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

use case: have a way for zon to define which --build-file to use #17818

Open
nektro opened this issue Nov 1, 2023 · 5 comments
Open

use case: have a way for zon to define which --build-file to use #17818

nektro opened this issue Nov 1, 2023 · 5 comments

Comments

@nektro
Copy link
Contributor

nektro commented Nov 1, 2023

this option is available to zig build when you want to run a build in a file other than build.zig. it should be available to consumers of packages as well.

@andrewrk
Copy link
Member

andrewrk commented Nov 1, 2023

can you elaborate more on this use case?

@nektro
Copy link
Contributor Author

nektro commented Nov 1, 2023

for instance if a package provided a module in build.foo.zig so as to not interfere with an incompatible root build.zig then users might be able to pass .build_file = "build.foo.zig", in their zon file to obtain access to the module

there's also been various talks about support for "monorepos" and they could also be supported through this with .build_file = "foo/build.zig",

@andrewrk
Copy link
Member

andrewrk commented Nov 1, 2023

I think this needs a full example to remain open. It's difficult to understand based on this description alone.

@nektro
Copy link
Contributor Author

nektro commented Nov 1, 2023

https://gist.github.com/nektro/a28d4aadca050d32ab8ea5723bcb6739

the expected output of cloning this and running zig build run is:

info: 184
info: 486

@nektro
Copy link
Contributor Author

nektro commented Nov 4, 2023

another better alternative to the exact code i provided is if .build_file = "build.zig.zig", could be read from the zon of the package being depended on, rather than having to be a field on the consumer

@nektro nektro changed the title use case: have a way for zon dependencies to pass --build-file use case: have a way for zon to define which --build-file to use Dec 19, 2023
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