bots-garden/razorbillpublic Fork
⑂ fb46abf
Commits
⬇ Clone ▾
git clone https://git.rickub.com/bots-garden/razorbill.git
git clone ssh://git@rickub.com/bots-garden/razorbill.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

Download ZIP

install.sh / release.sh refuse to run as root (root-owned files broke later builds)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
k33g committed 2026-11-26T17:17:10+01:00 Browse files
fb46abf parent: bee62ed
modified .memory/history.md +9 -0
@@ -405,3 +405,12 @@ MB) but the build log (.build/xcode/Logs/Build/*.xcactivitylog, gzip) still show
405405 added CLANG_COVERAGE_MAPPING=NO everywhere. Still to verify on the Mac.
406406 Verified by the user on the Mac (2026-11-26): no more default.profraw after install.sh with
407407 CLANG_ENABLE_CODE_COVERAGE=NO CLANG_COVERAGE_MAPPING=NO. Local tag v0.2.0 moved to dbbd03c.
408+
409+## 2026-11-26 — compat.sh build fails with "Operation not permitted"
410+
411+User's `scripts/compat.sh` failed twice writing into `.build/xcode` (swiftmodule, .o, then ld on
412+Products/Release/_NumericsShims.o); stopping kDrive did not help; deleting Intermediates needed
413+`sudo`. Hypothesis (to confirm with `find .build -user root`): a build ran as root around 15:44
414+(the failing files date from then) and left root-owned files. Fix proposed: `sudo chown -R
415+$(whoami) .build`. install.sh and release.sh now refuse to run as root; troubleshooting row in the
416+build how-to EN+FR. Earlier suspicion on kDrive and on sandbox reads of .build/xcode not confirmed.
@@ -405,3 +405,12 @@ MB) but the build log (.build/xcode/Logs/Build/*.xcactivitylog, gzip) still show
405 added CLANG_COVERAGE_MAPPING=NO everywhere. Still to verify on the Mac.405 added CLANG_COVERAGE_MAPPING=NO everywhere. Still to verify on the Mac.
406 Verified by the user on the Mac (2026-11-26): no more default.profraw after install.sh with406 Verified by the user on the Mac (2026-11-26): no more default.profraw after install.sh with
407 CLANG_ENABLE_CODE_COVERAGE=NO CLANG_COVERAGE_MAPPING=NO. Local tag v0.2.0 moved to dbbd03c.407 CLANG_ENABLE_CODE_COVERAGE=NO CLANG_COVERAGE_MAPPING=NO. Local tag v0.2.0 moved to dbbd03c.
408+
409+## 2026-11-26 — compat.sh build fails with "Operation not permitted"
410+
411+User's `scripts/compat.sh` failed twice writing into `.build/xcode` (swiftmodule, .o, then ld on
412+Products/Release/_NumericsShims.o); stopping kDrive did not help; deleting Intermediates needed
413+`sudo`. Hypothesis (to confirm with `find .build -user root`): a build ran as root around 15:44
414+(the failing files date from then) and left root-owned files. Fix proposed: `sudo chown -R
415+$(whoami) .build`. install.sh and release.sh now refuse to run as root; troubleshooting row in the
416+build how-to EN+FR. Earlier suspicion on kDrive and on sandbox reads of .build/xcode not confirmed.
modified docs/en/how-to/build-on-the-mac.md +1 -0
@@ -60,6 +60,7 @@ The script never overwrites or removes an `rzb` launcher it did not write.
6060 | Symptom | Fix |
6161 | --- | --- |
6262 | The build fails while compiling MLX's Metal shaders (the `metal` tool is missing) | Run `xcodebuild -downloadComponent MetalToolchain`. |
63+| `Operation not permitted` or `can't write output file` under `.build/xcode` | A build ran with `sudo` and left files owned by root. Run `sudo chown -R "$(whoami)" .build`, then build again without `sudo` (`scripts/install.sh` asks for it itself, only to copy). |
6364 | A `default.profraw` file appears in the folder where `rzb` ran | `rzb` was built without `CLANG_ENABLE_CODE_COVERAGE=NO CLANG_COVERAGE_MAPPING=NO`: the package scheme gathers test coverage and instruments the Release build too. Rebuild with the command above (or `scripts/install.sh`) and delete the file. |
6465 | `Failed to load the default metallib` when a model loads | `rzb` was built with `swift build`, or copied away from `mlx-swift_Cmlx.bundle`. Build with `xcodebuild` as above and run it from `Build/Products/Release`. |
6566
@@ -60,6 +60,7 @@ The script never overwrites or removes an `rzb` launcher it did not write.
60 | Symptom | Fix |60 | Symptom | Fix |
61 | --- | --- |61 | --- | --- |
62 | The build fails while compiling MLX's Metal shaders (the `metal` tool is missing) | Run `xcodebuild -downloadComponent MetalToolchain`. |62 | The build fails while compiling MLX's Metal shaders (the `metal` tool is missing) | Run `xcodebuild -downloadComponent MetalToolchain`. |
63+| `Operation not permitted` or `can't write output file` under `.build/xcode` | A build ran with `sudo` and left files owned by root. Run `sudo chown -R "$(whoami)" .build`, then build again without `sudo` (`scripts/install.sh` asks for it itself, only to copy). |
63 | A `default.profraw` file appears in the folder where `rzb` ran | `rzb` was built without `CLANG_ENABLE_CODE_COVERAGE=NO CLANG_COVERAGE_MAPPING=NO`: the package scheme gathers test coverage and instruments the Release build too. Rebuild with the command above (or `scripts/install.sh`) and delete the file. |64 | A `default.profraw` file appears in the folder where `rzb` ran | `rzb` was built without `CLANG_ENABLE_CODE_COVERAGE=NO CLANG_COVERAGE_MAPPING=NO`: the package scheme gathers test coverage and instruments the Release build too. Rebuild with the command above (or `scripts/install.sh`) and delete the file. |
64 | `Failed to load the default metallib` when a model loads | `rzb` was built with `swift build`, or copied away from `mlx-swift_Cmlx.bundle`. Build with `xcodebuild` as above and run it from `Build/Products/Release`. |65 | `Failed to load the default metallib` when a model loads | `rzb` was built with `swift build`, or copied away from `mlx-swift_Cmlx.bundle`. Build with `xcodebuild` as above and run it from `Build/Products/Release`. |
65 66
modified docs/fr/how-to/compiler-sur-le-mac.md +1 -0
@@ -60,6 +60,7 @@ Le script n'écrase ni ne supprime jamais un lanceur `rzb` qu'il n'a pas écrit.
6060 | Symptôme | Solution |
6161 | --- | --- |
6262 | La compilation échoue en compilant les shaders Metal de MLX (l'outil `metal` manque) | Lancez `xcodebuild -downloadComponent MetalToolchain`. |
63+| `Operation not permitted` ou `can't write output file` sous `.build/xcode` | Une compilation a tourné avec `sudo` et laissé des fichiers appartenant à root. Lancez `sudo chown -R "$(whoami)" .build`, puis recompilez sans `sudo` (`scripts/install.sh` le demande lui-même, seulement pour la copie). |
6364 | Un fichier `default.profraw` apparaît dans le dossier où `rzb` a tourné | `rzb` a été compilé sans `CLANG_ENABLE_CODE_COVERAGE=NO CLANG_COVERAGE_MAPPING=NO` : le scheme du package mesure la couverture des tests et instrumente aussi la compilation Release. Recompilez avec la commande ci-dessus (ou `scripts/install.sh`) et supprimez le fichier. |
6465 | `Failed to load the default metallib` au chargement d'un modèle | `rzb` a été compilé avec `swift build`, ou copié loin de `mlx-swift_Cmlx.bundle`. Compilez avec `xcodebuild` comme ci-dessus et lancez-le depuis `Build/Products/Release`. |
6566
@@ -60,6 +60,7 @@ Le script n'écrase ni ne supprime jamais un lanceur `rzb` qu'il n'a pas écrit.
60 | Symptôme | Solution |60 | Symptôme | Solution |
61 | --- | --- |61 | --- | --- |
62 | La compilation échoue en compilant les shaders Metal de MLX (l'outil `metal` manque) | Lancez `xcodebuild -downloadComponent MetalToolchain`. |62 | La compilation échoue en compilant les shaders Metal de MLX (l'outil `metal` manque) | Lancez `xcodebuild -downloadComponent MetalToolchain`. |
63+| `Operation not permitted` ou `can't write output file` sous `.build/xcode` | Une compilation a tourné avec `sudo` et laissé des fichiers appartenant à root. Lancez `sudo chown -R "$(whoami)" .build`, puis recompilez sans `sudo` (`scripts/install.sh` le demande lui-même, seulement pour la copie). |
63 | Un fichier `default.profraw` apparaît dans le dossier où `rzb` a tourné | `rzb` a été compilé sans `CLANG_ENABLE_CODE_COVERAGE=NO CLANG_COVERAGE_MAPPING=NO` : le scheme du package mesure la couverture des tests et instrumente aussi la compilation Release. Recompilez avec la commande ci-dessus (ou `scripts/install.sh`) et supprimez le fichier. |64 | Un fichier `default.profraw` apparaît dans le dossier où `rzb` a tourné | `rzb` a été compilé sans `CLANG_ENABLE_CODE_COVERAGE=NO CLANG_COVERAGE_MAPPING=NO` : le scheme du package mesure la couverture des tests et instrumente aussi la compilation Release. Recompilez avec la commande ci-dessus (ou `scripts/install.sh`) et supprimez le fichier. |
64 | `Failed to load the default metallib` au chargement d'un modèle | `rzb` a été compilé avec `swift build`, ou copié loin de `mlx-swift_Cmlx.bundle`. Compilez avec `xcodebuild` comme ci-dessus et lancez-le depuis `Build/Products/Release`. |65 | `Failed to load the default metallib` au chargement d'un modèle | `rzb` a été compilé avec `swift build`, ou copié loin de `mlx-swift_Cmlx.bundle`. Compilez avec `xcodebuild` comme ci-dessus et lancez-le depuis `Build/Products/Release`. |
65 66
modified scripts/install.sh +6 -0
@@ -28,6 +28,12 @@ done
2828
2929 fail() { echo "install.sh: $*" >&2; exit 1; }
3030
31+# Never as root: the build would leave root-owned files in .build that later builds, run as
32+# the user, cannot replace ("Operation not permitted").
33+if [[ "$(id -u)" == 0 ]]; then
34+ fail "do not run this script with sudo: it asks for sudo itself, only to copy into the prefix"
35+fi
36+
3137 products=.build/xcode/Build/Products/Release
3238 home="$prefix/lib/razorbill"
3339 launcher="$prefix/bin/rzb"
@@ -28,6 +28,12 @@ done
28 28
29 fail() { echo "install.sh: $*" >&2; exit 1; }29 fail() { echo "install.sh: $*" >&2; exit 1; }
30 30
31+# Never as root: the build would leave root-owned files in .build that later builds, run as
32+# the user, cannot replace ("Operation not permitted").
33+if [[ "$(id -u)" == 0 ]]; then
34+ fail "do not run this script with sudo: it asks for sudo itself, only to copy into the prefix"
35+fi
36+
31 products=.build/xcode/Build/Products/Release37 products=.build/xcode/Build/Products/Release
32 home="$prefix/lib/razorbill"38 home="$prefix/lib/razorbill"
33 launcher="$prefix/bin/rzb"39 launcher="$prefix/bin/rzb"
modified scripts/release.sh +6 -0
@@ -27,6 +27,12 @@ done
2727
2828 fail() { echo "release.sh: $*" >&2; exit 1; }
2929
30+# Never as root: the build would leave root-owned files in .build that later builds, run as
31+# the user, cannot replace ("Operation not permitted").
32+if [[ "$(id -u)" == 0 ]]; then
33+ fail "do not run this script with sudo"
34+fi
35+
3036 version=$(sed -n 's/.*static let version = "\([^"]*\)".*/\1/p' Sources/RazorbillCore/Razorbill.swift)
3137 [[ -n "$version" ]] || fail "no version found in Sources/RazorbillCore/Razorbill.swift"
3238 name="razorbill-${version}-macos-arm64"
@@ -27,6 +27,12 @@ done
27 27
28 fail() { echo "release.sh: $*" >&2; exit 1; }28 fail() { echo "release.sh: $*" >&2; exit 1; }
29 29
30+# Never as root: the build would leave root-owned files in .build that later builds, run as
31+# the user, cannot replace ("Operation not permitted").
32+if [[ "$(id -u)" == 0 ]]; then
33+ fail "do not run this script with sudo"
34+fi
35+
30 version=$(sed -n 's/.*static let version = "\([^"]*\)".*/\1/p' Sources/RazorbillCore/Razorbill.swift)36 version=$(sed -n 's/.*static let version = "\([^"]*\)".*/\1/p' Sources/RazorbillCore/Razorbill.swift)
31 [[ -n "$version" ]] || fail "no version found in Sources/RazorbillCore/Razorbill.swift"37 [[ -n "$version" ]] || fail "no version found in Sources/RazorbillCore/Razorbill.swift"
32 name="razorbill-${version}-macos-arm64"38 name="razorbill-${version}-macos-arm64"