mesonbuild / mesonbuild/meson

add_install_script() / ninja install fail with "[script.sh]: No such file or directory" / "FAILED: install script 'bash [script.sh]'"

Open
#8,565 18 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
6.6k
Forks
1.9k
Avg merge
2d 6h
Merged PRs (30d)
33

Description

Describe the bug
ninja install does not work on MSYS2/MinGW64. It 'cannot find' even the simplest install script.

$ ninja install
[0/1] Installing files.
Running custom install script 'bash C:/msys64/home/user.name/src/tmp/test.sh HELLO'
--- stdout ---

--- stderr ---
/bin/bash: C:/msys64/home/user.name/src/tmp/test.sh: No such file or directory

FAILED: install script 'bash C:/msys64/home/user.name/src/tmp/test.sh HELLO' exit code 127, stopped
FAILED: meson-install
"C:/msys64/mingw64/bin/meson" "install" "--no-rebuild"
ninja: build stopped: subcommand failed.

To Reproduce
meson.build:

project('test')
meson.add_install_script('test.sh')

tesh.sh:

#!/bin/bash
echo hiya

Expected behavior
The script should be trivially found and run!

system parameters

  • Is this a cross build or just a plain native build (for the same computer)? native
  • what operating system Windows 10 with msys2-runtime 3.1.7-6
  • what Python version are you using 3.8.8
  • what meson --version 0.57.1
  • what ninja --version if it's a Ninja build 1.10.2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the meson.build example and the meson.add_install_script('test.sh') entry point, then reproduce the failure with ninja install on Windows 10 under MSYS2/MinGW64. Trace how the referenced test.sh path is passed to the install script and verify that the script is found and runs successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
bash, python
Domain
build-system, operating-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.