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

Additional FreeBSD fixes #865

Merged
merged 3 commits into from
Dec 18, 2024
Merged

Additional FreeBSD fixes #865

merged 3 commits into from
Dec 18, 2024

Conversation

michael-yuji
Copy link
Contributor

@michael-yuji michael-yuji commented Dec 18, 2024

Add FreeBSD support for swift-testing.

Result:

With this PR, swift-testing can be built on FreeBSD (tested on x86_64 FreeBSD 14.1-RELEASE-p6)

Known issue:

There are some issue running swift test on this repo, but most likely due to bugs in my host toolchain.

  • Tests failed to link due to duplicated main symbols:
error: link command failed with exit code 1 (use -v to see invocation)
ld: error: duplicate symbol: main
>>> defined at TestingMacrosMain.swift:0 (/zdata/swift-main/swift-project/swift-testing/Sources/TestingMacros/TestingMacrosMain.swift:0)
>>>            /zdata/swift-main/swift-project/swift-testing/.build/x86_64-unknown-freebsd14.1/debug/TestingMacros-tool.build/TestingMacrosMain.swift.o:(main)
>>> defined at runner.swift:0 (/zdata/swift-main/swift-project/swift-testing/.build/x86_64-unknown-freebsd14.1/debug/swift-testingPackageTests.derived/runner.swift:0)
>>>            /zdata/swift-main/swift-project/swift-testing/.build/x86_64-unknown-freebsd14.1/debug/swift_testingPackageTests-tool.build/runner.swift.o:(.text.main+0x0)
clang: error: linker command failed with exit code 1 (use -v to see invocation)
[25/26] Linking swift-testingPackageTests.xctest
  • Code and documentation should follow the style of the Style Guide.
  • If public symbols are renamed or modified, DocC references should be updated.

@grynspan grynspan changed the title add FreeBSD support Additional FreeBSD fixes Dec 18, 2024
@grynspan grynspan added bug Something isn't working freebsd 😈 FreeBSD support labels Dec 18, 2024
@grynspan grynspan added this to the Swift 6.x milestone Dec 18, 2024
@grynspan
Copy link
Contributor

Thanks for taking a look at this! I've left you some questions.

@grynspan
Copy link
Contributor

Some tests failed to build (due to missing openpty)

FreeBSD has the openpty() function. Is there a missing #include in _TestingInternals that we can add?

@grynspan
Copy link
Contributor

@swift-ci test

@michael-yuji
Copy link
Contributor Author

michael-yuji commented Dec 18, 2024

Some tests failed to build (due to missing openpty)

FreeBSD has the openpty() function. Is there a missing #include in _TestingInternals that we can add?

This is the weird part. openpty supposed to be in libutil.h, but for some reason even if I added libutil.h to _TestingItnernals Includes.h the compiler still couldn't see the symbol and I don't know why.

Hey! turns out it's because I made a typo. This is now fixed too.

@grynspan
Copy link
Contributor

@swift-ci test

@grynspan
Copy link
Contributor

@swift-ci test

@grynspan grynspan merged commit 014d874 into swiftlang:main Dec 18, 2024
3 checks passed
@grynspan
Copy link
Contributor

Related: swiftlang/swift#77836

@michael-yuji
Copy link
Contributor Author

Related: swiftlang/swift-package-manager#8193
The above swiftpm PR should've fix the duplicated symbol error for Functional Tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working freebsd 😈 FreeBSD support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants