Skip to content

Conversation

@tsani
Copy link
Contributor

@tsani tsani commented Aug 21, 2025

Several versions of packages mentioned in the lockfiles before this commit do not exist on opam anymore. This causes a build failure on a fresh clone of this repo in docker, which uses the package versions pinned in the lockfiles.

To find these package versions, I simply deleted the lockfiles, installed all dependencies in a fresh OCaml 5.1.1 switch, and used opam lock. This process resulted in version 5.9.1 for
js_of_ocaml{,-toplevel,-compiler,...} on which Learn-OCaml's toplevel fails to initialize, making the webapp unusable. I then manually lowered the pinned version of js_of_ocaml back to the previously pinned version, 5.8.2.

  • Kind: bugfix

Description

Fresh clone of learn-ocaml fails to build in docker due to bogus pinned package versions, which no longer exist in opam.

Checklist

Note to maintainers

  • Read this wiki page.
  • Make sure the PR has a milestone.
  • Assign yourself before merging.
  • Either do a regular merge:
    • for PRs containing several commits following conventional-commits,
    • or for PRs containing 1 commit shared with a later PR (to preserve the SHA1)
  • Or do a squash-merge:
    • for PRs containing only 1 commit (not shared with a later PR),
    • or for PRs containing several commits that need not be kept in the history;
    • Update the commit message header with a conventional-commit type,
    • Add a footer Close #… if a related issue exists.

tsani added 2 commits August 21, 2025 09:12
Several versions of packages mentioned in the lockfiles before this
commit do not exist on opam anymore. This causes a build failure on a
fresh clone of this repo in docker, which uses the package versions
pinned in the lockfiles.

To find these package versions, I simply deleted the lockfiles,
installed all dependencies in a fresh OCaml 5.1.1 switch, and used `opam
lock`. This process resulted in version 5.9.1 for
js_of_ocaml{,-toplevel,-compiler,...} on which Learn-OCaml's toplevel
fails to initialize, making the webapp unusable. I then manually lowered
the pinned version of js_of_ocaml back to the previously pinned version,
5.8.2.
Otherwise, opam is unable to find a solution to the dependencies of
learn-ocaml with the new pinned package versions.
@erikmd erikmd added kind: fix kind: infrastructure CI, build tools, development tools labels Aug 22, 2025
@erikmd erikmd self-assigned this Aug 22, 2025
Copy link
Collaborator

@erikmd erikmd left a comment

Choose a reason for hiding this comment

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

@tsani the CI is fine, and I sucessfully tested your branch locally. Thanks!

But given the details you gave when preparing the PR (I then manually lowered the pinned version of js_of_ocaml), I'd suggest you add this upper bound in the two learn-ocaml*.opam files:

  "js_of_ocaml" {>= "5.0.0" & < "5.9.0"}

and/or

  "js_of_ocaml-compiler" {>= "5.0.0" & < "5.9.0"}

@tsani
Copy link
Contributor Author

tsani commented Aug 26, 2025

I'd suggest you add this upper bound in the two learn-ocaml*.opam files

Done. Makes perfect sense to do so, as it should make regenerating the lockfiles easier next time.

@erikmd erikmd added this to the learn-ocaml 1.1.0 milestone Aug 26, 2025
Copy link
Collaborator

@erikmd erikmd left a comment

Choose a reason for hiding this comment

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

Thanks!

@erikmd erikmd merged commit ce843c5 into ocaml-sf:master Aug 26, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind: fix kind: infrastructure CI, build tools, development tools

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: docker build failure, bogus pinned package versions, "Toplevel not initialized"

2 participants