Bug 412477 - meson support not working when meson is a symlink
Summary: meson support not working when meson is a symlink
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: Build tools: Meson (show other bugs)
Version: 5.6.1
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-09-30 10:26 UTC by Manuel Mommertz
Modified: 2021-12-05 09:03 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.8.220400


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Manuel Mommertz 2019-09-30 10:26:17 UTC
When I try to use meson with kdevelop I always get error messages like:

/home/../project> /usr/lib64/python-exec/python-exec2 --reconfigure /home/../project/build
/usr/lib64/python-exec/python-exec2: python-exec2 is a wrapper, it must not be run directly.
*** Failure: Exit code 127 ***

The problem arises because kdevelop seems to resolve symlinks itself before running the corresponding executable. But on gentoo systems python-scripts are all symlinks to python-exec. When kdevelop resolves the symlink /usr/bin/meson->/usr/lib64/python-exec/python-exec2 the original name is lost and python-exec doesn't know that to do.

Solutions:
Kdevelop shouldn't resolve the symlink itself.
Comment 1 Ihor Antonov 2020-12-13 00:28:37 UTC
End of year 2020
The problem still exists.

Gentoo 

/usr/lib/python-exec/python-exec2 --backend ninja /home/.../project/build
/usr/lib/python-exec/python-exec2: python-exec2 is a wrapper, it must not be run directly
*** Failure: Exit code 127 ***
Comment 2 Petros 2020-12-19 11:10:03 UTC
(In reply to Ihor Antonov from comment #1)
> End of year 2020
> The problem still exists.
> 
> Gentoo 
> 
> /usr/lib/python-exec/python-exec2 --backend ninja /home/.../project/build
> /usr/lib/python-exec/python-exec2: python-exec2 is a wrapper, it must not be
> run directly
> *** Failure: Exit code 127 ***

Same here, I am using KDevelop-5.6.1, meson-0.55.3 and I am getting the same error.

Is there any temporary workaround?
Comment 3 Ihor Antonov 2020-12-19 17:32:09 UTC
(In reply to Petros from comment #2)
> (In reply to Ihor Antonov from comment #1)
> Is there any temporary workaround?

Yes. After reading meson quick start guide I learned that meson can be used directly from its git repository:
https://mesonbuild.com/Quick-guide.html#installation-from-source

So I cloned https://github.com/mesonbuild/meson into some directory and pointed KDevelop at meson in that directory

---------------------
WORKAROUND:
1. clone https://github.com/mesonbuild/meson
2. in KDevelop when setting up meson project use meson.py that you obtain at step #1 as meson binary
Comment 4 Petros 2020-12-19 17:35:24 UTC
(In reply to Ihor Antonov from comment #3)
> Yes. After reading meson quick start guide I learned that meson can be used
> directly from its git repository:
> https://mesonbuild.com/Quick-guide.html#installation-from-source
> 
> So I cloned https://github.com/mesonbuild/meson into some directory and
> pointed KDevelop at meson in that directory
> 
> ---------------------
> WORKAROUND:
> 1. clone https://github.com/mesonbuild/meson
> 2. in KDevelop when setting up meson project use meson.py that you obtain at
> step #1 as meson binary

Thank you.
Comment 5 Igor Kushnir 2021-11-28 18:31:08 UTC
Can anyone verify that https://invent.kde.org/kdevelop/kdevelop/-/merge_requests/251 fixes this issue?
Comment 6 Manuel Mommertz 2021-11-29 08:11:58 UTC
(In reply to Igor Kushnir from comment #5)
> Can anyone verify that
> https://invent.kde.org/kdevelop/kdevelop/-/merge_requests/251 fixes this
> issue?

Yes, works perfectly! :)

Thank you!
Comment 7 Bernd Buschinski 2021-12-05 09:03:53 UTC
Git commit 2f723c977906582ddca5c0a710791e25bc35a51b by Bernd Buschinski.
Committed on 04/12/2021 at 21:39.
Pushed by buschinski into branch 'master'.

Fix meson executable

- on my system meson is a link to python2-exec
  $ ls -ld $(which meson)
  /usr/bin/meson -> ../lib/python-exec/python-exec2
  The python2-exec must not be executed directly.
- Currently the mesonExecutable is canonicalized, which also resolves symlinks
  This causes the meson plugin to execute stuff like:
  $ python2-exec --reconfigure
  instead of
  $ meson --reconfigure
  Fix this by not canonicalizing the mesonExecutable, validity is already checked earlier.
FIXED-IN: 5.8.220400

M  +1    -1    plugins/meson/mesonconfig.cpp

https://invent.kde.org/kdevelop/kdevelop/commit/2f723c977906582ddca5c0a710791e25bc35a51b