Skip to content

[XcodeGen] Handle 'rule' declarations and generate command line args #78879

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

Merged
merged 1 commit into from
Jan 29, 2025

Conversation

rintaro
Copy link
Member

@rintaro rintaro commented Jan 24, 2025

  • NinjaParser to handle include and rule directives
  • NinjaParser to parse "rule name" in build directive correctly
  • Make variable table a simple [String: String] and keep any bindings to make the substitutions possible
  • Generate command line arguments using command variable in the rule and use it as the source of truth, instead of using random known bindings like FLAGS

Primary motivation of this patch is to resolve an issue where MACOSX_DEPLOYMENT_TARGET is not derived correctly because -target argument is specified in the rule. not in build. (see -target in ${build_dir}/CMakeFiles/rules.ninja). Because of that, some modules are (correctly) compiled for 13.0, but some are incorrectly compiled for the current default deployment target.

Copy link
Contributor

@hamishknight hamishknight left a comment

Choose a reason for hiding this comment

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

Very nice, thank you!

@rintaro rintaro force-pushed the xcodegen-commandline branch from 2563756 to a80a5a5 Compare January 27, 2025 18:23
@rintaro
Copy link
Member Author

rintaro commented Jan 27, 2025

@swift-ci Please smoke test

@rintaro
Copy link
Member Author

rintaro commented Jan 27, 2025

@swift-ci Please smoke test macOS

@rintaro rintaro marked this pull request as ready for review January 27, 2025 21:39
* Rename 'BuildRule to 'BuildEdige' because it is the official term
* NinjaParser to handle 'include' and 'rule' directives
* NinjaParser to handle parse "rule name" in 'build' correctly
* Make variable table a simple `[String: String]` and keep any bindings
  to make the substitutions possible.
* Generate command line argumets using 'command' variable in the 'rule'
  and use it as the source of truth, istead of using random known
  bindings like 'FLAGS'.
@rintaro rintaro force-pushed the xcodegen-commandline branch from a80a5a5 to 8d2ac00 Compare January 28, 2025 18:07
@rintaro
Copy link
Member Author

rintaro commented Jan 28, 2025

@swift-ci Please smoke test

@rintaro
Copy link
Member Author

rintaro commented Jan 28, 2025

@swift-ci Please smoke test macOS

@rintaro rintaro enabled auto-merge January 28, 2025 19:18
@rintaro rintaro merged commit 464d9d3 into swiftlang:main Jan 29, 2025
3 checks passed
@rintaro rintaro deleted the xcodegen-commandline branch January 29, 2025 05:17
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.

2 participants