Skip to content

Fix building on FreeBSD via cmake#925

Merged
grynspan merged 2 commits into
swiftlang:mainfrom
michael-yuji:freebsd-cmake
Jan 28, 2025
Merged

Fix building on FreeBSD via cmake#925
grynspan merged 2 commits into
swiftlang:mainfrom
michael-yuji:freebsd-cmake

Conversation

@michael-yuji

Copy link
Copy Markdown
Member

Currently building swift-testing via cmake (e.g. when building the toolchain) fail if not compile as PIC. Adding "-fPIC" fixed this problem. Moreover, we need to link against libexecinfo on FreeBSD where the symbol backtrace lives.

Result:

Swift testing can now successfully build via cmake thus installed to the toolchain 🥳

@grynspan grynspan added bug 🪲 Something isn't working build 🧱 Affects the project's build configuration or process freebsd 😈 FreeBSD support labels Jan 25, 2025
@grynspan grynspan added this to the Swift 6.x milestone Jan 25, 2025
@grynspan

Copy link
Copy Markdown
Contributor

I assume you've tested this?

@grynspan

Copy link
Copy Markdown
Contributor

@swift-ci test

@michael-yuji

Copy link
Copy Markdown
Member Author

I assume you've tested this?

yup, I compiled a toolchain with the change and tested on a random swift project (in this case, swift-crypto) and verified swift-testing is loading.

➜  swift-crypto git:(main) ✗ swift test --parallel
[1/1] Planning build
Building for debugging...
[1/1] Write swift-version-36984124FBC43BBA.txt
Build complete! (6.20s)
[293/293] Testing _CryptoExtrasTests.PBKDF2Tests/testRfcTestVectorsSHA1
◇ Test run started.
↳ Testing Library Version: 6.2-dev (faaabba3a977d67 - modified)
↳ Target Platform: x86_64-unknown-freebsd
✔ Test run with 0 tests passed after 0.001 seconds.

@grynspan

Copy link
Copy Markdown
Contributor

We obviously don't have any CI set up for FreeBSD, but please wait until the CI we do have is done before merging.

Comment thread Sources/_TestingInternals/CMakeLists.txt
@grynspan

Copy link
Copy Markdown
Contributor

@swift-ci test

@grynspan

Copy link
Copy Markdown
Contributor

Feel free to merge once CI is green—if you don't have the Big Green Button yet, send me a DM and I'll do it.

@grynspan

Copy link
Copy Markdown
Contributor

@swift-ci test Windows

@grynspan grynspan merged commit ff27a80 into swiftlang:main Jan 28, 2025
@grynspan grynspan moved this to Done in Swift on FreeBSD Mar 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug 🪲 Something isn't working build 🧱 Affects the project's build configuration or process freebsd 😈 FreeBSD support

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants