You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Reproducible builds with pixi install and SOURCE_DATE_EPOCH #4969
When installing a pixi environment in a docker image, I'm seeing that the layer hash changes on every build despite the contents of pixi.toml and pixi.lock not changing.
FROM ghcr.io/prefix-dev/pixi:0.59.0
# Set environment variables for reproducibility
ENV SOURCE_DATE_EPOCH=200001010000
ENV TZ=UTC
ENV LANG=C.UTF-8
ENV LC_ALL=C.UTF-8
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONHASHSEED=0
COPY --chown=root:root --chmod=644 pixi.toml pixi.toml
COPY --chown=root:root --chmod=644 pixi.lock pixi.lock
# Run pixi install and then fix all timestamps and sort order issues
RUN pixi install --locked
The majority of files are actually extracted plainly from conda archives. Thus, I would actually think we should respect their original timestamps instead of always creating them with the current one.
Thanks for bringing this up. We could indeed try to do a better job at preserving timestamps from the conda package to the environment. However, there are files that we rewrite (to replace the PREFIX placeholder string). In that case, we could indeed use the SOURCE_DATE_EPOCH, or default to a constant date (birth date of pixi, or something).
Which filesystems are you running on? We try to set the mtime, but will not consider it an error if doing so fails, as users wanted to install to exfat drives.
With these two changes pixi install && tar -czf pixi.tar .pixi will produce identical tarballs each time it is run (provided that pixi.lock does not change of course).
Activity
xhochy commentedon Nov 24, 2025
The majority of files are actually extracted plainly from conda archives. Thus, I would actually think we should respect their original timestamps instead of always creating them with the current one.
wolfv commentedon Nov 24, 2025
Thanks for bringing this up. We could indeed try to do a better job at preserving timestamps from the conda package to the environment. However, there are files that we rewrite (to replace the PREFIX placeholder string). In that case, we could indeed use the SOURCE_DATE_EPOCH, or default to a constant date (birth date of pixi, or something).
baszalmstra commentedon Nov 28, 2025
Or could we reset the modified date maybe? Would that make sense?
baszalmstra commentedon Dec 17, 2025
@xhochy @wolfv does it make sense to reset the latest modified date to the original date in the archive?
xhochy commentedon Dec 17, 2025
Yes, that sounds like the expected behaviour.
xhochy commentedon Mar 18, 2026
Should this already be a in a
pixirelease?pixi=0.660sadly doesn't seems to behave as promised.wolfv commentedon Mar 18, 2026
Yes, I think it's a different issue than what we closed. Reopening!
hunger commentedon Mar 20, 2026
Which filesystems are you running on? We try to set the mtime, but will not consider it an error if doing so fails, as users wanted to install to exfat drives.
xhochy commentedon Mar 23, 2026
I'm testing this on macOS (standard APFS) with
hunger commentedon Mar 27, 2026
Thanks for getting back to this issue!
hunger commentedon May 8, 2026
With these two changes
pixi install && tar -czf pixi.tar .pixiwill produce identical tarballs each time it is run (provided that pixi.lock does not change of course).hunger commentedon May 18, 2026
#6056 is about making a tarball of pixi envs reproducible and should finally fix this issue for good.