mesonbuild / meson

The Meson Build System
http://mesonbuild.com
Apache License 2.0
5.54k stars 1.61k forks source link

Ninja install fails when trying to restore SELinux security context #3276

Open ghost opened 6 years ago

ghost commented 6 years ago

build.meson:

project('hello', 'c')
executable('hello', 'main.c')

When running ninja -C build install:

ninja: Entering directory `build'
[0/1] Regenerating build files.
The Meson build system
Version: 0.44.1
Source dir: /tmp/tmp.e30jwX36u0
Build dir: /tmp/tmp.e30jwX36u0/build
Build type: native build
Project name: hello
Native C compiler: ccache cc (gcc 7.3.1)
Build machine cpu family: x86_64
Build machine cpu: x86_64
Build targets in project: 1
Found ninja-1.8.2 at /usr/bin/ninja
[2/3] Installing files.
Failed to restore SELinux context of installed files...
Standard output:

Standard error:
restorecon: SELinux: Could not get canonical path for  restorecon: No such file or directory.

It works when I include install : true in the build.meson. Might it be possible for better error messages in this case? It doesn't seem very helpful to a person to see what the issue might be with that.

mikkeljohnsen commented 6 years ago

I have this error aswell.

How do I make ninja not use SELinux at all. I have run "setenforce 0" but no luck ?

What do you mean by "It works when I include install : true in the build.meson" ?

keeferrourke commented 5 years ago

I recently ran into the same issue... based on the docs, you need to specify that a target is 'installable' by setting the install : true option on the target.

This appears to be intended behaviour. e.g.

shared_library('foo', 'foolib.c', install: true)

However, I'd agree that the error messages from ninja are certainly not helpful.

Hope this is helpful to someone who comes across this issue as well!