diff options
author | Yoann Congal <yoann.congal@smile.fr> | 2024-08-03 01:35:53 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-08-05 14:31:57 +0100 |
commit | 47ed8ac83a67fcd4f10b4e4dc9a13c7f75516f57 (patch) | |
tree | cbd3a1146219018049b5b2d99d5c95d4170560bb /meta/recipes-graphics | |
parent | cb2848c3adb5315a4c86806e91516ef7d4bba337 (diff) | |
download | poky-47ed8ac83a67fcd4f10b4e4dc9a13c7f75516f57.tar.gz |
spirv-tools: Fix git-describe related reproducibility
This reproducibility problem comes down to git-describe output. Fixes
this by using an environment variable to force the description and use
it to set this description to ${PV}
Fixes [YOCTO #15567].
(From OE-Core rev: fa7ab8f9afaeeba9e2b2806f28e7e9cbd2595353)
Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-graphics')
-rw-r--r-- | meta/recipes-graphics/spir/spirv-tools/0001-update_build_version.py-support-an-envvar-to-force-t.patch | 43 | ||||
-rw-r--r-- | meta/recipes-graphics/spir/spirv-tools_1.3.290.0.bb | 9 |
2 files changed, 51 insertions, 1 deletions
diff --git a/meta/recipes-graphics/spir/spirv-tools/0001-update_build_version.py-support-an-envvar-to-force-t.patch b/meta/recipes-graphics/spir/spirv-tools/0001-update_build_version.py-support-an-envvar-to-force-t.patch new file mode 100644 index 0000000000..edcbf506b9 --- /dev/null +++ b/meta/recipes-graphics/spir/spirv-tools/0001-update_build_version.py-support-an-envvar-to-force-t.patch | |||
@@ -0,0 +1,43 @@ | |||
1 | From 39b6385454d705128e684ed779ba9620e2ead1e2 Mon Sep 17 00:00:00 2001 | ||
2 | From: Yoann Congal <yoann.congal@smile.fr> | ||
3 | Date: Thu, 1 Aug 2024 18:58:04 +0200 | ||
4 | Subject: [PATCH] update_build_version.py: support an envvar to force the | ||
5 | description | ||
6 | |||
7 | FORCED_BUILD_VERSION_DESCRIPTION envvar can be used to force a version | ||
8 | description instead of resorting to git describe which can change for a | ||
9 | given commit if multiple lightweight commits point ot it. | ||
10 | |||
11 | Signed-off-by: Yoann Congal <yoann.congal@smile.fr> | ||
12 | Upstream-Status: Submitted [https://github.com/KhronosGroup/SPIRV-Tools/pull/5758] | ||
13 | --- | ||
14 | utils/update_build_version.py | 9 +++++---- | ||
15 | 1 file changed, 5 insertions(+), 4 deletions(-) | ||
16 | |||
17 | diff --git a/utils/update_build_version.py b/utils/update_build_version.py | ||
18 | index bb66e18a..9115cab1 100755 | ||
19 | --- a/utils/update_build_version.py | ||
20 | +++ b/utils/update_build_version.py | ||
21 | @@ -24,9 +24,10 @@ | ||
22 | # - The software version deduced from the given CHANGES file. | ||
23 | # - A longer string with the project name, the software version number, and | ||
24 | # git commit information for the CHANGES file's directory. The commit | ||
25 | -# information is the output of "git describe" if that succeeds, or "git | ||
26 | -# rev-parse HEAD" if that succeeds, or otherwise a message containing the | ||
27 | -# phrase "unknown hash". | ||
28 | +# information is the content of the FORCED_BUILD_VERSION_DESCRIPTION | ||
29 | +# environement variable is it exists, else the output of "git describe" if | ||
30 | +# that succeeds, or "git rev-parse HEAD" if that succeeds, or otherwise a | ||
31 | +# message containing the phrase "unknown hash". | ||
32 | # The string contents are escaped as necessary. | ||
33 | |||
34 | import datetime | ||
35 | @@ -150,7 +151,7 @@ def main(): | ||
36 | sys.exit(1) | ||
37 | |||
38 | repo_path = os.path.dirname(changes_file_path) | ||
39 | - description = describe(repo_path) | ||
40 | + description = os.getenv("FORCED_BUILD_VERSION_DESCRIPTION", describe(repo_path)) | ||
41 | content = OUTPUT_FORMAT.format(version_tag=version, description=description) | ||
42 | |||
43 | # Escape file content. | ||
diff --git a/meta/recipes-graphics/spir/spirv-tools_1.3.290.0.bb b/meta/recipes-graphics/spir/spirv-tools_1.3.290.0.bb index 1270da5b85..d0f1c387f1 100644 --- a/meta/recipes-graphics/spir/spirv-tools_1.3.290.0.bb +++ b/meta/recipes-graphics/spir/spirv-tools_1.3.290.0.bb | |||
@@ -8,7 +8,9 @@ LICENSE = "Apache-2.0" | |||
8 | LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57" | 8 | LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57" |
9 | 9 | ||
10 | SRCREV = "0cfe9e7219148716dfd30b37f4d21753f098707a" | 10 | SRCREV = "0cfe9e7219148716dfd30b37f4d21753f098707a" |
11 | SRC_URI = "git://github.com/KhronosGroup/SPIRV-Tools.git;branch=main;protocol=https" | 11 | SRC_URI = "git://github.com/KhronosGroup/SPIRV-Tools.git;branch=main;protocol=https \ |
12 | file://0001-update_build_version.py-support-an-envvar-to-force-t.patch \ | ||
13 | " | ||
12 | PE = "1" | 14 | PE = "1" |
13 | # These recipes need to be updated in lockstep with each other: | 15 | # These recipes need to be updated in lockstep with each other: |
14 | # glslang, vulkan-headers, vulkan-loader, vulkan-tools, spirv-headers, spirv-tools | 16 | # glslang, vulkan-headers, vulkan-loader, vulkan-tools, spirv-headers, spirv-tools |
@@ -29,6 +31,11 @@ EXTRA_OECMAKE += "\ | |||
29 | -DSPIRV_SKIP_TESTS=ON \ | 31 | -DSPIRV_SKIP_TESTS=ON \ |
30 | " | 32 | " |
31 | 33 | ||
34 | # Force the version description "git describe" related non-reproducibility | ||
35 | do_compile:prepend() { | ||
36 | export FORCED_BUILD_VERSION_DESCRIPTION="${PV}" | ||
37 | } | ||
38 | |||
32 | do_install:append:class-target() { | 39 | do_install:append:class-target() { |
33 | # Properly set _IMPORT_PREFIX in INTERFACE_LINK_LIBRARIES so that dependent | 40 | # Properly set _IMPORT_PREFIX in INTERFACE_LINK_LIBRARIES so that dependent |
34 | # tools can find the right library | 41 | # tools can find the right library |