Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

meson: Do not emit absolute path when S != B #2461

Merged
merged 2 commits into from
Sep 22, 2024
Merged

Conversation

kraj
Copy link
Contributor

@kraj kraj commented Aug 15, 2024

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

@infirit
Copy link
Contributor

infirit commented Aug 15, 2024

This broke the meson build, cannyou check.

Regardless, please use join_paths() to build paths in meson.

https://mesonbuild.com/Reference-manual_functions.html#join_paths

@infirit
Copy link
Contributor

infirit commented Aug 15, 2024

Also ideally we use mesons native cython support 1, but when I tried I ran into meson errors and put it on hold

1 https://mesonbuild.com/Cython.html

@kraj kraj force-pushed the main branch 2 times, most recently from 99f8cc8 to bd16da4 Compare August 26, 2024 18:34
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 <raj.khem@gmail.com>
@kraj kraj changed the title meson: DO not emit absolute path when S != B meson: Do not emit absolute path when S != B Aug 26, 2024
@kraj
Copy link
Contributor Author

kraj commented Aug 26, 2024

This broke the meson build, cannyou check.

Regardless, please use join_paths() to build paths in meson.

https://mesonbuild.com/Reference-manual_functions.html#join_paths

done.

@kraj
Copy link
Contributor Author

kraj commented Aug 26, 2024

This broke the meson build, cannyou check.

yeah I needed to make input relative to buildroot as well. Fixed now.

Regardless, please use join_paths() to build paths in meson.

https://mesonbuild.com/Reference-manual_functions.html#join_paths

Copy link

sonarcloud bot commented Sep 22, 2024

Copy link
Contributor

@infirit infirit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't break anything for me on Arch and CI is happy.

If this helps with reproducible builds ok with me.

@infirit infirit merged commit c07e8a4 into blueman-project:main Sep 22, 2024
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants