From 4947abc5ede2dc356f011b7c45f6760c9c2ce9f1 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Wed, 14 Aug 2024 21:26:24 -0700 Subject: [PATCH 1/2] meson: Do not emit absolute path when S != B build systems like OE build outside sourcetree in such cases it works ok but cython resolves the input file to absolute path and that gets emitted into genetate _blueman.c as module name, renders the build non-reproducible, wish cython had a better way to handle this but there is not, therefore tweak the meson build rule to account for specifying workdir to cython which will search the inputs correctly, and use meson's build_root to emit the output into build dir. This ensures that it becomes independent of source or build directories and cython does not generate the absolute paths into generate C code. See cython discussion on [1] [1] https://github.com/cython/cython/issues/5949 Signed-off-by: Khem Raj --- module/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/meson.build b/module/meson.build index 096ad7c8e..fddef547a 100644 --- a/module/meson.build +++ b/module/meson.build @@ -4,7 +4,7 @@ blueman_c = custom_target( 'blueman_c', output: '_blueman.c', input: '_blueman.pyx', - command: [cython, '--output-file', '@OUTPUT@', '@INPUT@']) + command: [cython, '-w', meson.source_root(), '--output-file', join_paths(meson.build_root(), '@OUTPUT@'), join_paths(meson.build_root(), '@INPUT@')]) sources = [ blueman_c, From 94814736217f7d90025de61fb443bc5714337e57 Mon Sep 17 00:00:00 2001 From: Sander Sweers Date: Sun, 22 Sep 2024 12:45:13 +0200 Subject: [PATCH 2/2] Fix usage of deprecated function --- module/meson.build | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/module/meson.build b/module/meson.build index fddef547a..162b9b225 100644 --- a/module/meson.build +++ b/module/meson.build @@ -1,10 +1,12 @@ cython = find_program('cython', 'cython3' ,required: true) +cython_outfile = join_paths(meson.project_build_root(), '@OUTPUT@') +cython_infile = join_paths(meson.project_build_root(), '@INPUT@') blueman_c = custom_target( 'blueman_c', output: '_blueman.c', input: '_blueman.pyx', - command: [cython, '-w', meson.source_root(), '--output-file', join_paths(meson.build_root(), '@OUTPUT@'), join_paths(meson.build_root(), '@INPUT@')]) + command: [cython, '-w', meson.project_source_root(), '--output-file', cython_outfile, cython_infile]) sources = [ blueman_c,