Put gcroots in own directory first

[?]
Apr 12, 2023, 6:35 AM
2IS7OERZV6OXIZLAW3LWL4RVA4NW6IFX7YPAOKOQ4NK2MPKJEDQAC

Dependencies

  • [2] KLDNEAB5 Rename 06-windows -> 06-windows-wine
  • [3] FYBNOJLT Automagically add --rebuild to nix build commands in interactive mode
  • [4] WNFTZY3M Optionally prevent relevant nix store paths from being GC'ed
  • [5] U6EHWR7Y Tweak --gcroots
  • [*] W2G433QU Refactor libdemo and flakeref for nix run commands
  • [*] ZV5WPO25 Extend 02

Change contents

  • replacement in bash/nix-container-demo-helper.sh at line 33
    [4.1010][4.1010:1071]()
    __nix_gcroot_dir="/nix/var/nix/gcroots/per-user/${USER}"
    [4.1010]
    [4.1071]
    __nix_gcroot_local_dir="$(dirname "${BASH_SOURCE[0]}")/../gcroots"
    __nix_gcroot_store_dir="/nix/var/nix/gcroots/per-user/${USER}"
  • edit in bash/nix-container-demo-helper.sh at line 40
    [3.106]
    [3.106]
    local -r suffix="$(basename "${storepath}")"
  • replacement in bash/nix-container-demo-helper.sh at line 42
    [3.158][3.158:333]()
    local -r gcroot="${__nix_gcroot_dir}/${__nix_gcroot_prefix}-$(basename "${storepath}")"
    rm -f "${gcroot}"
    ln -s "${storepath}" "${gcroot}"
    [3.158]
    [3.333]
    mkdir -p "${__nix_gcroot_local_dir}"
    local -r gcroot_local="$(realpath --no-symlinks "${__nix_gcroot_local_dir}/${__nix_gcroot_prefix}-${suffix}")"
    rm -f "${gcroot_local}"
    ln -s "${storepath}" "${gcroot_local}"
    local -r gcroot_store="${__nix_gcroot_store_dir}/${__nix_gcroot_prefix}-${suffix}"
    rm -f "${gcroot_store}"
    ln -s "${gcroot_local}" "${gcroot_store}"
  • replacement in bash/nix-container-demo-helper.sh at line 54
    [4.1289][4.1289:1397]()
    find "${__nix_gcroot_dir}" -name "${__nix_gcroot_prefix}-*" -print | sed "s|${__nix_gcroot_dir}/||"
    [4.1289]
    [4.1397]
    find "${__nix_gcroot_store_dir}" -name "${__nix_gcroot_prefix}-*" -print | sed "s|${__nix_gcroot_store_dir}/||"
  • replacement in bash/nix-container-demo-helper.sh at line 60
    [4.1502][4.1502:1578]()
    find "${__nix_gcroot_dir}" -name "${__nix_gcroot_prefix}-*" -delete
    [4.1502]
    [4.909]
    find "${__nix_gcroot_store_dir}" -name "${__nix_gcroot_prefix}-*" -delete
  • edit in .gitignore at line 5
    [2.167]
    /gcroots