Bug 2143393 - Using du to measure setuptools wheel size in %check has non-deterministic results
Summary: Using du to measure setuptools wheel size in %check has non-deterministic res...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: python-setuptools
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miro Hrončok
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PPCTracker
TreeView+ depends on / blocked
 
Reported: 2022-11-16 19:25 UTC by Miro Hrončok
Modified: 2022-12-01 13:40 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-12-01 13:40:27 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Miro Hrončok 2022-11-16 19:25:47 UTC
I've just noticed accidentally that the size of the setuptools wheel differs on ppc64le. To reproduce, you can scratch build python-setuptools like this:

$ fedpkg build --nowait --fail-fast --scratch --arch ppc64le
...
++ du /builddir/build/BUILD/setuptools-65.5.1/pyproject-wheeldir/setuptools-65.5.1-py3-none-any.whl
++ cut -f1
+ test 896 -lt 900

$ fedpkg build --nowait --fail-fast --scratch --arch x86_64
...
++ du /builddir/build/BUILD/setuptools-65.5.1/pyproject-wheeldir/setuptools-65.5.1-py3-none-any.whl
+ test 860 -lt 900

This goes back at least to Fedora 36 where the (even stricter) `du` check actually fails the build on ppc64le.

Since the wheel is required by Python (and hence dnf etc.), it's installed in containers and we want it to be as small as possible. We should really see if this is just different zip compression or something more serious. Running the build on other arches to see the difference is also a good next step.

Comment 1 Miro Hrončok 2022-11-16 19:35:46 UTC
Funnily enough, when I download the RPMs, the whl size is 860 and they appear identical. I'll verify this next week and reassign this to coreutils if I can verify du reports wrong size on ppc64le, but I cannot connect to ppc64le-test.fedorainfracloud.org now.

Comment 2 Petr Viktorin (pviktori) 2022-11-23 13:55:45 UTC
The `du` tool estimates disk usage, so I'd expect it to filesystem settings (block size, compression, holes, etc.) take into account. (And I wouldn't be surprised if the estimates change in different du versions even if the data is the same, as the tool tries to catch up to what filesystems do.)

It would be better to look at file size rather than disk usage, e.g.:

    stat --format %s /builddir/build/BUILD/setuptools-65.5.1/pyproject-wheeldir/setuptools-65.5.1-py3-none-any.whl

Comment 3 Miro Hrončok 2022-11-23 15:51:12 UTC
 stat --format %s is indeed arch-independent. I'll make the change, thanks.


Note You need to log in before you can comment on or make changes to this bug.