-
Notifications
You must be signed in to change notification settings - Fork 413
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
aux files set-up as read-only #3437
Comments
Signed-off-by: Martin Bodin <[email protected]>
Yup, sorry. This is a problem related to read-only mode of build objects that I did not foresee when I chose to ignore Unfortunately Coq doesn't have a flag to remove aux file generation, I will add such flag for 8.11.2 / 8.12, meanwhile let me think what the best way to fix this in Dune is. |
Hi @Mbodin , I cannot reproduce using a plain I was a bit puzzled as even |
Note that I'm using Coq 8.11 , this could be very well Coq-specific, can you reproduce with 8.11? |
Using https://github.com/Mbodin/dune-bug and ignoring the $ coqc --version
The Coq Proof Assistant, version 8.10.1 (January 2020)
compiled on Jan 8 2020 11:29:37 with OCaml 4.09.0
$ dune --version
2.5.1
$ dune build @all
coqc theories/common.vo (exit 1)
(cd _build/default && /home/martin/.opam/4.09.0/bin/coqc -R theories Bug_Coq theories/common.v)
Error: System error: "./theories/.common.aux: Permission denied" I also get the error with Coq 8.11. Given that both Travis and you are getting the same positive results, this must be an issue with my own configuration. |
Thanks for the pointers @Mbodin , maybe you have some strange The problem seems to be that your Even with the cache enabled I cannot reproduce the problem. It would be helpful if you could post (from a clean build tree):
|
Sure. Here are the information.
I’m quite surprised by the produced logs: it seems that the issue came with the compilation of the files producing the |
Thanks for the extra info @Mbodin ; just to be clear, does the problem happen on a fresh compilation, that is to say, after |
I didn’t do |
Using a |
Thanks @Mbodin , what is the output of
? |
Thank you for your time ☺ Here it is: $ dune build @all
coqc theories/common.vo (exit 1)
(cd _build/default && /home/martin/.opam/4.07.0/bin/coqc -R theories Bug_Coq theories/common.v)
Error: System error: "./theories/.common.aux: Permission denied"
$ (cd _build/default && /home/martin/.opam/4.07.0/bin/coqc -debug -R theories Bug_Coq theories/common.v)
Error:
System error: "./theories/.common.aux: Permission denied"
frame @ file "toplevel/coqc.ml", line 67, characters 4-25
frame @ file "toplevel/coqc.ml", line 45, characters 2-81
frame @ file "list.ml", line 106, characters 12-15
frame @ file "toplevel/ccompile.ml", line 214, characters 2-39
frame @ file "toplevel/ccompile.ml", line 138, characters 16-113
frame @ file "stdlib.ml", line 321, characters 2-74
frame @ file "stdlib.ml", line 316, characters 29-55 |
Thanks to you @Mbodin ; that is quite bizarre, in particular as the file seems to be there. If you do
do you still get the same? |
At this point something like this may be needed:
please paste the contents of the file |
Indeed, removing the $ dune build @all
coqc theories/common.vo (exit 1)
(cd _build/default && /home/martin/.opam/4.07.0/bin/coqc -R theories Bug_Coq theories/common.v)
Error: System error: "./theories/.common.aux: Permission denied"
$ (cd _build/default && rm -f theories/.common.aux && /home/martin/.opam/4.07.0/bin/coqc -R theories Bug_Coq theories/common.v)
$ ls -la _build/default/theories/
total 56
drwxr-xr-x 2 martin martin 4096 May 4 14:48 .
drwxr-xr-x 5 martin martin 4096 May 4 14:48 ..
-rw-r--r-- 1 martin martin 272 May 4 14:48 .common.aux
-rw-r--r-- 1 martin martin 1038 May 4 14:48 common.glob
-r--r--r-- 1 martin martin 306 May 4 14:48 common.v
-r--r--r-- 1 martin martin 94 May 4 14:48 common.v.d
-rw-r--r-- 1 martin martin 16738 May 4 14:48 common.vo
-rw-r--r-- 1 martin martin 0 May 4 14:48 common.vok
-rw-r--r-- 1 martin martin 0 May 4 14:48 common.vos
-r--r--r-- 1 martin martin 50 May 4 14:48 dune
-r--r--r-- 1 martin martin 213 May 4 14:48 value.v
-r--r--r-- 1 martin martin 110 May 4 14:48 value.v.d
$ dune build @all
coqc theories/common.vo (exit 1)
(cd _build/default && /home/martin/.opam/4.07.0/bin/coqc -R theories Bug_Coq theories/common.v)
Error: System error: "./theories/.common.aux: Permission denied"
$ dune clean
$ dune build @all
coqc theories/common.vo (exit 1)
(cd _build/default && /home/martin/.opam/4.07.0/bin/coqc -R theories Bug_Coq theories/common.v)
Error: System error: "./theories/.common.aux: Permission denied"
$ (cd _build/default && strace -o coqc_strace_out -- /home/martin/.opam/4.07.0/bin/coqc -R theories Bug_Coq theories/common.v)
Error: System error: "./theories/.common.aux: Permission denied"
The content of |
I'm afraid I'm totally lost on why the aux file is already there when you do I cannot reproduce :S , only think I could image is that for some reason coqc is called twice? |
If you remove the extraction stanza does that still happen? |
Maybe there is something else wrong with my system :-\ The fact that the issue is not reproducible elsewhere is very frustrating ☹ (This also makes this issue less important, I imagine.) I just commented-out the extraction stanza, and the issue is still happening, including after a |
I have the same problem on a project here. Some context: I'm using OCaml 4.07.1, dune 2.5.1, coq 8.10.1 in an opam switch. I'll try to come back with a minimum example as soon as possible. |
Oups, I just found that I had a remaining |
Thanks @picojulien , that would explain a lot! Good catch! As of today dune doesn't consider |
@Mbodin would that explain some of your problems? |
It does! I did not notice it before, but I do have a I’m thus closing this issue. Do you think that a warning message should be displayed when such |
This is indeed a real issue, Dune should be aware of aux files as targets and thus error if such files are present. |
Something I don't fully grasp is why |
Possible some stray glob dependency? If there's no dependency on .aux anywhere and it's still being copied then we should def. fix this bug in dune. |
Fix ocaml#3437 Signed-off-by: Rudi Grinberg <[email protected]>
I misunderstood the issue. #3721 adds .aux files as targets. |
Fix ocaml#3437 Signed-off-by: Rudi Grinberg <[email protected]>
Fix ocaml#3437 Signed-off-by: Rudi Grinberg <[email protected]>
Fix ocaml#3437 Signed-off-by: Rudi Grinberg <[email protected]>
…lugin, dune-private-libs and dune-glob (2.7.1) CHANGES: - configurator: More flexible probing of `#define`. We allow duplicate values in the object file, as long as they are the same after parsing. (ocaml/dune#3739, fixes ocaml/dune#3736, @rgrinberg) - Record instrumentation backends in dune-package files. This makes it possible to use instrumentation backends defined in installed libraries (eg via OPAM). (ocaml/dune#3735, @nojb) - Add missing `.aux` & `.glob` targets to coq rules (ocaml/dune#3721, fixes ocaml/dune#3437, @rgrinberg) - Fix `dune-package` installation when META templates are present (ocaml/dune#3743, fixes ocaml/dune#3746, @rgrinberg) - Resolve symlinks before running `$ git diff` (ocaml/dune#3750, fixes ocaml/dune#3740, @rgrinberg) - Cram tests: when checking that all test directories contain a `run.t` file, skip empty directories. These can be left around by git. (ocaml/dune#3753, @emillon)
…lugin, dune-private-libs and dune-glob (2.7.1) CHANGES: - configurator: More flexible probing of `#define`. We allow duplicate values in the object file, as long as they are the same after parsing. (ocaml/dune#3739, fixes ocaml/dune#3736, @rgrinberg) - Record instrumentation backends in dune-package files. This makes it possible to use instrumentation backends defined in installed libraries (eg via OPAM). (ocaml/dune#3735, @nojb) - Add missing `.aux` & `.glob` targets to coq rules (ocaml/dune#3721, fixes ocaml/dune#3437, @rgrinberg) - Fix `dune-package` installation when META templates are present (ocaml/dune#3743, fixes ocaml/dune#3746, @rgrinberg) - Resolve symlinks before running `$ git diff` (ocaml/dune#3750, fixes ocaml/dune#3740, @rgrinberg) - Cram tests: when checking that all test directories contain a `run.t` file, skip empty directories. These can be left around by git. (ocaml/dune#3753, @emillon)
I am using the
coq.extraction
new stanza defined from dune 2.5. The compilation process of this stanza seems to request .aux files with the read-write permissions. Unfortunately, these are only created as read-only permission by thecoq.theory
stanza.This might be a bug of Coq rather than Dune. I am putting it here because the bug never appeared before the
coq.extraction
stanza when I used ad-hoc rules like:Expected Behavior
I would expect the compilation to go well, with the
coq.extraction
stanza using the files created during thecoq.theory
stanza.Actual Behavior
I get the following output:
Error: System error: "./theories/.common.aux: Permission denied"
instead.Running
chmod +w
on the said file, thendune build @all
makes the compilation working.Reproduction
I did a stand-alone repository to test the issue: https://github.com/Mbodin/dune-bug
I tried to make the repository as minimal as I could, but then the .aux files were not created. So I added some lemmas to trigger the issue.
I will send a PR with this same reproducing test very soon.
In the meantime, I can explain it in the context of this subrepository.
It is based on
esy
, a docker-like for OCaml. Basically, typingesy dune build @all
calls dune in a context where all the packages constraints specified in the file package.json are met.Typing
esy dune build --verbose @all
yields the output given in the gist below.Typing
chmod +w _build/default/theories/*.aux
thenesy dune build @all
again makes the whole thing compile.A run on Travis CI can be seen at: https://travis-ci.org/github/Mbodin/dune-bug/builds/681395518
The bug is not reproduced on Travis CI: there must be something about my specific system. I will keep investigating.
Specifications
dune
(output ofdune --version
): 2.5.1ocaml
(output ofocamlc --version
): 4.09.0coq
(output ofcoqcc --version
): The Coq Proof Assistant, version 8.10.1 (April 2020)uname -a
: Linux ibekso 4.15.0-1079-oem Add clean subcommand #89-Ubuntu SMP Fri Mar 27 05:22:11 UTC 2020 x86_64 x86_64 x86_64 GNU/LinuxAdditional information
dune
with the--verbose
flag): https://gist.github.com/Mbodin/291a9c4e0d75cbac38f946b1dc3263b8The text was updated successfully, but these errors were encountered: