Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit f1c8f5a

Browse files
committedApr 11, 2024·
Fix bootstrap if repository path contains symlinks.
Pigweed seems to fail with: ERROR at /home/angus/projects/connectedhomeip/third_party/pigweed/repo/pw_build/facade.gni:187:7: Assertion failed. assert(_dep_is_in_link_dependencies, when the repo path has symlinks in it and bootstrap is run. The workaround is to change to the symlink-resolved path temporarily while doing the pigweed parts of bootstrap.sh. Fixes project-chip#31851
1 parent 9e0f288 commit f1c8f5a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
 

‎scripts/setup/bootstrap.sh

+12
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,20 @@ EOF
167167
# bootstrap or run_in_build_env.sh can be executed in a build env
168168
_ORIGINAL_PW_ENVIRONMENT_ROOT="$PW_ENVIRONMENT_ROOT"
169169

170+
# pigweed does not seem to handle pwd involving symlinks very well.
171+
original_pwd=$PWD
172+
if hash realpath 2>/dev/null; then
173+
realpwd="$(realpath "$PWD")"
174+
if [ "$realpwd" != "$PWD" ]; then
175+
echo "Warning: $PWD contains symlinks, using $realpwd instead"
176+
cd "$realpwd"
177+
fi
178+
fi
179+
170180
_bootstrap_or_activate "$0"
171181

182+
cd $original_pwd
183+
172184
if [ "$_ACTION_TAKEN" = "bootstrap" ]; then
173185
# By default, install all extra pip dependencies even if slow. -p/--platform
174186
# arguments may override this default.

0 commit comments

Comments
 (0)
Please sign in to comment.