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

cinaps fails with Error: Unable to resolve symlink #7376

Closed
smuenzel opened this issue Mar 22, 2023 · 7 comments · Fixed by #7618
Closed

cinaps fails with Error: Unable to resolve symlink #7376

smuenzel opened this issue Mar 22, 2023 · 7 comments · Fixed by #7618

Comments

@smuenzel
Copy link

smuenzel commented Mar 22, 2023

When creating a dune project with cinaps 1.2 and a file to run cinaps on, @runtest will fail with

Error: Unable to resolve symlink

on the file we apply cinaps to. cinaps 1.0 works fine.
@hhugo suspects it's related to #6176

Steps to reproduce

git clone git@github.com:smuenzel/sandbox2.git
cd sandbox2
dune build @runtest

Note: this is a repo with just one ml file and dune files, cut down from the original repo where I had the issue

Specifications

$ dune --version
3.7.0
$ ocamlopt.opt --version
4.14.1
$ head -n1 /etc/os-release
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"

Additional information

@Alizter
Copy link
Collaborator

Alizter commented Mar 22, 2023

I am unable to reproduce your example. I just get:

 |  $ git clone git@github.com:smuenzel/sandbox2.git
+|  Cloning into 'sandbox2'...
 |  $ cd sandbox2
 |  $ dune build @runtest
+|  File "bindings/boolector.ml", line 1, characters 0-0:
+|  Error: Files _build/default/bindings/boolector.ml and
+|  _build/default/bindings/boolector.ml.cinaps-corrected differ.
+|  [1]
 |  $ exit

@hhugo
Copy link
Collaborator

hhugo commented Mar 22, 2023

I can reproduce the issue on my machine. @Alizter, you seem to be using some cram tests, could it explain the difference ?

@Alizter
Copy link
Collaborator

Alizter commented Mar 22, 2023

Yes, I can confirm the issue outside of a cram test.

@rgrinberg rgrinberg added this to the 3.8.0 milestone Mar 23, 2023
@Alizter
Copy link
Collaborator

Alizter commented Apr 23, 2023

OK, so the issue here is that the build action fails, but we want to print the diff. However since the action is sandboxed, the original failed file gets cleaned up before we can diff it. This is at least what I expect is happening. I haven't been able to reproduce this behaviour with user defined actions.

Edit: actually scratch that. The sandbox is still there, but for some reason the original source file is missing.

Also FTR --sandbox none will get ignored, so that can't be a workaround.

@Alizter
Copy link
Collaborator

Alizter commented Apr 23, 2023

OK the issue was that the action we had for the cinaps rule didn't record the source files hence they were missing from the sandbox. I have fixed this and tested that the example here now works (fails) correctly.

#7618

@smuenzel
Copy link
Author

Also FTR --sandbox none will get ignored, so that can't be a workaround.

Do you know why this happens? Seems kind of bad if it can't be used to avoid problems with the sandbox.

@Alizter
Copy link
Collaborator

Alizter commented Apr 24, 2023

@smuenzel some actions in Dune rules use sandboxing in a critical way where disabling it would break the rules. The sandbox option is really only for sandboxing declared by the user where it might not be critical.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants