From 038d646d7e3d54d8775f97611515fdcf1db2af6c Mon Sep 17 00:00:00 2001 From: Julien Stephan Date: Thu, 24 Aug 2023 09:34:58 +0200 Subject: vulkan-samples: convert debugfix.patch to git format patch devtool modify on vulkan-samples fails to apply the debugfix.patch because it is not in one of git's known formats. Here is the error: ERROR: Applying patch 'debugfix.patch' on target directory '<..>/build/tmp/work/core2-64-poky-linux/vulkan-samples/git/devtooltmp-38uz7jyq/workdir/git' CmdError("sh -c 'git add -f -A .'", 0, 'stdout: stderr: fatal: not a git repository (or any of the parent directories): .git ') Also, rename debugfix.patch to something more meaningfull (From OE-Core rev: c05c508cf3141a6923d87e1d04f7387ce3c91a9d) Signed-off-by: Julien Stephan Signed-off-by: Luca Ceresoli Signed-off-by: Richard Purdie --- ...-vulkan-samples-Fix-reproducibility-issue.patch | 43 ++++++++++++++++++++++ .../vulkan/vulkan-samples/debugfix.patch | 31 ---------------- meta/recipes-graphics/vulkan/vulkan-samples_git.bb | 2 +- 3 files changed, 44 insertions(+), 32 deletions(-) create mode 100644 meta/recipes-graphics/vulkan/vulkan-samples/0001-vulkan-samples-Fix-reproducibility-issue.patch delete mode 100644 meta/recipes-graphics/vulkan/vulkan-samples/debugfix.patch (limited to 'meta') diff --git a/meta/recipes-graphics/vulkan/vulkan-samples/0001-vulkan-samples-Fix-reproducibility-issue.patch b/meta/recipes-graphics/vulkan/vulkan-samples/0001-vulkan-samples-Fix-reproducibility-issue.patch new file mode 100644 index 0000000000..7609011421 --- /dev/null +++ b/meta/recipes-graphics/vulkan/vulkan-samples/0001-vulkan-samples-Fix-reproducibility-issue.patch @@ -0,0 +1,43 @@ +From d998c753254649c7cf7c64e3fed78e41c11ad7ed Mon Sep 17 00:00:00 2001 +From: Richard Purdie +Date: Wed, 23 Aug 2023 09:38:37 +0200 +Subject: [PATCH] vulkan-samples: Fix reproducibility issue + +There is code to remove the prefix CMAKE_SOURCE_DIR from __FILENAME__ paths +used for logging with LOGE() in the code. We need to make this match the value we use +in the debug source remapping from CFLAGS + +We export the right path to use in the recipe with: + +EXTRA_OECMAKE = "-DCMAKE_DEBUG_SRCDIR=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR}/" + +and we then patch this into the code instead of the broken use +of CMAKE_SOURCE_DIR since __FILENAME__ will match our path prefix +changes. + +This also breaks reproducibility since the path length of the build directory +will currently change the output! + +Upstream-Status: Pending [needs to be discussed upstream] +Signed-off-by: Richard Purdie + +Signed-off-by: Julien Stephan +--- + bldsys/cmake/global_options.cmake | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/bldsys/cmake/global_options.cmake b/bldsys/cmake/global_options.cmake +index b15c2da..d8952e5 100644 +--- a/bldsys/cmake/global_options.cmake ++++ b/bldsys/cmake/global_options.cmake +@@ -62,7 +62,7 @@ set(CMAKE_CXX_STANDARD 14) + set(CMAKE_DISABLE_SOURCE_CHANGES ON) + set(CMAKE_DISABLE_IN_SOURCE_BUILD ON) + +-string(LENGTH "${CMAKE_SOURCE_DIR}/" ROOT_PATH_SIZE) ++string(LENGTH "${CMAKE_DEBUG_SRCDIR}/" ROOT_PATH_SIZE) + add_definitions(-DROOT_PATH_SIZE=${ROOT_PATH_SIZE}) + + set(CMAKE_C_FLAGS_DEBUG "-DDEBUG=0 ${CMAKE_C_FLAGS_DEBUG}") +-- +2.41.0 diff --git a/meta/recipes-graphics/vulkan/vulkan-samples/debugfix.patch b/meta/recipes-graphics/vulkan/vulkan-samples/debugfix.patch deleted file mode 100644 index d723fcc19a..0000000000 --- a/meta/recipes-graphics/vulkan/vulkan-samples/debugfix.patch +++ /dev/null @@ -1,31 +0,0 @@ -There is code to remove the prefix CMAKE_SOURCE_DIR from __FILENAME__ paths -used for logging with LOGE() in the code. We need to make this match the value we use -in the debug source remapping from CFLAGS - -We export the right path to use in the recipe with: - -EXTRA_OECMAKE = "-DCMAKE_DEBUG_SRCDIR=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR}/" - -and we then patch this into the code instead of the broken use -of CMAKE_SOURCE_DIR since __FILENAME__ will match our path prefix -changes. - -This also breaks reproducibility since the path length of the build directory -will currently change the output! - -Upstream-Status: Pending [needs to be discussed upstream] -Signed-off-by: Richard Purdie - -Index: git/bldsys/cmake/global_options.cmake -=================================================================== ---- git.orig/bldsys/cmake/global_options.cmake -+++ git/bldsys/cmake/global_options.cmake -@@ -47,7 +47,7 @@ set(CMAKE_CXX_STANDARD 14) - set(CMAKE_DISABLE_SOURCE_CHANGES ON) - set(CMAKE_DISABLE_IN_SOURCE_BUILD ON) - --string(LENGTH "${CMAKE_SOURCE_DIR}/" ROOT_PATH_SIZE) -+string(LENGTH "${CMAKE_DEBUG_SRCDIR}/" ROOT_PATH_SIZE) - add_definitions(-DROOT_PATH_SIZE=${ROOT_PATH_SIZE}) - - set(CMAKE_C_FLAGS_DEBUG "-DDEBUG=0 ${CMAKE_C_FLAGS_DEBUG}") diff --git a/meta/recipes-graphics/vulkan/vulkan-samples_git.bb b/meta/recipes-graphics/vulkan/vulkan-samples_git.bb index 458d1405ae..66f1ef5e9d 100644 --- a/meta/recipes-graphics/vulkan/vulkan-samples_git.bb +++ b/meta/recipes-graphics/vulkan/vulkan-samples_git.bb @@ -6,7 +6,7 @@ LICENSE = "Apache-2.0" LIC_FILES_CHKSUM = "file://LICENSE;md5=48aa35cefb768436223a6e7f18dc2a2a" SRC_URI = "gitsm://github.com/KhronosGroup/Vulkan-Samples.git;branch=main;protocol=https;lfs=0 \ - file://debugfix.patch \ + file://0001-vulkan-samples-Fix-reproducibility-issue.patch \ file://0001-Do-not-use-LFS64-functions-on-linux-musl.patch;patchdir=third_party/spdlog \ file://0001-Deprecate-u8string_view.patch;patchdir=third_party/spdlog \ file://32bit.patch \ -- cgit v1.2.3-54-g00ecf