| 9 Nov 2025 |
samasaur | okay this does not work | 03:43:57 |
samasaur | trying -Wno-error=unguarded-availability in NIX_CXXFLAGS_COMPILE | 04:10:25 |
samasaur | that didn't work (though i could have done it worng) | 04:23:31 |
samasaur | * that didn't work (though i could have done it wrong) | 04:23:35 |
samasaur | regardless I think I found the real root of the issue which is the COMPATIBILITY_MINIMUM_DEPLOYMENT_VERSION_OSX cmake variable, which defaults to 10.9 | 04:24:25 |
samasaur | running a build where I override that to 14.0 | 04:24:39 |
samasaur | which does make the "back" part of the backdeployment less effective | 04:24:59 |
Randy Eckenrode | We don’t support older though. (I wonder why I didn’t have this issue on my branch?) | 04:56:43 |
samasaur | is the backdeploy even useful if we don't support older versions? | 04:58:25 |
samasaur | hmm even with COMPATIBILITY_MINIMUM_DEPLOYMENT_VERSION_OSX set it's still passing -target arm64-apple-macosx10.9 | 05:12:32 |
Randy Eckenrode | It should be NIX_CFLAGS_COMPILE. | 05:13:36 |
Randy Eckenrode | e.g., https://github.com/NixOS/nixpkgs/blob/staging-next/pkgs/by-name/mo/moltenvk/package.nix#L102 | 05:15:57 |
Randy Eckenrode | * | 05:16:26 |
samasaur | could have sworn there was a cxx version as well... | 05:33:34 |
samasaur | regardless setting the correct variable has made it past where the build failed originally | 05:33:51 |
samasaur | we'll see if this succeeds | 05:34:09 |
samasaur | sigh | 05:38:53 |
samasaur | okay that fails because NIX_CFLAGS_COMPILE apparently applies to Swift as well, which results in error: unknown argument: '-Werror=unguarded-availability' when it tries to build the swift module Basic | 05:39:50 |
samasaur | at least I assume the error is coming from swift | 05:40:59 |
samasaur | the bootstrap swiftc | 05:41:07 |
samasaur | I just see
swift> [1160/1373] Building swift module Basic
swift> FAILED: bootstrapping1/SwiftCompilerSources/Basic.o /private/tmp/nix-build-swift-5.10.1.drv-10/build/swift/bootstrapping1/SwiftCompilerSources/Basic.o
swift> cd /private/tmp/nix-build-swift-5.10.1.drv-10/src/swift/SwiftCompilerSources && /private/tmp/nix-build-swift-5.10.1.drv-10/build/swift/bootstrapping0/bin/swiftc -c -o /private/tmp/nix-build-swift-5.10.1.drv-10/build/swift/bootstrapping1/SwiftCompilerSources/Basic.o -sdk /nix/store/rrjy7x4jpxp92gs1prpbg79ng0mcl5hj-apple-sdk-14.4/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk -I /private/tmp/nix-build-swift-5.10.1.drv-10/build/swift/bootstrapping0/bin/../lib -I /nix/store/rrjy7x4jpxp92gs1prpbg79ng0mcl5hj-apple-sdk-14.4/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk/usr/lib -target arm64-apple-macosx14.0 -module-name Basic -emit-module -emit-module-path /private/tmp/nix-build-swift-5.10.1.drv-10/build/swift/bootstrapping1/SwiftCompilerSources/Basic.swiftmodule -parse-as-library /private/tmp/nix-build-swift-5.10.1.drv-10/src/swift/SwiftCompilerSources/Sources/Basic/SourceLoc.swift /private/tmp/nix-build-swift-5.10.1.drv-10/src/swift/SwiftCompilerSources/Sources/Basic/Utils.swift -wmo -Xfrontend -validate-tbd-against-ir=none -Xfrontend -enable-experimental-cxx-interop -Xcc -std=c++17 -Xcc -UIBOutlet -Xcc -UIBAction -Xcc -UIBInspectable -Xfrontend -disable-implicit-string-processing-module-import -O -cross-module-optimization -Xcc -DNDEBUG -Xcc -I -Xcc /private/tmp/nix-build-swift-5.10.1.drv-10/src/llvm-project/llvm/include -Xcc -I -Xcc /private/tmp/nix-build-swift-5.10.1.drv-10/build/llvm/include -Xcc -I -Xcc /private/tmp/nix-build-swift-5.10.1.drv-10/src/llvm-project/clang/include -Xcc -I -Xcc /private/tmp/nix-build-swift-5.10.1.drv-10/build/llvm/tools/clang/include -Xcc -I -Xcc /private/tmp/nix-build-swift-5.10.1.drv-10/src/swift/include -Xcc -I -Xcc /private/tmp/nix-build-swift-5.10.1.drv-10/build/swift/SwiftCompilerSources/../include -I /private/tmp/nix-build-swift-5.10.1.drv-10/build/swift/bootstrapping1/SwiftCompilerSources
swift> Warning: supplying the --target arm64-apple-macosx14.0 != arm64-apple-darwin argument to a nix-wrapped compiler may not work correctly - cc-wrapper is currently not designed with multi-target compilers in mind. You may want to use an un-wrapped compiler instead.
swift> <unknown>:0: error: unknown argument: '-Werror=unguarded-availability'
| 05:41:36 |
samasaur | hm | 05:43:47 |
samasaur | okay even running swiftc --help using that bootstrap compiler produces the unknown argument error | 05:44:26 |
samasaur | because it's wrapped and it's passing -Werror=unguarded-availability directly to swift-frontend-unwrapped | 05:45:50 |
samasaur | ah | 05:47:41 |
samasaur | well | 05:47:41 |
samasaur | found out why! | 05:47:43 |
samasaur | swift-wrapper has this in it:
# TODO: If we ever need to expand functionality of this hook, it may no longer
# be compatible with Swift. Right now, it is only used on Darwin to force
# -target, which also happens to work with Swift.
if [[ -e $cc_wrapper/nix-support/add-local-cc-cflags-before.sh ]]; then
source $cc_wrapper/nix-support/add-local-cc-cflags-before.sh
fi
| 05:48:16 |
samasaur | but the -Werror=unguarded-availability flag was added in add-local-cc-cflags-before.sh | 05:48:53 |
samasaur | so it now does not work with swift | 05:49:02 |