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

Moving to latest dune #425

Merged
merged 2 commits into from Apr 3, 2023
Merged

Moving to latest dune #425

merged 2 commits into from Apr 3, 2023

Conversation

ElectreAAS
Copy link
Contributor

Since #420, if building using the latest versions of dune (above 3.5.0), we had an error in the pipeline:

Error: A running dune (pid: 861738) instance has locked the build directory.
If this is not the case, please delete _build/.lock

This is because in pipeline/reload.sh we use dune build --watch and then call dev/github-app.sh, which calls dune build. This workflow has been made impossible in dune 3.6 and up with the use of lockfiles.

The simplest fix was to use dune exec --watch, introduced in the latest version of dune (3.7.0), and to call dev/github-app.sh before the call to watch.
Using the latest dune version introduced a bit of noise, sorry for that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Special reviewing attention should be paid to these changes as shell quoting is notably difficult.
The arguments to this script are located in development.docker-compose.yaml, and look like "--foo=bar" "--baz" "--spam=eggs break=fast". This list was prepended with the executable produced by dune to call it directly.
We used to do COMMAND="${*@Q}", then sh -c "$COMMAND".

What I now do is remove the direct call to the executable, in favor of a simpler dune exec bin/main.exe -- "$@". This means the arguments now need not be super quoted because of the call to sh, but still need to be somewhat quoted so they don't break dune.

@punchagan
Copy link
Contributor

This is because in pipeline/reload.sh we use dune build --watch and then call dev/github-app.sh, which calls dune build. This workflow has been made impossible in dune 3.6 and up with the use of lockfiles.

Thanks for working on fixing this!

I also see an error that goes like this, when I stop the development docker container and restart it.

error checking context: no permission to read from '/home/punchagan/code/segfault/current-bench/pipeline/_build/.lock'

Adding pipeline/_build to the .dockerignore file helps. Would that be useful to add?

@ElectreAAS
Copy link
Contributor Author

I also see an error that goes like this, when I stop the development docker container and restart it. error checking context: no permission to read from '/home/punchagan/code/segfault/current-bench/pipeline/_build/.lock'

I can't reproduce that... But I rm -rf pipeline/_build several times recently to clean up my directories, maybe that's the cause? If doing that doesn't solve the error, could you give me more details?

@punchagan
Copy link
Contributor

I can't reproduce that... But I rm -rf pipeline/_build several times recently to clean up my directories, maybe that's the cause? If doing that doesn't solve the error, could you give me more details?

If I remove the files, the docker container starts up, but I run into the issue again if I shutdown the container and start it again. It may be a difference between running docker on Linux vs MacOS hosts, which is why you're probably not running into it.

@ElectreAAS
Copy link
Contributor Author

I added it to the ignore file. As I can't test it on my machine I'm going to trust you on this one :)

Copy link
Contributor

@punchagan punchagan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Thanks!

@punchagan punchagan merged commit 6df7b2f into main Apr 3, 2023
1 check passed
@punchagan punchagan deleted the dune-fix branch April 3, 2023 06:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants