Skip to content

Ensure extendedGlob returns paths in lexical order #6169

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Honny1
Copy link
Member

@Honny1 Honny1 commented May 19, 2025

What type of PR is this?

/kind api-change
/kind bug
/kind cleanup
/kind deprecation
/kind design
/kind documentation
/kind failing-test
/kind feature
/kind flake
/kind other

What this PR does / why we need it:

The filepath.Glob function does not provide deterministic output. In order to achieve a reproducible build, files must be copied in a deterministic manner, and filepath.Glob did not guarantee this. Other functions such as filepath.Walk and os.ReadDir return deterministic output. So copying files to the image is done in the same order each time.

How to verify it

Which issue(s) this PR fixes:

Fixes: https://issues.redhat.com/browse/RUN-2661

Special notes for your reviewer:

Does this PR introduce a user-facing change?

None

Copy link

Ephemeral COPR build failed. @containers/packit-build please check.

@Honny1 Honny1 force-pushed the sort-glob-output branch from 14c7248 to 42d67c9 Compare May 19, 2025 12:51
@Honny1 Honny1 marked this pull request as ready for review May 19, 2025 12:55
@nalind
Copy link
Member

nalind commented May 19, 2025

/approve
LGTM

Copy link
Contributor

openshift-ci bot commented May 19, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Honny1, nalind

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

The `filepath.Glob` function does not provide deterministic output. In order to achieve a reproducible build, files must be copied in a deterministic manner, and `filepath.Glob` did not guarantee this. Other functions such as `filepath.Walk` and `os.ReadDir` return deterministic output. So copying files to the image is done in the same order each time.

Fixes: https://issues.redhat.com/browse/RUN-2661

Signed-off-by: Jan Rodák <[email protected]>
@Honny1 Honny1 force-pushed the sort-glob-output branch from 42d67c9 to b7dcea0 Compare May 26, 2025 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants