Add the support for ARG in the native builder parser#516
Merged
dkovba merged 23 commits intoapple:mainfrom Aug 20, 2025
Merged
Conversation
wlan0
reviewed
Aug 17, 2025
Sources/NativeBuilder/ContainerBuildIR/Graph/GraphBuilder+Arg.swift
Outdated
Show resolved
Hide resolved
wlan0
reviewed
Aug 17, 2025
wlan0
reviewed
Aug 17, 2025
wlan0
reviewed
Aug 17, 2025
Sources/NativeBuilder/ContainerBuildIR/Graph/GraphBuilder+Arg.swift
Outdated
Show resolved
Hide resolved
wlan0
reviewed
Aug 17, 2025
Sources/NativeBuilder/ContainerBuildParser/Docker/Instructions/ExposeInstruction.swift
Outdated
Show resolved
Hide resolved
wlan0
requested changes
Aug 17, 2025
Contributor
There was a problem hiding this comment.
Only fix needed is to fix NSRange vs. String counting.
LGTM otherwise!
Also, the current impl doesn't support the following instructions right?
ARG var=i.e. no valueRUN $vari.e. without enclosing${}ARG var2=${var1:-default}
Could we add an issue for these (if true)
| #expect(Bool(false), "Expected registry image source") | ||
| } | ||
|
|
||
| if let run = stage.nodes[1].operation as? ExecOperation { |
Contributor
There was a problem hiding this comment.
Can we add guards for accessing the nodes in the stage?
Contributor
Author
There was a problem hiding this comment.
Crashing immediately with an index out of bounds error in a test provides a clear, specific failure message that pinpoints exactly what assumption was violated, whereas a guard might obscure the root cause. This will also make it easier to add new tests for added instructions in the future.
Tests/NativeBuilderTests/ContainerBuildParserTests/ParserTests.swift
Outdated
Show resolved
Hide resolved
Sources/NativeBuilder/ContainerBuildParser/Docker/DockerInstructionVisitor.swift
Outdated
Show resolved
Hide resolved
Tests/NativeBuilderTests/ContainerBuildParserTests/ParserTests.swift
Outdated
Show resolved
Hide resolved
Sources/NativeBuilder/ContainerBuildParser/Docker/DockerfileParser.swift
Show resolved
Hide resolved
wlan0
reviewed
Aug 18, 2025
wlan0
approved these changes
Aug 18, 2025
wlan0
reviewed
Aug 20, 2025
Sources/NativeBuilder/ContainerBuildParser/Docker/DockerInstructionVisitor.swift
Show resolved
Hide resolved
wlan0
approved these changes
Aug 20, 2025
dkovba
added a commit
that referenced
this pull request
Aug 21, 2025
Fixes a warning missed in #516.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds the support for the ARG instruction in the native builder parser, implements the support for different kinds of ARGs, and performs the substitution of ARG variables in the supported instructions. Resolves #437.
Some features are currently blocked and not included into this PR: