Skip to content

Commit 37b500f

Browse files
abueideclaude
andcommitted
fix(android,ios,rn): standardize shell options and remove DEVBOX_COREPACK_ENABLED workaround
Sourced scripts (lib, platform, domain, init) now use `set -e` only. Previously `set -eu` in sourced init hooks leaked `set -u` into devbox's generated hooks shell, causing `DEVBOX_COREPACK_ENABLED: unbound variable` when nodejs was included alongside plugins. Executed scripts (CLI entry points) keep `set -eu` (POSIX sh) and test scripts keep `set -euo pipefail` (bash) since they run in subprocesses and cannot leak shell options. With the root cause fixed, the DEVBOX_COREPACK_ENABLED="" workaround is removed from devbox.json and plugin.json. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent bce0344 commit 37b500f

27 files changed

Lines changed: 25 additions & 29 deletions

File tree

devbox.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
"REPORTS_DIR": "reports",
1313
"TEST_RESULTS_DIR": "reports/results",
1414
"TEST_LOGS_DIR": "reports/logs",
15-
"TEST_TUI": "false",
16-
"DEVBOX_COREPACK_ENABLED": ""
15+
"TEST_TUI": "false"
1716
},
1817
"shell": {
1918
"scripts": {

examples/react-native/devbox.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
"ANDROID_APP_ID": "com.reactnativeexample",
1313
"ANDROID_APP_APK": "android/app/build/outputs/apk/debug/app-debug.apk",
1414
"ANDROID_MAX_API": "35",
15-
"DEVBOX_COREPACK_ENABLED": "",
1615
"ANDROID_SDK_REQUIRED": "0"
1716
},
1817
"shell": {

plugins/android/virtenv/scripts/domain/avd-reset.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Android Plugin - AVD Reset and Cleanup Operations
33
# Extracted from avd.sh to eliminate circular dependencies
44

5-
set -eu
5+
set -e
66

77
if ! (return 0 2>/dev/null); then
88
echo "ERROR: avd_reset.sh must be sourced, not executed directly" >&2

plugins/android/virtenv/scripts/domain/avd.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Android Plugin - AVD Manager Operations
33
# Extracted from avd.sh to eliminate circular dependencies
44

5-
set -eu
5+
set -e
66

77
if ! (return 0 2>/dev/null); then
88
echo "ERROR: avd_manager.sh must be sourced, not executed directly" >&2

plugins/android/virtenv/scripts/domain/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Android Plugin - Build Command
33
# Auto-detects Gradle project and builds with sensible defaults
44

5-
set -eu
5+
set -e
66

77
if ! (return 0 2>/dev/null); then
88
echo "ERROR: build.sh must be sourced, not executed directly" >&2

plugins/android/virtenv/scripts/domain/deploy.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Android Plugin - Application Run
33
# See SCRIPTS.md for detailed documentation
44

5-
set -eu
5+
set -e
66

77
if ! (return 0 2>/dev/null); then
88
echo "ERROR: deploy.sh must be sourced, not executed directly" >&2

plugins/android/virtenv/scripts/domain/emulator.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Android Plugin - Emulator Lifecycle Management
33
# See SCRIPTS.md for detailed documentation
44

5-
set -eu
5+
set -e
66

77
if ! (return 0 2>/dev/null); then
88
echo "ERROR: emulator.sh must be sourced, not executed directly" >&2

plugins/android/virtenv/scripts/domain/validate.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# See SCRIPTS.md for detailed documentation
44
# Philosophy: Warn, don't block
55

6-
set -eu
6+
set -e
77

88
# Validate that ANDROID_SDK_ROOT points to an existing directory (non-blocking)
99
android_validate_sdk() {

plugins/android/virtenv/scripts/init/setup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ ANDROID_ENV_LOADED=1
3535
ANDROID_ENV_LOADED_PID="$$"
3636
export ANDROID_ENV_LOADED ANDROID_ENV_LOADED_PID
3737

38-
set -eu
38+
set -e
3939

4040
# ============================================================================
4141
# Source Dependencies

plugins/android/virtenv/scripts/lib/lib.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Android Plugin - Core Utilities
33
# See SCRIPTS.md for detailed documentation
44

5-
set -eu
5+
set -e
66

77
if ! (return 0 2>/dev/null); then
88
echo "ERROR: lib.sh must be sourced" >&2

0 commit comments

Comments
 (0)