Commit 02312bf
authored
fix: Gate SELinux to Linux and add cross-platform CI tests (#8795)
Gate SELinux functionality to Linux-only and provide stub implementations
for chcon/runcon on non-Linux platforms to maintain cross-platform builds.
Changes:
- Gate all SELinux code with target_os = "linux" checks
- Add stub main() for chcon/runcon on non-Linux with user-friendly errors
- Add CI job to verify stubs build correctly on macOS and Windows
- Update ls to check both selinux feature AND target_os
Benefits:
- Fixes build failures on macOS/Windows (#8581, #7996, #7695, #6491)
- Maintains workspace buildability across all platforms
- Provides clear error messages instead of silent failures
- Prevents accidental SELinux usage on unsupported platforms
CI Testing:
- New 'Build/SELinux-Stubs (Non-Linux)' job tests macOS and Windows
- Verifies stub binaries are created and compilation succeeds
- Validates full workspace builds with stubs present
Addresses maintainer feedback in PR #87951 parent e16ce60 commit 02312bf
4 files changed
+59
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1280 | 1280 | | |
1281 | 1281 | | |
1282 | 1282 | | |
| 1283 | + | |
| 1284 | + | |
| 1285 | + | |
| 1286 | + | |
| 1287 | + | |
| 1288 | + | |
| 1289 | + | |
| 1290 | + | |
| 1291 | + | |
| 1292 | + | |
| 1293 | + | |
| 1294 | + | |
| 1295 | + | |
| 1296 | + | |
| 1297 | + | |
| 1298 | + | |
| 1299 | + | |
| 1300 | + | |
| 1301 | + | |
| 1302 | + | |
| 1303 | + | |
| 1304 | + | |
| 1305 | + | |
| 1306 | + | |
| 1307 | + | |
| 1308 | + | |
| 1309 | + | |
| 1310 | + | |
| 1311 | + | |
| 1312 | + | |
| 1313 | + | |
| 1314 | + | |
| 1315 | + | |
| 1316 | + | |
1283 | 1317 | | |
1284 | 1318 | | |
1285 | 1319 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
2 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1085 | 1085 | | |
1086 | 1086 | | |
1087 | 1087 | | |
1088 | | - | |
| 1088 | + | |
1089 | 1089 | | |
1090 | 1090 | | |
1091 | 1091 | | |
1092 | | - | |
| 1092 | + | |
1093 | 1093 | | |
1094 | 1094 | | |
1095 | 1095 | | |
| |||
3309 | 3309 | | |
3310 | 3310 | | |
3311 | 3311 | | |
3312 | | - | |
| 3312 | + | |
3313 | 3313 | | |
3314 | 3314 | | |
3315 | 3315 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
2 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
0 commit comments