-
Notifications
You must be signed in to change notification settings - Fork 456
Fix dependencies of utop dev tool #12747
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
Conversation
| (* Disallow sharing so that the only packages in the DB are the ones from | ||
| the universe's respective lock directory. *) | ||
| DB.of_ctx ctx ~allow_sharing:false | ||
| | Dev_tool tool -> DB.of_dev_tool tool >>| fst |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change looks correct to me. However, how does this affect only utop?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function here (all_deps) is used when communicating dependencies outside of Pkg_rules. Mechanisms for traversing the dependency closure entirely within Pkg_rules are unchanged. However building a utop top level with access to the code in the current project requires an OCAMLPATH with all the dependencies of utop, and the function which computes this (Pkg_rules.dev_tool_ocamlpath) finds dependencies using all_deps.
.github/workflows/workflow.yml
Outdated
| nix-${{ runner.os }}-${{ github.job }}-${{ hashFiles('**/*.nix', '**/flake.lock') }} | ||
| restore-prefixes-first-match: nix-${{ runner.os }}-${{ github.job }}- | ||
| gc-max-store-size-linux: 2G | ||
| - name: Set up a project and build it with alice in a nix shell |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This name doesn't seem accurate to the step, also at least this part is wrong :)
| - name: Set up a project and build it with alice in a nix shell | |
| - name: Set up a project and build it with dune in a nix shell |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haha woops! Fixed.
f71f4ab to
3ab7782
Compare
|
Would you mind describing the bug here and why the fix fixes it? |
|
Building a utop top level for a project requires knowing the paths to all the libraries that the utop package depends on (e.g. Lines 188 to 197 in 194210a
Pkg_rules and exposed with the function dune/src/dune_rules/pkg_rules.mli Line 27 in 194210a
#12526 changed the representation of dependencies in This PR changes |
shonfeder
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for catching the bug and fixing it!
This fixes a bug in computing dependencies of a dev tool package when using dune package management. It only affected the utop dev tool. This change also adds an integration test for the utop dev tool. The test is a github action workflow rather than a cram test so that the real utop package can be tested, since the utop rules have some logic which is specific to the utop package and thus is non-trivial to accurately test with a mock utop package as we do with other dev tool tests. Signed-off-by: Stephen Sherratt <[email protected]>
3ab7782 to
517ab3a
Compare
This fixes a bug in computing dependencies of a dev tool package when using dune package management. It only affected the utop dev tool. This change also adds an integration test for the utop dev tool. The test is a github action workflow rather than a cram test so that the real utop package can be tested, since the utop rules have some logic which is specific to the utop package and thus is non-trivial to accurately test with a mock utop package as we do with other dev tool tests.