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

Cannot convert file objects to string since cec3edc08a6cd6a89761c49292ba6a3bace8b3c1 #12259

Closed
medhefgo opened this issue Sep 15, 2023 · 4 comments · Fixed by #12289 · May be fixed by #12287
Closed

Cannot convert file objects to string since cec3edc08a6cd6a89761c49292ba6a3bace8b3c1 #12259

medhefgo opened this issue Sep 15, 2023 · 4 comments · Fixed by #12289 · May be fixed by #12287

Comments

@medhefgo
Copy link
Contributor

cec3edc will break systemd once released and it's even failing on your own test cases (which is pretty much what systemd is doing). It seems that CI tests are either not working properly or results are not checked before committing.

(master =) $ ./meson.py setup --fatal-meson-warnings --wipe test\ cases/linuxlike/3\ linker\ script/ /tmp/meson-bug
The Meson build system
Version: 1.2.99
Source dir: /home/medhefgo/meson/test cases/linuxlike/3 linker script
Build dir: /tmp/meson-bug
Build type: native build
Project name: linker script
Project version: undefined
C compiler for the host machine: sccache cc (gcc 13.2.1 "cc (GCC) 13.2.1 20230801")
C linker for the host machine: cc ld.bfd 2.41.0
Host machine cpu family: x86_64
Host machine cpu: x86_64
Configuring bob-conf.map using configuration
test cases/linuxlike/3 linker script/meson.build:25: DEPRECATION: Project uses feature that was always broken, and is now deprecated since '1.3.0': str.format: Value other than strings, integers, bools, options, dictionaries and lists thereof..

test cases/linuxlike/3 linker script/meson.build:25:35: ERROR: Fatal warnings enabled, aborting

A full log can be found at /tmp/meson-bug/meson-logs/meson-log.txt
@tristan957
Copy link
Contributor

We don't run the CI with --fatal-meson-warnings

@dcbaker
Copy link
Member

dcbaker commented Sep 25, 2023

I'm assuming that what systemd is doing is something like:

build_target(
  ...
  link_args : ['--linker-script=', '@0@'.format(files('foo.sym')[0])],
)

This was a misfeature, and doesn't work reliably. It won't break unless you're running with fatal warnings. But we should have a solution for this, which we've been discussing anyway.

@dcbaker
Copy link
Member

dcbaker commented Sep 25, 2023

I've opened #12287 to try to address this problem

@eli-schwartz
Copy link
Member

even failing on your own test cases (which is pretty much what systemd is doing)

Good, because our own test cases are incorrect and broken and what they suggest to do does not work. People who think to copy our test case are in for worlds of pain if they actually try to use it.

nirbheek pushed a commit that referenced this issue Sep 28, 2023
This has never, ever, ever worked. You can get away with it a tiny, tiny
bit, iff you magically assume several things about both internal
implementations, as well as the project source layout and builddir
location.

This can be witnessed by the way using files() was mercilessly tortured
through joining the undefined stringified format value of the file to
the current source dir... because it didn't actually *work*, the
stringified value isn't an absolute path or a builddir-relative one, but
it works as long as you do it from the root meson.build file.

Furthermore, this triggers a deprecation warning if you do it. And using
it for files() is frivolous, the "static map file" case was correct all
along.

Fix the configure_file case to demonstrate the same painful hoops we
must jump through to get custom_target outputs to work correctly.

Fixes #12259
nirbheek pushed a commit that referenced this issue Sep 28, 2023
This has never, ever, ever worked. You can get away with it a tiny, tiny
bit, iff you magically assume several things about both internal
implementations, as well as the project source layout and builddir
location.

This can be witnessed by the way using files() was mercilessly tortured
through joining the undefined stringified format value of the file to
the current source dir... because it didn't actually *work*, the
stringified value isn't an absolute path or a builddir-relative one, but
it works as long as you do it from the root meson.build file.

Furthermore, this triggers a deprecation warning if you do it. And using
it for files() is frivolous, the "static map file" case was correct all
along.

Fix the configure_file case to demonstrate the same painful hoops we
must jump through to get custom_target outputs to work correctly.

Fixes #12259
robtaylor pushed a commit to robtaylor/meson that referenced this issue Oct 14, 2023
This has never, ever, ever worked. You can get away with it a tiny, tiny
bit, iff you magically assume several things about both internal
implementations, as well as the project source layout and builddir
location.

This can be witnessed by the way using files() was mercilessly tortured
through joining the undefined stringified format value of the file to
the current source dir... because it didn't actually *work*, the
stringified value isn't an absolute path or a builddir-relative one, but
it works as long as you do it from the root meson.build file.

Furthermore, this triggers a deprecation warning if you do it. And using
it for files() is frivolous, the "static map file" case was correct all
along.

Fix the configure_file case to demonstrate the same painful hoops we
must jump through to get custom_target outputs to work correctly.

Fixes mesonbuild#12259
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants