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

Import a build.zig file as a build step #368

Closed
AndreaOrru opened this issue May 8, 2017 · 6 comments · Fixed by #14265
Closed

Import a build.zig file as a build step #368

AndreaOrru opened this issue May 8, 2017 · 6 comments · Fixed by #14265
Labels
enhancement Solving this issue will likely involve adding new logic or components to the codebase. zig build system std.Build, the build runner, `zig build` subcommand, package management
Milestone

Comments

@AndreaOrru
Copy link
Contributor

Kinda like this:
https:/zig-lang/zig/blob/master/test/build_examples.zig

But included in the standard build system.

@andrewrk
Copy link
Member

andrewrk commented May 8, 2017

Why does it need to be a separate build file? In the example you linked, we're testing the zig build system itself which is the reason for running zig build in a subprocess.

In your case, can you not import the file and pass it the Builder reference?

@andrewrk
Copy link
Member

andrewrk commented May 9, 2017

Related: #353

@AndreaOrru
Copy link
Contributor Author

AndreaOrru commented May 9, 2017

No. For example, the paths are going to be inconsistent: relative to the root of the project when building the module from the main build.zig, and to the module directory when building it by itself.

You should be able to cd into the module directory and build it independently from the rest of the project.

@AndreaOrru
Copy link
Contributor Author

AndreaOrru commented May 9, 2017

Related issue: if two executables are part of the same build, and you call .setBuildMode(b.standardReleaseOptions()) on both, you get this error:

Option 'release-safe' declared twice.

andrewrk added a commit that referenced this issue May 10, 2017
@andrewrk
Copy link
Member

The standardReleaseOptions issue is resolved.

@andrewrk andrewrk added the enhancement Solving this issue will likely involve adding new logic or components to the codebase. label May 10, 2017
@andrewrk andrewrk added this to the 0.2.0 milestone May 10, 2017
@andrewrk andrewrk modified the milestones: 0.2.0, 0.3.0 Jan 19, 2018
@andrewrk andrewrk modified the milestones: 0.3.0, 0.4.0 Feb 28, 2018
@andrewrk
Copy link
Member

andrewrk commented Feb 5, 2019

Related to #353 and #943

@andrewrk andrewrk modified the milestones: 0.4.0, 0.5.0 Feb 15, 2019
@andrewrk andrewrk added the zig build system std.Build, the build runner, `zig build` subcommand, package management label Jul 4, 2019
@andrewrk andrewrk modified the milestones: 0.5.0, 0.6.0 Sep 11, 2019
@andrewrk andrewrk modified the milestones: 0.6.0, 0.7.0 Feb 10, 2020
@andrewrk andrewrk modified the milestones: 0.7.0, 0.8.0 Oct 9, 2020
@andrewrk andrewrk modified the milestones: 0.8.0, 0.9.0 Nov 6, 2020
@andrewrk andrewrk modified the milestones: 0.9.0, 0.10.0 May 19, 2021
@andrewrk andrewrk mentioned this issue Jan 12, 2023
32 tasks
@andrewrk andrewrk modified the milestones: 0.12.0, 0.11.0 Jan 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Solving this issue will likely involve adding new logic or components to the codebase. zig build system std.Build, the build runner, `zig build` subcommand, package management
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants