mesonbuild/meson

Meson tries to use install_name_tool and otools when install_name_tool exists on ninja install, even with native linux build and installation

Open

#8 027 ouverte le 25 nov. 2020

Voir sur GitHub
 (6 commentaires) (0 réactions) (0 assignés)Python (1 465 forks)batch import
OS:macoscrossgood first issue

Métriques du dépôt

Stars
 (4 978 stars)
Métriques de merge PR
 (Merge moyen 30j 19h) (63 PRs mergées en 30 j)

Description

Describe the bug

When ninja install-ing sway package in a fakeroot (as run by makepkg) on Archlinux, meson is taking some path that should be reserved to darwin systems and try to call otool. I do have cross-compilation tools installed on my system for the darwin platform. Assigned to meson since sway project doesn't have reference to otool in its repository.

Full logs and stacktrace below:

~/workspace/archofficiel/community/sway/repos/community-x86_64 ‹master› 
╰─$ makepkg                                                                                                                         1 ↵
==> Making package: sway 1:1.5.1-1 (Wed 25 Nov 2020 12:09:10 PM CET)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found sway-1.5.1.tar.gz
  -> Found sway-1.5.1.tar.gz.sig
  -> Found 50-systemd-user.conf
==> Validating source files with sha512sums...
    sway-1.5.1.tar.gz ... Passed
    sway-1.5.1.tar.gz.sig ... Skipped
    50-systemd-user.conf ... Passed
==> Verifying source file signatures with gpg...
    sway-1.5.1.tar.gz ... Passed
==> Extracting sources...
  -> Extracting sway-1.5.1.tar.gz with bsdtar
==> Starting prepare()...
==> Removing existing $pkgdir/ directory...
==> Starting build()...
+ exec meson setup --prefix /usr --libexecdir lib --sbindir bin --buildtype plain --auto-features enabled --wrap-mode nodownload -D b_lto=true -D b_pie=true build sway-1.5.1 -D werror=false -D b_ndebug=true
Directory already configured.

Just run your build command (e.g. ninja) and Meson will regenerate as necessary.
If ninja fails, run "ninja reconfigure" or "meson --reconfigure"
to force Meson to regenerate.

If build failures persist, run "meson setup --wipe" to rebuild from scratch
using the same options as passed when configuring the build.
To change option values, run "meson configure" instead.
ninja: Entering directory `build'
[0/1] Regenerating build files.
The Meson build system
Version: 0.56.0
Source dir: /home/alexandre/workspace/archofficiel/community/sway/repos/community-x86_64/src/sway-1.5.1
Build dir: /home/alexandre/workspace/archofficiel/community/sway/repos/community-x86_64/src/build
Build type: native build
Project name: sway
Project version: 1.5.1
C compiler for the host machine: ccache gcc (gcc 10.2.0 "gcc (GCC) 10.2.0")
C linker for the host machine: gcc ld.bfd 2.35.1
Host machine cpu family: x86_64
Host machine cpu: x86_64
Dependency json-c found: YES 0.15 (cached)
Dependency libpcre found: YES 8.44 (cached)
Dependency wayland-server found: YES 1.18.0 (cached)
Dependency wayland-client found: YES 1.18.0 (cached)
Dependency wayland-cursor found: YES 1.18.0 (cached)
Dependency wayland-egl found: YES 18.1.0 (cached)
Dependency wayland-protocols found: YES 1.20 (cached)
Dependency xkbcommon found: YES 1.0.2 (cached)
Dependency cairo found: YES 1.17.3 (cached)
Dependency pango found: YES 1.48.0 (cached)
Dependency pangocairo found: YES 1.48.0 (cached)
Dependency gdk-pixbuf-2.0 found: YES 2.42.0 (cached)
Dependency pixman-1 found: YES 0.40.0 (cached)
Dependency glesv2 found: YES 3.2 (cached)
Dependency libevdev found: YES 1.10.0 (cached)
Dependency libinput found: YES 1.16.3 (cached)
Dependency libsystemd found: YES 246 (cached)
Found pkg-config: /usr/bin/pkg-config (1.7.3)
Found CMake: /usr/bin/cmake (3.19.0)
Run-time dependency libelogind found: NO (tried pkgconfig and cmake)
Dependency xcb found: YES 1.14 (cached)
Run-time dependency bash-completion found: NO (tried pkgconfig and cmake)
Run-time dependency fish found: NO (tried pkgconfig and cmake)
Library m found: YES
Library rt found: YES
Neither a subproject directory nor a wlroots.wrap file was found.
Subproject  wlroots is buildable: NO (disabling)
Dependency wlroots found: YES 0.12.0 (cached)
Fetching value of define "WLR_HAS_XWAYLAND" with dependency wlroots: 1 (cached)
Dependency scdoc found: YES 1.11.0 (cached)
Program /usr/bin/scdoc found: YES (/usr/bin/scdoc)
Program sh found: YES (/usr/bin/sh)
Program git found: YES (/usr/bin/git)
Compiler for C supports arguments -fmacro-prefix-map=/prefix/to/hide=: YES (cached)
Configuring config.h using configuration
Dependency wayland-scanner found: YES 1.18.0 (cached)
Program /usr/bin/wayland-scanner found: YES (/usr/bin/wayland-scanner)
Configuring config using configuration
Build targets in project: 38

sway 1.5.1

      xwayland: YES
    gdk-pixbuf: YES
       systemd: YES
       elogind: NO
          tray: YES
     man-pages: YES

  Subprojects
       wlroots: NO Neither a subproject directory nor a wlroots.wrap file was found.

Option werror is: false [default: true]
Found ninja-1.10.1 at /usr/bin/ninja
ninja: no work to do.
==> Entering fakeroot environment...
==> Starting package()...
ninja: Entering directory `build'
[0/1] Installing files.
Installing sway.1 to /home/alexandre/workspace/archofficiel/community/sway/repos/community-x86_64/pkg/sway/usr/share/man/man1
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/mesonbuild/mesonmain.py", line 140, in run
    return options.run_func(options)
  File "/usr/lib/python3.8/site-packages/mesonbuild/minstall.py", line 554, in run
    installer.do_install(datafilename)
  File "/usr/lib/python3.8/site-packages/mesonbuild/minstall.py", line 372, in do_install
    self.install_targets(d)
  File "/usr/lib/python3.8/site-packages/mesonbuild/minstall.py", line 527, in install_targets
    depfixer.fix_rpath(outname, t.rpath_dirs_to_remove, install_rpath, final_path,
  File "/usr/lib/python3.8/site-packages/mesonbuild/scripts/depfixer.py", line 484, in fix_rpath
    fix_darwin(fname, new_rpath, final_path, install_name_mappings)
  File "/usr/lib/python3.8/site-packages/mesonbuild/scripts/depfixer.py", line 396, in fix_darwin
    rpaths = get_darwin_rpaths_to_remove(fname)
  File "/usr/lib/python3.8/site-packages/mesonbuild/scripts/depfixer.py", line 377, in get_darwin_rpaths_to_remove
    out = subprocess.check_output(['otool', '-l', fname],
  File "/usr/lib/python3.8/subprocess.py", line 411, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/usr/lib/python3.8/subprocess.py", line 489, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/usr/lib/python3.8/subprocess.py", line 854, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.8/subprocess.py", line 1702, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'otool'
FAILED: meson-install 
/usr/bin/meson install --no-rebuild
ninja: build stopped: subcommand failed.
==> ERROR: A failure occurred in package().
    Aborting...

To Reproduce

With makepkg tools installed (like, on archlinux):

git clone https://github.com/archlinux/svntogit-community community
cd community/sway/repos/community-x86_64/
makepkg

I didn't try on a clean archlinux install yet.

Expected behavior

The package install normally.

system parameters

  • This is a plain native build
  • Up-to-date archlinux
  • Python version 3.8.6
  • Archlinux upstream meson version 0.56.0
  • Ninja version 1.10,1

Guide contributeur