Closed josecastillolema closed 1 year ago
Dune contains some opam files in its tests, and they are detected by the recursive pin. But 2 of them are empty files for test purpose.
> opam pin scan git+https://github.com/ocaml/dune --rec
[ERROR] In test/blackbox-tests/test-cases/coq/ml-lib.t/ml_lib.opam:
unsupported or missing file format version; should be 2.0 or older [skipped]
[ERROR] In test/blackbox-tests/test-cases/coq/compose-plugin.t/cplugin.opam:
unsupported or missing file format version; should be 2.0 or older [skipped]
# Name # Version # Url # Subpath
mypackage - git+https://github.com/ocaml/dune test/blackbox-tests/test-cases/public_name-exe.t
baz 0.1.0 git+https://github.com/ocaml/dune test/blackbox-tests/test-cases/pkg/lockfile-generation.t/mock-opam-repository/packages/baz/baz.0.1.0
baz 0.0.1 git+https://github.com/ocaml/dune test/blackbox-tests/test-cases/pkg/lockfile-generation.t/mock-opam-repository/packages/baz/baz.0.0.1
bar 0.5.0 git+https://github.com/ocaml/dune test/blackbox-tests/test-cases/pkg/lockfile-generation.t/mock-opam-repository/packages/bar/bar.0.5.0
bar 0.4.0 git+https://github.com/ocaml/dune test/blackbox-tests/test-cases/pkg/lockfile-generation.t/mock-opam-repository/packages/bar/bar.0.4.0
bar 0.0.1 git+https://github.com/ocaml/dune test/blackbox-tests/test-cases/pkg/lockfile-generation.t/mock-opam-repository/packages/bar/bar.0.0.1
foo 0.0.1 git+https://github.com/ocaml/dune test/blackbox-tests/test-cases/pkg/lock-per-context.t/mock-opam-repository/packages/foo/foo.0.0.1
baz 0.1.0 git+https://github.com/ocaml/dune test/blackbox-tests/test-cases/pkg/lock-per-context.t/mock-opam-repository/packages/baz/baz.0.1.0
baz 0.0.1 git+https://github.com/ocaml/dune test/blackbox-tests/test-cases/pkg/lock-per-context.t/mock-opam-repository/packages/baz/baz.0.0.1
bar 0.5.0 git+https://github.com/ocaml/dune test/blackbox-tests/test-cases/pkg/lock-per-context.t/mock-opam-repository/packages/bar/bar.0.5.0
bar 0.4.0 git+https://github.com/ocaml/dune test/blackbox-tests/test-cases/pkg/lock-per-context.t/mock-opam-repository/packages/bar/bar.0.4.0
bar 0.0.1 git+https://github.com/ocaml/dune test/blackbox-tests/test-cases/pkg/lock-per-context.t/mock-opam-repository/packages/bar/bar.0.0.1
lib2 - git+https://github.com/ocaml/dune test/blackbox-tests/test-cases/github568.t
lib1 - git+https://github.com/ocaml/dune test/blackbox-tests/test-cases/github568.t
dune_inline_tests - git+https://github.com/ocaml/dune test/blackbox-tests/test-cases/github1549.t/backend
ml_lib - git+https://github.com/ocaml/dune test/blackbox-tests/test-cases/coq/ml-lib.t
cplugin - git+https://github.com/ocaml/dune test/blackbox-tests/test-cases/coq/compose-plugin.t
plugin1 - git+https://github.com/ocaml/dune otherlibs/dune-site/test/plugin_require_thread.t/plugin
myproject 1.0 git+https://github.com/ocaml/dune example/with-configure-step.t
hello_world 1.0 git+https://github.com/ocaml/dune example/hello_world.t
xdg - git+https://github.com/ocaml/dune -
stdune - git+https://github.com/ocaml/dune -
ordering - git+https://github.com/ocaml/dune -
ocamlc-loc - git+https://github.com/ocaml/dune -
dyn - git+https://github.com/ocaml/dune -
dune - git+https://github.com/ocaml/dune -
dune-site - git+https://github.com/ocaml/dune -
dune-rpc - git+https://github.com/ocaml/dune -
dune-rpc-lwt - git+https://github.com/ocaml/dune -
dune-private-libs - git+https://github.com/ocaml/dune -
dune-glob - git+https://github.com/ocaml/dune -
dune-configurator - git+https://github.com/ocaml/dune -
dune-build-info - git+https://github.com/ocaml/dune -
dune-action-plugin - git+https://github.com/ocaml/dune -
chrome-trace - git+https://github.com/ocaml/dune -
You can use pin scan to select/unselect some paths opam pin scan url --normalise | grep -v <path> | xargs opam pin
What is your goal by doing that? It looks like you've created an opam repository structure (repo file, packages directory) but not using it as a repository, rather a storage place for vendored dependencies (which in the case of the packages you've added seems to be rather complicated to setup so I'm not sure you want that)
If you want an opam repository instead of vendored dependencies you can replace the vendored subdirectories by opam files (taken from https://github.com/ocaml/opam-repository/ for example) and call opam repository add your-local-repo .
Thanks! Will look into that. And as there is a proposed workaround will close this issue.
ps. As for the goal question, I am trying to package ocaml (with some dependencies) into a FlatPak application. For that, in the first step I need to download all the sources, and in the second step to build them (the second step does not have Internet access). Any suggestions will be welcomed.
You can have an opam repository with only selected packages. Then run opam admin cache
at root directory, it will download all repository archives. In your repo
file, add the field archive-mirrors: cache
.
From there, you have all archives, you can work offline (if there is no extra-sources defined in selected opam files). You initialise opam with that repository opam init <path/to/repository>
(or add it via opam repository add
), create a switch and install the packages. By default, opam first retrieves repository cached sources.
So @rjbou unfortunately to the best of my knowledge that approach wont work for flatpak packaging. There are two phases when building flatpak packages:
opam admin cache
)The way I am trying to approach the problem is:
This approach is not ideal, if you have any better alternatives please let me know.
Thanks!
opam pin --recursive
fails to pin dune package. Have not observed this behavior with other packets.