Changes between Version 14 and Version 15 of Questions and Answers
- Timestamp:
- 04/29/25 22:17:55 (4 weeks ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Questions and Answers
v14 v15 44 44 == CI / CD 45 45 46 '''Q:''' How do I guarantee that newer package versions are available on CI / CD?46 Q: How can I ensure newer package versions are available on my air-gapped CI/CD server (and build them there)? 47 47 48 '''A:''' There are several steps involved 48 A: 49 If you want to build everything from source on the CI/CD server, you must transfer: 49 50 50 ---- 51 Updated package definitions (e.g., new Guix commit / channel state) 52 All required source code (not binaries) 51 53 52 * Step 1 54 Step 1: On a networked (twin) machine 55 a) Check for new versions 53 56 54 Run 57 guix refresh PACKAGE-NAME 58 This will update the local package definition in your channel checkout (if you're maintaining your own channels or overlay packages). 55 59 56 {{{#!sh 57 guix refresh 58 }}} 60 b) Build the package to pull source code into the store 59 61 60 on a twin machine to check for new package versions. 62 guix build --source PACKAGE-NAME 63 This ensures that all source tarballs and patches are downloaded and cached. 61 64 62 ---- 65 c) Export source code and channel state 63 66 64 * Step 2 67 Export the source derivation (not the binaries!): 65 68 66 Run 69 guix archive --export -r $(guix build --source PACKAGE-NAME) > sources.nar 70 Also export the updated Guix channels or commit used: 67 71 68 {{{#!sh 69 guix graph 70 }}} 72 guix describe --format=channels > channels.scm 71 73 72 on the output of guix refresh to find dependencies. 74 Step 2: Transfer to the air-gapped CI/CD server 75 Copy the following files via USB or other air-gap-compliant method: 73 76 74 ---- 77 sources.nar (the archive of source derivations) 78 channels.scm (to sync channel state) 79 Optionally: your custom channel checkout (if using overlays) 75 80 76 * Step 3 81 Step 3: On the CI/CD server 82 a) Sync channel state 77 83 78 Copy related source packages to CI / CD via USB drive 84 guix time-machine -C channels.scm -- build PACKAGE-NAME 85 Or, if you want to pull into your main Guix: 79 86 80 ---- 87 guix pull --channels=channels.scm 88 b) Import the sources 89 90 guix archive --import < sources.nar 91 Now the CI/CD server has all it needs to build the package from source without network access. 92 93 Optional: Preload additional sources or dependencies 94 To avoid surprises, you may want to pre-fetch all sources recursively: 95 96 guix build --sources=transitive PACKAGE-NAME 97 guix archive --export -r $(guix build --sources=transitive PACKAGE-NAME) > all-sources.nar 98 This ensures no source fetch attempts will occur during CI builds. 81 99 82 100 [WikiStart Back]