-
-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
init: optionally load the system SELinux policy #400
base: master
Are you sure you want to change the base?
Changes from 1 commit
69d80f4
0a5f876
c465b81
6063686
57b94a2
6910b6d
67c3d8b
55b82d8
15e2f6e
ca63b57
159ffac
0e959a7
a40f43a
7d88201
157a78a
01640d8
a8ecd7d
10c8198
e4b5b3e
02b93a8
66be73d
e06e054
4bf712a
eadc90c
86a9f0c
8737eef
f093426
e40b38e
a6af309
25eb167
d90b013
1f2f7cf
ab15586
90b789b
c0cef53
2a6af9d
ef2c41f
8f1ac95
64ec986
266cc8c
cec70a6
4774421
38fdef4
b7ef63a
7d5ac36
c502a07
6f3f5cd
4a5d7c1
350fed8
376c1cc
5d143f4
cc8bcb7
653ecf4
46ac998
1a79e2f
46331bf
26c1855
c2cf2f9
f360aff
9260c20
0f114a6
c5b6aae
6be8175
a3062d7
3b674b3
7e52501
ed2a166
7a843a0
622790e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,12 @@ dinit_source_files = [ | |
'dinit-env.cc', | ||
'settings.cc' | ||
] | ||
dinit_dependencies = [] | ||
|
||
if libselinux.found() | ||
dinit_dependencies += libselinux | ||
endif | ||
|
||
|
||
## src/'s Defines | ||
shutdown_built = false | ||
|
@@ -40,7 +46,8 @@ endif | |
executable( | ||
'dinit', | ||
dinit_source_files, | ||
kwargs: misc_args | ||
kwargs: misc_args, | ||
dependencies: dinit_dependencies | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This could be a simple There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's no harm having a variable if it makes things clearer - putting There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually. Build output shows:
... why is libselinux considered a "run-time dependency"? Is it because of this? Then I think it needs to be changed back. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. libselinux is a "run-time dependency" in the sense that it is being searched for in order to use it when compiling installable executables. It would be a
if it was searched for using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Dependencies can be looked up only optionally, in this case: libselinux_dep = dependency('libselinux', version : '>= 2.1.9', required : support_selinux) it will only be looked up when the "support-selinux={enabled|disabled|auto}" build option permits it. (In the enabled case, the configuration will fatally error out when libselinux is not found -- it is required, so you cannot proceed without it. The default is "auto" and the CI build doesn't have a selinux system so it configures without selinux. In the "disabled" case, even if libselinux is installed and available, meson ignores it because you disabled support and will return "Dependency libselinux skipped: feature support-selinux disabled".) The return value can be checked to see if it was indeed found -- and either way, you can use it anywhere a dependency is a valid parameter type.
So it is always safe to pass it even if it isn't used, greatly reducing the amount of control flow necessary for converting build configuration intents into compilation commands. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I think maybe I understand what you are saying, but it seems very much at odds with what I would normally think of as a run-time vs build-time dependency. To me a dependency that is used when compiling the final executable(s), or at any stage in the lead-up to that, is a build-time dependency; i.e. a build-time dependency is something that is required when the application is built, and a run-time dependency is required when the application is run. Anyway, I guess that means this is fine as is, and that the "run-time" message is correct as far as meson is concerned - thanks for clarifying. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's a bit of weird wording -- I certainly didn't choose it lol. :) I went and looked up where it was introduced in the git history -- @Ericson2314 introduced it in mesonbuild/meson@07777e1 as part of a refactor that shouldn't actually have affected this at all and I do not know why! Before that commit, it would list "Dependency libselinux found: NO" except in a cross build, when it would say "Cross dependency libselinux found: NO". |
||
) | ||
executable( | ||
'dinitctl', | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is claiming that selinux support is enabled by default on Linux based systems, but it doesn't seem to be the case (and it probably shouldn't be) since
SUPPORT_SELINUX
is defaulted to 0.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm is that from the
Enabled only on Linux based systems
bit? Not sure how to better phrase that personally.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From
./configure --help
:Also you need to add
--disable-selinux
option description here, after the--enable-selinux
.And then just use
[Disabled]
in front of--disable-selinux
option description.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, got it. Thanks!