Skip to content

Commit

Permalink
meson: Do not emit absolute path when S != B (#2461)
Browse files Browse the repository at this point in the history
* 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] cython/cython#5949

Signed-off-by: Khem Raj <[email protected]>

* Fix usage of deprecated function

---------

Signed-off-by: Khem Raj <[email protected]>
  • Loading branch information
kraj authored Sep 22, 2024
1 parent e1c1bf6 commit c07e8a4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion module/meson.build
Original file line number Diff line number Diff line change
@@ -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, '--output-file', '@OUTPUT@', '@INPUT@'])
command: [cython, '-w', meson.project_source_root(), '--output-file', cython_outfile, cython_infile])

sources = [
blueman_c,
Expand Down

0 comments on commit c07e8a4

Please sign in to comment.