setuptools_scm icon indicating copy to clipboard operation
setuptools_scm copied to clipboard

Different hash (length) in generated name

Open senysenyseny16 opened this issue 1 year ago • 6 comments
trafficstars

Wheels are built in the same environment, periodically some of the wheels have a different hash, differing in length by one digit.

package_name-3.7.2.dev52+g84cda2814-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
package_name-3.7.2.dev52+g84cda281-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
package_name-3.7.2.dev52+g84cda281-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
g84cda281   [3.9, 3.10]
g84cda2814  [3.8]

version: latest

senysenyseny16 avatar Jun 25 '24 04:06 senysenyseny16

What git versions are the different builders using

It may be necessary to as always use the long describe

RonnyPfannschmidt avatar Jun 25 '24 04:06 RonnyPfannschmidt

All three wheels are built in the same image with the same version of Git:

❯ docker run -it --rm quay.io/pypa/manylinux2014_x86_64
[root@b9d0ea36c864 /]# git --version
git version 2.45.2

From build to build, the incorrect names change for different versions of Python.

senysenyseny16 avatar Jun 25 '24 04:06 senysenyseny16

Thanks for the details, it seems like we hit a non-deterministic case in git and need to ensure a consistent minimum length

RonnyPfannschmidt avatar Jun 25 '24 05:06 RonnyPfannschmidt

I tried to reproduce it on Python 3.8, 3.9, and 3.10 using this image quay.io/pypa/manylinux2014_x86_64, but it didn't reproduce. Did I miss something?

Click to see the reproduce outputs
(venv) sxp@pc ~/test (main)> docker run -it --rm quay.io/pypa/manylinux2014_x86_64
[root@5af35412ad10 /]# cd home/
[root@5af35412ad10 home]# ls
[root@5af35412ad10 home]# git clone https://github.com/shenxianpeng/test_setuptools_scm_1052.git
Cloning into 'test_setuptools_scm_1052'...
remote: Enumerating objects: 6, done.
remote: Counting objects: 100% (6/6), done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 6 (delta 0), reused 6 (delta 0), pack-reused 0
Receiving objects: 100% (6/6), done.
[root@5af35412ad10 home]# cd test_setuptools_scm_1052/
[root@5af35412ad10 test_setuptools_scm_1052]# git --version
git version 2.45.2

#
# test with Python 3.8
# 
[root@5af35412ad10 test_setuptools_scm_1052]# python3.8 -m venv 38venv
[root@5af35412ad10 test_setuptools_scm_1052]# source 38venv/bin/activate
(38venv) [root@5af35412ad10 test_setuptools_scm_1052]# python3 -V
Python 3.8.19
(38venv) [root@5af35412ad10 test_setuptools_scm_1052]# pip install -e .
Obtaining file:///home/test_setuptools_scm_1052
  Installing build dependencies ... done
  Checking if build backend supports build_editable ... done
  Getting requirements to build editable ... done
  Preparing editable metadata (pyproject.toml) ... done
Building wheels for collected packages: test_issue
  Building editable for test_issue (pyproject.toml) ... done
  Created wheel for test_issue: filename=test_issue-0.1.dev1+g04e93a2-0.editable-py3-none-any.whl size=2842 sha256=1342767a78318fed8aaca41fe217c51aa553ef87e6bbc43afb015b0700a56ef0
  Stored in directory: /tmp/pip-ephem-wheel-cache-80hha3gn/wheels/62/d0/0e/44193a61fd339ff14753364905482ef08cddea9ea81763ac72
Successfully built test_issue
Installing collected packages: test_issue
Successfully installed test_issue-0.1.dev1+g04e93a2

[notice] A new release of pip is available: 23.0.1 -> 24.1.2
[notice] To update, run: pip install --upgrade pip

#
# test with Python 3.9
# 
(38venv) [root@5af35412ad10 test_setuptools_scm_1052]# python3.9 -m venv 39venv
(38venv) [root@5af35412ad10 test_setuptools_scm_1052]# source 39venv/bin/activate
(39venv) [root@5af35412ad10 test_setuptools_scm_1052]# python3 -V
Python 3.9.19
(39venv) [root@5af35412ad10 test_setuptools_scm_1052]# pip install -e .
Obtaining file:///home/test_setuptools_scm_1052
  Installing build dependencies ... done
  Checking if build backend supports build_editable ... done
  Getting requirements to build editable ... done
  Preparing editable metadata (pyproject.toml) ... done
Building wheels for collected packages: test_issue
  Building editable for test_issue (pyproject.toml) ... done
  Created wheel for test_issue: filename=test_issue-0.1.dev1+g04e93a2-0.editable-py3-none-any.whl size=2842 sha256=a25d13987938686db91e3dda51b874d027d35dc587921982f064568794c7439c
  Stored in directory: /tmp/pip-ephem-wheel-cache-v71i4s1o/wheels/ee/72/cb/e0bdaf0973e29187ccdce5437d9651c56c0f8d28a9b179a13a
Successfully built test_issue
Installing collected packages: test_issue
Successfully installed test_issue-0.1.dev1+g04e93a2

[notice] A new release of pip is available: 23.0.1 -> 24.1.2
[notice] To update, run: pip install --upgrade pip

#
# test with Python 3.10
# 
(39venv) [root@5af35412ad10 test_setuptools_scm_1052]# python3.10 -m venv 310venv
(39venv) [root@5af35412ad10 test_setuptools_scm_1052]# source 310venv/bin/activate
(310venv) [root@5af35412ad10 test_setuptools_scm_1052]# python3 -V
Python 3.10.14
(310venv) [root@5af35412ad10 test_setuptools_scm_1052]# pip install -e .
Obtaining file:///home/test_setuptools_scm_1052
  Installing build dependencies ... done
  Checking if build backend supports build_editable ... done
  Getting requirements to build editable ... done
  Preparing editable metadata (pyproject.toml) ... done
Building wheels for collected packages: test_issue
  Building editable for test_issue (pyproject.toml) ... done
  Created wheel for test_issue: filename=test_issue-0.1.dev1+g04e93a2-0.editable-py3-none-any.whl size=2842 sha256=a68a5d790b670024182ba7520c7731b891e1be3657830ccd4ca396870d5647a5
  Stored in directory: /tmp/pip-ephem-wheel-cache-5_gis1by/wheels/26/26/88/98aee2f877ce57050772b31f5f64d1c54af27c37d1f608a8b2
Successfully built test_issue
Installing collected packages: test_issue
Successfully installed test_issue-0.1.dev1+g04e93a2

[notice] A new release of pip is available: 23.0.1 -> 24.1.2
(310venv) [root@5af35412ad10 test_setuptools_scm_1052]#

shenxianpeng avatar Jul 09 '24 08:07 shenxianpeng

hi @shenxianpeng

I tried to look into this a little deeper and discovered that a different name is generated by unique runner from the entire set of runners in our CI. What can I do to help reproduce the problem?

senysenyseny16 avatar Jul 09 '24 08:07 senysenyseny16

I believe the safest way is to go for full nodes anytime

RonnyPfannschmidt avatar Jul 09 '24 10:07 RonnyPfannschmidt