Skip to content

Produced zipapp is not reproducible due to _bootstrap file ordering #265

@timothyg-stripe

Description

@timothyg-stripe

👋 We are using shiv in reproducible mode, but we found that the output is not idempotent due to this block of code that adds the _bootstrap directory:

shiv/src/shiv/builder.py

Lines 165 to 177 in a353d10

bootstrap_target = Path("_bootstrap")
for path, name in iter_package_files(bootstrap):
data = path.read_bytes()
write_to_zipapp(
archive,
str(bootstrap_target / name),
data,
zipinfo_datetime,
compression,
stat=path.stat(),
)

In particular, iter_package_files(bootstrap) (which eventually calls Path.iterdir()) is not guaranteed to be in any particular order.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions