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

dune pkg management fails on optional directories (jsont/bytesrw) #11405

Open
avsm opened this issue Jan 28, 2025 · 3 comments
Open

dune pkg management fails on optional directories (jsont/bytesrw) #11405

avsm opened this issue Jan 28, 2025 · 3 comments

Comments

@avsm
Copy link
Member

avsm commented Jan 28, 2025

Expected Behavior

With the sample project with:

dune-project:

(lang dune 3.17)
(package
 (allow_empty)
 (name test)
 (depends jsont bytesrw))

dune:

(executable
  (name t)
  (libraries jsont jsont.bytesrw))

and a t.ml to build:

open Jsont
open Bytesrw

The lock works

$ dune pkg lock
Solution for dune.lock:      e
- bytesrw.0.1.0
- jsont.0.1.1
- ocaml.5.3.0
- ocaml-base-compiler.5.3.0
- ocaml-compiler.5.3.0
- ocaml-config.3
- ocamlbuild.0.15.0+dune
- ocamlfind.1.9.6+dune
- topkg.1.0.7

but the build fails:

$ dune build
    Building ocaml-config.3
    Building ocaml.5.3.0
 Downloading ocamlfind.1.9.6+dune
    Building ocamlfind.1.9.6+dune
    Building ocamlbuild.0.15.0+dune
    Building topkg.1.0.7
    Building bytesrw.0.1.0
    Building jsont.0.1.1
Error: This rule defines a directory target "default/.pkg/jsont/target" that
matches the requested path "default/.pkg/jsont/target/lib/jsont/brr" but the
rule's action didn't produce it

Actual Behavior

The build should work

Specifications

"Dune Developer Preview: build 2025-01-28T02:10:32Z, git revision
c0e3bb6"
on macOS

rgrinberg added a commit that referenced this issue Feb 1, 2025
Signed-off-by: Rudi Grinberg <[email protected]>

<!-- ps-id: 6f68050b-a79c-4ee2-989c-75502462ab58 -->
@rgrinberg
Copy link
Member

rgrinberg commented Feb 1, 2025

Thanks for the bug report. depopts aren't the cause of this issue but the fact that we have an optional directory inside the META file. Unfortunately, there's a limitation that makes it impossible to check for the existence of a subdirectory inside a directory produced by a rule without triggering this error.

I'll see if I can workaround this somehow.

Repro in #11426

rgrinberg added a commit that referenced this issue Feb 1, 2025
Signed-off-by: Rudi Grinberg <[email protected]>

<!-- ps-id: 6f68050b-a79c-4ee2-989c-75502462ab58 -->

Signed-off-by: Rudi Grinberg <[email protected]>
rgrinberg added a commit that referenced this issue Feb 1, 2025
Signed-off-by: Rudi Grinberg <[email protected]>
@avsm avsm changed the title dune pkg management fails on depopts (jsont/bytesrw) dune pkg management fails on optional directories (jsont/bytesrw) Feb 2, 2025
@avsm
Copy link
Member Author

avsm commented Feb 2, 2025

Thanks for the triage! I've edited the title to reflect the diagnosis.

@rgrinberg
Copy link
Member

@ElectreAAS could you have a look at this one? Should be quite similar to the other directory targets issue you've fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants