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

build: define build path structure in BuildSystemProvider.Kind #8298

Merged

Conversation

bkhouri
Copy link
Contributor

@bkhouri bkhouri commented Feb 19, 2025

There are a few places that check the BuildSystemProvider.Kind is Xcode to determine the build directory structure. With the upcoming Swift Build integration, which uses the "Xcode path" structure, we would need to update all instances to check the two build system provider kinds.

Add an extension on the BuildSystemProvider.Kind that create a boolean variable useXcodeBuildEngine, which determines whether the build system should use the xcode path structure or not. In addition, update the code that requires a "isXcodeBuildSystemEnabled" to return this build system provider variable.

This will hopefully help address #8272 when #8271 is merged and added case .swiftbuild: return true to the useXcodeBuildEngine

Fixes #8272
rdar://144023142

@bkhouri bkhouri marked this pull request as ready for review February 19, 2025 14:51
@bkhouri bkhouri force-pushed the t/main/gh8272_rdar_144023142_partial_fix branch from 87d8887 to a926008 Compare February 20, 2025 04:58
@bkhouri bkhouri requested a review from cmcgee1024 February 20, 2025 04:59
@bkhouri
Copy link
Contributor Author

bkhouri commented Feb 20, 2025

@swift-ci please test

@bkhouri bkhouri enabled auto-merge (squash) February 20, 2025 16:25
Copy link
Contributor

@MaxDesiatov MaxDesiatov left a comment

Choose a reason for hiding this comment

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

I'm not sure if usesXcodeBuildEngine is more readable than == .xcode. If this were more than an enum with two cases (or there were plans to make it more complex in the future), one might argue that the check is complex enough, but for an enum as trivial as this I don't see much benefit.

@bkhouri
Copy link
Contributor Author

bkhouri commented Feb 25, 2025

I'm not sure if usesXcodeBuildEngine is more readable than == .xcode. If this were more than an enum with two cases (or there were plans to make it more complex in the future), one might argue that the check is complex enough, but for an enum as trivial as this I don't see much benefit.

This enum will be expanding with the introduction of #8271. And this change will force us to set the case .swiftbuild: return true, thus having automatically fixed #8272.

There are a few places that check the BuildSystemProvider.Kind is Xcode
to determine the build directory structure.  With the upcoming Swift
Build integration, which uses the "Xcode path" structure, we would need
to update all instances to check the two build system provider kinds.

Add an extension on the BuildSystemProvider.Kind that create a boolean
variable `useXcodeBuildEngine`, which determines whether the build
system should use the xcode path structure or not.  In addition, update
the code that requires a  "isXcodeBuildSystemEnabled" to return this
build system provider variable.

This will hopefully help address swiftlang#8272 when swiftlang#8271, where it adds
`case .swiftbuild: return true` to the `useXcodeBuildEngine`
@bkhouri bkhouri force-pushed the t/main/gh8272_rdar_144023142_partial_fix branch from 30a126f to a497441 Compare February 25, 2025 15:08
@bkhouri
Copy link
Contributor Author

bkhouri commented Feb 25, 2025

@swift-ci please test

@bkhouri bkhouri disabled auto-merge February 25, 2025 15:11
@bkhouri bkhouri enabled auto-merge (squash) February 25, 2025 15:11
@bkhouri
Copy link
Contributor Author

bkhouri commented Feb 26, 2025

@swift-ci please test

@bkhouri
Copy link
Contributor Author

bkhouri commented Feb 26, 2025

@swift-ci please test windows

@bkhouri bkhouri merged commit 11ca6b9 into swiftlang:main Feb 26, 2025
5 checks passed
bripeticca pushed a commit to bripeticca/swift-package-manager that referenced this pull request Feb 28, 2025
…lang#8298)

There are a few places that check the BuildSystemProvider.Kind is Xcode
to determine the build directory structure. With the upcoming Swift
Build integration, which uses the "Xcode path" structure, we would need
to update all instances to check the two build system provider kinds.

Add an extension on the BuildSystemProvider.Kind that create a boolean
variable `useXcodeBuildEngine`, which determines whether the build
system should use the xcode path structure or not. In addition, update
the code that requires a "isXcodeBuildSystemEnabled" to return this
build system provider variable.

This will hopefully help address swiftlang#8272 when swiftlang#8271 is merged and added
`case .swiftbuild: return true` to the `useXcodeBuildEngine `

Fixes swiftlang#8272
rdar://144023142
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.

swift-test doesn't find xctest bundle with swiftbuild
2 participants