Skip to content

Commit 75b3b89

Browse files
Adjust K nix caching (#4844)
Currently, the K repository caches two nix build on k-framework-binary.cachix.org for `kup`: `k` and `k.openssl.procps.secp256k1`. While a proper build seems to be cached for `k`, the build for `k.openssl.procps.secp256k1` seems to be different than requested by kup. This kind of issue had been observed and fixed previously for kup packages. To debug this, I download dependencies that were pushed to the nix cache k-framework.cachix.org. But the K repository does not yet push dependencies to this cache. Therefore, this repository adjusts the GitHub release workflow to also push nix build dependencies to k-framework.cachix.org. In addition, caching is introduced for the package `k.openssl.secp256k1`, which is a version that users are instructed to install in, e.g., the [kontrol repository](https://github.com/runtimeverification/kontrol/blob/d38d674a9b7dc1715d72803ee9b001a485a575c5/README.md?plain=1#L25). This is why version should be cashed in the nix binary cache as well. --------- Co-authored-by: automergerpr-permission-manager[bot] <190534181+automergerpr-permission-manager[bot]@users.noreply.github.com>
1 parent 3b31b5a commit 75b3b89

1 file changed

Lines changed: 53 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,60 @@ jobs:
8585
script: |
8686
export PATH="$(nix build github:runtimeverification/kup --no-link --json | jq -r '.[].outputs | to_entries[].value')/bin:$PATH"
8787
kup publish --verbose k-framework-binary .#k --keep-days 180
88+
kup publish --verbose k-framework-binary .#k.openssl.secp256k1 --keep-days 180
8889
kup publish --verbose k-framework-binary .#k.openssl.procps.secp256k1 --keep-days 180
8990
91+
cachix-release-dependencies:
92+
name: 'k-framework cachix release'
93+
strategy:
94+
matrix:
95+
include:
96+
- runner: ubuntu-24.04
97+
os: ubuntu-24.04
98+
- runner: MacM1
99+
os: self-macos-12
100+
runs-on: ${{ matrix.runner }}
101+
timeout-minutes: 120
102+
steps:
103+
- name: 'Check out code'
104+
uses: actions/checkout@v4
105+
106+
- name: 'Install Nix'
107+
if: ${{ !startsWith(matrix.os, 'self') }}
108+
uses: cachix/install-nix-action@v22
109+
with:
110+
install_url: https://releases.nixos.org/nix/nix-2.13.3/install
111+
extra_nix_config: |
112+
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
113+
substituters = http://cache.nixos.org https://hydra.iohk.io
114+
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=
115+
116+
- name: 'Install Cachix'
117+
if: ${{ !startsWith(matrix.os, 'self') }}
118+
uses: cachix/cachix-action@v14
119+
with:
120+
name: k-framework-binary
121+
122+
- name: 'Build and cache K and K dependencies'
123+
uses: workflow/nix-shell-action@v3
124+
env:
125+
GC_DONT_GC: 1
126+
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_PUBLIC_TOKEN }}
127+
with:
128+
packages: jq
129+
script: |
130+
K=$(nix build --extra-experimental-features 'nix-command flakes' .#k --json | jq -r '.[].outputs | to_entries[].value')
131+
DRV_K=$(nix-store --query --deriver ${K})
132+
nix-store --query --requisites --include-outputs ${DRV_K} | cachix push k-framework
133+
134+
K_OPENSSL_SECP256K1=$(nix build --extra-experimental-features 'nix-command flakes' .#k.openssl.secp256k1 --json | jq -r '.[].outputs | to_entries[].value')
135+
DRV_K_OPENSSL_SECP256K1=$(nix-store --query --deriver ${K_OPENSSL_SECP256K1})
136+
nix-store --query --requisites --include-outputs ${DRV_K_OPENSSL_SECP256K1} | cachix push k-framework
137+
138+
K_OPENSSL_PROCPS_SECP256K1=$(nix build --extra-experimental-features 'nix-command flakes' .#k.openssl.procps.secp256k1 --json | jq -r '.[].outputs | to_entries[].value')
139+
DRV_K_OPENSSL_PROCPS_SECP256K1=$(nix-store --query --deriver ${K_OPENSSL_PROCPS_SECP256K1})
140+
nix-store --query --requisites --include-outputs ${DRV_K_OPENSSL_PROCPS_SECP256K1} | cachix push k-framework
141+
90142
pyk-build-wheel:
91143
name: 'Pyk: Build Python wheel'
92144
runs-on: ubuntu-24.04
@@ -456,7 +508,7 @@ jobs:
456508
name: 'Publish Release'
457509
runs-on: [self-hosted, linux, normal]
458510
environment: production
459-
needs: [cachix-release, macos-test, source-tarball, ubuntu-jammy, ubuntu-noble, set-release-id]
511+
needs: [cachix-release, cachix-release-dependencies, macos-test, source-tarball, ubuntu-jammy, ubuntu-noble, set-release-id]
460512
steps:
461513
- name: 'Check out code'
462514
uses: actions/checkout@v4

0 commit comments

Comments
 (0)