diff --git a/.github/workflows/aarch64-linux.yml b/.github/workflows/aarch64-linux.yml index 1db5c8d..f197d8c 100644 --- a/.github/workflows/aarch64-linux.yml +++ b/.github/workflows/aarch64-linux.yml @@ -1,7 +1,8 @@ name: DevX closures for aarch64-linux on: - push: + # Disabled until we have a new aarch64-linux hydra builder + # push: jobs: build: diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 02fd814..927de0e 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -111,7 +111,8 @@ jobs: # see https://github.com/actions/upload-artifact#permission-loss # windows doesn't care \o/ - name: Restore Executable Permission - if: ${{ inputs.target-platform != '-windows' }} + # Disable for windows cross and dynamic macOS builds (fail due to missing libgmp dylib) + if: ${{ inputs.target-platform != '-windows' && (inputs.target-platform != '' || (inputs.platform != 'x86_64-darwin' && inputs.platform != 'aarch64-darwin')}} run: chmod +x ./hello - name: Run hello executable diff --git a/.github/workflows/hello.yml b/.github/workflows/hello.yml index c54c648..25bf092 100644 --- a/.github/workflows/hello.yml +++ b/.github/workflows/hello.yml @@ -37,12 +37,6 @@ jobs: # Just cross compiling javascript with ghc 9.6 and above - compiler-nix-name: ghc810 target-platform: "-js" - # Static builds not working for darwin yet - - platform: x86_64-darwin - target-platform: "-static" - # Static tools not working right now (so just building "-static-minimal" for now) - - target-platform: "-static" - minimal: false # Windows cross compilation only works on x86_64 right now. - platform: aarch64-darwin target-platform: "-windows" diff --git a/dynamic.nix b/dynamic.nix index e1d9316..5fd0fe5 100644 --- a/dynamic.nix +++ b/dynamic.nix @@ -21,19 +21,21 @@ let tool-version-map = (import ./tool-map.nix) self; # a shared file. It will also not work for anything that has more than # the system libs linked. fixup-nix-deps = pkgs.writeShellApplication { - name = "fixup-nix-deps"; - text = '' + name = "fixup-nix-deps"; + text = '' for nixlib in $(otool -L "$1" |awk '/nix\/store/{ print $1 }'); do - case "$nixlib" in - *libiconv.dylib) install_name_tool -change "$nixlib" /usr/lib/libiconv.dylib "$1" ;; - *libffi.*.dylib) install_name_tool -change "$nixlib" /usr/lib/libffi.dylib "$1" ;; - *libz.dylib) install_name_tool -change "$nixlib" /usr/lib/libz.dylib "$1" ;; + case "$nixlib" in + *libiconv.dylib) install_name_tool -change "$nixlib" /usr/lib/libiconv.dylib "$1" ;; + *libiconv.2.dylib) install_name_tool -change "$nixlib" /usr/lib/libiconv.2.dylib "$1" ;; + *libffi.*.dylib) install_name_tool -change "$nixlib" /usr/lib/libffi.dylib "$1" ;; + *libc++.*.dylib) install_name_tool -change "$nixlib" /usr/lib/libc++.dylib "$1" ;; + *libz.dylib) install_name_tool -change "$nixlib" /usr/lib/libz.dylib "$1" ;; + *libresolv.*.dylib) install_name_tool -change "$nixlib" /usr/lib/libresolv.dylib "$1" ;; *) ;; - esac + esac done - ''; + ''; }; - # this wrapped-cabal is for now the identity, but it's the same logic we # have in the static configuration, and we may imagine needing to inject # some flags into cabal (temporarily), hence we'll keep this functionality @@ -126,8 +128,8 @@ pkgs.mkShell { ++ optionals withIOGFull ( [ postgresql ] ++ (optional stdenv.hostPlatform.isAarch64 R) ) - ++ attrValues haskell-tools ) + ++ attrValues haskell-tools ++ optionals withGHCTooling ( with pkgs; [ python3 automake autoconf alex happy git libffi.dev ] ) diff --git a/static.nix b/static.nix index f2d55b8..5f91545 100644 --- a/static.nix +++ b/static.nix @@ -14,18 +14,20 @@ let tool-version-map = (import ./tool-map.nix) self; # fixup-nix-deps allows us to drop dylibs from macOS executables that can be # linked directly. fixup-nix-deps = pkgs.writeShellApplication { - name = "fixup-nix-deps"; - text = '' + name = "fixup-nix-deps"; + text = '' for nixlib in $(otool -L "$1" |awk '/nix\/store/{ print $1 }'); do - case "$nixlib" in - *libiconv.dylib) install_name_tool -change "$nixlib" /usr/lib/libiconv.dylib "$1" ;; - *libffi.*.dylib) install_name_tool -change "$nixlib" /usr/lib/libffi.dylib "$1" ;; - *libc++.*.dylib) install_name_tool -change "$nixlib" /usr/lib/libc++.dylib "$1" ;; - *libz.dylib) install_name_tool -change "$nixlib" /usr/lib/libz.dylib "$1" ;; + case "$nixlib" in + *libiconv.dylib) install_name_tool -change "$nixlib" /usr/lib/libiconv.dylib "$1" ;; + *libiconv.2.dylib) install_name_tool -change "$nixlib" /usr/lib/libiconv.2.dylib "$1" ;; + *libffi.*.dylib) install_name_tool -change "$nixlib" /usr/lib/libffi.dylib "$1" ;; + *libc++.*.dylib) install_name_tool -change "$nixlib" /usr/lib/libc++.dylib "$1" ;; + *libz.dylib) install_name_tool -change "$nixlib" /usr/lib/libz.dylib "$1" ;; + *libresolv.*.dylib) install_name_tool -change "$nixlib" /usr/lib/libresolv.dylib "$1" ;; *) ;; - esac + esac done - ''; + ''; }; # A cabal-install wrapper that sets the appropriate static flags wrapped-cabal = pkgs.writeShellApplication {