Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 759433 - meson.eclass - _meson_env_array calls python directly
Summary: meson.eclass - _meson_env_array calls python directly
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Mike Gilbert
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-12-11 02:04 UTC by cyrillic
Modified: 2023-05-08 03:23 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description cyrillic 2020-12-11 02:04:45 UTC
dev-lang/python-exec[-native-symlinks] breaks dev-util/meson because "python" is called directly.

Reproducible: Always

Actual Results:  
# emerge --oneshot games-board/gnome-mahjongg
Calculating dependencies... done!

>>> Verifying ebuild manifests

>>> Emerging (1 of 1) games-board/gnome-mahjongg-3.36.2::gentoo
 * gnome-mahjongg-3.36.2.tar.xz BLAKE2B SHA512 size ;-) ...                                                                  [ ok ]
>>> Unpacking source...
>>> Unpacking gnome-mahjongg-3.36.2.tar.xz to /tmp/portage/games-board/gnome-mahjongg-3.36.2/work
>>> Source unpacked in /tmp/portage/games-board/gnome-mahjongg-3.36.2/work
>>> Preparing source in /tmp/portage/games-board/gnome-mahjongg-3.36.2/work/gnome-mahjongg-3.36.2 ...
>>> Source prepared.
>>> Configuring source in /tmp/portage/games-board/gnome-mahjongg-3.36.2/work/gnome-mahjongg-3.36.2 ...
/tmp/portage/games-board/gnome-mahjongg-3.36.2/temp/environment: line 471: python: command not found
/tmp/portage/games-board/gnome-mahjongg-3.36.2/temp/environment: line 471: python: command not found
/tmp/portage/games-board/gnome-mahjongg-3.36.2/temp/environment: line 471: python: command not found
/tmp/portage/games-board/gnome-mahjongg-3.36.2/temp/environment: line 471: python: command not found
/tmp/portage/games-board/gnome-mahjongg-3.36.2/temp/environment: line 471: python: command not found
/tmp/portage/games-board/gnome-mahjongg-3.36.2/temp/environment: line 471: python: command not found
/tmp/portage/games-board/gnome-mahjongg-3.36.2/temp/environment: line 471: python: command not found
/tmp/portage/games-board/gnome-mahjongg-3.36.2/temp/environment: line 471: python: command not found
/tmp/portage/games-board/gnome-mahjongg-3.36.2/temp/environment: line 471: python: command not found
/tmp/portage/games-board/gnome-mahjongg-3.36.2/temp/environment: line 471: python: command not found
/tmp/portage/games-board/gnome-mahjongg-3.36.2/temp/environment: line 471: python: command not found
/tmp/portage/games-board/gnome-mahjongg-3.36.2/temp/environment: line 471: python: command not found
/tmp/portage/games-board/gnome-mahjongg-3.36.2/temp/environment: line 471: python: command not found
/tmp/portage/games-board/gnome-mahjongg-3.36.2/temp/environment: line 471: python: command not found
/tmp/portage/games-board/gnome-mahjongg-3.36.2/temp/environment: line 471: python: command not found
/tmp/portage/games-board/gnome-mahjongg-3.36.2/temp/environment: line 471: python: command not found
/tmp/portage/games-board/gnome-mahjongg-3.36.2/temp/environment: line 471: python: command not found
/tmp/portage/games-board/gnome-mahjongg-3.36.2/temp/environment: line 471: python: command not found
/tmp/portage/games-board/gnome-mahjongg-3.36.2/temp/environment: line 471: python: command not found
meson setup --buildtype plain --libdir lib64 --localstatedir /var/lib --prefix /usr --sysconfdir /etc --wrap-mode nodownload --build.pkg-config-path /tmp/portage/games-board/gnome-mahjongg-3.36.2/temp/pkgconfig:/usr/lib64/pkgconfig:/usr/share/pkgconfig:/usr/share/pkgconfig --pkg-config-path /tmp/portage/games-board/gnome-mahjongg-3.36.2/temp/pkgconfig:/usr/lib64/pkgconfig:/usr/share/pkgconfig:/usr/share/pkgconfig --native-file /tmp/portage/games-board/gnome-mahjongg-3.36.2/temp/meson.x86_64-pc-linux-gnu.amd64.ini /tmp/portage/games-board/gnome-mahjongg-3.36.2/work/gnome-mahjongg-3.36.2 /tmp/portage/games-board/gnome-mahjongg-3.36.2/work/gnome-mahjongg-3.36.2-build
Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/mesonbuild/mesonmain.py", line 140, in run
    return options.run_func(options)
  File "/usr/lib/python3.9/site-packages/mesonbuild/msetup.py", line 245, in run
    app.generate()
  File "/usr/lib/python3.9/site-packages/mesonbuild/msetup.py", line 154, in generate
    env = environment.Environment(self.source_dir, self.build_dir, self.options)
  File "/usr/lib/python3.9/site-packages/mesonbuild/environment.py", line 579, in __init__
    config = coredata.parse_machine_files(self.coredata.config_files)
  File "/usr/lib/python3.9/site-packages/mesonbuild/coredata.py", line 944, in parse_machine_files
    parser = MachineFileParser(filenames)
  File "/usr/lib/python3.9/site-packages/mesonbuild/coredata.py", line 899, in __init__
    self.sections[s] = self._parse_section(s)
  File "/usr/lib/python3.9/site-packages/mesonbuild/coredata.py", line 911, in _parse_section
    res = self._evaluate_statement(ast.lines[0])
IndexError: list index out of range
 * ERROR: games-board/gnome-mahjongg-3.36.2::gentoo failed (configure phase):
 *   (no error message)
 * 
 * Call stack:
 *     ebuild.sh, line  125:  Called src_configure
 *   environment, line 2688:  Called meson_src_configure
 *   environment, line 1956:  Called die
 * The specific snippet of code:
 *       "${mesonargs[@]}" ) || die
 * 


Other packages using meson give the same results.
Comment 1 Ionen Wolkens gentoo-dev 2020-12-11 02:12:38 UTC
It's going to break a lot of things, it's a flag more intended for internal testing.

Any reason it isn't in package.use.force like binutils/gcc-config's native-symlinks flags?
Comment 2 cyrillic 2020-12-11 02:22:38 UTC
(In reply to Ionen Wolkens from comment #1)
> It's going to break a lot of things ...

I think that is the plan.
Anyways, dev-util/meson should be one of the first ones to get fixed because it affects so many other packages.
Comment 3 Ionen Wolkens gentoo-dev 2020-12-11 02:30:11 UTC
(In reply to cyrillic from comment #2)
> (In reply to Ionen Wolkens from comment #1)
> > It's going to break a lot of things ...
> 
> I think that is the plan.
> Anyways, dev-util/meson should be one of the first ones to get fixed because
> it affects so many other packages.
I see, given summary started with python-exec it made it look like you were filling this against python-exec rather than meson.
Comment 4 Mike Gilbert gentoo-dev 2020-12-11 21:46:35 UTC
The issue seems to be in meson.eclass, specifically the _meson_env_array function which calls python directly.

I don't really have any intention of "fixing" this unless someone comes up with a clever solution.
Comment 5 Mike Gilbert gentoo-dev 2020-12-11 23:20:05 UTC
We could solve this by installing a python-exec compatible script instead of calling python with an inline program.

Patch sent to gentoo-dev for review.
Comment 6 William Hubbs gentoo-dev 2020-12-20 19:44:39 UTC
As I said on the ml, I'm strongly against this use flag in
dev-lang/python-exec unless upstream python is going the way of
removing /usr/bin/python from its native builds. If upstream python is
not doing this, we shouldn't in Gentoo either.

On the other hand, if they are moving toward this, I agree we should
start figuring out a plan.
Comment 7 Larry the Git Cow gentoo-dev 2020-12-28 22:38:31 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=496198d0ab1971e26e01129cff736fb4073739b8

commit 496198d0ab1971e26e01129cff736fb4073739b8
Author:     Mike Gilbert <floppym@gentoo.org>
AuthorDate: 2020-12-28 22:24:09 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2020-12-28 22:34:16 +0000

    meson.eclass: use meson-format-array
    
    Closes: https://bugs.gentoo.org/759433
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>

 eclass/meson.eclass | 19 ++++---------------
 1 file changed, 4 insertions(+), 15 deletions(-)

Additionally, it has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3e391ef7abaf60b6a6966121a586b6e69b43f080

commit 3e391ef7abaf60b6a6966121a586b6e69b43f080
Author:     Mike Gilbert <floppym@gentoo.org>
AuthorDate: 2020-12-28 22:22:14 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2020-12-28 22:32:58 +0000

    dev-util/meson-format-array: new package
    
    Bug: https://bugs.gentoo.org/759433
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>

 .../meson-format-array/files/meson-format-array    | 24 ++++++++++++++++++++++
 .../meson-format-array/meson-format-array-0.ebuild | 22 ++++++++++++++++++++
 dev-util/meson-format-array/metadata.xml           |  8 ++++++++
 3 files changed, 54 insertions(+)