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

Ensure package variables are available at package install #4841

Merged
merged 5 commits into from
Oct 18, 2021

Conversation

dra27
Copy link
Member

@dra27 dra27 commented Sep 17, 2021

The ocaml package uses the stublibs variable defined during its build in setenv:

setenv: [
  [CAML_LD_LIBRARY_PATH = "%{_:stubsdir}%"]
  [CAML_LD_LIBRARY_PATH += "%{lib}%/stublibs"]
  [OCAML_TOPLEVEL_PATH = "%{toplevel}%"]
]

This has never worked when the package was installed, because although ocaml.config is correctly installed, it wasn't added to the switch state. Thus on switch creation, CAML_LD_LIBRARY_PATH is incorrect. At the next call to opam install (or anything else which refreshed the environment file) this would be corrected, but I have a feeling we have seen errors relating to this before.

This PR threads the config back through the install process to OpamSolution so that it can update the state.

@dra27 dra27 added this to the 2.1.1 milestone Sep 17, 2021
@dra27 dra27 modified the milestones: 2.1.1, 2.0.10 Sep 17, 2021
@rjbou rjbou added the PR: QUEUED Pending pull request, waiting for other work to be merged or closed label Oct 15, 2021
dra27 and others added 5 commits October 15, 2021 19:23
When a package is installed, the switch environment is recomputed and
written, but if the setenv fields referred to package variables just
written to .config then these weren't available as the switch state
didn't include the new config file.

Subsequent calls to opam would then fix the issue as the .config file
will have been loaded with the switch state.
@rjbou rjbou removed the PR: QUEUED Pending pull request, waiting for other work to be merged or closed label Oct 15, 2021
@rjbou rjbou merged commit ce2be81 into ocaml:master Oct 18, 2021
@dra27 dra27 mentioned this pull request Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants