!lheuhImcToQZYTQTuI:nixos.org

Nix on macOS

1155 Members
“There are still many issues with the Darwin platform but most of it is quite usable.” — http://yves.gnu-darwin.org187 Servers

Load older messages


SenderMessageTime
9 Nov 2025
@samasaur:matrix.orgsamasaurokay this does not work03:43:57
@samasaur:matrix.orgsamasaur trying -Wno-error=unguarded-availability in NIX_CXXFLAGS_COMPILE 04:10:25
@samasaur:matrix.orgsamasaurthat didn't work (though i could have done it worng)04:23:31
@samasaur:matrix.orgsamasaur* that didn't work (though i could have done it wrong)04:23:35
@samasaur:matrix.orgsamasaur 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:matrix.orgsamasaurrunning a build where I override that to 14.004:24:39
@samasaur:matrix.orgsamasaurwhich does make the "back" part of the backdeployment less effective04:24:59
@reckenrode:matrix.orgRandy EckenrodeWe don’t support older though. (I wonder why I didn’t have this issue on my branch?)04:56:43
@samasaur:matrix.orgsamasauris the backdeploy even useful if we don't support older versions?04:58:25
@samasaur:matrix.orgsamasaur hmm even with COMPATIBILITY_MINIMUM_DEPLOYMENT_VERSION_OSX set it's still passing -target arm64-apple-macosx10.9 05:12:32
@reckenrode:matrix.orgRandy Eckenrode It should be NIX_CFLAGS_COMPILE. 05:13:36
@reckenrode:matrix.orgRandy Eckenrodee.g., https://github.com/NixOS/nixpkgs/blob/staging-next/pkgs/by-name/mo/moltenvk/package.nix#L10205:15:57
@reckenrode:matrix.orgRandy Eckenrode * 05:16:26
@samasaur:matrix.orgsamasaurcould have sworn there was a cxx version as well...05:33:34
@samasaur:matrix.orgsamasaurregardless setting the correct variable has made it past where the build failed originally05:33:51
@samasaur:matrix.orgsamasaurwe'll see if this succeeds05:34:09
@samasaur:matrix.orgsamasaursigh05:38:53
@samasaur:matrix.orgsamasaur 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:matrix.orgsamasaurat least I assume the error is coming from swift05:40:59
@samasaur:matrix.orgsamasaurthe bootstrap swiftc05:41:07
@samasaur:matrix.orgsamasaur

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:matrix.orgsamasaurhm05:43:47
@samasaur:matrix.orgsamasaur okay even running swiftc --help using that bootstrap compiler produces the unknown argument error 05:44:26
@samasaur:matrix.orgsamasaur because it's wrapped and it's passing -Werror=unguarded-availability directly to swift-frontend-unwrapped 05:45:50
@samasaur:matrix.orgsamasaurah05:47:41
@samasaur:matrix.orgsamasaurwell05:47:41
@samasaur:matrix.orgsamasaurfound out why!05:47:43
@samasaur:matrix.orgsamasaur

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:matrix.orgsamasaur but the -Werror=unguarded-availability flag was added in add-local-cc-cflags-before.sh 05:48:53
@samasaur:matrix.orgsamasaurso it now does not work with swift05:49:02

Show newer messages


Back to Room ListRoom Version: 6