Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Space character in parent directory breaks many commands #4705

Closed
ryanartecona opened this issue Jun 9, 2021 · 1 comment · Fixed by #4707
Closed

Space character in parent directory breaks many commands #4705

ryanartecona opened this issue Jun 9, 2021 · 1 comment · Fixed by #4707
Milestone

Comments

@ryanartecona
Copy link

I get an error like the following on a number of opam subcommands (switch create, install, upgrade).

sh: -c: line 0: syntax error near unexpected token `('
sh: -c: line 0: `rm -rf /Users/ryanartecona/Dropbox (Personal)/Code/Web/ryanartecona.github.io/example/_opam/.opam-switch/build/ocaml-system.4.12.0'
Switch initialisation failed: clean up? ('n' will leave the
switch partially installed) [Y/n] n
Cannot remove /Users/ryanartecona/Dropbox (Personal)/Code/Web/ryanartecona.github.io/example/_opam/.opam-switch/build/ocaml-system.4.12.0 (error 2).

This seems to be caused by OpamSystem.remove_dir running an rm -rf dir command without quoting the dir. With a space anywhere in the path, the shell splits the argument into 2 (and in my case chokes on a ( that follows the space).


> opam config report
# opam config report
# opam-version      2.0.8 
# self-upgrade      no
# system            arch=x86_64 os=macos os-distribution=homebrew os-version=10.15.7
# solver            builtin-mccs+glpk
# install-criteria  -removed,-count[version-lag,request],-count[version-lag,changed],-changed
# upgrade-criteria  -removed,-count[version-lag,solution],-new
# jobs              4
# repositories      1 (http) (default repo at c8553cab)
# pinned            0
# current-switch    /Users/ryanartecona/Dropbox (Personal)/Code/Web/ryanartecona.github.io/example```
@dra27
Copy link
Member

dra27 commented Jun 10, 2021

As @kit-ty-kate notes in the PR, this has been present for a loooong time, but having spotted it it will be dealt with for 2.0.9 and 2.1.0, thanks!

@rjbou rjbou modified the milestones: 2.1.0~rc, 2.0.9 Jun 10, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
3 participants