Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/hello.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
22 changes: 12 additions & 10 deletions dynamic.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,20 @@ 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
Expand Down Expand Up @@ -126,8 +128,8 @@ pkgs.mkShell {
++ optionals withIOGFull (
[ postgresql ] ++ (optional stdenv.hostPlatform.isAarch64 R)
)
++ attrValues haskell-tools
)
++ attrValues haskell-tools
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was moved inside isIOG in #175. I am pretty sure it was unintentional.

++ optionals withGHCTooling (
with pkgs; [ python3 automake autoconf alex happy git libffi.dev ]
)
Expand Down
20 changes: 11 additions & 9 deletions static.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Loading