forked from ocaml/ocaml
-
Notifications
You must be signed in to change notification settings - Fork 0
[Relocatable] Follow-up 10: Overhaul handling of empty components in PATH-like environment variables #227
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
Open
dra27
wants to merge
2
commits into
relocatable-testing
Choose a base branch
from
empty-paths
base: relocatable-testing
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.
Conversation
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
3c8b5c1 to
2a7e0ad
Compare
d644c59 to
63922b2
Compare
5444318 to
1582e1f
Compare
63922b2 to
198fcfd
Compare
198fcfd to
56b115d
Compare
Previously, if OCAMLRUNPARAM was "Set But Null", CAMLRUNPARAM was completely ignored. Similarly, a "Set But Null" value for OCAMLLIB caused CAMLLIB and subsequently the default location of the Standard Library to be ignored. Especially for OCAMLLIB/CAMLLIB, this behaviour is counter-intuitive, as it's highly unlikely to be useful. Now, if OCAMLLIB is set, but to the empty string, then CAMLLIB is checked and, more importantly, if it is either not set or also set to the empty string then the default location of the Standard Library is still used. For consistency, if OCAMLRUNPARAM is set, but to the empty string, then CAMLRUNPARAM is read.
POSIX recognises empty components in a PATH-like variable as meaning "." (the current directory). This is reflected in the processing of OCAMLTOP_INCLUDE_PATH, CAML_LD_LIBRARY_PATH and ld.conf where either a blank component or a blank line is interpreted as "." Somewhat confusingly, this processing is applied inconsistently between Unix and Windows (it's confusing given that Windows more readily includes the current working directory by default in PATH searches). It also has the side-effect that a "Set But Null" environment variable is interpreted as "." which counter-intuitively makes CAML_LD_LIBRARY_PATH= ocamlrun add the current working directory to the search path. Blank lines and empty components of both OCAMLTOP_INCLUDE_PATH and CAML_LD_LIBRARY_PATH are now ignored. The current working directory can still be explicitly included, of course, by adding a "." entry/line where required.
56b115d to
5c4d9f3
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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.
No description provided.