Skip to content

build: reproducibility issue with hatch version #1984

Closed

Description

@jku

I'm currently seeing our wheel file contents changing without changes to source:

diff -r locally-built-whl/tuf-1.1.0.dist-info/WHEEL github-whl/tuf-1.1.0.dist-info/WHEEL
2c2
< Generator: hatch 0.23.0
---
> Generator: hatch 0.22.0

So yes, we need to pin hatch version. This makes a lot of sense to me -- why would we not pin the build tool when we pin all other dependencies?

I'm also a bit worried about that 0.22? Where did that come from -- I don't see it on pypi?

Activity

  1. jku commented on Apr 28, 2022

    @jku
    MemberAuthor

    Looking at the CD build log:
    https://github.com/theupdateframework/python-tuf/runs/6194444912

    2022-04-27T13:29:42.2105578Z ##[group]Run python3 -m pip install --upgrade pip build
    2022-04-27T13:29:42.2105992Z �[36;1mpython3 -m pip install --upgrade pip build�[0m
    2022-04-27T13:29:42.2159788Z shell: /usr/bin/bash -e {0}
    2022-04-27T13:29:42.2160084Z env:
    2022-04-27T13:29:42.2160375Z   pythonLocation: /opt/hostedtoolcache/Python/3.10.4/x64
    2022-04-27T13:29:42.2160897Z   LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.10.4/x64/lib
    2022-04-27T13:29:42.2161221Z ##[endgroup]
    2022-04-27T13:29:43.1058776Z Requirement already satisfied: pip in /opt/hostedtoolcache/Python/3.10.4/x64/lib/python3.10/site-packages (22.0.4)
    2022-04-27T13:29:43.2703389Z Collecting build
    2022-04-27T13:29:43.4295475Z   Downloading build-0.7.0-py3-none-any.whl (16 kB)
    2022-04-27T13:29:43.4938649Z Collecting pep517>=0.9.1
    2022-04-27T13:29:43.5098992Z   Downloading pep517-0.12.0-py2.py3-none-any.whl (19 kB)
    2022-04-27T13:29:43.5614602Z Collecting packaging>=19.0
    2022-04-27T13:29:43.5772679Z   Downloading packaging-21.3-py3-none-any.whl (40 kB)
    2022-04-27T13:29:43.5861275Z      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 40.8/40.8 KB 5.1 MB/s eta 0:00:00
    2022-04-27T13:29:43.6241660Z Collecting tomli>=1.0.0
    2022-04-27T13:29:43.6689276Z   Downloading tomli-2.0.1-py3-none-any.whl (12 kB)
    2022-04-27T13:29:43.7484252Z Collecting pyparsing!=3.0.5,>=2.0.2
    2022-04-27T13:29:43.7643664Z   Downloading pyparsing-3.0.8-py3-none-any.whl (98 kB)
    2022-04-27T13:29:43.7813118Z      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 98.5/98.5 KB 6.1 MB/s eta 0:00:00
    2022-04-27T13:29:43.8467688Z Installing collected packages: tomli, pyparsing, pep517, packaging, build
    2022-04-27T13:29:44.1224863Z Successfully installed build-0.7.0 packaging-21.3 pep517-0.12.0 pyparsing-3.0.8 tomli-2.0.1
    2022-04-27T13:29:44.4009331Z ##[group]Run python3 -m build --sdist --wheel --outdir dist/ .
    2022-04-27T13:29:44.4009799Z �[36;1mpython3 -m build --sdist --wheel --outdir dist/ .�[0m
    2022-04-27T13:29:44.4058282Z shell: /usr/bin/bash -e {0}
    2022-04-27T13:29:44.4058575Z env:
    2022-04-27T13:29:44.4059011Z   pythonLocation: /opt/hostedtoolcache/Python/3.10.4/x64
    2022-04-27T13:29:44.4059358Z   LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.10.4/x64/lib
    2022-04-27T13:29:44.4059674Z ##[endgroup]
    2022-04-27T13:29:56.5796245Z * Creating venv isolated environment...
    2022-04-27T13:29:56.5796897Z * Installing packages in isolated environment... (hatchling>=0.21.0)
    2022-04-27T13:29:56.5797346Z * Getting dependencies for sdist...
    2022-04-27T13:29:56.5797698Z * Building sdist...
    2022-04-27T13:29:56.5798044Z * Creating venv isolated environment...
    2022-04-27T13:29:56.5798500Z * Installing packages in isolated environment... (hatchling>=0.21.0)
    2022-04-27T13:29:56.5798924Z * Getting dependencies for wheel...
    2022-04-27T13:29:56.5799310Z * Building wheel...
    2022-04-27T13:29:56.5800048Z Successfully built tuf-1.1.0.tar.gz and tuf-1.1.0-py3-none-any.whl
    

    It does not even document the hatchling version anywhere! How did GitHub end up with 0.22.0? How did my local build end with 0.23.0? Neither of those versions is on pypi AFAICT and current release has been 0.23.1 for months!

  2. jku commented on Apr 28, 2022

    @jku
    MemberAuthor

    @ofek I suppose the pinning is fairly simple... but do you have any ideas about these random versions: where do they come from?

  3. ofek commented on Apr 28, 2022

    @ofek
    Contributor

    https://pypi.org/project/hatchling/#history

    It's customary to use the name of the broader project rather than the backend

  4. jku commented on Apr 28, 2022

    @jku
    MemberAuthor

    It's customary to use the name of the broader project rather than the backend

    this is probably part of the problem: I have issues understanding which is which and what actually gets used...

    The reality is that our WHEEL file says: Generator: hatch 0.22.0

    This is not a release I can find anywhere. Maybe it should say hatchling 0.22.0 ?

  5. jku commented on Apr 28, 2022

    @jku
    MemberAuthor

    Maybe it [WHEEL] should say hatchling 0.22.0?

    I think this is the issue: we depend on hatchling only but for some reason the WHEEL file documents it as hatch but still using hatchling version numbers.

    Then it makes sense:

    • we just pin our hatchling version pyproject.toml and build is now reproducible
    • whatever component uses the wrong name in WHEEL should be fixed ... but it's not critical to our build reproducibility
  6. linked a pull request that will close this issuebuild: Pin hatchling version #1989on Apr 28, 2022
  7. ofek commented on Apr 28, 2022

    @ofek
    Contributor
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions