[Rpm-maint] [rpm-software-management/rpm] SPECPARTS dir in %_builddir/%buildsubdir is leaking to setuptools package discovery (Issue #2532)
The `SPECPARTS` directory is leaking into setuptools package discovery. When upstream Python projects choose to use automatic Python package discovery by setuptools, `SPECPARTS` is considered a Python package (because empty directories actually *are* Python packages) and when not explicitly excluded, it makes setuptools die with: ``` ... discovered packages -- ['pgactivity', 'SPECPARTS', 'pgactivity.queries'] Traceback (most recent call last): ... File "/usr/lib/python3.11/site-packages/setuptools/discovery.py", line 441, in _analyse_flat_layout return self._analyse_flat_packages() or self._analyse_flat_modules() ^ File "/usr/lib/python3.11/site-packages/setuptools/discovery.py", line 447, in _analyse_flat_packages self._ensure_no_accidental_inclusion(top_level, "packages") File "/usr/lib/python3.11/site-packages/setuptools/discovery.py", line 477, in _ensure_no_accidental_inclusion raise PackageDiscoveryError(cleandoc(msg)) setuptools.errors.PackageDiscoveryError: Multiple top-level packages discovered in a flat-layout: ['SPECPARTS', 'pgactivity']. ``` (Full traceback at https://github.com/dalibo/pg_activity/pull/378#issuecomment-1571655683) I suppose other upstreams might consider a new directory in `$PWD` something to automatically consider important. Could this directory either be moved outside of `%_builddir/%buildsubdir` or at least be hidden (e.g. `.SPECPARTS`)? Thanks -- Reply to this email directly or view it on GitHub: https://github.com/rpm-software-management/rpm/issues/2532 You are receiving this because you are subscribed to this thread. Message ID: ___ Rpm-maint mailing list Rpm-maint@lists.rpm.org http://lists.rpm.org/mailman/listinfo/rpm-maint
Re: [Rpm-maint] [rpm-software-management/rpm] SPECPARTS dir in %_builddir/%buildsubdir is leaking to setuptools package discovery (Issue #2532)
Yeah, I see this is a problem. The fact that we don't really have a proper directory for the build is really not great. We basically rely on the source tarball providing a directory (*). Having the directory beside the buildsubdir is probably the best solution for now until we move the whole thing one dir down (which is unlikely to happen in 4.19). *) details apply -- Reply to this email directly or view it on GitHub: https://github.com/rpm-software-management/rpm/issues/2532#issuecomment-1578610898 You are receiving this because you are subscribed to this thread. Message ID: ___ Rpm-maint mailing list Rpm-maint@lists.rpm.org http://lists.rpm.org/mailman/listinfo/rpm-maint
Re: [Rpm-maint] [rpm-software-management/rpm] SPECPARTS dir in %_builddir/%buildsubdir is leaking to setuptools package discovery (Issue #2532)
(see #2078 for further background) -- Reply to this email directly or view it on GitHub: https://github.com/rpm-software-management/rpm/issues/2532#issuecomment-1578622766 You are receiving this because you are subscribed to this thread. Message ID: ___ Rpm-maint mailing list Rpm-maint@lists.rpm.org http://lists.rpm.org/mailman/listinfo/rpm-maint
Re: [Rpm-maint] [rpm-software-management/rpm] SPECPARTS dir in %_builddir/%buildsubdir is leaking to setuptools package discovery (Issue #2532)
Another Fedora package is known to be impacted. python-quantities: https://bugzilla.redhat.com/show_bug.cgi?id=2213013 -- Reply to this email directly or view it on GitHub: https://github.com/rpm-software-management/rpm/issues/2532#issuecomment-1579523314 You are receiving this because you are subscribed to this thread. Message ID: ___ Rpm-maint mailing list Rpm-maint@lists.rpm.org http://lists.rpm.org/mailman/listinfo/rpm-maint
Re: [Rpm-maint] [rpm-software-management/rpm] SPECPARTS dir in %_builddir/%buildsubdir is leaking to setuptools package discovery (Issue #2532)
Repeating this here to attach it to the issue rather than a specific PR: An easy solution would be letting a package override the path. That allows the handful of special cases to handle it on spec level while leaving it loud and clear for the others. Those overriding it are obviously aware of the magic it entails so that's not a problem. Currently the macro thing is kinda backwards in that the directory is hardcoded in C and then exposed as a macro, when it should be the other way around. -- Reply to this email directly or view it on GitHub: https://github.com/rpm-software-management/rpm/issues/2532#issuecomment-1580150245 You are receiving this because you are subscribed to this thread. Message ID: ___ Rpm-maint mailing list Rpm-maint@lists.rpm.org http://lists.rpm.org/mailman/listinfo/rpm-maint
Re: [Rpm-maint] [rpm-software-management/rpm] SPECPARTS dir in %_builddir/%buildsubdir is leaking to setuptools package discovery (Issue #2532)
> An easy solution would be letting a package override the path. That allows > the handful of special cases to handle it on spec level while leaving it loud > and clear for the others... What would b the advice for packages affected by the setuptools package discovery issue? Putting `%global specpartsdir .SPECPARTS` in the spec? Do we want dozens of specs with that? -- Reply to this email directly or view it on GitHub: https://github.com/rpm-software-management/rpm/issues/2532#issuecomment-1580153563 You are receiving this because you are subscribed to this thread. Message ID: ___ Rpm-maint mailing list Rpm-maint@lists.rpm.org http://lists.rpm.org/mailman/listinfo/rpm-maint
Re: [Rpm-maint] [rpm-software-management/rpm] SPECPARTS dir in %_builddir/%buildsubdir is leaking to setuptools package discovery (Issue #2532)
I wonder if we could make it the default value for now (i.e. in the spirit of #2533 basically)? -- Reply to this email directly or view it on GitHub: https://github.com/rpm-software-management/rpm/issues/2532#issuecomment-1580266258 You are receiving this because you are subscribed to this thread. Message ID: ___ Rpm-maint mailing list Rpm-maint@lists.rpm.org http://lists.rpm.org/mailman/listinfo/rpm-maint
Re: [Rpm-maint] [rpm-software-management/rpm] SPECPARTS dir in %_builddir/%buildsubdir is leaking to setuptools package discovery (Issue #2532)
In our testing Copr for Python 3.12, the `r"Multiple top-level packages discovered in a flat-layout: \[.*'SPECPARTS'"` regex was found in: - python-uc-micro-py - python-linkify-it-py - python-nose2 -- Reply to this email directly or view it on GitHub: https://github.com/rpm-software-management/rpm/issues/2532#issuecomment-1580353114 You are receiving this because you are subscribed to this thread. Message ID: ___ Rpm-maint mailing list Rpm-maint@lists.rpm.org http://lists.rpm.org/mailman/listinfo/rpm-maint
Re: [Rpm-maint] [rpm-software-management/rpm] SPECPARTS dir in %_builddir/%buildsubdir is leaking to setuptools package discovery (Issue #2532)
I don't know. Three affected packages is a handful that where a workaround seems acceptable, if it's dozens of packages then less so. Unless it could be hidden in the surrounding helper macros. -- Reply to this email directly or view it on GitHub: https://github.com/rpm-software-management/rpm/issues/2532#issuecomment-1580610822 You are receiving this because you are subscribed to this thread. Message ID: ___ Rpm-maint mailing list Rpm-maint@lists.rpm.org http://lists.rpm.org/mailman/listinfo/rpm-maint
Re: [Rpm-maint] [rpm-software-management/rpm] SPECPARTS dir in %_builddir/%buildsubdir is leaking to setuptools package discovery (Issue #2532)
#2534 would solve that issue by moving the SPECPARTS dir one dir up. It's only one char different for moving it back in. But so far I don't quite see a drawback for doing it this way except there is now one more way how builds of the same package can step on each others toe. -- Reply to this email directly or view it on GitHub: https://github.com/rpm-software-management/rpm/issues/2532#issuecomment-1580621915 You are receiving this because you are subscribed to this thread. Message ID: ___ Rpm-maint mailing list Rpm-maint@lists.rpm.org http://lists.rpm.org/mailman/listinfo/rpm-maint
Re: [Rpm-maint] [rpm-software-management/rpm] SPECPARTS dir in %_builddir/%buildsubdir is leaking to setuptools package discovery (Issue #2532)
> Three affected packages is a handful where a workaround seems acceptable, if > it's dozens of packages then less so. "Automatic discovery" in setuptools is quite new ([v61.0.0](https://setuptools.pypa.io/en/latest/history.html#v61-0-0), 24 Mar 2022) and still in beta; that's probably why so few packages use it for now. -- Reply to this email directly or view it on GitHub: https://github.com/rpm-software-management/rpm/issues/2532#issuecomment-1580689586 You are receiving this because you are subscribed to this thread. Message ID: ___ Rpm-maint mailing list Rpm-maint@lists.rpm.org http://lists.rpm.org/mailman/listinfo/rpm-maint
Re: [Rpm-maint] [rpm-software-management/rpm] SPECPARTS dir in %_builddir/%buildsubdir is leaking to setuptools package discovery (Issue #2532)
@ffesti's proposal is probably the least painful way out for now: it avoids polluting specs with crap that would become obsolete with #2078. -- Reply to this email directly or view it on GitHub: https://github.com/rpm-software-management/rpm/issues/2532#issuecomment-1581977224 You are receiving this because you are subscribed to this thread. Message ID: ___ Rpm-maint mailing list Rpm-maint@lists.rpm.org http://lists.rpm.org/mailman/listinfo/rpm-maint
Re: [Rpm-maint] [rpm-software-management/rpm] SPECPARTS dir in %_builddir/%buildsubdir is leaking to setuptools package discovery (Issue #2532)
Closed #2532 as completed via df8d1fb1b32becf61bbe0366bd7a1966157bf08f. -- Reply to this email directly or view it on GitHub: https://github.com/rpm-software-management/rpm/issues/2532#event-9513245937 You are receiving this because you are subscribed to this thread. Message ID: ___ Rpm-maint mailing list Rpm-maint@lists.rpm.org http://lists.rpm.org/mailman/listinfo/rpm-maint
Re: [Rpm-maint] [rpm-software-management/rpm] SPECPARTS dir in %_builddir/%buildsubdir is leaking to setuptools package discovery (Issue #2532)
Could the default be `SPECPARTS-%{name}` instead of `%{name}-SPECPARTS`, so that `$RPM_BUILD_DIR/%{name}*` doesn't change meaning? -- Reply to this email directly or view it on GitHub: https://github.com/rpm-software-management/rpm/issues/2532#issuecomment-1705676298 You are receiving this because you are subscribed to this thread. Message ID: ___ Rpm-maint mailing list Rpm-maint@lists.rpm.org http://lists.rpm.org/mailman/listinfo/rpm-maint
Re: [Rpm-maint] [rpm-software-management/rpm] SPECPARTS dir in %_builddir/%buildsubdir is leaking to setuptools package discovery (Issue #2532)
That assumes `%{_builddir}/%{name}*` has a meaning to begin with. Any package making assumptions about has already stepped outside its boundaries. -- Reply to this email directly or view it on GitHub: https://github.com/rpm-software-management/rpm/issues/2532#issuecomment-1706032257 You are receiving this because you are subscribed to this thread. Message ID: ___ Rpm-maint mailing list Rpm-maint@lists.rpm.org http://lists.rpm.org/mailman/listinfo/rpm-maint