Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable Mac build in GitHub Action #1219

Merged

Conversation

peterbecich
Copy link
Member

#1193

nix flake check restricted to current system in latest Nix version, so there should be no error "Mac required but I am a Linux", or vice versa

@peterbecich
Copy link
Member Author

Would someone with a Mac try nix flake check and tell me if this error occurs? Thanks

https://github.com/haskell/hackage-server/actions/runs/5307816226/jobs/9606696192#step:6:27

error: Package ‘glibc-2.37-8’ in /nix/store/22z4n4mxs2vz3l3lg41dz3mgnq1d4wxs-source/pkgs/development/libraries/glibc/default.nix:166 
is not available on the requested hostPlatform:

        hostPlatform.config = "x86_64-apple-darwin"
         package.meta.platforms = [
           "aarch64-linux"
           "armv5tel-linux"
           "armv6l-linux"
           "armv7a-linux"
           "armv7l-linux"
           "i686-linux"
           "m68k-linux"
           "microblaze-linux"
           "microblazeel-linux"
           "mipsel-linux"
           "mips64el-linux"
           "powerpc64-linux"
           "powerpc64le-linux"
           "riscv32-linux"
           "riscv64-linux"
           "s390-linux"
           "s390x-linux"
           "x86_64-linux"
         ]
         package.meta.badPlatforms = [ ]
       , refusing to evaluate.

@peterbecich
Copy link
Member Author

I have asked if this might be in haskell-flake: srid/haskell-flake#172

@srid
Copy link

srid commented Jun 19, 2023

@peterbecich This should do it,

--- a/flake.nix
+++ b/flake.nix
@@ -117,7 +117,7 @@
             with pkgs;
             [ cabal-install
               ghc
-
+            ] ++ lib.optionals pkgs.stdenv.isLinux [
               glibc
               icu67
               zlib

@srid
Copy link

srid commented Jun 19, 2023

Or better (to re-use haskell-flake's devShell):

diff --git a/flake.nix b/flake.nix
index cbac13ae..59f149f3 100644
--- a/flake.nix
+++ b/flake.nix
@@ -113,11 +113,11 @@
         # devShells.default =
         #   config.mission-control.installToDevShell self'.devShells.main;
         devShells.default = pkgs.mkShell {
+          inputsFrom = [
+            config.haskellProjects.main.outputs.devShell
+          ];
           buildInputs =
-            with pkgs;
-            [ cabal-install
-              ghc
-
+            with pkgs; lib.optionals pkgs.stdenv.isLinux [
               glibc
               icu67
               zlib

@peterbecich peterbecich changed the title enable nix flake check and Mac build in GitHub Action enable Mac build in GitHub Action Jun 19, 2023
@peterbecich
Copy link
Member Author

Awesome, thank you @srid . I am going to merge this now so it caches, which should use fewer GitHub Actions minutes, and I will apply that fix in a subsequent PR

@peterbecich peterbecich merged commit b89121f into haskell:master Jun 19, 2023
@peterbecich peterbecich deleted the enable-mac-nix-build-in-github-action branch June 19, 2023 15:46
peterbecich added a commit to peterbecich/hackage-server that referenced this pull request Jun 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants