Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 688136 - dev-util/spirv-tools should have build-time dependency on Python
Summary: dev-util/spirv-tools should have build-time dependency on Python
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All All
: Normal normal
Assignee: Nick Sarnie
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-06-15 23:27 UTC by Arfrever Frehtes Taifersar Arahesis
Modified: 2019-06-16 00:08 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Arfrever Frehtes Taifersar Arahesis 2019-06-15 23:27:01 UTC
dev-util/spirv-tools should have build-time dependency on Python (at least 3.* works).

Some examples from build log of dev-util/spirv-tools-2019.1-r1:

...
-- Found PythonInterp: /usr/bin/python (found version "3.7.3")
...
make[2]: Entering directory '/var/tmp/portage/dev-util/spirv-tools-2019.1-r1/work/SPIRV-Tools-2019.1-abi_x86_32.x86'
[  1%] Generate extended instruction tables for spv-amd-shader-explicit-vertex-parameter.
cd /var/tmp/portage/dev-util/spirv-tools-2019.1-r1/work/SPIRV-Tools-2019.1-abi_x86_32.x86/source && /usr/bin/python /var/tmp/portage/dev-util/spirv-tools-2019.1-r1/work/SPIRV-Tools-2019.1/utils/generate_grammar_tables.py --extinst-vendor-grammar=/var/tmp/portage/dev-util/spirv-tools-2019.1-r1/work/SPIRV-Tools-2019.1/source/extinst.spv-amd-shader-explicit-vertex-parameter.grammar.json --vendor-insts-output=/var/tmp/portage/dev-util/spirv-tools-2019.1-r1/work/SPIRV-Tools-2019.1-abi_x86_32.x86/spv-amd-shader-explicit-vertex-parameter.insts.inc
/var/tmp/portage/dev-util/spirv-tools-2019.1-r1/work/SPIRV-Tools-2019.1/utils/generate_grammar_tables.py:745: ResourceWarning: unclosed file <_io.TextIOWrapper name='/var/tmp/portage/dev-util/spirv-tools-2019.1-r1/work/SPIRV-Tools-2019.1-abi_x86_32.x86/spv-amd-shader-explicit-vertex-parameter.insts.inc' mode='w' encoding='UTF-8'>
  file=open(args.vendor_insts_output, 'w'))
make[2]: Leaving directory '/var/tmp/portage/dev-util/spirv-tools-2019.1-r1/work/SPIRV-Tools-2019.1-abi_x86_32.x86'
...


Python is called 12 times per ABI (so 24 times with ABI_X86="32 64").

python-any-r1.eclass should be inherited.
If ebuild is updated to EAPI="7", then ${PYTHON_DEPS} should be placed in BDEPEND.
Comment 1 Larry the Git Cow gentoo-dev 2019-06-15 23:44:36 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b3a2ef344f6d59dea8747afdecd902cbcd96aed6

commit b3a2ef344f6d59dea8747afdecd902cbcd96aed6
Author:     Nick Sarnie <sarnex@gentoo.org>
AuthorDate: 2019-06-15 23:40:14 +0000
Commit:     Nick Sarnie <sarnex@gentoo.org>
CommitDate: 2019-06-15 23:40:14 +0000

    dev-util/spirv-tools: Fix python dependency
    
    Fixes: https://bugs.gentoo.org/688136
    Package-Manager: Portage-2.3.67, Repoman-2.3.14
    Signed-off-by: Nick Sarnie <sarnex@gentoo.org>

 dev-util/spirv-tools/spirv-tools-2019.1-r2.ebuild | 43 +++++++++++++++++++++++
 dev-util/spirv-tools/spirv-tools-9999.ebuild      |  7 ++--
 2 files changed, 48 insertions(+), 2 deletions(-)
Comment 2 Arfrever Frehtes Taifersar Arahesis 2019-06-16 00:04:21 UTC
I was not suggesting to move dev-util/spirv-headers...
C/C++ headers should be in DEPEND, and adding them to BDEPEND is usually suspicious.

dev-util/spirv-tools is more unusual, since it apparently should have dev-util/spirv-headers in both BDEPEND and DEPEND:

- In DEPEND because some C headers are used.
  Example:
  source/latest_version_spirv_header.h (included from many other files) contains:
#include "spirv/unified1/spirv.h"

- In BDEPEND because some *.json files and /usr/include/spirv/spir-v.xml are used.
  These lines from build log show their usage:
cd /var/tmp/portage/dev-util/spirv-tools-2019.1-r1/work/SPIRV-Tools-2019.1-abi_x86_64.amd64/source && /usr/bin/python /var/tmp/portage/dev-util/spirv-tools-2019.1-r1/work/SPIRV-Tools-2019.1/utils/generate_grammar_tables.py --extinst-opencl-grammar=/usr//include/spirv/unified1/extinst.opencl.std.100.grammar.json --opencl-insts-output=/var/tmp/portage/dev-util/spirv-tools-2019.1-r1/work/SPIRV-Tools-2019.1-abi_x86_64.amd64/opencl.std.insts.inc
cd /var/tmp/portage/dev-util/spirv-tools-2019.1-r1/work/SPIRV-Tools-2019.1-abi_x86_64.amd64/source && /usr/bin/python /var/tmp/portage/dev-util/spirv-tools-2019.1-r1/work/SPIRV-Tools-2019.1/utils/generate_grammar_tables.py --extinst-glsl-grammar=/usr//include/spirv/unified1/extinst.glsl.std.450.grammar.json --glsl-insts-output=/var/tmp/portage/dev-util/spirv-tools-2019.1-r1/work/SPIRV-Tools-2019.1-abi_x86_64.amd64/glsl.std.450.insts.inc
cd /var/tmp/portage/dev-util/spirv-tools-2019.1-r1/work/SPIRV-Tools-2019.1-abi_x86_64.amd64/source && /usr/bin/python /var/tmp/portage/dev-util/spirv-tools-2019.1-r1/work/SPIRV-Tools-2019.1/utils/generate_grammar_tables.py --spirv-core-grammar=/usr//include/spirv/unified1/spirv.core.grammar.json --extinst-debuginfo-grammar=/var/tmp/portage/dev-util/spirv-tools-2019.1-r1/work/SPIRV-Tools-2019.1/source/extinst.debuginfo.grammar.json --extension-enum-output=/var/tmp/portage/dev-util/spirv-tools-2019.1-r1/work/SPIRV-Tools-2019.1-abi_x86_64.amd64/extension_enum.inc --enum-string-mapping-output=/var/tmp/portage/dev-util/spirv-tools-2019.1-r1/work/SPIRV-Tools-2019.1-abi_x86_64.amd64/enum_string_mapping.inc
cd /var/tmp/portage/dev-util/spirv-tools-2019.1-r1/work/SPIRV-Tools-2019.1-abi_x86_64.amd64/source && /usr/bin/python /var/tmp/portage/dev-util/spirv-tools-2019.1-r1/work/SPIRV-Tools-2019.1/utils/generate_grammar_tables.py --spirv-core-grammar=/usr//include/spirv/unified1/spirv.core.grammar.json --extinst-debuginfo-grammar=/var/tmp/portage/dev-util/spirv-tools-2019.1-r1/work/SPIRV-Tools-2019.1/source/extinst.debuginfo.grammar.json --core-insts-output=/var/tmp/portage/dev-util/spirv-tools-2019.1-r1/work/SPIRV-Tools-2019.1-abi_x86_64.amd64/core.insts-unified1.inc --operand-kinds-output=/var/tmp/portage/dev-util/spirv-tools-2019.1-r1/work/SPIRV-Tools-2019.1-abi_x86_64.amd64/operand.kinds-unified1.inc
cd /var/tmp/portage/dev-util/spirv-tools-2019.1-r1/work/SPIRV-Tools-2019.1-abi_x86_64.amd64/source && /usr/bin/python /var/tmp/portage/dev-util/spirv-tools-2019.1-r1/work/SPIRV-Tools-2019.1/utils/generate_registry_tables.py --xml=/usr//include/spirv/spir-v.xml --generator-output=/var/tmp/portage/dev-util/spirv-tools-2019.1-r1/work/SPIRV-Tools-2019.1-abi_x86_64.amd64/generators.inc
Comment 3 Larry the Git Cow gentoo-dev 2019-06-16 00:08:57 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ddc2c0ab491c99ea9299ce7e198b73e2beffdfb9

commit ddc2c0ab491c99ea9299ce7e198b73e2beffdfb9
Author:     Nick Sarnie <sarnex@gentoo.org>
AuthorDate: 2019-06-16 00:08:17 +0000
Commit:     Nick Sarnie <sarnex@gentoo.org>
CommitDate: 2019-06-16 00:08:17 +0000

    dev-util/spirv-tools: Fix spirv-headers dependency
    
    Just shoot me
    
    Bug: https://bugs.gentoo.org/show_bug.cgi?id=688136
    Package-Manager: Portage-2.3.67, Repoman-2.3.14
    Signed-off-by: Nick Sarnie <sarnex@gentoo.org>

 dev-util/spirv-tools/spirv-tools-2019.1-r2.ebuild | 5 +++--
 dev-util/spirv-tools/spirv-tools-9999.ebuild      | 6 +++---
 2 files changed, 6 insertions(+), 5 deletions(-)