-
Notifications
You must be signed in to change notification settings - Fork 27
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
Rewrite unused package names #367
Merged
Leonidas-from-XIV
merged 17 commits into
tarides:main
from
Leonidas-from-XIV:rewrite-package-names
Jan 31, 2023
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
bac8a3f
Determine the dune packages/public_names of packages
Leonidas-from-XIV b0f025b
Write detected dune packages to lockfile
Leonidas-from-XIV d3460d4
Implement package uniquization
Leonidas-from-XIV 00d227f
Better prettyprinting of expressions
Leonidas-from-XIV 972e818
Better pretty-printing of atoms in Sexp
Leonidas-from-XIV ef3490d
Add option to disable deduplication
Leonidas-from-XIV 8ab3a12
Clean up printing logic using formatters exclusively
Leonidas-from-XIV 1600162
Add description of change for the changelog
Leonidas-from-XIV 12ecdeb
Add combinator for Opam Option values
Leonidas-from-XIV f3f2c71
Change OPAM file format
Leonidas-from-XIV f308b0a
Deduplicate Ident/String
Leonidas-from-XIV b119116
Fixup all existing tests to match new format
Leonidas-from-XIV 1c22ba2
Add test to evaluate deduplication logic
Leonidas-from-XIV 7cb1971
Split function into two more sensible functions
Leonidas-from-XIV aded250
Add documentation to the feature
Leonidas-from-XIV 38aa318
Use record as return type
Leonidas-from-XIV 5c87fbc
Use hash of directory to disambiguate libraries instead of random ID
Leonidas-from-XIV File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
One trick I recently learned is that you can patch the
dune
file of a subdirectory without writing in that directory: you can mark that directory asdata_only_dirs
and use(subdir)
to set the contents of the (virtual) dune file in there. I don't know if that applies to that case, but that can be useful if you don't want to change the contents of the unpacked tarball.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.
That's an interesting trick, but I can unfortunately see a number of problems with nested directories where I need to modify
foo/dune
but there is afoo/bar/dune
that would has to stay the same (or be also moved up usingsubdir
).Rewriting it this way I can't easily ignore
dune
files in OCaml (and hoping they don't create issues). The cleanest way would probably be to collect alldune
stanzas and dump them into a top leveldune
file but then I would also need to know whichdune
-files are actually being evaluated (e.g. no point to collectdune
files fromdata_only_dirs
which might actually break the build if collected). I feel this is getting dangerously close to a half-baked implementation of the rule-discovery logic of Dune itself.But this does point at the necessity of eventually implementing such a feature in Dune itself.