Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[buildsystem]: Fix error 'chown: missing operand after' #13569

Merged
merged 1 commit into from
Feb 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/sonic-build-hooks/scripts/buildinfo_base.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ else
PKG_CACHE_PATH=/sonic/target/vcache/${IMAGENAME}
fi
PKG_CACHE_FILE_NAME=${PKG_CACHE_PATH}/cache.tgz
$SUDO mkdir -p ${PKG_CACHE_PATH}
$SUDO chown $USER $PKG_CACHE_PATH
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the log, it looks like $USER="".
But it needs tests. SUDO can't be removed. Because there will be other error message.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@liushilongbuaa originally it was without sudo. Please see the PR description. Looks like sudo is not needed since the cache path is created with the regular user privileges long before executing the script during docker container build (environment doesn't have USER variable defined)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Building sonic-slave-* is different from build target/sonic-*.gz.
Some needs sudo, but some din't need.
I added sudo because of error message.

mkdir -p ${PKG_CACHE_PATH}

. ${BUILDINFO_PATH}/scripts/utils.sh

Expand Down