I am trying to create a package, without much success. I run a windows box, and hope this is not the reason why it fails.
My opam file is below :
opam-version: "2.0"
name: "stlib-theme"
version: "0.1"
synopsis: "An theme mimicking ocaml manual's theme"
description: """
This is a theme with the same look as OCaml manual's theme.
"""
maintainer: "Heyji <heyji2@gmail.com>"
author: "Heyji <heyji2@gmail.com>"
license: "ISC"
homepage:"https://github.com/Heyji2/stdlib-theme"
bug-reports:"https://github.com/Heyji2/stdlib-theme/issue"
dev-repo:"git+https://github.com/Heyji2/stdlib-theme"
depends: ["odoc" {>="3.0.0"} "odig" {>="0.0.9"}]
depopts: []
install: [
["mkdir" "%{stdlib-theme:share}%/odoc/odoc-theme/%{name}%"]
["mv" "odoc.css" "%{stdlib-theme:share}%/odoc/odoc-theme/%{name}%/odoc.css"]
]
When I check my file with lint it says some packages are mentioned without dependencies…but I don’t see which one :
PS H:\OCaml\stdlib-theme> opam lint --debug-level=3 .\stdlib-theme.opam
00:00.029 FILE(switch-config) Read H:\OCaml\stdlib-theme\_opam\.opam-switch\switch-config in 0.000s
00:00.031 FILE(config) Read ~\AppData\Local\opam\config in 0.000s
00:00.032 CLI Parsing CLI version 2.2
H:\OCaml\stdlib-theme\stdlib-theme.opam: Warnings.
warning 41: Some packages are mentioned in package scripts or features, but there is no dependency or depopt toward them: "stdlib-theme"
PS H:\OCaml\stdlib-theme> opam list --depends-on stdlib-theme
# Packages matching: depends-on(stdlib-theme) & (installed | available)
# No matches found
Then I try to install the package despite the w41, and it says 22 packages must be installed but some of them are already installed, with the same version.
I am lost in the way opam and the dependencies work…any hint appreciated.
PS H:\OCaml\stdlib-theme> opam install stdlib-theme
<><> Synchronising pinned packages ><><><><><><><><><><><><><><><><><><><><> 🐫
[NOTE] Ignoring uncommitted changes in H:/OCaml/stdlib-theme (`--working-dir' not specified or specified with no argument).
[stdlib-theme.0.1] synchronised (no changes)
The following actions will be performed:
=== install 22 packages
∗ astring 0.8.5 [required by odoc]
∗ b0 0.0.5 [required by odig]
∗ camlp-streams 5.0.1 [required by odoc-parser]
...
PS H:\OCaml\stdlib-theme> opam show astring b0 cmdliner -f version
0.8.5
0.0.5
1.3.0
Thanks, that solved the first issue. W41 disappeared. I still have to solve the installation issue and understand why it wants me to install package already installed.
opam install --working-dir uses the working directory state of your project, instead of the state registered in the version control system. Don’t worry, opam will warn you if you have uncommitted changes and forgot to specify --working-dir.
(not sure this will fix your problem, just a friendly heads up )
opam-version: "2.0"
synopsis: "An theme mimicking ocaml manual's theme"
description: """
This is a theme with the same look as OCaml manual's theme.
"""
maintainer: "Heyji <heyji2@gmail.com>"
author: "Heyji <heyji2@gmail.com>"
license: "ISC"
homepage:"https://github.com/Heyji2/stdlib-theme"
bug-reports:"https://github.com/Heyji2/stdlib-theme/issue"
dev-repo:"git+https://github.com/Heyji2/stdlib-theme"
depends: [
"odoc" {>="3.0.0"}
"odig" {>="0.0.9"}
]
install: [
["mkdir" "%{stdlib-theme:share}%/odoc/odoc-theme/%{name}%"]
["cp" "odoc.css" "%{stdlib-theme:share}%/odoc/odoc-theme/%{name}%/odoc.css"]
]
And then install it with opam install ./stdlib-theme.opam (to tell OPAM that you want to install this particular package from this file, not a package from the enabled opam-repositories).
It says the same thing. I wonder if it is not an missconfigured switch that causes this reinstallation ?
PS H:\OCaml\stdlib-theme> opam install .\stdlib-theme.opam
[NOTE] Ignoring uncommitted changes in H:/OCaml/stdlib-theme (`--working-dir' not specified or specified with no argument).
[stdlib-theme.0.1] synchronised (git+file://H:/OCaml/stdlib-theme#main)
[stdlib-theme] Installing new package description from upstream git+file://H:/OCaml/stdlib-theme#main
The following actions will be performed:
=== install 22 packages
∗ astring 0.8.5 [required by odoc]
∗ b0 0.0.5 [required by odig]
∗ camlp-streams 5.0.1 [required by odoc-parser]
∗ cmdliner 1.3.0 [required by odig]
∗ cppo 1.8.0 [required by odoc]
∗ crunch 4.0.0 [required by odoc]
∗ fmt 0.10.0 [required by odoc]
∗ fpath 0.7.3 [required by odoc]
∗ ocamlbuild 0.16.1 [required by odig]
∗ ocamlfind 1.9.8 [required by odig]
∗ odig 0.0.9 [required by stdlib-theme]
∗ odoc 3.0.0 [required by stdlib-theme]
∗ odoc-parser 3.0.0 [required by odoc]
∗ ptime 1.2.0 [required by crunch]
∗ re 1.12.0 [required by tyxml]
∗ result 1.5 [required by odoc]
∗ seq base [required by tyxml, yojson]
∗ stdlib-theme 0.1 (pinned)
∗ topkg 1.0.8 [required by odig]
∗ tyxml 4.6.0 [required by odoc]
∗ uutf 1.0.4 [required by tyxml]
∗ yojson 2.2.2 [required by odoc]
Proceed with ∗ 22 installations? [y/n] n