Skip to content

Support hash checking against RECORD #888

Closed

Description

@charliermarsh

We should validate the hash of each individual file in the wheel against the hash recorded in RECORD. (This is distinct from the hash-checking mode described in #131 and #474.)

Activity

  1. konstin commented on Jan 11, 2024

    @konstin
    Member

    During installation or for an existing venv?

    install-wheel-rs can do during installation, but it's turned off by default for perf reason (sha256 is slow) and because pip also didn't validate last time i checked.

    For an existing venv, https://github.com/konstin/poc-monotrail/blob/main/crates/monotrail/src/verify_installation.rs implements this.

  2. charliermarsh commented on Jan 11, 2024

    @charliermarsh
    MemberAuthor

    For us, installation is linking, so it should really happen when unzipping into the cache.

  3. charliermarsh commented on Jan 11, 2024

    @charliermarsh
    MemberAuthor

    Or we could do it after-the-fact as part of our venv validation...

  4. added
    enhancement
    wish
    on Jan 11, 2024
  5. added
    wish
    and removed
    wish
    on Jan 11, 2024
  6. vors commented on Aug 13, 2024

    @vors

    Related topic (let me know if I should create a separate issue):

    Currently most python packaging tooling doesn't have any kind of guardrails against the clobbering of files in one whl from another whl. This is basically undefined behavior -- depending on the order the final venv will be different. There are packages in the wild that include things like empty __init__.py files that do clobber each other and it's not a problem in practice (most notably google cloud family of packages). There are also cases when people put README.md into the top-level folder so it ends up in site-packages/README.md and conflicts.

    @hauntsaninja proposed that we could do a hash check against the RECORD file entry and maybe have a flag to fail loudly in case of violation -- that should simultaneously allow clobbering of empty __init__.py files and prevent undefined behaviors.

    What do you think about this idea? Maybe there is a better way to achieve more strict semantic?

  7. konstin commented on Dec 2, 2025

    @konstin
    Member

    Given that hash checking against RECORD wasn't implemented in pip nor uv, the security features weren't use (https://discuss.python.org/t/discouraging-deprecating-pep-427-style-signatures/94968), it's slow and new security feature such as hashes in the simple API and attestations work on a whole-file basis, I suggest we close this as not planned and focus on whole-archive hash checking.

  8. konstin commented on Aug 5, 2026

    @konstin
    Member

    Closing in favor of the actually verifiable attestations, I don't think we should implement RECORD given PEP 815.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementsecuritywish

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions