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

Bad interaction with cross file and find_program() #3737

Closed
rossburton opened this issue Jun 12, 2018 · 0 comments
Closed

Bad interaction with cross file and find_program() #3737

rossburton opened this issue Jun 12, 2018 · 0 comments

Comments

@rossburton
Copy link
Contributor

rossburton commented Jun 12, 2018

Because it's generated, my cross file often contains arguments to commands. To make things easier, all items are written as lists. For example:

[binaries]
nm = ['my-nm']

I believe this is fine because we've done this for a while to pass CFLAGS and so on.

However if meson.build does find_program('nm').path(), you get a exception from inside posixpath.

| Traceback (most recent call last):
|   File "/data/poky-tmp/master/work/corei7-64-poky-linux/libdrm/2.4.92-r0/recipe-sysroot-native/usr/lib/python3.5/site-packages/mesonbuild/mesonmain.py", line 376, in run
|     app.generate()
|   File "/data/poky-tmp/master/work/corei7-64-poky-linux/libdrm/2.4.92-r0/recipe-sysroot-native/usr/lib/python3.5/site-packages/mesonbuild/mesonmain.py", line 134, in generate
|     self._generate(env)
|   File "/data/poky-tmp/master/work/corei7-64-poky-linux/libdrm/2.4.92-r0/recipe-sysroot-native/usr/lib/python3.5/site-packages/mesonbuild/mesonmain.py", line 185, in _generate
|     intr.run()
|   File "/data/poky-tmp/master/work/corei7-64-poky-linux/libdrm/2.4.92-r0/recipe-sysroot-native/usr/lib/python3.5/site-packages/mesonbuild/interpreter.py", line 3261, in run
|     super().run()
|   File "/data/poky-tmp/master/work/corei7-64-poky-linux/libdrm/2.4.92-r0/recipe-sysroot-native/usr/lib/python3.5/site-packages/mesonbuild/interpreterbase.py", line 215, in run
|     self.evaluate_codeblock(self.ast, start=1)
|   File "/data/poky-tmp/master/work/corei7-64-poky-linux/libdrm/2.4.92-r0/recipe-sysroot-native/usr/lib/python3.5/site-packages/mesonbuild/interpreterbase.py", line 239, in evaluate_codeblock
|     raise e
|   File "/data/poky-tmp/master/work/corei7-64-poky-linux/libdrm/2.4.92-r0/recipe-sysroot-native/usr/lib/python3.5/site-packages/mesonbuild/interpreterbase.py", line 231, in evaluate_codeblock
|     self.evaluate_statement(cur)
|   File "/data/poky-tmp/master/work/corei7-64-poky-linux/libdrm/2.4.92-r0/recipe-sysroot-native/usr/lib/python3.5/site-packages/mesonbuild/interpreterbase.py", line 248, in evaluate_statement
|     return self.method_call(cur)
|   File "/data/poky-tmp/master/work/corei7-64-poky-linux/libdrm/2.4.92-r0/recipe-sysroot-native/usr/lib/python3.5/site-packages/mesonbuild/interpreterbase.py", line 529, in method_call
|     (args, kwargs) = self.reduce_arguments(args)
|   File "/data/poky-tmp/master/work/corei7-64-poky-linux/libdrm/2.4.92-r0/recipe-sysroot-native/usr/lib/python3.5/site-packages/mesonbuild/interpreterbase.py", line 688, in reduce_arguments
|     reduced_pos = [self.evaluate_statement(arg) for arg in args.arguments]
|   File "/data/poky-tmp/master/work/corei7-64-poky-linux/libdrm/2.4.92-r0/recipe-sysroot-native/usr/lib/python3.5/site-packages/mesonbuild/interpreterbase.py", line 688, in <listcomp>
|     reduced_pos = [self.evaluate_statement(arg) for arg in args.arguments]
|   File "/data/poky-tmp/master/work/corei7-64-poky-linux/libdrm/2.4.92-r0/recipe-sysroot-native/usr/lib/python3.5/site-packages/mesonbuild/interpreterbase.py", line 248, in evaluate_statement
|     return self.method_call(cur)
|   File "/data/poky-tmp/master/work/corei7-64-poky-linux/libdrm/2.4.92-r0/recipe-sysroot-native/usr/lib/python3.5/site-packages/mesonbuild/interpreterbase.py", line 514, in method_call
|     obj = self.evaluate_statement(invokable)
|   File "/data/poky-tmp/master/work/corei7-64-poky-linux/libdrm/2.4.92-r0/recipe-sysroot-native/usr/lib/python3.5/site-packages/mesonbuild/interpreterbase.py", line 244, in evaluate_statement
|     return self.function_call(cur)
|   File "/data/poky-tmp/master/work/corei7-64-poky-linux/libdrm/2.4.92-r0/recipe-sysroot-native/usr/lib/python3.5/site-packages/mesonbuild/interpreterbase.py", line 504, in function_call
|     return func(node, posargs, kwargs)
|   File "/data/poky-tmp/master/work/corei7-64-poky-linux/libdrm/2.4.92-r0/recipe-sysroot-native/usr/lib/python3.5/site-packages/mesonbuild/interpreterbase.py", line 99, in wrapped
|     return f(s, node_or_state, args, kwargs)
|   File "/data/poky-tmp/master/work/corei7-64-poky-linux/libdrm/2.4.92-r0/recipe-sysroot-native/usr/lib/python3.5/site-packages/mesonbuild/interpreter.py", line 2417, in func_find_program
|     return self.find_program_impl(args, native=use_native, required=required, silent=False)
|   File "/data/poky-tmp/master/work/corei7-64-poky-linux/libdrm/2.4.92-r0/recipe-sysroot-native/usr/lib/python3.5/site-packages/mesonbuild/interpreter.py", line 2396, in find_program_impl
|     progobj = self.program_from_cross_file(args, silent=silent)
|   File "/data/poky-tmp/master/work/corei7-64-poky-linux/libdrm/2.4.92-r0/recipe-sysroot-native/usr/lib/python3.5/site-packages/mesonbuild/interpreter.py", line 2335, in program_from_cross_file
|     extprog = dependencies.ExternalProgram(exename, silent=silent)
|   File "/data/poky-tmp/master/work/corei7-64-poky-linux/libdrm/2.4.92-r0/recipe-sysroot-native/usr/lib/python3.5/site-packages/mesonbuild/dependencies/base.py", line 747, in __init__
|     self.command = self._search(name, search_dir)
|   File "/data/poky-tmp/master/work/corei7-64-poky-linux/libdrm/2.4.92-r0/recipe-sysroot-native/usr/lib/python3.5/site-packages/mesonbuild/dependencies/base.py", line 881, in _search
|     command = shutil.which(name)
|   File "/data/poky-tmp/master/work/corei7-64-poky-linux/libdrm/2.4.92-r0/recipe-sysroot-native/usr/lib/python3.5/shutil.py", line 1110, in which
|     if os.path.dirname(cmd):
|   File "/data/poky-tmp/master/work/corei7-64-poky-linux/libdrm/2.4.92-r0/recipe-sysroot-native/usr/lib/python3.5/posixpath.py", line 148, in dirname
|     i = p.rfind(sep) + 1
| AttributeError: 'list' object has no attribute 'rfind'

Changing the cross to be nm = "my-nm" works fine, but I suspect this is a workaround and not a fix.

halstead pushed a commit to openembedded/openembedded-core that referenced this issue Jun 16, 2018
There's a bug in Meson[1] where it find_program("foo") will fail if foo is
defined in the cross file as a list.

This is causing the Meson build of libdrm to fail, but for this instance we can
work around the problem by only using lists in the cross file if there are
arguments, and just using a string if there are not.

[1] mesonbuild/meson#3737

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
gbionescu pushed a commit to gbionescu/poky that referenced this issue Jun 16, 2018
There's a bug in Meson[1] where it find_program("foo") will fail if foo is
defined in the cross file as a list.

This is causing the Meson build of libdrm to fail, but for this instance we can
work around the problem by only using lists in the cross file if there are
arguments, and just using a string if there are not.

[1] mesonbuild/meson#3737

(From OE-Core rev: d50a50e3e09f02cb90fe5e80cd6233a84bf69f90)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
kraj pushed a commit to YoeDistro/poky-old that referenced this issue Jun 16, 2018
There's a bug in Meson[1] where it find_program("foo") will fail if foo is
defined in the cross file as a list.

This is causing the Meson build of libdrm to fail, but for this instance we can
work around the problem by only using lists in the cross file if there are
arguments, and just using a string if there are not.

[1] mesonbuild/meson#3737

(From OE-Core rev: d50a50e3e09f02cb90fe5e80cd6233a84bf69f90)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
halstead pushed a commit to openembedded/openembedded-core that referenced this issue Jun 16, 2018
There's a bug in Meson[1] where it find_program("foo") will fail if foo is
defined in the cross file as a list.

This is causing the Meson build of libdrm to fail, but for this instance we can
work around the problem by only using lists in the cross file if there are
arguments, and just using a string if there are not.

[1] mesonbuild/meson#3737

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
gbionescu pushed a commit to gbionescu/poky that referenced this issue Jun 16, 2018
There's a bug in Meson[1] where it find_program("foo") will fail if foo is
defined in the cross file as a list.

This is causing the Meson build of libdrm to fail, but for this instance we can
work around the problem by only using lists in the cross file if there are
arguments, and just using a string if there are not.

[1] mesonbuild/meson#3737

(From OE-Core rev: 928a7e26f254eb2da20bd917e83ed5467323de13)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
gbionescu pushed a commit to gbionescu/poky that referenced this issue Jun 17, 2018
There's a bug in Meson[1] where it find_program("foo") will fail if foo is
defined in the cross file as a list.

This is causing the Meson build of libdrm to fail, but for this instance we can
work around the problem by only using lists in the cross file if there are
arguments, and just using a string if there are not.

[1] mesonbuild/meson#3737

(From OE-Core rev: 928a7e26f254eb2da20bd917e83ed5467323de13)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
gbionescu pushed a commit to gbionescu/poky that referenced this issue Jun 17, 2018
There's a bug in Meson[1] where it find_program("foo") will fail if foo is
defined in the cross file as a list.

This is causing the Meson build of libdrm to fail, but for this instance we can
work around the problem by only using lists in the cross file if there are
arguments, and just using a string if there are not.

[1] mesonbuild/meson#3737

(From OE-Core rev: 928a7e26f254eb2da20bd917e83ed5467323de13)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
gbionescu pushed a commit to gbionescu/poky that referenced this issue Jun 17, 2018
There's a bug in Meson[1] where it find_program("foo") will fail if foo is
defined in the cross file as a list.

This is causing the Meson build of libdrm to fail, but for this instance we can
work around the problem by only using lists in the cross file if there are
arguments, and just using a string if there are not.

[1] mesonbuild/meson#3737

(From OE-Core rev: 928a7e26f254eb2da20bd917e83ed5467323de13)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
@nirbheek nirbheek self-assigned this Jun 18, 2018
@nirbheek nirbheek added this to the meson-next milestone Jun 18, 2018
halstead pushed a commit to openembedded/openembedded-core that referenced this issue Jun 18, 2018
There's a bug in Meson[1] where it find_program("foo") will fail if foo is
defined in the cross file as a list.

This is causing the Meson build of libdrm to fail, but for this instance we can
work around the problem by only using lists in the cross file if there are
arguments, and just using a string if there are not.

[1] mesonbuild/meson#3737

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
gbionescu pushed a commit to gbionescu/poky that referenced this issue Jun 18, 2018
There's a bug in Meson[1] where it find_program("foo") will fail if foo is
defined in the cross file as a list.

This is causing the Meson build of libdrm to fail, but for this instance we can
work around the problem by only using lists in the cross file if there are
arguments, and just using a string if there are not.

[1] mesonbuild/meson#3737

(From OE-Core rev: 7fd8bc469c2caacc1c2021bd0aa83dd6da7fe1e7)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
jpuhlman pushed a commit to MontaVista-OpenSourceTechnology/poky that referenced this issue Jun 19, 2018
Source: poky
MR: 00000
Type: Integration
Disposition: Merged from poky
ChangeID: c76ca2c
Description:

There's a bug in Meson[1] where it find_program("foo") will fail if foo is
defined in the cross file as a list.

This is causing the Meson build of libdrm to fail, but for this instance we can
work around the problem by only using lists in the cross file if there are
arguments, and just using a string if there are not.

[1] mesonbuild/meson#3737

(From OE-Core rev: 7fd8bc469c2caacc1c2021bd0aa83dd6da7fe1e7)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Jeremy Puhlman <jpuhlman@mvista.com>
nirbheek added a commit that referenced this issue Jun 29, 2018
This is accepted by all other binaries in the cross file. With this
change, we also don't check whether the specified command exists at
configure time, but that's probably a feature anyway.

Fixes #3737
nirbheek added a commit that referenced this issue Jun 29, 2018
This is accepted by all other binaries in the cross file. With this
change, we also don't check whether the specified command exists at
configure time, but that's probably a feature anyway.

Fixes #3737
nirbheek added a commit that referenced this issue Jun 29, 2018
This is accepted by all other binaries in the cross file. With this
change, we also don't check whether the specified command exists at
configure time, but that's probably a feature anyway.

Fixes #3737
nirbheek added a commit that referenced this issue Jun 29, 2018
This is accepted by all other binaries in the cross file. With this
change, we also don't check whether the specified command exists at
configure time, but that's probably a feature anyway.

Fixes #3737
nirbheek added a commit that referenced this issue Jul 1, 2018
This is accepted by all other binaries in the cross file. With this
change, we also don't check whether the specified command exists at
configure time, but that's probably a feature anyway.

Fixes #3737
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants