Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[new release] opam-monorepo (0.3.0) #21236

Closed

Conversation

NathanReb
Copy link
Contributor

Assemble and manage fully vendored Dune repositories

CHANGES:

Added

Changed

Deprecated

Fixed

Removed

Security

CHANGES:

### Added

- Add opam extensions `x-opam-monorepo-opam-repositories` and
  `x-opam-monorepo-global-opam-vars` to make `lock` fully reproducible.
  (tarides/opam-monorepo#250, tarides/opam-monorepo#253, @NathanReb)
- Show an error message when the solver can't find any version that satisfies
  the requested version constraint in the user's OPAM file (tarides/opam-monorepo#215, tarides/opam-monorepo#248,
  @Leonidas-from-XIV)
- Allow packages to be marked as being provided by Opam and not to be pulled by
  `opam-monorepo`. To control this a new optional Opam file field,
  `x-opam-monorepo-opam-provided` is introduced. Its value is a list of package
  names that are to be excluded from being pulled (tarides/opam-monorepo#234, @Leonidas-from-XIV)
- Show an error message when the OCaml version of the lock file does not match
  the OCaml version of the switch (tarides/opam-monorepo#267, tarides/opam-monorepo#268, @Leonidas-from-XIV)
- Generate a `duniverse/README.md` file to explain the basics of
  `opam-monorepo` in the vendored directory (tarides/opam-monorepo#272, tarides/opam-monorepo#274, @Leonidas-from-XIV)
- Add a `--prefer-cross-compile` flag for the solver to select cross-compiling
  versions of packages when available. This is determined through the presence
  of the `"cross-compile"` tag in the opam metadata.

### Changed

- Bump lockfile version to 0.3 (tarides/opam-monorepo#285, @NathanReb)
- Mark packages to be pulled by opam-monorepo with the `vendor` variable so
  using OPAM with `opam install --deps-only --locked .` will not install
  packages that will be installed with `opam-monorepo pull` (tarides/opam-monorepo#237,
  @Leonidas-from-XIV)

### Deprecated

### Fixed

- Fix a bug where a package which had a single version that built with dune and got selected by the solver
  would be reported has having no version building with dune. (tarides/opam-monorepo#245, @Leonidas-from-XIV)
- Fix the solver so it does not select beta versions of the compiler unless
  forced to by version constraints or `--ocaml-version`. (tarides/opam-monorepo#269, @NathanReb)

### Removed

- Drop support for lockfile versions 0.2 and lower (tarides/opam-monorepo#285, @NathanReb)

### Security
@NathanReb
Copy link
Contributor Author

Will work on a discuss post for this one as it's a pretty significant release!

bug-reports: "https://github.com/ocamllabs/opam-monorepo/issues"
depends: [
"dune" {>= "2.9"}
"ocaml" {>= "4.08.0"}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"ocaml" {>= "4.08.0"}
"ocaml" {>= "4.13"}
#=== ERROR while compiling opam-monorepo.0.3.0 ================================#
# context              2.1.2 | linux/x86_64 | ocaml-base-compiler.4.12.1 | pinned(https://github.com/ocamllabs/opam-monorepo/releases/download/0.3.0/opam-monorepo-0.3.0.tbz)
# path                 ~/.opam/4.12/.opam-switch/build/opam-monorepo.0.3.0
# command              ~/.opam/opam-init/hooks/sandbox.sh build dune build -p opam-monorepo -j 31 @install
# exit-code            1
# env-file             ~/.opam/log/opam-monorepo-1976-b81551.env
# output-file          ~/.opam/log/opam-monorepo-1976-b81551.out
### output ###
# (cd duniverse/0install/src/gui_gtk && /home/opam/.opam/4.12/bin/ocaml -I +compiler-libs /home/opam/.opam/4.12/.opam-switch/build/opam-monorepo.0.3.0/_build/.dune/default/duniverse/0install/src/gui_gtk/dune.ml)
# sh: 1: ocamlfind: not found
# (will skip building the GTK plugin)
# (cd _build/default && /home/opam/.opam/4.12/bin/ocamldep.opt -modules -impl cli/lock.ml) > _build/default/cli/.duniverse_cli.objs/lock.ml.d
# File "cli/lock.ml", line 259, characters 15-17:
# 259 |       let* acc in
#                      ^^
# Error: Syntax error: operator expected.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Argh that's ocamlformat reformatting it this way. I'm afraid we'll have to abort this release and start again!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there an issue somewhere tracking this bug?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not an ocamlformat-per-se bug. It just defaults to format for the currently active OCaml version (I assume) and we didn't tell it to stay 4.08 compatible: tarides/opam-monorepo#287

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah I see. I was unaware of the ocaml-version option

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’m still considering this somewhat of a bug personally and I opened a PR here to avoid this issue in the future: ocaml-ppx/ocamlformat#2064

Comment on lines +27 to +45
depexts: [
["devel/pkgconf"] {os = "openbsd"}
["pkg-config"] {os-family = "debian"}
["pkg-config"] {os = "macos" & os-distribution = "homebrew"}
["pkgconf"] {os = "freebsd"}
["pkgconf"] {os-distribution = "alpine"}
["pkgconf"] {os-distribution = "arch"}
["pkgconf-pkg-config"] {os-distribution = "fedora"}
["pkgconf-pkg-config"] {os-distribution = "mageia"}
["pkgconf-pkg-config"] {os-distribution = "centos" & os-version >= "8"}
["pkgconf-pkg-config"] {os-distribution = "ol" & os-version >= "8"}
["pkgconf-pkg-config"] {os-distribution = "rhel" & os-version >= "8"}
["pkgconfig"] {os-distribution = "nixos"}
["pkgconfig"] {os = "macos" & os-distribution = "macports"}
["pkgconfig"] {os-distribution = "centos" & os-version <= "7"}
["pkgconfig"] {os-distribution = "ol" & os-version <= "7"}
["pkgconfig"] {os-distribution = "rhel" & os-version <= "7"}
["system:pkgconf"] {os = "win32" & os-distribution = "cygwinports"}
]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
depexts: [
["devel/pkgconf"] {os = "openbsd"}
["pkg-config"] {os-family = "debian"}
["pkg-config"] {os = "macos" & os-distribution = "homebrew"}
["pkgconf"] {os = "freebsd"}
["pkgconf"] {os-distribution = "alpine"}
["pkgconf"] {os-distribution = "arch"}
["pkgconf-pkg-config"] {os-distribution = "fedora"}
["pkgconf-pkg-config"] {os-distribution = "mageia"}
["pkgconf-pkg-config"] {os-distribution = "centos" & os-version >= "8"}
["pkgconf-pkg-config"] {os-distribution = "ol" & os-version >= "8"}
["pkgconf-pkg-config"] {os-distribution = "rhel" & os-version >= "8"}
["pkgconfig"] {os-distribution = "nixos"}
["pkgconfig"] {os = "macos" & os-distribution = "macports"}
["pkgconfig"] {os-distribution = "centos" & os-version <= "7"}
["pkgconfig"] {os-distribution = "ol" & os-version <= "7"}
["pkgconfig"] {os-distribution = "rhel" & os-version <= "7"}
["system:pkgconf"] {os = "win32" & os-distribution = "cygwinports"}
]

depends: [
"dune" {>= "2.9"}
"ocaml" {>= "4.08.0"}
"odoc" {with-doc}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"odoc" {with-doc}
"odoc" {with-doc}
"conf-pkg-config"

@kit-ty-kate
Copy link
Member

The tests failed with multiple failures, could you have a look as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants