Skip to content

install_mode is ignored #841

@jameswestman

Description

@jameswestman

meson-python doesn't set the permissions specified in the install_mode argument of configure_file or install_data. This is useful for configuring files, where you don't want the source file to be executable (since it doesn't work due to the placeholders) but you want it to be executable once installed.

Example:

meson.build

project('meson-python-bug', version: '0.1.0')

configure_file(
    input: 'meson_python_bug.py.in',
    output: 'meson_python_bug.py',
    configuration: { 'greeting': 'Hello, Meson!' },
    install: true,
    install_dir: get_option('bindir'),
    install_mode: 'rwxr-xr-x',
)

meson_python_bug.py.in (rw-r--r--)

#!/usr/bin/env python3
print("@greeting@")

pyproject.toml

[build-system]
build-backend = 'mesonpy'
requires = ['meson-python']

Installing this minimal example using meson/ninja directly works, but installing via pip install . and trying to run meson_python_bug.py gives an error: bash: /home/jwestman/.local/bin/meson_python_bug.py: Permission denied.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions