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

fix: Allow package in any location in rule #7445

Merged
merged 3 commits into from
Mar 30, 2023
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
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ Unreleased
- Support `(link_flags ...)` in `(cinaps ...)` stanza. (#7423, fixes #7416,
@nojb)

- Allow `(package ...)` in any position within `(rule ...)` stanza (#7445,
@Leonidas-from-XIV)

3.7.0 (2023-02-17)
------------------

Expand Down
1 change: 1 addition & 0 deletions src/dune_rules/dune_file.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1728,6 +1728,7 @@ module Rule = struct
; ("aliases", Field)
; ("alias", Field)
; ("enabled_if", Field)
; ("package", Field)
]

let short_form =
Expand Down
Empty file.
12 changes: 12 additions & 0 deletions test/blackbox-tests/test-cases/package-rule.t/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
(test
(name test)
(modules test test_a test_b)
(package a))

(rule
(action (copy test_temp.ml test_a.ml))
(package a))

(rule
(package a)
(action (copy test_temp.ml test_b.ml)))
1 change: 1 addition & 0 deletions test/blackbox-tests/test-cases/package-rule.t/dune-project
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(lang dune 2.0)
5 changes: 5 additions & 0 deletions test/blackbox-tests/test-cases/package-rule.t/run.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
When --only-packages is passed, it runs

$ dune build --only-packages a @runtest
A
A
Alizter marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 2 additions & 0 deletions test/blackbox-tests/test-cases/package-rule.t/test.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
module _ = Test_a
module _ = Test_b
1 change: 1 addition & 0 deletions test/blackbox-tests/test-cases/package-rule.t/test_temp.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
let () = print_endline "A"