Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ charon/tests/cargo/**/target

# Temporary files we don't want to commit
charon-ml/tests/serialized
charon-ml/tests/test-outputs/*
/bin

# Generated by charon
Expand Down
1 change: 0 additions & 1 deletion charon-ml/tests/test-outputs

This file was deleted.

3 changes: 3 additions & 0 deletions charon-ml/tests/test-outputs/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
(copy_files
(alias runtest)
(files ../../../charon/tests/ui/*))
1 change: 1 addition & 0 deletions dune
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(data_only_dirs charon)
10 changes: 3 additions & 7 deletions nix/charon-ml.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@ let
buildInputs = [ ocamlPackages.calendar ];
};

# We need both `charon-ml` and the `dune-project` file.
# We need `charon-ml`, the `dune-project` file, and files that are used in tests.
src = lib.cleanSourceWith {
src = ./..;
filter =
path: type:
(lib.hasPrefix (toString ../charon-ml) path)
|| (lib.hasPrefix (toString ../dune-project) path);
|| (lib.hasPrefix (toString ../dune-project) path)
|| (lib.hasPrefix (toString ../charon/tests/ui) path);
Copy link
Member

Choose a reason for hiding this comment

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

That's not needed: ocaml only needs .llbc files, none of which are part of the git repo.

};

charon-name_matcher_parser =
Expand Down Expand Up @@ -72,11 +73,6 @@ let
inherit src;

OCAMLPARAM = "_,warn-error=+A"; # Turn all warnings into errors.
preCheck =
if doCheck then ''
ln -sf ${charon}/tests-llbc charon-ml/tests/test-outputs
'' else
"";
Comment on lines -75 to -79
Copy link
Member

@Nadrieril Nadrieril Dec 15, 2025

Choose a reason for hiding this comment

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

Something like this is needed because in the nix env the test outputs are otherwise not accessible

Copy link
Member

Choose a reason for hiding this comment

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

You cuold rm -r test-outputs first, that should work

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm, not sure what that means
Why does it need to be available for nix? Isn't dune taking care of all of this?

Copy link
Member

Choose a reason for hiding this comment

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

In nix we build the rust side and ocaml sides separately. So when we get to building the ocaml side, the llbc files emitted by running the rust tests are not there. We must put them there ourselves, which is what this does.

Copy link
Member

Choose a reason for hiding this comment

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

Anyway I can do the nix bits, but I'm not sure I want two copies to happen on the ocaml side

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Aaaaah, got it
Closing this anyway until it works one the dune side

propagatedBuildInputs = with ocamlPackages; [
core
ppx_deriving
Expand Down
Loading