Skip to content

Deterministic/reproducible packaging for Compress-PSResource #2047

Description

@GeeLaw

Summary of the new feature / enhancement

Deterministic/reproducible builds are an undeniably important feature for auditability and security. Currently, Compress-PSResource doesn't provide support for that, and it should.

Currently, I post-process my packages to ensure fully reproducible output, which takes significant time in a build.

Proposed technical implementation details (optional)

There are a few sources of non-determinism I have observed in Compress-PSResource:

  • The timestamps of files in the zipped package.
  • The PSMDCP file name is non-deterministic. Consequently, the .rels file content is non-deterministic.
  • The [Content_Types].xml content, notably the order of children, is non-deterministic. (? I remember observing this but couldn't give a stable reproduction at the moment.)

Suggestion.

  1. Make Compress-PSResource deterministic by default. PSMDCP name can be a hash of non-.rels non-.psmdcp files, and [Content_Types].xml children should be sorted.
  2. Provide a new parameter -Timestamp. When this parameter is set, all files in the package should use this timestamp.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions