Skip to content

Commit 0df14d6

Browse files
Update gn_silabs_example to use PW_ENVIRONMENT_ROOT's gn install if… (project-chip#35755)
* Update gn_silabs_example to use PW_ENVIRONMENT_ROOT's gn install if declared else default to the expected matter bootstrapped environment location * Fix so bootstrap is run when PW_ENVIRONMENT_ROOT is set
1 parent 711fb1f commit 0df14d6

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

scripts/examples/gn_silabs_example.sh

+10-9
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,21 @@ else
2828
CHIP_ROOT="$MATTER_ROOT"
2929
fi
3030

31+
if [[ -z "${PW_ENVIRONMENT_ROOT}" ]]; then
32+
echo "Using the bootstrapped pigweed ENV in Matter root"
33+
PW_PATH="$CHIP_ROOT/.environment/cipd/packages/pigweed"
34+
else
35+
echo "Using provided $PW_ENVIRONMENT_ROOT as Pigweed ENV root"
36+
PW_PATH="$PW_ENVIRONMENT_ROOT/cipd/packages/pigweed"
37+
fi
38+
3139
set -x
3240
env
3341
USE_WIFI=false
3442
USE_DOCKER=false
3543
USE_GIT_SHA_FOR_VERSION=true
3644
USE_SLC=false
37-
GN_PATH=gn
38-
GN_PATH_PROVIDED=false
45+
GN_PATH="$PW_PATH/gn"
3946
USE_BOOTLOADER=false
4047
DOTFILE=".gn"
4148

@@ -260,7 +267,6 @@ else
260267
;;
261268
--slc_reuse_files)
262269
optArgs+="slc_reuse_files=true "
263-
USE_SLC=true
264270
shift
265271
;;
266272
--gn_path)
@@ -270,7 +276,6 @@ else
270276
else
271277
GN_PATH="$2"
272278
fi
273-
GN_PATH_PROVIDED=true
274279
shift
275280
shift
276281
;;
@@ -310,11 +315,7 @@ else
310315
} &>/dev/null
311316
fi
312317

313-
if [ "$USE_SLC" == true ]; then
314-
if [ "$GN_PATH_PROVIDED" == false ]; then
315-
GN_PATH=./.environment/cipd/packages/pigweed/gn
316-
fi
317-
elif [ "$USE_SLC" == false ]; then
318+
if [ "$USE_SLC" == false ]; then
318319
# Activation needs to be after SLC generation which is done in gn gen.
319320
# Zap generation requires activation and is done in the build phase
320321
source "$CHIP_ROOT/scripts/activate.sh"

0 commit comments

Comments
 (0)