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

Pass all arguments when initing testing parameters in swift build #7396

Merged
merged 1 commit into from Mar 6, 2024

Conversation

grynspan
Copy link
Contributor

@grynspan grynspan commented Mar 6, 2024

Ensures that a fully-initialized TestingParameters structure is used with swift build --build-tests instead of using any default parameters (which will tend us toward the wrong output with packages that use --enable-test-discovery and still have LinuxMain.swift files.)

Tested with swift-numerics on Ubuntu 22.04 aarch64; before the change, we'd hit the fatalError() call in that package's LinuxMain.swift file. After the change, we correctly run XCTest-based tests.

Resolves #7389.

@grynspan grynspan added bug swift test Changes impacting `swift test` tool swift build Changes impacting `swift build` labels Mar 6, 2024
@grynspan grynspan self-assigned this Mar 6, 2024
@grynspan grynspan force-pushed the jgrynspan/7389-pass-all-test-params branch from 53d9941 to e948488 Compare March 6, 2024 13:54
@grynspan
Copy link
Contributor Author

grynspan commented Mar 6, 2024

@swift-ci please test

@grynspan grynspan changed the title Pass all arguments when initing testing parameters in swift build. Pass all arguments when initing testing parameters in swift build Mar 6, 2024
@rauhul
Copy link
Contributor

rauhul commented Mar 6, 2024

Can you change the visibility of --enable-test-discovery to be .hidden so it doesn't show up in help? Would it also be appropriate to emit a warning if this flag is used in 6.0?

@grynspan
Copy link
Contributor Author

grynspan commented Mar 6, 2024

@rauhul We should take changes for --enable-test-discovery in a separate PR once we decide exactly how we want to proceed with its deprecation/removal. It'd be out of scope for this PR which is primarily concerned with fixing a regression. 🥲

@rauhul
Copy link
Contributor

rauhul commented Mar 6, 2024

@rauhul We should take changes for --enable-test-discovery in a separate PR once we decide exactly how we want to proceed with its deprecation/removal. It'd be out of scope for this PR which is primarily concerned with fixing a regression. 🥲

gotcha, makes sense

@MaxDesiatov
Copy link
Member

Can you change the visibility of --enable-test-discovery to be .hidden so it doesn't show up in help? Would it also be appropriate to emit a warning if this flag is used in 6.0?

This is already marked as @Flag(help: .hidden), and it was emitting warnings when used since Swift 5.4 when it was deprecated.

@rauhul
Copy link
Contributor

rauhul commented Mar 6, 2024

Can you change the visibility of --enable-test-discovery to be .hidden so it doesn't show up in help? Would it also be appropriate to emit a warning if this flag is used in 6.0?

This is already marked as @Flag(help: .hidden), and it was emitting warnings when used since Swift 5.4 when it was deprecated.

Oh! Excuse the noise then!

@bnbarham
Copy link
Contributor

bnbarham commented Mar 6, 2024

and it was emitting warnings when used since Swift 5.4 when it was deprecated.

It's not quite that simple. We only emit a warning when the entry point file doesn't exist (which makes sense, since if the flag was removed we would then start using the entry point file). If the entry point file is deprecated I think we need something new for that, or we should make the experimental entry point file flag not experimental and then remove the defaults (but we still need some migration path for that).

@grynspan
Copy link
Contributor Author

grynspan commented Mar 6, 2024

I'm going to go ahead and merge this PR now to resolve the original issue, but let's continue this discussion in the forums or internally.

@grynspan grynspan merged commit b49a227 into main Mar 6, 2024
5 checks passed
@grynspan grynspan deleted the jgrynspan/7389-pass-all-test-params branch March 6, 2024 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug swift build Changes impacting `swift build` swift test Changes impacting `swift test` tool
Projects
None yet
Development

Successfully merging this pull request may close these issues.

swift build --build-tests doesn't work with --enable-test-discovery flag
4 participants