-
Notifications
You must be signed in to change notification settings - Fork 34
Relocatable ocamlfind with sprinkles #122
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
7
commits into
win-fixes
Choose a base branch
from
relocatable
base: win-fixes
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.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
1bb163a
Restore selection mechanism for topfind generation
dra27 77494f0
Interpret relative paths in findlib.conf
dra27 08b4ef5
Interpret relative paths to -sitelib
dra27 739d3dc
Interpret explicit-relative entries in ld.conf
dra27 1bcb370
Use Unix.realpath when available checking ld.conf
dra27 7db3735
Build relocatably
dra27 1faecd4
Temporarily disable the sandbox on macOS
dra27 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,26 @@ | ||
| #use "topfind";; | ||
| #list;; | ||
| #require "unix";; | ||
| #require "findlib";; | ||
| let realpath = Filename.concat (Sys.getcwd()) "src/findlib/realpath.ml" in | ||
| Topdirs.dir_use Format.err_formatter realpath;; | ||
| let () = | ||
| let ld_conf = Findlib.ocaml_ldconf () in | ||
| let print_line = Printf.printf " %s\n" in | ||
| let print_line {Findlib.raw = raw; Findlib.eff = eff} = | ||
| let real = realpath eff in | ||
| let real = | ||
| if real = eff then | ||
| "" | ||
| else | ||
| "\n -> " ^ real | ||
| in | ||
| let eff = | ||
| if raw ^ real = eff then | ||
| "" | ||
| else | ||
| "\n -> " ^ eff | ||
| in | ||
| Printf.printf " %s%s%s\n" raw eff real | ||
| in | ||
| Printf.printf "Reading %s\n" ld_conf; | ||
| List.iter print_line (Findlib.read_ldconf ld_conf);; |
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 |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| include Makefile.config | ||
|
|
||
| ifeq "$(IS_RELOCATABLE)" "1" | ||
| HASH := \# | ||
| SRCDIR_ENCODED = $(subst =,%+,$(subst :,%.,$(subst %,%$(HASH),$(SRCDIR_ABS)))) | ||
| SRCDIR_ABS_REAL := $(shell realpath $(SRCDIR_ABS) 2>/dev/null) | ||
| SRCDIR_REAL_ENCODED = \ | ||
| $(subst =,%+,$(subst :,%.,$(subst %,%$(HASH),$(SRCDIR_ABS_REAL)))) | ||
| BUILD_PATH_PREFIX_MAP ?= | ||
| export BUILD_PATH_PREFIX_MAP := \ | ||
| $(BUILD_PATH_PREFIX_MAP)$\ | ||
| :.=$(SRCDIR_ENCODED)$\ | ||
| $(if $(SRCDIR_REAL_ENCODED),:.=$(SRCDIR_REAL_ENCODED)) | ||
| endif | ||
|
|
||
| include Makefile |
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 | ||||
|---|---|---|---|---|---|---|
|
|
@@ -3,6 +3,11 @@ | |||||
| # Note that there are other files containing parts of the | ||||||
| # configuration, especially the site-lib/*/META files. | ||||||
| # | ||||||
| #---------------------------------------------------------------------- | ||||||
| # Where is findlib being compiled: | ||||||
| #---------------------------------------------------------------------- | ||||||
| SRCDIR_ABS=/home/user/ocamlfind | ||||||
|
|
||||||
| #---------------------------------------------------------------------- | ||||||
| # Where the OCAML core is installed: | ||||||
| #---------------------------------------------------------------------- | ||||||
|
|
@@ -21,7 +26,13 @@ OCAML_THREADS=vm | |||||
| # Where the site-lib directory will be | ||||||
| #---------------------------------------------------------------------- | ||||||
| OCAML_SITELIB=/usr/local/lib/ocaml/site-lib | ||||||
| OCAML_SITELIB_NATIVE=$(OCAML_SITELIB) | ||||||
|
|
||||||
| #---------------------------------------------------------------------- | ||||||
| # For Relocatable Findlib, the path of site-lib relative to the OCaml | ||||||
| # Standard Library directory. For normal Findlib, equal to | ||||||
|
Contributor
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.
Suggested change
I’d like to see the relocatable version be the new normal one. |
||||||
| # $(OCAML_SITELIB) | ||||||
| #---------------------------------------------------------------------- | ||||||
| OCAML_SITELIB_FROM_STDLIB=$(OCAML_SITELIB) | ||||||
|
|
||||||
| #---------------------------------------------------------------------- | ||||||
| # Where binaries and manual pages will be installed | ||||||
|
|
@@ -32,8 +43,9 @@ OCAMLFIND_MAN=/usr/local/man | |||||
| #---------------------------------------------------------------------- | ||||||
| # The absolute location of the configuration file | ||||||
| #---------------------------------------------------------------------- | ||||||
| OCAMLFIND_CONF=/usr/local/etc/ocamlfind.conf | ||||||
| OCAMLFIND_CONF=/usr/local/etc/$(OCAMLFIND_CONF_NAME) | ||||||
| OCAMLFIND_CONF_NATIVE=$(OCAMLFIND_CONF) | ||||||
| OCAMLFIND_CONF_NAME=ocamlfind.conf | ||||||
|
|
||||||
| #---------------------------------------------------------------------- | ||||||
| # Autolinking is usually on | ||||||
|
|
@@ -67,6 +79,12 @@ INSTALL_TOPFIND=1 | |||||
| #---------------------------------------------------------------------- | ||||||
| RELATIVE_PATHS=0 | ||||||
|
|
||||||
| #---------------------------------------------------------------------- | ||||||
| # Whether Relocatable Findlib is being built | ||||||
| #---------------------------------------------------------------------- | ||||||
| IS_RELOCATABLE=0 | ||||||
| RELOCATABLE= | ||||||
|
|
||||||
| #---------------------------------------------------------------------- | ||||||
| # Whether make install should update Makefile.packages just before | ||||||
| # running | ||||||
|
|
||||||
Oops, something went wrong.
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.
maybe, if only to shorten lines?