-
Notifications
You must be signed in to change notification settings - Fork 377
Order build-env after setenv #6713
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
Draft
kit-ty-kate
wants to merge
1
commit into
ocaml:master
Choose a base branch
from
kit-ty-kate:buildenv-after-setenv
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+29
−23
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -613,7 +613,7 @@ let env_update_resolved_with_default ?comment var = | |
| let rewrite = Some (SPF_Resolved (Some (default_sep_fmt_str var))) in | ||
| env_update_resolved ?comment ~rewrite var | ||
|
|
||
| let compute_updates ?(force_path=false) st = | ||
| let compute_updates ?(force_path=false) ~build_env st = | ||
| (* Todo: put these back into their packages! | ||
| let perl5 = OpamPackage.Name.of_string "perl5" in | ||
| let add_to_perl5lib = OpamPath.Switch.lib t.root t.switch t.switch_config perl5 in | ||
|
|
@@ -660,7 +660,7 @@ let compute_updates ?(force_path=false) st = | |
| in | ||
| List.map resolve_separator_and_format updates | ||
| in | ||
| switch_env @ pkg_env @ man_path @ [path] | ||
| pkg_env @ build_env @ switch_env @ man_path @ [path] | ||
|
|
||
| let updates_common ~set_opamroot ~set_opamswitch root switch = | ||
| let root = | ||
|
|
@@ -688,18 +688,18 @@ let updates_nix st = | |
| | Some env -> List.map resolve_separator_and_format env) | ||
| | _ -> [] | ||
|
|
||
| let updates ~set_opamroot ~set_opamswitch ?force_path st = | ||
| let updates ~set_opamroot ~set_opamswitch ?force_path ~build_env st = | ||
| let common = | ||
| updates_common ~set_opamroot ~set_opamswitch st.switch_global.root st.switch | ||
| in | ||
| common @ compute_updates ?force_path st @ updates_nix st | ||
| compute_updates ?force_path ~build_env st @ common @ updates_nix st | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. common and nix updates should probably be moved in |
||
|
|
||
| let get_pure ?(updates=[]) () = | ||
| let env = List.map (fun (v,va) -> v,va,None) (OpamStd.Env.list ()) in | ||
| add env updates | ||
|
|
||
| let get_opam ~set_opamroot ~set_opamswitch ~force_path st = | ||
| add [] (updates ~set_opamroot ~set_opamswitch ~force_path st) | ||
| add [] (updates ~set_opamroot ~set_opamswitch ~force_path ~build_env:[] st) | ||
|
|
||
| let get_opam_raw_updates ~set_opamroot ~set_opamswitch ~force_path root switch = | ||
| let env_file = OpamPath.Switch.environment root switch in | ||
|
|
@@ -740,7 +740,7 @@ let hash_env_updates upd = | |
| |> Digest.to_hex | ||
|
|
||
| let get_full | ||
| ~set_opamroot ~set_opamswitch ~force_path ?updates:(u=[]) ?(scrub=[]) | ||
| ~set_opamroot ~set_opamswitch ~force_path ~build_env ?updates:(u=[]) ?(scrub=[]) | ||
| st = | ||
| let env = | ||
| let env = OpamStd.Env.list () in | ||
|
|
@@ -753,10 +753,10 @@ let get_full | |
| List.filter (fun (name, _) -> not (OpamStd.Env.Name.Set.mem name scrub)) env | ||
| in | ||
| let env0 = List.map (fun (v,va) -> v,va,None) env in | ||
| let u = | ||
| (List.map resolve_separator_and_format u) in | ||
| let u = List.map resolve_separator_and_format u in | ||
| let build_env = List.map resolve_separator_and_format build_env in | ||
| let updates = | ||
| u @ updates ~set_opamroot ~set_opamswitch ~force_path st in | ||
| u @ updates ~set_opamroot ~set_opamswitch ~force_path ~build_env st in | ||
| add env0 updates | ||
|
|
||
| let is_up_to_date_raw ?(skip=OpamStateConfig.(!r.no_env_notice)) updates = | ||
|
|
@@ -821,7 +821,7 @@ let full_with_path ~force_path ?(updates=[]) root switch = | |
|
|
||
| let is_up_to_date ?skip st = | ||
| is_up_to_date_raw ?skip | ||
| (updates ~set_opamroot:false ~set_opamswitch:false ~force_path:false st) | ||
| (updates ~set_opamroot:false ~set_opamswitch:false ~force_path:false ~build_env:[] st) | ||
|
|
||
| (** Returns shell-appropriate statement to evaluate [cmd]. *) | ||
| let shell_eval_invocation shell cmd = | ||
|
|
@@ -1206,7 +1206,7 @@ let write_dynamic_init_scripts st = | |
| | _ -> true | ||
| in | ||
| let updates = | ||
| updates ~set_opamroot:false ~set_opamswitch:false st | ||
| updates ~set_opamroot:false ~set_opamswitch:false ~build_env:[] st | ||
| |> List.filter is_not_empty_update | ||
| in | ||
| try | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should pre-command hooks and the like have build-env? It feels like they should