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

Run: add output directory arguments #19826

Merged
merged 3 commits into from May 9, 2024
Merged

Conversation

jacobly0
Copy link
Member

@jacobly0 jacobly0 commented May 1, 2024

This allows running commands that take an output directory argument. The main thing that was needed for this feature was generated file subpaths, to allow access to the files in a generated directory. Additionally, a minor change was required to so that the correct directory is created for output directory args.

Also adds run step input files includes lots of cleanup.

@jacobly0 jacobly0 force-pushed the outdirarg branch 10 times, most recently from 5888d16 to 4f6f558 Compare May 4, 2024 19:13
This replaces `extra_file_dependencies` with support for lazy paths.

Also assert output file basenames are not empty, avoid improper use of
field default values, ensure stored strings are duplicated, and
prefer `ArrayListUnmanaged` to discourage misuse of direct field access
which wouldn't add step dependencies.
 * `doc/langref` formatting
 * upgrade `.{ .path = "..." }` to `b.path("...")`
 * avoid using arguments named `self`
 * make `Build.Step.Id` usage more consistent
 * add `Build.pathResolve`
 * use `pathJoin` and `pathResolve` everywhere
 * make sure `Build.LazyPath.getPath2` returns an absolute path
@jacobly0 jacobly0 force-pushed the outdirarg branch 2 times, most recently from 80474bc to 725f2f9 Compare May 5, 2024 19:27
This allows running commands that take an output directory argument. The
main thing that was needed for this feature was generated file subpaths,
to allow access to the files in a generated directory. Additionally, a
minor change was required to so that the correct directory is created
for output directory args.
Copy link
Member

@andrewrk andrewrk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thanks for making sure the up directory going too far is checked before applying the sub path 👍

@andrewrk andrewrk merged commit 6bc0cef into ziglang:master May 9, 2024
10 checks passed
@jacobly0 jacobly0 deleted the outdirarg branch May 9, 2024 03:11
@andrewrk
Copy link
Member

andrewrk commented May 11, 2024

I suspect this caused #19938.

Edit: indeed, when I revert this commit, the regression disappears.

linusg added a commit to linusg/any-pointer that referenced this pull request May 17, 2024
The 'path' union field got removed upstream.

See: ziglang/zig#19826
linusg added a commit to linusg/parser-toolkit that referenced this pull request May 17, 2024
The 'path' union field got removed upstream.

See: ziglang/zig#19826
linusg added a commit to linusg/zig-args that referenced this pull request May 17, 2024
The 'path' union field got removed upstream.

See: ziglang/zig#19826
linusg added a commit to linusg/zigline that referenced this pull request May 17, 2024
The 'path' union field got removed upstream.

See: ziglang/zig#19826
linusg added a commit to linusg/zig-build-macos-sdk that referenced this pull request May 17, 2024
The 'path' union field got removed upstream.

See: ziglang/zig#19826
alimpfard pushed a commit to alimpfard/zigline that referenced this pull request May 17, 2024
The 'path' union field got removed upstream.

See: ziglang/zig#19826
ikskuh pushed a commit to ikskuh/zig-args that referenced this pull request May 18, 2024
The 'path' union field got removed upstream.

See: ziglang/zig#19826
ikskuh pushed a commit to ikskuh/parser-toolkit that referenced this pull request May 18, 2024
The 'path' union field got removed upstream.

See: ziglang/zig#19826
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

Successfully merging this pull request may close these issues.

None yet

2 participants