Skip to content

Commit 1ff0149

Browse files
Fix depot_tools initialization by prepending PATH and bypassing root check
1. Prepend `depot_tools` to `PATH` instead of appending, ensuring correct tool precedence. 2. Set `export USER=builder` to bypass the `update_depot_tools` root check, allowing `gclient` to properly bootstrap `depot_tools` (downloading python, etc.) in the CI environment where it runs as root. 3. Remove the manual `ensure_bootstrap` call which was insufficient.
1 parent 4e59eb2 commit 1ff0149

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

linux/build_linux.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ else
2828
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
2929
fi
3030
# make them available for further build steps
31-
export PATH="$PATH:$(pwd)/depot_tools"
31+
export PATH="$(pwd)/depot_tools:$PATH"
3232

3333
output "Initializing depot_tools..."
3434

35-
# Explicitly ensure bootstrap
36-
if [ -f "depot_tools/ensure_bootstrap" ]; then
37-
depot_tools/ensure_bootstrap
38-
fi
35+
# Trick depot_tools into thinking we are not running as root
36+
# This is necessary because update_depot_tools aborts if it detects root,
37+
# preventing the necessary bootstrapping (python3, cipd, etc.)
38+
export USER=builder
3939

4040
gclient || (output "gclient initialization failed!" && exit 1)
4141

0 commit comments

Comments
 (0)