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

opam var fixes #4192

Merged
merged 4 commits into from
Jun 29, 2020
Merged

opam var fixes #4192

merged 4 commits into from
Jun 29, 2020

Conversation

rjbou
Copy link
Collaborator

@rjbou rjbou commented May 11, 2020

@rjbou rjbou added this to the 2.1.0~beta milestone May 11, 2020
OpamConsole.error_and_exit `Not_found "Variable %s not found in %s" v
(match switch with
| None -> "global config"
| Some switch -> "in switch " ^ (OpamSwitch.to_string switch))

let is_switch_defined_var switch_config v =
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Should we move this function into OpamPackageVar ?

@rjbou rjbou requested a review from AltGr May 20, 2020 17:55
@kit-ty-kate
Copy link
Member

This PR doesn't seem to fix an issue that arise for packages that uses opam config var when during compilation. For instance:

#=== ERROR while compiling ocaml-freestanding.0.6.0 ===========================#
# context     2.1.0~alpha | linux/x86_64 | ocaml-variants.4.11.0+trunk | pinned(https://github.com/mirage/ocaml-freestanding/archive/v0.6.0.tar.gz)
# path        ~/.opam/4.11/.opam-switch/build/ocaml-freestanding.0.6.0
# command     ~/.opam/opam-init/hooks/sandbox.sh build make
# exit-code   2
# env-file    ~/.opam/log/ocaml-freestanding-3440035-e7966f.env
# output-file ~/.opam/log/ocaml-freestanding-3440035-e7966f.out
### output ###
# ./configure.sh
# Fatal error:
# opam: "open" failed on /home/kit_ty_kate/.opam/log/log-3441455-4438d8.out: Read-only file system

the configure script uses opam config var prefix and thus fails when this command tries to create a log file

@rjbou
Copy link
Collaborator Author

rjbou commented Jun 11, 2020

@kit-ty-kate are you in the case of #4188?

@kit-ty-kate
Copy link
Member

That seems to be the case (.opam directory upgraded from opam 2.0.7)

Copy link
Member

@AltGr AltGr left a comment

Choose a reason for hiding this comment

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

All good!

`Ok ()
| `empty -> assert false (* can't happen *)
| `value_eq _ ->
`Error (true, "variable setting needs a scope, \
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This restriction is only for opam var affectations, should we set switch scope by default ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

After some discussions, no for variables

@rjbou rjbou merged commit 698cdda into ocaml:master Jun 29, 2020
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.

opam var changes opam var package var not found
3 participants