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

fatal error with absolute -build-dir #5503

Closed
vicuna opened this issue Feb 9, 2012 · 4 comments

Comments

Projects
None yet
1 participant
@vicuna
Copy link

commented Feb 9, 2012

Original bug ID: 5503
Reporter: Hendrik Tews
Assigned to: @xclerc
Status: closed (set by @xavierleroy on 2015-12-11T18:19:49Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 3.12.1
Fixed in version: 3.13.0+dev
Category: -for ocamlbuild use https://github.com/ocaml/ocamlbuild/issues
Has duplicate: #4502
Monitored by: mehdi @glondu @xclerc @jberdine jm

Bug description

ocamlbuild uses wrong filename concatenation when it tries to open the _digest file. It therefore dies with a Sys_error when given an absolute build dir.

Steps to reproduce

touch t.ml
ocamlbuild -build-dir /tmp/x t.byte

this dies with

Fatal error: exception Sys_error("/tmp//tmp/x/_digests: No such file or directory")

because it does

open("/tmp//tmp/x/_digests", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0666) = -1 ENOENT (No such file or directory)

Additional information

The bug is also present in 3.13.0+dev11 (2012-01-26)

File attachments

@vicuna

This comment has been minimized.

Copy link
Author

commented Feb 15, 2012

Comment author: @xclerc

Tentative fix in trunk by commit 12154.
Could you confirm it fixes the issue on your machine?

@vicuna

This comment has been minimized.

Copy link
Author

commented Feb 21, 2012

Comment author: jm

the current fix breaks builds not giving -build-dir;
as ocamlbuild tries to write in _build/_build/:

  • ocamlfind ocamlc -where > _build/ocamlc.where
    /bin/sh: cannot create _build/ocamlc.where: Directory nonexistent
    Command exited with code 2.
    Compilation unsuccessful after building 1 target (0 cached) in 00:00:00.
    Fatal error: exception Sys_error("_build/_digests: No such file or directory")
@vicuna

This comment has been minimized.

Copy link
Author

commented Feb 25, 2012

Comment author: @avsm

I fixed it with the attached one-liner in pr-5503.diff, which seems to work both with and without a build-dir specified.

@vicuna

This comment has been minimized.

Copy link
Author

commented Mar 5, 2012

Comment author: @damiendoligez

Fixed in trunk (commit 12191).

Hopefully, this fix will work with all combinations (without -build, with -build relative, with -build absolute).

The fix is actually from Xavier, I'm the committer for technical reasons.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.