Changes between Version 14 and Version 15 of Questions and Answers


Ignore:
Timestamp:
04/29/25 22:17:55 (4 weeks ago)
Author:
enno
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Questions and Answers

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