apple / swift-corelibs-foundation

The Foundation Project, providing core utilities, internationalization, and OS independence
swift.org
Apache License 2.0
5.23k stars 1.12k forks source link

[Linux] Enable build-ids. #4995

Closed al45tair closed 1 week ago

al45tair commented 1 week ago

We should use build IDs on Linux so that we can identify the built artefacts, and also so that we can match them up with debug information should we choose to separate it.

rdar://130582768

al45tair commented 1 week ago

Do we also need to do the same for all of the dependencies (swift-foundation, swift-foundation-icu, and swift-collections)?

👍 Yes, ideally, anything that is installed as a .so or that produces an executable on Linux would have --build-id=sha1 as a linker option, so that we get build IDs on everything (like we have on Apple platforms by default). It isn't necessary for static libraries.

jmschonfeld commented 1 week ago

I'm seeing some build failures that appear to be new with this change:

(.data.rel.ro+0x330): error: undefined reference to '$s22_FoundationCollections4RopeV8_StorageCMn'
/home/build-user/build/buildbot_linux/none-swift_package_sandbox_linux-x86_64/usr/lib/swift_static/linux/libFoundationEssentials.a(AttributedString+_InternalRuns.swift.o)(.data.rel.ro+0x338): error: undefined reference to '$s22_FoundationCollections4RopeV5_NodeVMn'

This symbol should be exported from lib_FoundationCollections.a which is auto linked from libFoundationEssentials.a:

target_compile_options(FoundationEssentials PRIVATE
        "SHELL:$<$<COMPILE_LANGUAGE:Swift>:-Xfrontend -public-autolink-library -Xfrontend _FoundationCollections>")

Is it possible that this change introduced that issue?

jmschonfeld commented 1 week ago

Oh I apologize, that was due to an issue on my end. New test run kicked off at https://ci.swift.org/job/swift-PR-Linux/16085/

jmschonfeld commented 1 week ago

Ok the new linux test passed so this looks good to me, thanks!