Skip to content

Conversation

belkhadir
Copy link
Contributor

This merge request includes two refactoring:

  • Removed unused code to improve clarity and maintainability.
  • Replaced usage of Path with URL to eliminate Xcode warnings and align with recommended API usage.

let versionContainer = try container.nestedContainer(
keyedBy: ToolchainVersionCodingKeys.self, forKey: .version
)
let name = try versionContainer.decode(String.self, forKey: .name)
Copy link
Member

Choose a reason for hiding this comment

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

issue (blocking): I think that the name could be in the decoding stream, even though it is redundant for decoding because it is a synthesized property of ToolchainVersion. I expect that the name will need to be decoded here, even if the return value is thrown away. Some kind of handling of the name key here will also help with symmetry between this init and the encode method above.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for your feedback.

To clarify, are you expecting the decode to be strict in this context?
I am considering adding:

_ = try versionContainer.decode(String.self, forKey: .name)

This approach ensures that decoding fails if the name is missing, maintaining symmetry with the encode(to:) function, even if the value is not directly used.
Please let me know if this aligns with your intended solution.

@cmcgee1024
Copy link
Member

praise: Overall this is good code cleanup. There's just one straight forward issue and then I think that this can be merged.

// Create generation tool arguments.
var generationToolArguments = [
builtArtifact.path.string,
builtArtifact.url.path(),
Copy link

@Frizlab Frizlab Sep 26, 2025

Choose a reason for hiding this comment

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

Unless I’m mistaken, this should be path(percentEncoded: false).

See FB20238046 and https://developer.apple.com/forums/thread/784446.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice catch! Totally makes sense since we're dealing with file system paths

builtArtifact.url.path(),
"--output-file",
outputFile.string,
outputFile.path(),
Copy link

Choose a reason for hiding this comment

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

Same, percentEncoded: false should be set here.

@cmcgee1024
Copy link
Member

@belkhadir there were some problems on the main branch that were causing the workflows to fail on pull requests. You'll need to pull the latest from the main branch and incorporate them here in this PR before the workflows can succeed. Once you've done that then I'll run the workflows to perform their checks.

@cmcgee1024 cmcgee1024 merged commit d7d77d6 into swiftlang:main Oct 3, 2025
23 checks passed
@cmcgee1024
Copy link
Member

@belkhadir thank you for your contribution.

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.

3 participants