Skip to content
This repository has been archived by the owner on Nov 27, 2024. It is now read-only.

Latest commit

 

History

History
160 lines (123 loc) · 3.41 KB

DEVELOPMENT.md

File metadata and controls

160 lines (123 loc) · 3.41 KB

Developer documentation

Building packages

  • Build single package
nix build .#<PACKAGE>
  • Build all packages
nix build .#all-packages
  • Build customized version of a package
nix build \
  --impure \
  --expr "(builtins.getFlake (toString ./.)).packages.x86_64-linux.<PACKAGE>.override { <PARAMETER> = <VALUE>; }"

# e.g. build QGIS with rasterio
nix build \
  --impure \
  --expr "let f = builtins.getFlake (toString ./.); in f.packages.x86_64-linux.qgis.override { extraPythonPackages = ps: with f.packages.x86_64-linux; [ python3-rasterio ]; }"

# e.g. build package containing multiple qgis-plugins
nix build \
  --impure \
  --expr "let f = builtins.getFlake (toString ./.); in f.inputs.nixpkgs.legacyPackages.x86_64-linux.symlinkJoin { name = \"qgis-plugins\"; paths = with f.packages.x86_64-linux; [ qgis-plugin-qgis2web qgis-plugin-MapTiler ]; }"
  • Run package passthru tests
nix build -L .#<PACKAGE>.tests.<TEST-NAME>
  • Run single flake check
nix build -L .#checks.x86_64-linux.<TEST-NAME>

To an re-build already built package or to re-run already succeeded tests, use the --rebuild switch.

Debugging packages

  • Explore derivation
nix show-derivation .#<PACKAGE>
  • Explore package store path content
nix path-info -rsSh .#<PACKAGE> | sort -nk3
  • Explain package dependencies
nix why-depends .#<PACKAGE> .#<DEPENDENCY>

Weekly development cycle

  • Monday (1 AM): automatic update of base packages from latest stable Nixpkgs branch (nix flake update)

  • Monday - Thursday: development and updates of geospatial packages in Nixpkgs master

  • Thursday - Friday: pull from Nixpkgs master to Geospatial NIX master, integration, testing

  • Sunday (11 PM): automatic release of new version

Packages update process

  • Checkout to weekly-update PR (PR title "pkgs: weekly update (weekly-update-)") (Thursday - Friday)
gh pr checkout -f <PR-NUMBER>
  • Pull from the latest Nixpkgs master
utils/pull-nixpkgs.sh <NIXPKGS-DIR>
  • Visually review changes created by pull-nixpkgs.sh script
git diff
  • Test build with changes
nix build --dry-run .#all-packages
  • Identify related PRs in Nixpkgs
git log -- <PATH-TO-PACKAGE>  # list changes to package in nixpkgs
gh pr list --web --state all --search <NIXPKGS-COMMIT-HASH>  # identify PR related to commit
  • Optional: generate a reverse patch for changes which are not desired
git diff <CHANGED-FILE> > pkgs/<PACKAGE>/nixpkgs/<PATCH-NAME>.patch
  • Create separate commit for each change (include Nixpkgs PR URL in commit message)
git commit

<PACKAGE>: <CHANGE-DESCRIPTION>

Nixpkgs PR: <NIXPKGS-PR-URL>
  • Update gdal-master package
pushd pkgs/gdal
./update-master.sh
popd

git add pkgs/gdal/master-rev.nix
git commit -m "gdal-master: weekly update"
  • Update QGIS plugins
pushd pkgs/qgis
./update-plugins.sh
popd

git add pkgs/qgis/*-plugins-list.nix
git commit -m "qgis-plugins: weekly update"
  • Update GRASS plugins
pushd pkgs/grass
./update-plugins.sh
popd

git add pkgs/grass/plugins-rev.nix
git add pkgs/grass/plugins-list.nix
git commit -m "grass-plugins: weekly update"
  • Build, test and upload all packages to binary chache
utils/nix-build-all.sh
  • Push changes to weekly-update PR
git push
  • Merge weekly-update PR (Friday, Saturday)