mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
scripts: namespace dev_cli tmp dir per user and drop dead BUILD_DIR
The shared /tmp/cloud-hypervisor/ path is created by the first user to
run dev_cli.sh and owned by them, so other users on the same host fail
the +x+w check and cannot chmod it back. Move both tmp paths under
/tmp/cloud-hypervisor-${USER}/ so each user gets their own tree.
While here, fold the local BUILD_DIR in build_container() into the
existing (previously unused) CLH_CTR_BUILD_DIR, which ensure_build_dir()
already creates.
Assisted-by: Claude:Opus-4.7
Signed-off-by: Bo Chen <bchen@crusoe.ai>
This commit is contained in:
@@ -20,7 +20,7 @@ CLH_ROOT_DIR=$(cd "${CLH_SCRIPTS_DIR}/.." && pwd)
|
||||
CLH_BUILD_DIR="${CLH_ROOT_DIR}/build"
|
||||
CLH_CARGO_TARGET="${CLH_BUILD_DIR}/cargo_target"
|
||||
CLH_DOCKERFILE="${CLH_SCRIPTS_DIR}/../resources/Dockerfile"
|
||||
CLH_CTR_BUILD_DIR="/tmp/cloud-hypervisor/ctr-build"
|
||||
CLH_CTR_BUILD_DIR="/tmp/cloud-hypervisor-${USER}/ctr-build"
|
||||
CLH_INTEGRATION_WORKLOADS="${HOME}/workloads"
|
||||
|
||||
# Container paths
|
||||
@@ -649,10 +649,7 @@ cmd_tests() {
|
||||
build_container() {
|
||||
ensure_build_dir
|
||||
|
||||
BUILD_DIR=/tmp/cloud-hypervisor/container/
|
||||
|
||||
mkdir -p $BUILD_DIR
|
||||
cp "$CLH_DOCKERFILE" $BUILD_DIR
|
||||
cp "$CLH_DOCKERFILE" "$CLH_CTR_BUILD_DIR"
|
||||
|
||||
[ "$(uname -m)" = "aarch64" ] && TARGETARCH="arm64"
|
||||
[ "$(uname -m)" = "x86_64" ] && TARGETARCH="amd64"
|
||||
@@ -660,9 +657,9 @@ build_container() {
|
||||
$DOCKER_RUNTIME build \
|
||||
--target dev \
|
||||
-t "$CTR_IMAGE" \
|
||||
-f $BUILD_DIR/Dockerfile \
|
||||
-f "$CLH_CTR_BUILD_DIR/Dockerfile" \
|
||||
--build-arg TARGETARCH="$TARGETARCH" \
|
||||
$BUILD_DIR
|
||||
"$CLH_CTR_BUILD_DIR"
|
||||
}
|
||||
|
||||
cmd_build-container() {
|
||||
|
||||
Reference in New Issue
Block a user