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

base: use a symlink for which instead of hard-coded path #151

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

haampie
Copy link

@haampie haampie commented Jan 10, 2024

R hard-codes the path to the which executable inside bytecode, which is
stored in a compressed format.

This makes it very hard to relocate R itself at a later stage, or update the
path to which if it ever moves on the system.

This patch creates a symlink rlib/R/library/base/R/which ->
/path/to/bin/which so it's easier to relocate R / which, as you can just
modify a symlink instead of dealing with base.rdb and base.rdx files.

@haampie haampie changed the title base: use a symlink for which instead of hard-coded string base: use a symlink for which instead of hard-coded path Jan 10, 2024
haampie added a commit to haampie/spack that referenced this pull request Jan 10, 2024
R embeds an absolute path to the `which` executable in the sources for
`Sys.which`. This gets ultimately stored as serialized byte code in some
custom database format, which uses compression for entries.

As a result, Spack cannot relocate `<prefix which>/bin/which` when
installing from a build cache.

The patch works around this by making R create a symlink to `which` in
its own prefix, have the R sources call that, so that relocation works
again.

See r-devel/r-svn#151
@haampie haampie closed this Jan 10, 2024
@haampie haampie reopened this Jan 10, 2024
@haampie
Copy link
Author

haampie commented Jan 10, 2024

Looks like CI for windows is broken due to timeouts when installing miktex

Installing CTAN packages
Sorry, but: Timeout was reached

alalazo pushed a commit to spack/spack that referenced this pull request Jan 16, 2024
R embeds an absolute path to the `which` executable in the sources for
`Sys.which`. This gets ultimately stored as serialized byte code in some
custom database format, which uses compression for entries.

As a result, Spack cannot relocate `<prefix which>/bin/which` when
installing from a build cache.

The patch works around this by making R create a symlink to `which` in
its own prefix, have the R sources call that, so that relocation works
again.

See r-devel/r-svn#151
RikkiButler20 pushed a commit to RikkiButler20/spack that referenced this pull request Jan 25, 2024
R embeds an absolute path to the `which` executable in the sources for
`Sys.which`. This gets ultimately stored as serialized byte code in some
custom database format, which uses compression for entries.

As a result, Spack cannot relocate `<prefix which>/bin/which` when
installing from a build cache.

The patch works around this by making R create a symlink to `which` in
its own prefix, have the R sources call that, so that relocation works
again.

See r-devel/r-svn#151
RikkiButler20 pushed a commit to RikkiButler20/spack that referenced this pull request Jan 31, 2024
R embeds an absolute path to the `which` executable in the sources for
`Sys.which`. This gets ultimately stored as serialized byte code in some
custom database format, which uses compression for entries.

As a result, Spack cannot relocate `<prefix which>/bin/which` when
installing from a build cache.

The patch works around this by making R create a symlink to `which` in
its own prefix, have the R sources call that, so that relocation works
again.

See r-devel/r-svn#151
kwryankrattiger pushed a commit to kwryankrattiger/spack that referenced this pull request Jul 9, 2024
R embeds an absolute path to the `which` executable in the sources for
`Sys.which`. This gets ultimately stored as serialized byte code in some
custom database format, which uses compression for entries.

As a result, Spack cannot relocate `<prefix which>/bin/which` when
installing from a build cache.

The patch works around this by making R create a symlink to `which` in
its own prefix, have the R sources call that, so that relocation works
again.

See r-devel/r-svn#151
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.

1 participant