|Anonymous | Login | Signup for a new account||2014-04-24 18:35 CEST|
|Main | My View | View Issues | Change Log | Roadmap|
|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0005996||OCaml||OCamlbuild (the tool)||public||2013-04-22 09:46||2013-08-19 16:25|
|Target Version||4.01.1+dev||Fixed in Version|
|Summary||0005996: ocamlbuild -build-dir dangerous behaviour|
|Description||I run this command :|
ocamlbuild -build-dir ../../toto ..
which did not work
+ mkdir /home/william/tmp/test/test2/..
mkdir: impossible de créer le répertoire « /home/william/tmp/test/test2/.. »: Le fichier existe
Command exited with code 1.
Error during command "mkdir /home/troit/tmp/test/test2/..": My_std.Exit_with_code(10).
then I did this :
ocamlbuild -build-dir '~/svn/build'
which created the directory '~' in the repository where I executed ocamlbuild
Then I wanted to remove the directory :
rm -Rf ~
Don't explain you what the problem is. Felt like a newbe
|Tags||No tags attached.|
PEBKAC, ocamlbuild behaviour is correct.
Passing '~' inside single quotes precludes its expansion by the shell, and tells ocamlbuild to use literally the '~' directory, instead of $HOME, exactly what happened.
You probbably want to use "~" (inside double quotes). Read 'man bash' for shell quoting rules before using the shell.
edited on: 2013-07-29 08:45
ok, but let's try to isolate things :
1) make ../foo works,
but ocamlbuild -build-dir ../foo does not work
2) make '~/foo' does not work (and does not create a folder named '~')
but ocamlbuild -build-dir '~/foo' creates directory '~' (becareful, do not launch this command unless you know how to remove '~' without removing your home directory :-), which I don't, so will not try it again)
3) make "~/foo" works (thanks ygrek for the explanation about " and ')
but ocamlbuild build-dir "~/foo" creates directory '~' (and subfolders) inside the directory, as subdirectories without expanding '~'.
and '~' can be removed by doing :
|for information, there is no big deal with all this, there may be more important things. also, it was quite clear in the doc that build dir was to be local.|
|There are some difficulties with absolute vs. relative paths in various places in OCamlbuild. This precise issue is at least a case of confusing user interface.|
|2013-04-22 09:46||william||New Issue|
|2013-04-22 23:12||doligez||Severity||major => minor|
|2013-04-22 23:12||doligez||Status||new => confirmed|
|2013-04-22 23:12||doligez||Target Version||=> 4.01.0+dev|
|2013-07-29 05:12||ygrek||Note Added: 0009960|
|2013-07-29 08:41||william||Note Added: 0009966|
|2013-07-29 08:45||william||Note Edited: 0009966||View Revisions|
|2013-07-29 08:47||william||Note Added: 0009967|
|2013-07-29 08:57||gasche||Note Added: 0009969|
|2013-08-19 16:25||doligez||Target Version||4.01.0+dev => 4.01.1+dev|
|Copyright © 2000 - 2011 MantisBT Group|