-
Notifications
You must be signed in to change notification settings - Fork 455
Repro test: no hint about missing depext #12857
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
Open
ElectreAAS
wants to merge
1
commit into
ocaml:main
Choose a base branch
from
ElectreAAS:push-luuuyzmytzxl
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+77
−0
Open
Changes from all commits
Commits
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 hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| If we have a 'pure' system dependency (no OCaml compilation unit) | ||
| and no 'libraries' field, we don't fail nor do we print a hint | ||
|
|
||
| $ . ../helpers.sh | ||
| $ mkrepo | ||
| $ add_mock_repo_if_needed | ||
|
|
||
| $ cat > dune-project << EOF | ||
| > (lang dune 3.20) | ||
| > (package | ||
| > (name foo) | ||
| > (depends conf-foobar)) | ||
| > EOF | ||
|
|
||
| $ mkdir src | ||
|
|
||
| $ cat > src/dune << EOF | ||
| > (executable | ||
| > (name foo) | ||
| > (public_name foo)) | ||
| > EOF | ||
|
|
||
| $ cat > src/foo.ml << EOF | ||
| > let _exit_code = Sys.command "foobar some_arg" in | ||
| > () | ||
| > EOF | ||
|
|
||
| $ mkpkg conf-foobar << EOF | ||
| > build: [ | ||
| > ["foobar" "--version"] | ||
| > ] | ||
| > depexts: [ | ||
| > ["foobar-cram"] | ||
| > ] | ||
| > flags: conf | ||
| > EOF | ||
|
|
||
| Dune is aware of the dependency | ||
| $ dune show depexts | ||
| foobar-cram | ||
|
|
||
| And we add it to the lock solution | ||
| $ dune pkg lock | ||
| Solution for dune.lock | ||
|
|
||
| Dependencies common to all supported platforms: | ||
| - conf-foobar.0.0.1 | ||
|
|
||
| Yet we don't try to build it at all | ||
| $ dune build | ||
|
|
||
| And we don't print the hint | ||
| $ dune exec src/foo.exe | ||
| sh: line 1: foobar: command not found | ||
|
|
||
| If however, the 'libraries' field is present and there is an unknown 'hi' | ||
| lib required, dune will try building depexts to find said 'hi' module, | ||
| even if it is unrelated to our depext. | ||
|
|
||
| $ rm src/dune | ||
| $ cat > src/dune << EOF | ||
| > (executable | ||
| > (name foo) | ||
| > (public_name foo) | ||
| > (libraries hi)) | ||
| > EOF | ||
|
|
||
| Now we see it! | ||
| $ dune build | ||
| File "dune.lock/conf-foobar.0.0.1.pkg", line 4, characters 30-36: | ||
| 4 | (all_platforms ((action (run foobar --version))))) | ||
| ^^^^^^ | ||
| Error: Program foobar not found in the tree or in PATH | ||
| (context: default) | ||
| Hint: You may want to verify the following depexts are installed: | ||
| - foobar-cram | ||
| [1] | ||
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.
Does it work with the empty
(libraries)field?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.
an empty libraries field produces the same behaviour as no field at all