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

Cannot build executable in a target directory #10335

Open
samoht opened this issue Mar 29, 2024 · 2 comments
Open

Cannot build executable in a target directory #10335

samoht opened this issue Mar 29, 2024 · 2 comments

Comments

@samoht
Copy link
Member

samoht commented Mar 29, 2024

I am trying to use target directories to generate a dune file that generates a binary and then extract that binary from there. But it doesn't seem to work. I think this is expected to work, but I am not totally sure I am doing the right thing.

Here is a repro: https://github.com/samoht/dune-crash/tree/main/2

The error is:

$ dune build
File "dune", line 1, characters 0-95:
1 | (rule
2 |   (targets (dir foo))
3 |   (mode promote)
4 |   (deps ./config.sh)
5 |   (action (run ./config.sh)))
Error: This rule defines a directory target "foo" that matches the requested
path "foo/main.exe" but the rule's action didn't produce it
-> required by _build/default/main.exe
-> required by alias all
-> required by alias default
@samoht
Copy link
Member Author

samoht commented Apr 3, 2024

I guess this is expected: a1c7151 seems to indicate that directory targets cannot contain generated sources. Do you think this restriction could be lifted?

@rgrinberg
Copy link
Member

Yes, it should be possible

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

No branches or pull requests

2 participants