build: build every static library for the deployment target the app ships - #2965
Merged
Merged
Conversation
…not change the archive
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The app deploys to macOS 13.0 and every static library it links was built for 14.0. The linker said so 121 times per build and nobody saw it, because the app passes
-Wl,-w.How it got here
#2874 dropped the app to 13.0. Five build scripts held their own copy of
14.0and none of them moved, so the libraries kept targeting the version the app had left behind. A library built for a newer OS than the binary linking it is not a warning the toolchain invents: it means the archive may reference symbols that do not exist on the deployment target, and nothing catches it before a 13.0 user runs it.What this changes
scripts/lib/deployment-target.shis the one place the target is read, and it reads it fromproject.ymlrather than restating it. Five scripts (lib/macos.sh,build-cassandra.sh,build-dameng.sh,build-duckdb.sh,build-freetds.sh,create-openssl-dylibs.sh) source it instead of holding a constant.scripts/ci/check-deployment-target.shfails the build if a new one hardcodes a version, and runs in Repo Hygiene.Every archive is rebuilt: 60 of them, all now
minos 13.0, published tolibs-v1with the checksums in this branch.Two things the rebuild turned up that are not deployment-target changes but come with it:
configurewritesPG_INT64_TYPE long inton this platform; the committed header saidlong long int. Swift importslongasIntandlong longasInt64, so the two spellings are the same 64 bits to C and a different type to Swift, and the driver stopped compiling. Configure's answer is the correct one for LP64 andscripts/ios/build-libpq-ios.shalready writes it, so the header now matches what a rebuild produces and the two timeout constants inLibPQPluginConnectionare typedpg_usec_time_tinstead ofInt64. They compile under either spelling now, so the next rebuild cannot break them again._snappy_compress,_snappy_max_compressed_length,_snappy_uncompress) that the shipped one had zero of. That is a plugin that loads on this machine and fails on every other.-DENABLE_SNAPPY=OFFpins it; verified back to zero.Also here:
build-libmongoc.shtakes a CMake 3 throughCMAKE_BINbecause CMake 4.4.3 cannot configure mongo-c-driver at all (The warning category "error -DCMAKE_CXX_LINK_EXECUTABLE=..." is not known; 1.30.11 carries the sameTRY_COMPILEline, so a version bump is not the way out), and a library build can stage into anotherLIBS_DIRso a rebuild can be checked before it replaces the working copy. That staging is what caught the snappy regression.Not in the archive, fixed anyway
Two more things were building for 14.0 and neither is a
.a:Libs/dylibs/).download-libs.shbuilds these locally from the verified static libs, so they are not published and CI gets 13.0 for free once these archives land.create-openssl-dylibs.shnow reads the shared target.Native/, outsideLibs/). Rebuilt; reports 11.0 and 13.0, no 14.0.Verification
Measured on this branch with the rebuilt libraries in place:
built for newer 'macOS' versionwarningsTableProscheme: BUILD SUCCEEDED.CassandraDriver,MongoDBDriver,DuckDBDriver,MSSQLDriver,DamengDriver: all BUILD SUCCEEDED. Between them and the app that links every one of the 15 library families.AllPluginsaggregate stops inoracle-nioonunknown attribute 'usableFromInlinenonisolated', a@TaskLocalmacro expansion in the Xcode-beta toolchain. Pre-existing and unrelated: it reproduces at two different pinned oracle-nio revisions and on branches that share no code. The five plugins above were built individually for that reason.