Hi,
I'd like to control auto-dep generation on a subpackage basis.
A Go software unit is just a subdirectory in a specific location. Therefore my current Go autodep attr logic processes all those subdirectories.
Unfortunately unit test files are mixed with normal files in Go.
So, if you separate unit tests in specific subpackages (as current Fedora specs do), there is the risk one of those subpackages will own the same directory as the subpackage containing the main go code. And rpm will then think the unit test subpackage ships the whole Go code unit.
Is there a way to pass a subpackage-specific variable or package name to the dep generator, so it can learn to disable provides for unit tests? (auto requires are fine — unit test code has dep requirements)
Regards,
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256
On Mon, 2018-01-08 at 15:00 +0100, nicolas.mailhot@laposte.net wrote:
Hi,
Hello,
I'd like to control auto-dep generation on a subpackage basis.
A Go software unit is just a subdirectory in a specific location. Therefore my current Go autodep attr logic processes all those subdirectories.
Unfortunately unit test files are mixed with normal files in Go.
So, if you separate unit tests in specific subpackages (as current Fedora specs do), there is the risk one of those subpackages will own the same directory as the subpackage containing the main go code. And rpm will then think the unit test subpackage ships the whole Go code unit.
Is there a way to pass a subpackage-specific variable or package name to the dep generator, so it can learn to disable provides for unit tests? (auto requires are fine — unit test code has dep requirements)
As far as I know, RPM passes you list of files and for each file you print its dependencies. - -- - -Igor Gnatenko
On Fri, Jan 12, 2018 at 2:31 AM, Igor Gnatenko ignatenkobrain@fedoraproject.org wrote:
On Mon, 2018-01-08 at 15:00 +0100, nicolas.mailhot@laposte.net wrote:
Hi,
Hello,
I'd like to control auto-dep generation on a subpackage basis.
A Go software unit is just a subdirectory in a specific location. Therefore my current Go autodep attr logic processes all those subdirectories.
Unfortunately unit test files are mixed with normal files in Go.
So, if you separate unit tests in specific subpackages (as current Fedora specs do), there is the risk one of those subpackages will own the same directory as the subpackage containing the main go code. And rpm will then think the unit test subpackage ships the whole Go code unit.
Is there a way to pass a subpackage-specific variable or package name to the dep generator, so it can learn to disable provides for unit tests? (auto requires are fine — unit test code has dep requirements)
As far as I know, RPM passes you list of files and for each file you print its dependencies.
Since Go uses a folder structure to enforce "Go packages", it's absurdly easy to do Provides generation. Requires generation is trickier, but appears to be possible, since I've seen other distributions do it...
Hi Igor,
The problem here is that in Go dependencies are linked to directories, not individual files, several subpackages can ship files in the same directory (and Go mixing production and unit test files in the same directory pretty much ensures the directory will need to be split among subpackages), so a reliable way to tell "the autodep belongs to this subpackage" or "this subpackage should not generate autodeps) is needed
Of course one can emulate this by mandating the Go directory should only be owned by one subpackage, but that's awfully brittle and error-prone.
Regards,
packaging@lists.fedoraproject.org