Context
Successfully building a package on the development system does not necessarily mean that the port itself is correct.
The environment may contain previously installed dependencies, local configuration or artifacts from earlier builds that hide problems which would immediately appear on a clean installation.
prt-snapshot was created to reduce that uncertainty.
Goal
Create isolated and disposable environments where CRUX ports can be built and validated from a known state.
Host system
↓
Snapshot
↓
Clean environment
↓
Port + dependencies
↓
Build
↓
Validation
The environment stops being an implicit variable in the process and becomes part of the test.
The development system problem
A system used every day accumulates state.
Installed packages, libraries, tools and configuration can make a build succeed for reasons that are not declared by the port itself.
This is particularly problematic when validating dependencies.
A package may build successfully not because its definition is complete, but because a missing dependency was already installed on the host.
Isolation
The strategy is to perform the test inside a controlled environment rather than continuously trying to clean the main system.
The cycle can be repeated as many times as necessary:
prepare
↓
build
↓
inspect
↓
discard
↓
repeat
Breaking the environment during a test therefore stops being a problem.
If the experiment fails, it can be discarded and restarted from a known state.
Reproducibility
The goal is not perfect binary reproducibility.
What matters here is reducing differences introduced by the environment and ensuring that tests start from sufficiently well-known conditions.
This makes it possible to answer much more useful questions:
- are all dependencies declared?
- does the port work from a clean environment?
- does the result accidentally depend on the host?
- can the test be repeated after modifying the port?
Evolution
The tool has become more defensive through its own real-world use.
Working with snapshots, package databases and temporary environments introduces problems of its own: permissions, residual state, paths and operations that must remain safe even when a previous execution did not finish as expected.
Part of its development therefore applies the same principle that the tool itself is intended to provide: start from known states and avoid relying on implicit conditions.
Usage
prt-snapshot is part of the workflow used to test ports before considering them sufficiently validated.
It does not replace the CRUX package system or build process. It provides a layer around them that makes testing more controlled and repeatable.
Status
Active.
The tool continues to evolve as new real-world cases appear while building and validating ports.