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

Fix a crash in sandbox.sh when the XDG cache directory does not exist #4278

Merged
merged 4 commits into from
Jul 20, 2020

Conversation

kit-ty-kate
Copy link
Member

Opam 2.1 has support for symlinked cache directory, however currently if the cache directory does not exist, the script will crash with no error message.

~/opam-repository$ ls ~/.cache
ls: cannot access '/home/opam/.cache': No such file or directory
~/opam-repository$ OPAM_SWITCH_PREFIX ~/.opam/opam-init/hooks/sandbox.sh build ls
bash: OPAM_SWITCH_PREFIX: command not found
~/opam-repository$ OPAM_SWITCH_PREFIX=blah ~/.opam/opam-init/hooks/sandbox.sh build ls
~/opam-repository$ echo $?
1
~/opam-repository$ sed -i 's/readlink -f/readlink -m/' ~/.opam/opam-init/hooks/sandbox.sh
~/opam-repository$ OPAM_SWITCH_PREFIX=blah ~/.opam/opam-init/hooks/sandbox.sh build ls
CHANGES.md  CONTRIBUTING.md  COPYING  README.md  packages  repo  version

@kit-ty-kate
Copy link
Member Author

The script also missed some quotes

@kit-ty-kate kit-ty-kate force-pushed the fix-sandbox-null-xdg-cache-dir branch from fbe8435 to 7efaeba Compare July 18, 2020 16:07
@rjbou rjbou added this to the 2.1.0~alpha2 milestone Jul 20, 2020
@rjbou
Copy link
Collaborator

rjbou commented Jul 20, 2020

Thanks!

@rjbou rjbou merged commit 06a607b into ocaml:master Jul 20, 2020
@rjbou rjbou mentioned this pull request Nov 10, 2020
@rjbou rjbou modified the milestones: 2.1.0~alpha2, 2.0.8 Nov 10, 2020
@rjbou rjbou modified the milestones: 2.1.0~alpha2, 2.0.8 Feb 10, 2021
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.

2 participants