Skip to content

Latest commit

 

History

History
144 lines (110 loc) · 3.15 KB

DEVELOPMENT.md

File metadata and controls

144 lines (110 loc) · 3.15 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
  • 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"
  • 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)