Skip to content

Conversation

@randomizedcoder
Copy link

Add comprehensive Nix packaging support for PCP 7.0.5, enabling reproducible
builds via Nix flakes and preparing for inclusion in nixpkgs.

New files:

  • flake.nix: Main Nix flake with package definition, dev shell, and VM test
  • flake.lock: Pinned nixpkgs and flake-utils versions
  • nix/vm-test.nix: NixOS VM integration test for pmcd daemon
  • nix/patches/gnumakefile-nix-fixes.patch: Remove ownership flags, fix
      tmpfiles path, exclude qa from build
  • nix/patches/tmpdir-portability.patch: Use ${TMPDIR:-/tmp} instead of
      hardcoded /var/tmp for sandbox compatibility
  • nix/patches/configure-ar-portable.patch: Portable ar fallback (not
      applied, available for upstream)
  • docs/HowTos/nix/index.rst: Comprehensive documentation explaining Nix
      packaging, technical details, and future improvements

Features enabled by default (Linux):

  • Core PCP tools, libraries, and PMDAs
  • Python3 and Perl language bindings
  • BPF/BCC kernel tracing PMDAs
  • Systemd integration
  • SNMP, device mapper, and service discovery

The flake provides:

  • nix build: Build PCP package with split outputs (out, man, doc)
  • nix develop: Development shell with build dependencies and PCP logo
  • nix build .#checks.x86_64-linux.vm-test: NixOS VM integration test

Technical fixes for Nix sandbox:

  • Patch /var/tmp to ${TMPDIR:-/tmp} for sandbox compatibility
  • Remove install ownership flags (handled by NixOS module)
  • Fix broken symlinks with double /nix/store prefix
  • Override systemd paths from pkg-config
  • Export AR for configure script

Documentation ./docs/HowTos/nix/index.rst includes explanations of why Nix
packaging can be challenging (non-FHS paths, sandboxed builds, pure
environment) and how these constraints help expose portability issues in
build systems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant