Skip to content

[Windows] Use a multiroot data file to test (corelibs-)foundation on Windows - #80122

Merged
ahoppen merged 1 commit into
swiftlang:mainfrom
ahoppen:windows-multiroot-data-file
Aug 12, 2025
Merged

ahoppen merged 1 commit into
swiftlang:mainfrom
ahoppen:windows-multiroot-data-file

Conversation

@ahoppen

@ahoppen ahoppen commented Mar 19, 2025

Copy link
Copy Markdown
Member

We currently rebuild swift-syntax, swift-foundation-icu and swift-foundation twice: Once to test swift-foundation and once to test swift-corelibs-foundation. Using a unified build for both projects means that we only need to rebuild them once, saving ~5 minutes.

@ahoppen

ahoppen commented Mar 19, 2025

Copy link
Copy Markdown
Member Author

@swift-ci Please test Windows

@ahoppen

ahoppen commented Mar 21, 2025

Copy link
Copy Markdown
Member Author

@swift-ci Please smoke test

@ahoppen
ahoppen marked this pull request as ready for review March 21, 2025 16:55
@ahoppen
ahoppen force-pushed the windows-multiroot-data-file branch from 3d7ce49 to 6053b15 Compare March 21, 2025 16:57
@ahoppen

ahoppen commented Mar 21, 2025

Copy link
Copy Markdown
Member Author

@swift-ci Please smoke test

@ahoppen

ahoppen commented Mar 21, 2025

Copy link
Copy Markdown
Member Author

@swift-ci Please smoke test macOS

@ahoppen

ahoppen commented Mar 21, 2025

Copy link
Copy Markdown
Member Author

Odd, we are building less in the swift-corelibs-foundation test but it’s still slower. Attaching relevant portions of the build log and running again to see if there’s nondeterminism involved.

swift-PR-windows-38051.txt

@ahoppen

ahoppen commented Mar 21, 2025

Copy link
Copy Markdown
Member Author

@swift-ci Please test Windows

1 similar comment
@ahoppen

ahoppen commented Mar 25, 2025

Copy link
Copy Markdown
Member Author

@swift-ci Please test Windows

@ahoppen
ahoppen force-pushed the windows-multiroot-data-file branch from 6053b15 to 3483edb Compare March 26, 2025 15:43
@ahoppen

ahoppen commented Mar 26, 2025

Copy link
Copy Markdown
Member Author

@swift-ci Please test Windows

1 similar comment
@ahoppen

ahoppen commented Mar 27, 2025

Copy link
Copy Markdown
Member Author

@swift-ci Please test Windows

@ahoppen
ahoppen force-pushed the windows-multiroot-data-file branch from 3483edb to a2e001a Compare March 28, 2025 03:45
@ahoppen

ahoppen commented Mar 28, 2025

Copy link
Copy Markdown
Member Author

@swift-ci Please test Windows

1 similar comment
@ahoppen

ahoppen commented Mar 28, 2025

Copy link
Copy Markdown
Member Author

@swift-ci Please test Windows

@ahoppen
ahoppen force-pushed the windows-multiroot-data-file branch from a2e001a to c0a8227 Compare March 28, 2025 21:15
@ahoppen

ahoppen commented Mar 28, 2025

Copy link
Copy Markdown
Member Author

@swift-ci Please test Windows

@ahoppen

ahoppen commented Mar 29, 2025

Copy link
Copy Markdown
Member Author

Looking at the performance logs for this PR, I realized that #80082 accidentally changed swift-foundation to be tested in release configuration again. This restores it to be built in debug again.

It also saves ~2 minutes in swift-corelibs-foundation through the multiroot data file. It’s less than I would have expected

Before this PR:

  • Testing swift-foundation: 00:24:15
  • Testing swift-corelibs-foundation: 00:07:37

With this PR (Log):

  • Testing swift-foundation: 00:10:26
  • Testing swift-corelibs-foundation: 00:05:34

Running once more to see how stable these timings are.

Edit: Timings are stable.

@ahoppen

ahoppen commented Mar 29, 2025

Copy link
Copy Markdown
Member Author

@swift-ci Please test Windows

@bnbarham bnbarham left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, but CC @compnerd and @jmschonfeld as well

@jmschonfeld jmschonfeld left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should we do the same thing on Linux to keep our test environments consistent between the two platforms?

Comment thread utils/build.ps1 Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is $FoundationTestConfiguration defined somewhere?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yeah, defaults to debug:

.PARAMETER FoundationTestConfiguration
Whether to run swift-foundation and swift-corelibs-foundation tests in a debug or release configuration.
...
  [ValidateSet("debug", "release")]
  [string] $FoundationTestConfiguration = "debug",

Should we do the same thing on Linux to keep our test environments consistent between the two platforms?

I had thought we were, but... apparently not 🤔

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The use of Debug does scare me a bit - we release in release mode, not debug mode, and the optimizations can introduce issues (and was in fact how we learnt about CFString bridging failures). I would recommend that we test in release mode only. However, the shared build is a good idea.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I thought that we decided in #80076 that we want to test Foundation in debug during PR testing and in release during the nightly jobs. You just accidentally reverted the change for CoreFoundation in #80082 (note that swift-foundation still passed FoundationTestConfiguration).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Right, it would be okay to test in CI with debug and nightlies with Release (I actually would prefer that). I just don't see how we control that for the nightlies.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The nightlies are currently passing through release, eg. https://ci-external.swift.org/job/swift-main-windows-toolchain/1517/ has:

... utils\build.ps1 ... -FoundationTestConfiguration release

Though it also has -Test swift,dispatch,xctest,lldb, so they're not actually being run...

@ahoppen

ahoppen commented Aug 4, 2025

Copy link
Copy Markdown
Member Author

@swift-ci Please test Windows

@ahoppen
ahoppen force-pushed the windows-multiroot-data-file branch from eac6514 to 5f45130 Compare August 4, 2025 19:39
@ahoppen

ahoppen commented Aug 4, 2025

Copy link
Copy Markdown
Member Author

@swift-ci Please test Windows

@ahoppen

ahoppen commented Aug 5, 2025

Copy link
Copy Markdown
Member Author

Measured again and this reduces the test time for swift-foundation + swift-corelibs-foundation by 15 minutes.

@ahoppen
ahoppen force-pushed the windows-multiroot-data-file branch from 5f45130 to a4ad221 Compare August 7, 2025 12:11

@compnerd compnerd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think that we should go ahead and merge this for now, but would love to have @shahmishal verify that we are testing in release mode in nightlies.

Comment thread utils/build.ps1 Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Right, it would be okay to test in CI with debug and nightlies with Release (I actually would prefer that). I just don't see how we control that for the nightlies.

Comment thread utils/build.ps1 Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Would be nice if this was commented - this is here due to a failure that has been notoriously difficult to replicate outside of CI and we cannot get details on what is going on there.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ah yeah, sorry I should have done that. @ahoppen would you mind moving the -j 1 to the end and adding something like:

# Running parallel causes a non-deterministic crash in CI only, see https://github.com/swiftlang/swift/issues/83606

?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Added the comment.

…Windows

We currently rebuild swift-syntax, swift-foundation-icu and swift-foundation twice: Once to test swift-foundation and once to test swift-corelibs-foundation. Using a unified build for both projects means that we only need to rebuild them once, saving ~5 minutes.
@ahoppen
ahoppen force-pushed the windows-multiroot-data-file branch from a4ad221 to 61f833c Compare August 11, 2025 07:36
@ahoppen

ahoppen commented Aug 11, 2025

Copy link
Copy Markdown
Member Author

@swift-ci Please smoke test

@ahoppen

ahoppen commented Aug 11, 2025

Copy link
Copy Markdown
Member Author

@swift-ci Please test Windows

@ahoppen
ahoppen merged commit d3d8576 into swiftlang:main Aug 12, 2025
3 checks passed
@ahoppen
ahoppen deleted the windows-multiroot-data-file branch August 12, 2025 06:12
ahoppen added a commit to ahoppen/swift that referenced this pull request Aug 14, 2025
…ionTestConfiguration` is set to `debug`

This was discussed in swiftlang#80122 (comment) but got reverted by swiftlang#83693. Re-apply the fix.
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.

4 participants