Meson 0.44.0 is broken with guix.

  • Done
  • quality assurance status badge
Details
7 participants
  • Hartmut Goebel
  • Ludovic Courtès
  • Tobias Geerinckx-Rice
  • Peter Mikkelsen
  • Ricardo Wurmus
  • Fis Trivial
  • zimoun
Owner
unassigned
Submitted by
Fis Trivial
Severity
normal
Blocked by
F
F
Fis Trivial wrote on 23 Dec 2017 20:18
(name . bug-guix@gnu.org)(address . bug-guix@gnu.org)
MWHPR16MB00636D599AA2B8CDFD06770092030@MWHPR16MB0063.namprd16.prod.outlook.com
I installed meson with command `guix package -i meson`
* Error:
$ meson --version
Traceback (most recent call last):
  File
"/gnu/store/n53zdnl4l3gm9sg15bfwxp0wdrwrvhg4-meson-0.44.0/bin/.meson-real",
line 17, in <module>
    from mesonbuild import mesonmain, mesonlib
  File
"/gnu/store/n53zdnl4l3gm9sg15bfwxp0wdrwrvhg4-meson-0.44.0/lib/python3.5/site-packages/mesonbuild/mesonmain.py",
line 18, in <module>
    from . import environment, interpreter, mesonlib
  File
"/gnu/store/n53zdnl4l3gm9sg15bfwxp0wdrwrvhg4-meson-0.44.0/lib/python3.5/site-packages/mesonbuild/environment.py",
line 17, in <module>
    from . import coredata
  File
"/gnu/store/n53zdnl4l3gm9sg15bfwxp0wdrwrvhg4-meson-0.44.0/lib/python3.5/site-packages/mesonbuild/coredata.py",
line 20, in <module>
    from .mesonlib import MesonException, commonpath
  File
"/gnu/store/n53zdnl4l3gm9sg15bfwxp0wdrwrvhg4-meson-0.44.0/lib/python3.5/site-packages/mesonbuild/mesonlib.py",
line 60, in <module>
    meson_command = python_command + [detect_meson_py_location()]
  File
"/gnu/store/n53zdnl4l3gm9sg15bfwxp0wdrwrvhg4-meson-0.44.0/lib/python3.5/site-packages/mesonbuild/mesonlib.py",
line 51, in detect_meson_py_location
    raise RuntimeError('Could not determine how to run Meson. Please
file a bug with details.')
RuntimeError: Could not determine how to run Meson. Please file a bug
with details.
I'm currently using Guix on top of Fedora 26. The installed version of
meson is 0.44.0.
* Possible cause:
From /mesonlib.py/: line 47~51, we have:
#+BEGIN_BLOCK python
    # The only thing remaining is to try to find the bundled executable and
    # pray distro packagers have not moved it.
    fname = os.path.join(os.path.dirname(__file__), '..', 'meson.py')
    if not os.path.exists(fname):
        raise RuntimeError('Could not determine how to run Meson.
Please file a bug with details.')
#+END_BLOCK
which means meson will try to find the meson.py script at startup, but
it seems Guix has renamed the this file with the new file name
*.meson-real* and warp it with a shell script /meson/ in bin.
H
H
Hartmut Goebel wrote on 2 Jan 2018 16:52
(address . 29824@debbugs.gnu.org)
1a5a9106-e648-11ef-9880-8157eb1399f0@crazy-compilers.com
We need to have a look at the whole `detect_meson_py_location()`, not
only on lines 47 to 51.

detect_meson_py_location() assumes the executable to be called "meson"
or "meson.py", but in guix it currently is called ".meson-real" (see teh
first entry in the trace-back).

The solution would be to get rid of the wrapper-scripts, see

A work-around would be to substitute in file mesonbuild/mesonlib.py

meson_command = python_command + [detect_meson_py_location()]

by

meson_command = python_command + ["$OUT/bin/meson"]

(you got the idea, I assume). Of course we should verify
detect_meson_py_location() is not used elsewhere and consider renaming
that function to "disable" it.

--
Regards
Hartmut Goebel

| Hartmut Goebel | h.goebel@crazy-compilers.com |
| www.crazy-compilers.com | compilers which you thought are impossible |
Attachment: file
L
L
Ludovic Courtès wrote on 9 Jan 2018 13:46
Re: bug#29824: Meson 0.44.0 is broken with guix.
(name . Hartmut Goebel)(address . h.goebel@crazy-compilers.com)
87bmi3td28.fsf@gnu.org
Hi Hartmut,

Hartmut Goebel <h.goebel@crazy-compilers.com> skribis:

Toggle quote (18 lines)
> We need to have a look at the whole `detect_meson_py_location()`, not
> only on lines 47 to 51.
>
> detect_meson_py_location() assumes the executable to be called "meson"
> or "meson.py", but in guix it currently is called ".meson-real" (see teh
> first entry in the trace-back).
>
> The solution would be to get rid of the wrapper-scripts, see
> <https://lists.gnu.org/archive/html/guix-devel/2017-11/msg00041.html>
>
> A work-around would be to substitute in file mesonbuild/mesonlib.py
>
> meson_command = python_command + [detect_meson_py_location()]
>
> by
>
> meson_command = python_command + ["$OUT/bin/meson"]

Sounds reasonable. Does it work for you? If so, could you provide a
patch?

Ludo’.
H
H
Hartmut Goebel wrote on 9 Jan 2018 22:10
(name . Ludovic Courtès)(address . ludo@gnu.org)
37507911-49f5-5c6a-b763-8190b4920c6d@crazy-compilers.com
Am 09.01.2018 um 13:46 schrieb Ludovic Courtès:
Toggle quote (3 lines)
> Sounds reasonable. Does it work for you? If so, could you provide a
> patch?

I don't have any cards in this game and not time for working on it ATM,
I just did the analysis.

@peter: What about you?

--
Regards
Hartmut Goebel

| Hartmut Goebel | h.goebel@crazy-compilers.com |
| www.crazy-compilers.com | compilers which you thought are impossible |
P
P
Peter Mikkelsen wrote on 10 Jan 2018 00:34
(name . Hartmut Goebel)(address . h.goebel@crazy-compilers.com)
CADh9keVoOtrqkmddu4qTb1r=ePpVo9rHNJh1hawFfbAfAyNrrw@mail.gmail.com
Hi,

Den 9. jan. 2018 22.10 skrev "Hartmut Goebel" <h.goebel@crazy-compilers.com
Toggle quote (2 lines)
>:

Am 09.01.2018 um 13:46 schrieb Ludovic Courtès:
Toggle quote (3 lines)
> Sounds reasonable. Does it work for you? If so, could you provide a
> patch?

I don't have any cards in this game and not time for working on it ATM,
I just did the analysis.

@peter: What about you?




I am sorry to let you down, but I dont have any time for developing on guix
at the moment :/ and by the way, I am not, and have never considered myself
a user of meson, I just wanted the buildsystem in guix because I noticed
that gnome was starting to use it :)

-- Peter Mikkelsen
Attachment: file
F
F
Fis Trivial wrote on 14 Jan 2018 21:06
MWHPR16MB0063F14C8855B9FCD9A921E392150@MWHPR16MB0063.namprd16.prod.outlook.com
Toggle quote (21 lines)
>>
>> detect_meson_py_location() assumes the executable to be called "meson"
>> or "meson.py", but in guix it currently is called ".meson-real" (see teh
>> first entry in the trace-back).
>>
>> The solution would be to get rid of the wrapper-scripts, see
>> <https://lists.gnu.org/archive/html/guix-devel/2017-11/msg00041.html>
>>
>> A work-around would be to substitute in file mesonbuild/mesonlib.py
>>
>> meson_command = python_command + [detect_meson_py_location()]
>>
>> by
>>
>> meson_command = python_command + ["$OUT/bin/meson"]
>
> Sounds reasonable. Does it work for you? If so, could you provide a
> patch?
>
> Ludo’.
>
Or in this case, python script, we can change the wrapper script into something
like this:
#+BEGIN_SRC python
import os
os.environ['PYTHONPATH']="/gnu/store/.../site-packages${PYTHONPATH:+:}$PYTHONPATH"
exec(open("/gnu/store/n53zdnl4l3gm9sg15bfwxp0wdrwrvhg4-meson-0.44.0/bin/.meson-real").read())
#+END_SRC
or
#+BEGIN_SRC python
import os
os.environ['PYTHONPATH']="/gnu/store/.../site-packages${PYTHONPATH:+:}$PYTHONPATH"
exec(compile(
open(
"/gnu/store/n53zdnl4l3gm9sg15bfwxp0wdrwrvhg4-meson-0.44.0/bin/.meson-real".read(),
"/gnu/store/n53zdnl4l3gm9sg15bfwxp0wdrwrvhg4-meson-0.44.0/bin/.meson-real",
'exec'
)))
#+END_SRC
F
F
Fis Trivial wrote on 14 Jan 2018 21:14
MWHPR16MB0063D026A9C64FF5E5F56C5292150@MWHPR16MB0063.namprd16.prod.outlook.com
Toggle quote (13 lines)
> or
>
> #+BEGIN_SRC python
> import os
> os.environ['PYTHONPATH']="/gnu/store/.../site-packages${PYTHONPATH:+:}$PYTHONPATH"
> exec(compile(
> open(
> "/gnu/store/n53zdnl4l3gm9sg15bfwxp0wdrwrvhg4-meson-0.44.0/bin/.meson-real".read(),
> "/gnu/store/n53zdnl4l3gm9sg15bfwxp0wdrwrvhg4-meson-0.44.0/bin/.meson-real",
> 'exec'
> )))
> #+END_SRC
>
Sorry about that, this section is wrong. Here is the correct one. Be careful with the "..."
in the environ assignment. I omitted part of the path due to it's too long.
#+BEGIN_SRC python
#!/usr/bin/env python3
import os
os.environ['PYTHONPATH'] = "/gnu/store/.../site-packages${PYTHONPATH:+:}$PYTHONPATH"
# exec(open("/gnu/store/n53zdnl4l3gm9sg15bfwxp0wdrwrvhg4-meson-0.44.0/bin/.meson-real").read())
exec(compile(
open(
"/gnu/store/n53zdnl4l3gm9sg15bfwxp0wdrwrvhg4-meson-0.44.0/bin/.meson-real"
).read(),
"/gnu/store/n53zdnl4l3gm9sg15bfwxp0wdrwrvhg4-meson-0.44.0/bin/.meson-real",
'exec'
))
#+END_SRC
And the wrapper should be named as "meson", in this case.
The above code set the environment variables and execute the corresponding code
by loading it(not spawning a new process). Hence the argv will be preserved.
L
L
Ludovic Courtès wrote on 14 Jan 2018 23:02
(name . Fis Trivial)(address . ybbs.daans@hotmail.com)
87a7xgjdzr.fsf@gnu.org
Hello,

Fis Trivial <ybbs.daans@hotmail.com> skribis:

Toggle quote (22 lines)
> Sorry about that, this section is wrong. Here is the correct one. Be careful with the "..."
> in the environ assignment. I omitted part of the path due to it's too long.
>
> #+BEGIN_SRC python
> #!/usr/bin/env python3
> import os
> os.environ['PYTHONPATH'] = "/gnu/store/.../site-packages${PYTHONPATH:+:}$PYTHONPATH"
> # exec(open("/gnu/store/n53zdnl4l3gm9sg15bfwxp0wdrwrvhg4-meson-0.44.0/bin/.meson-real").read())
> exec(compile(
> open(
> "/gnu/store/n53zdnl4l3gm9sg15bfwxp0wdrwrvhg4-meson-0.44.0/bin/.meson-real"
> ).read(),
> "/gnu/store/n53zdnl4l3gm9sg15bfwxp0wdrwrvhg4-meson-0.44.0/bin/.meson-real",
> 'exec'
> ))
>
> #+END_SRC
>
> And the wrapper should be named as "meson", in this case.
> The above code set the environment variables and execute the corresponding code
> by loading it(not spawning a new process). Hence the argv will be preserved.

Sure, though Hartmut’s solution looked even simpler.

BTW, Ricardo has posted a patch on this topic here:


We could use it here (it won’t be merged until the next ‘core-updates’
cycle), but if there’s a simpler solution, we should probably go for
that.

Thanks,
Ludo’.
R
R
Ricardo Wurmus wrote on 4 Feb 2019 09:34
control message for bug #29824
(address . control@debbugs.gnu.org)
168b7a530bf.6c123492-1929141092.-7906724368339708670@zoho.com
block 29824 by 29951
R
R
Ricardo Wurmus wrote on 4 Feb 2019 09:02
control message for bug #29951
(address . control@debbugs.gnu.org)
168b78764c2.7307dec41255821358.-6686512393397758191@zoho.com
block 29951 by 29824
R
R
Ricardo Wurmus wrote on 4 Feb 2019 11:29
control message for bug #29824
(address . control@debbugs.gnu.org)
168b80f4d46.4e38f3fb-540430156.7945528783842604060@zoho.com
unblock 29824 by 29951
R
R
Ricardo Wurmus wrote on 4 Feb 2019 11:31
control message for bug #29951
(address . control@debbugs.gnu.org)
168b8107ef7.213235a9311363538.-800503255172129691@zoho.com
unblock 29951 by 29824
R
R
Ricardo Wurmus wrote on 4 Feb 2019 11:31
control message for bug #29824
(address . control@debbugs.gnu.org)
168b8104fcb.745c4eff1000524141.2903290622000671690@zoho.com
block 29824 by 29951
Z
Z
zimoun wrote on 28 Sep 2020 15:00
Re: bug#29824: Meson 0.44.0 is broken with guix.
(name . Fis Trivial)(address . ybbs.daans@hotmail.com)(address . 29824@debbugs.gnu.org)
875z7y3vkp.fsf@gmail.com
Dear,

On Sat, 23 Dec 2017 at 19:18, Fis Trivial <ybbs.daans@hotmail.com> wrote:
Toggle quote (8 lines)
> I installed meson with command `guix package -i meson`
>
> * Error:
> $ meson --version
>
> Traceback (most recent call last):
>   File

[...]

Toggle quote (3 lines)
> RuntimeError: Could not determine how to run Meson. Please file a bug
> with details.

Using Guix on the top of Debian and running:

Toggle snippet (4 lines)
guix environment -C --ad-hoc meson
meson --version

works for me with Guix 73e7a42. Is it still an issue for you?

Since the commit 0fb9a8df429a7b9f40610ff15baaff0d8e31e8cf is merged on
master – if I read correctly – the issue should be fixed.

What is the status of this bug?


All the best,
simon
T
T
Tobias Geerinckx-Rice wrote on 30 Nov 2020 17:14
Meson 0.44.0 is broken with guix.
(address . 29824-done@debbugs.gnu.org)
87r1oayg7f.fsf@nckx
Meson 0.44.0 is long gone and 0.55 works fine:

~ λ guix environment --{ad-hoc,pure} meson -- meson --version
0.55.1

Closing this fixed old bug,

T G-R
-----BEGIN PGP SIGNATURE-----

iIMEARYKACsWIQT12iAyS4c9C3o4dnINsP+IT1VteQUCX8UadA0cbWVAdG9iaWFz
LmdyAAoJEA2w/4hPVW150C0BANyFT5q5oFhPWaCXQuggnzUGWkoHoPaBNW3kuNcE
zj9nAP4sxWB9drsAdmehOdAGgTOuZga5RINZuBJuejX2wGE0Dw==
=gEVK
-----END PGP SIGNATURE-----

Closed
?