Skip to content
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

Add failing test when cross-compiling with ppxs #4155

Merged
merged 1 commit into from
Feb 9, 2021
Merged
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
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(lang dune 2.8)
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
(lang dune 2.0)

(context (default))

(context (default
(name cross-environment)
(host default)))
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
(library
(name foolib)
(preprocess (pps fooppx)))
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
(library
(name fooppx)
(enabled_if (= %{context_name} "default"))
(kind ppx_rewriter)
(libraries ppxlib))
Empty file.
14 changes: 14 additions & 0 deletions test/blackbox-tests/test-cases/ppx-cross-context-issue.t/run.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Using a ppx in a cross-compiled build context makes dune try to build the ppx
# in the target context instead of the host, then fail.
$ dune build --debug-dependency-path
Copy link
Member

Choose a reason for hiding this comment

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

Did you forget to promote?

This test also needs a description of the problem that it's trying to test.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Promoted the error and added a description!

File "lib/dune", line 3, characters 18-24:
3 | (preprocess (pps fooppx)))
^^^^^^
Error: Library "fooppx" in _build/cross-environment/ppx is hidden
(unsatisfied 'enabled_if').
-> required by lib/lib.pp.ml (context cross-environment)
-> required by alias lib/all (context cross-environment)
-> required by alias default (context cross-environment)
Hint: try:
dune external-lib-deps --missing --debug-dependency-path @@default
[1]