From 2408bd6b3647ec13b2b1f5d373efc7d0cc354b46 Mon Sep 17 00:00:00 2001 From: Kevin Burke Date: Tue, 20 May 2025 10:25:28 -0700 Subject: [PATCH 1/2] GNUMakefile: fix compilation on Macs Previously, attempting to compile on Macs would bring in the SELinux dependencies (runcon) which led to compilation errors on Macs. Fixes #7695. --- GNUmakefile | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/GNUmakefile b/GNUmakefile index a80b10ec8..43d8bba82 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -57,6 +57,13 @@ TOYBOX_ROOT := $(BASEDIR)/tmp TOYBOX_VER := 0.8.12 TOYBOX_SRC := $(TOYBOX_ROOT)/toybox-$(TOYBOX_VER) +#------------------------------------------------------------------------ +# Detect the host system. +# On Windows the environment already sets OS = Windows_NT. +# Otherwise let it default to the kernel name returned by uname -s +# (Linux, Darwin, FreeBSD, …). +#------------------------------------------------------------------------ +OS ?= $(shell uname -s) ifdef SELINUX_ENABLED override SELINUX_ENABLED := 0 @@ -180,6 +187,13 @@ SELINUX_PROGS := \ chcon \ runcon +$(info Detected OS = $(OS)) + +# Don't build the SELinux programs on macOS (Darwin) +ifeq ($(OS),Darwin) + SELINUX_PROGS := +endif + ifneq ($(OS),Windows_NT) PROGS := $(PROGS) $(UNIX_PROGS) # Build the selinux command even if not on the system From 24ff36ee88b66329c84684cd2bd7d3b3d12670ea Mon Sep 17 00:00:00 2001 From: Kevin Burke Date: Tue, 27 May 2025 15:09:40 -0700 Subject: [PATCH 2/2] .github: add additional combination to CI --- .github/workflows/CICD.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml index c9dcb2e35..9bab80028 100644 --- a/.github/workflows/CICD.yml +++ b/.github/workflows/CICD.yml @@ -526,6 +526,8 @@ jobs: - { os: ubuntu-latest , target: x86_64-unknown-redox , features: feat_os_unix_redox , use-cross: redoxer , skip-tests: true } - { os: ubuntu-latest , target: wasm32-unknown-unknown , default-features: false, features: uucore/format, skip-tests: true, skip-package: true, skip-publish: true } - { os: macos-latest , target: aarch64-apple-darwin , features: feat_os_macos, workspace-tests: true } # M1 CPU + # PR #7964: Mac should still build even if the feature is not enabled + - { os: macos-latest , target: aarch64-apple-darwin , workspace-tests: true } # M1 CPU - { os: macos-13 , target: x86_64-apple-darwin , features: feat_os_macos, workspace-tests: true } - { os: windows-latest , target: i686-pc-windows-msvc , features: feat_os_windows } - { os: windows-latest , target: x86_64-pc-windows-gnu , features: feat_os_windows }