Meson build leaks host 'sh' path to target build when cross-compiled

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



What did you do before the bug happened? (Steps to reproduce your issue)

  Cross compile git from source (git-2.48.1) using the meson build system
  (Buildroot package experimental converted from autoconf to meson).

What did you expect to happen? (Expected behavior)

  Execute command 'git fetch' on the target without failure.

What happened instead? (Actual behavior)

  Command 'git fetch' on the target failed.

What's different between what you expected and what actually happened?

  Debug with strace showed the following difference:

  - o.k (autoconf):

    679   execve("/bin/sh", ["/bin/sh", "-c", "git-upload-pack '/home/git-repo"..., "git-upload-pack '/home/git-repo"...], 0x55c342ce4420 /* 17 vars */ <unfinished ...>

  - failure (meson build):

    6861  execve("/usr/bin/sh", ["/usr/bin/sh", "-c", "git-upload-pack '/home/git-repo"..., "git-upload-pack '/home/git-repo"...], 0x5639ab382210 /* 17 vars */) = -1 ENOENT (No such file or directory)

  The meson build tries to execute the non-existent '/usr/bin/sh' (instead of
  '/bin/sh' as the autoconf build), 'which sh' on the host returns
  '/usr/bin/sh'...

  From meson.build

   [...]
   186 shell = find_program('sh', dirs: program_path)
   [...]
   685   '-DSHELL_PATH="' + fs.as_posix(shell.full_path()) + '"',

  Do not use the result of 'find_program('sh',...)' for '-DSHELL_PATH='
  (at least not for cross-compile), use fix '/bin/sh' instead or make it
  configurable via a meson option?

Regards,
Peter


[System Info]
git version:
git version 2.48.1
cpu: x86_64
no commit associated with this build
sizeof-long: 8
sizeof-size_t: 8
shell-path: /bin/sh
libcurl: 8.11.1
OpenSSL: OpenSSL 3.2.3 3 Sep 2024
zlib: 1.3.1
uname: Linux 6.13.1-1-default #1 SMP PREEMPT_DYNAMIC Mon Feb  3 05:33:25 UTC 2025 (1918d13) x86_64
compiler info: gnuc: 14.2
libc info: glibc: 2.40
$SHELL (typically, interactive shell): /bin/bash


[Enabled Hooks]
not run from a git repository - no hooks to show




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux