Avoid hardcoding paths in Profile and Sys#59998
Conversation
Current code fails when using custom paths. Save directory where Julia source is stored during build in `SOURCEDIR` instead of assuming it can be computed from `BINDIR` (new name chosen to avoid confusing with `build_dir` which is different). Use `DATAROOTDIR` and `DATAROOT` instead of hardcoding `usr/share/` and `share/`. Fix/continuation of #56601, #56627.
base/Makefile
Outdated
| @printf "%s\n" "const PRIVATE_LIBDIR = "$(call shell_escape,$(call julia_escape,$(call normalize_path,$(private_libdir_rel)))) >> $@ | ||
| @printf "%s\n" "const PRIVATE_LIBEXECDIR = "$(call shell_escape,$(call julia_escape,$(call normalize_path,$(private_libexecdir_rel)))) >> $@ | ||
| @printf "%s\n" "const INCLUDEDIR = "$(call shell_escape,$(call julia_escape,$(call normalize_path,$(includedir_rel)))) >> $@ | ||
| @printf "%s\n" "const SOURCEDIR = "$(call shell_escape,$(call julia_escape,$(call normalize_path,$(JULIAHOME)))) >> $@ |
There was a problem hiding this comment.
AFAICT this new constant is needed as paths to source files are those at build time. BUILD_ROOT_PATH which was defined below was incorrect in claiming that it pointed to the build-time source path as it was based on BINDIR, yet there's no guarantee that the julia executable during build time is next to the source dir.
Failure for `@juliasrc`: SOURCEDIR was "/c/workdir" (giving "\\c\\workdir") on Windows builder, while "C:\\workdir" was expected. Failure for `@Compiler`: missing ending slash meant that remainder was an absolute path. Minor cleanups.
|
CI failure on test x86_64-linux-gnuassertrr seems unrelated. |
|
Thanks @IanButterworth. Do you want to double-check this @KristofferC? These issues are so tricky that another pair of eyes wouldn't hurt... |
|
I see fewer hardcoded paths so that is nice. Should the stuff in #57274 be updated as well? |
|
I think it's correct as with the current options stdlib and Compiler will always live under This partly overlaps with #54353 which I'm trying to finish but I get some errors that I haven't been able to fix yet. |
KristofferC
left a comment
There was a problem hiding this comment.
Nice, LGTM (assuming CI is ok)
|
Thanks! |
Current code fails when using custom paths. Save directory where Julia source is stored during build in `SOURCEDIR` instead of assuming it can be computed from `BINDIR` (new name chosen to avoid confusing with `build_dir` which is different). Use `DATAROOTDIR` and `DATAROOT` instead of hardcoding `usr/share/` and `share/`. Fix/continuation of #56601, #56627. (cherry picked from commit b60d1db)
Current code fails when using custom paths. Save directory where Julia source is stored during build in `SOURCEDIR` instead of assuming it can be computed from `BINDIR` (new name chosen to avoid confusing with `build_dir` which is different). Use `DATAROOTDIR` and `DATAROOT` instead of hardcoding `usr/share/` and `share/`. Fix/continuation of #56601, #56627. (cherry picked from commit b60d1db)
I'm not sure why this removal was necessary, but deleting this binding messes up Profile's ability to identity build paths for `@Compiler/` etc. as of #59998
Deleting this binding messes up Profile's ability to identity build paths for `@Compiler/` etc. as of #59998
Deleting this binding messes up Profile's ability to identity build paths for `@Compiler/` etc. as of #59998
Current code fails when using custom paths. Save directory where Julia source is stored during build in `SOURCEDIR` instead of assuming it can be computed from `BINDIR` (new name chosen to avoid confusing with `build_dir` which is different). Use `DATAROOTDIR` and `DATAROOT` instead of hardcoding `usr/share/` and `share/`. Fix/continuation of JuliaLang#56601, JuliaLang#56627.
Current code fails when using custom paths. Save directory where Julia source is stored during build in `SOURCEDIR` instead of assuming it can be computed from `BINDIR` (new name chosen to avoid confusing with `build_dir` which is different). Use `DATAROOTDIR` and `DATAROOT` instead of hardcoding `usr/share/` and `share/`. Fix/continuation of #56601, #56627.
Current code fails when using custom paths. Save directory where Julia source is stored during build in `SOURCEDIR` instead of assuming it can be computed from `BINDIR` (new name chosen to avoid confusing with `build_dir` which is different). Use `DATAROOTDIR` and `DATAROOT` instead of hardcoding `usr/share/` and `share/`. Fix/continuation of #56601, #56627.
Current code fails when using custom paths. Save directory where Julia source is stored during build in `SOURCEDIR` instead of assuming it can be computed from `BINDIR` (new name chosen to avoid confusing with `build_dir` which is different). Use `DATAROOTDIR` and `DATAROOT` instead of hardcoding `usr/share/` and `share/`. Fix/continuation of JuliaLang#56601, JuliaLang#56627.
Current code fails when using custom paths. Save directory where Julia source is stored during build in
SOURCEDIRinstead of assuming it can be computed fromBINDIR(new name chosen to avoid confusing withbuild_dirwhich is different). UseDATAROOTDIRandDATAROOTinstead of hardcodingusr/share/andshare/.Fix/continuation of #56601, #56627.