Skip to content

Fix verification of artifacts in workflow#216

Merged
Leonidas-from-XIV merged 1 commit intoocaml-dune:mainfrom
Leonidas-from-XIV:binary-dune-test-file
Mar 6, 2026
Merged

Fix verification of artifacts in workflow#216
Leonidas-from-XIV merged 1 commit intoocaml-dune:mainfrom
Leonidas-from-XIV:binary-dune-test-file

Conversation

@Leonidas-from-XIV
Copy link
Contributor

For unknown to me reasons the check-artifacts actions started failing because it couldn't read the dune file. It's unclear why this stopped working, no relevant change has been done.

The source of the issue seems that when dune is trying to build the project in the test folder for some reason it traverses up into the containing folder (that of binary-distribution). This is also a dune project, however the dune file was overwritten by the artifact unpacking, thus dune instead of being a S-expression file is the dune binary. Thus the Dune that is being tested tries to read that and fails.

This whole setup is a bit of a mess, with multiple things being unpacked in the same place and potentially affecting each other. Thus this PR updates the code to:

  • Check out the repo into a separate subfolder, so the dune file is not overwritten by a binary
  • Install the dune binary into ~/.local/bin instead of the root directory
  • Use --root . to prevent the dune under test from traversing up from test

This change is done for both workflows as they suffer from the same issue. An example of a fixed workflow run can be seen in my fork (the workflow still fails eventually because it can't deploy due to lack of deployment secrets but the verification passes).

Signed-off-by: Marek Kubica <marek@tarides.com>
@Leonidas-from-XIV Leonidas-from-XIV merged commit 5a63243 into ocaml-dune:main Mar 6, 2026
3 checks passed
@Leonidas-from-XIV Leonidas-from-XIV deleted the binary-dune-test-file branch March 6, 2026 13:17
Copy link

@Sudha247 Sudha247 left a comment

Choose a reason for hiding this comment

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

Looks fine to me!
It is a bit suspicious that dune doesn't treat the test directory as the project root. Makes me wonder if we need to have something to build in the test folder, but that's not for this PR.

@Leonidas-from-XIV
Copy link
Contributor Author

I tried various things, like adding a valid dune-workspace file etc. but also locally on my machine it would traverse upward. I talked with @Alizter that maybe dune gets confused about the presence of .git in the folder above so it would traverse up, even despite the fact that it shouldn't. Thus I added --root . which finally made it stop.

Working on this I understood that test isn't really part of the dune-project of binary distribution but rather a separate project just to test that the generated binaries work, thus I changed the config to avoid building it: #217 which then also removes the dependencies from test.

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.

3 participants