You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The difference between them, if I'm not mistaken, is that dir3 is a symbolic link to a directory which contains "../../" (two occurrences of "..") in its path, while dir5 is a standard directory containing a symbolic link to a file. Though this symbolic link also contains "../../" in its path, it still works.
Note that a single "../" is not an issue, as exemplified by the dir2 directory. Symlinks to directories containing 3 or more ".." also seem to trigger the issue.
Steps to reproduce
Uncompress the contents of the attached tar.gz file and run:
I did some more tests, and the "../.." does not seem to be the problem (it does work in some cases), but the issue seems related to:
using an include with nested directories (e.g. -I dir1/dir2);
using a relative symbolic link for a directory.
I still couldn't find the exact situations where these work and where they don't, but it seems I have to combine both to obtain an error.
It would seem that in some cases the relative path is interpreted with respect to the directory from where ocamlbuild is run, instead of the directory containing the relative symbolic link. For instance, the following example code seems to trigger the issue on my machine:
Original bug ID: 6498
Reporter: maro
Status: closed (set by @damiendoligez on 2015-03-27T21:33:58Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 4.01.0
Target version: 4.02.2+dev / +rc1
Fixed in version: 4.02.2+dev / +rc1
Category: -for ocamlbuild use https://github.com/ocaml/ocamlbuild/issues
Related to: #5395
Monitored by: @gasche
Bug description
Relative symbolic links for directories with "../../" in their paths do not seem to be correctly followed.
I had the issue arrive in a large project, and I tried to reproduce it in a smaller directory structure (attached).
In the folder containing the extracted paths, when trying to compile b.ml with the following command:
ocamlbuild -I dir1/dir2 -I dir1/dir4/dir3 b.native
I obtain the following error message:
File "b.ml", line 2, characters 0-6:
Error: Unbound module C
Command exited with code 2.
I expected module C to be found since it is present in directory dir3.
If I run instead this command:
ocamlbuild -I dir1/dir2 -I dir1/dir4/dir5 b.native
Then compilation succeeds, as expected.
The difference between them, if I'm not mistaken, is that dir3 is a symbolic link to a directory which contains "../../" (two occurrences of "..") in its path, while dir5 is a standard directory containing a symbolic link to a file. Though this symbolic link also contains "../../" in its path, it still works.
Note that a single "../" is not an issue, as exemplified by the dir2 directory. Symlinks to directories containing 3 or more ".." also seem to trigger the issue.
Steps to reproduce
Uncompress the contents of the attached tar.gz file and run:
ocamlbuild -I dir1/dir2 -I dir1/dir4/dir3 b.native
ocamlbuild -I dir1/dir2 -I dir1/dir4/dir5 b.native
The first line should succeed but fails, while the second one succeeds.
File attachments
The text was updated successfully, but these errors were encountered: