-
-
Notifications
You must be signed in to change notification settings - Fork 243
Fix CI config issues (actually build with different GHC versions) #1057
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
base: main
Are you sure you want to change the base?
Changes from all commits
26dab99
ec437ff
bf29fbf
9ac6695
43d7881
2743bfe
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,13 +6,13 @@ concurrency: | |
|
|
||
| on: | ||
| pull_request: | ||
| branches: main | ||
| branches: [ main ] | ||
| types: | ||
| - opened | ||
| - synchronize | ||
|
|
||
| push: | ||
| branches: main | ||
| branches: [ main ] | ||
| paths-ignore: | ||
| - "configs/**" | ||
| - "scripts/**" | ||
|
|
@@ -23,26 +23,23 @@ on: | |
|
|
||
| jobs: | ||
| amazonka-gen: | ||
| strategy: | ||
| fail-fast: false | ||
|
|
||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - uses: cachix/install-nix-action@v22 | ||
| - uses: cachix/install-nix-action@v31 | ||
| with: | ||
| nix_path: nixpkgs=channel:nixos-unstable | ||
| extra_nix_config: | | ||
| trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= | ||
| extra-substituters = https://cache.iog.io | ||
| experimental-features = nix-command flakes | ||
|
|
||
| - uses: cachix/cachix-action@v12 | ||
| - uses: cachix/cachix-action@v17 | ||
| with: | ||
| name: amazonka | ||
| authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} | ||
|
|
||
| - uses: actions/checkout@v3 | ||
| - uses: actions/checkout@v6 | ||
|
|
||
| - run: nix build | ||
|
|
||
|
|
@@ -68,27 +65,27 @@ jobs: | |
| run: |- | ||
| sudo rm -rf /usr/local/lib/android /usr/share/dotnet /opt & | ||
|
|
||
| - uses: cachix/install-nix-action@v22 | ||
| - uses: cachix/install-nix-action@v31 | ||
| with: | ||
| nix_path: nixpkgs=channel:nixos-unstable | ||
| extra_nix_config: | | ||
| trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= | ||
| extra-substituters = https://cache.iog.io | ||
| experimental-features = nix-command flakes | ||
|
|
||
| - uses: cachix/cachix-action@v12 | ||
| - uses: cachix/cachix-action@v17 | ||
| with: | ||
| name: amazonka | ||
| authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} | ||
|
|
||
| - uses: actions/checkout@v3 | ||
| - uses: actions/checkout@v6 | ||
|
|
||
| - name: cabal update && cabal freeze | ||
| run: | | ||
| nix develop --print-build-logs --command \ | ||
| bash -c 'cabal update && cabal freeze' '.#${{matrix.ghc}}' | ||
| nix develop '.#${{matrix.ghc}}' --print-build-logs --command \ | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This matrix argument was not taken into account at all - all the jobs were using the ghc 9.4.8 provided by the default shell
It seems to me this is because the last param was somehow consumed by the Moving the arg before the --command seems to have fixed it (in that I see |
||
| bash -c 'cabal update && cabal freeze' | ||
|
|
||
| - uses: actions/cache@v3 | ||
| - uses: actions/cache@v5 | ||
| with: | ||
| key: v1-${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }} | ||
| restore-keys: | | ||
|
|
@@ -99,15 +96,15 @@ jobs: | |
|
|
||
| - name: cabal build core | ||
| run: | | ||
| nix develop --print-build-logs --command \ | ||
| bash -c 'cabal build amazonka-core amazonka' '.#${{matrix.ghc}}' | ||
| nix develop '.#${{matrix.ghc}}' --print-build-logs --command \ | ||
| bash -c 'cabal build amazonka-core amazonka' | ||
|
|
||
| - name: cabal build s3-encryption | ||
| run: | | ||
| nix develop --print-build-logs --command \ | ||
| bash -c 'cabal build amazonka-s3-encryption' '.#${{matrix.ghc}}' | ||
| nix develop '.#${{matrix.ghc}}' --print-build-logs --command \ | ||
| bash -c 'cabal build amazonka-s3-encryption' | ||
|
|
||
| - name: cabal build all | ||
| run: | | ||
| nix develop --print-build-logs --command \ | ||
| bash -c 'cabal test all' '.#${{matrix.ghc}}' | ||
| nix develop '.#${{matrix.ghc}}' --print-build-logs --command \ | ||
| bash -c 'cabal test all' | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you please explain what is forcing you to add the extra packages? I haven't needed them even when running NixOS (which is where I expect the most shenanigans around paths). If there's something wrong with the GHC you get when you use Nix as a package manager on a standard distribution, I think setting up the right
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm still iterating on this (and learning ins and outs of nix along the way), but TBH I initially just let claude-code thrash around to make the build pass. It seems to have found a fix which however has bunch of unnecessary stuff. Based on your remark I pushed it harder into making it demonstrate to me that all the changes are actually necessary and managed to trim it down to just this PKG_CONFIG_PATH declaration below. I still want to look around to see how people using nix + zlib do it in their projects, but this seems to be necessary to avoid linker picking the |

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The YAML extension in vscode caught couple of schema issues in this config (screenshot below)