From a83a0d2c68d466b4dad8e1ff1550c2f453baa6bd Mon Sep 17 00:00:00 2001 From: Jerry Zhao Date: Tue, 21 Feb 2023 11:34:27 -0800 Subject: [PATCH 1/2] Fix socket name length issues on CI --- .github/scripts/defaults.sh | 5 +++++ .github/scripts/remote-do-rtl-build.sh | 2 +- .github/workflows/chipyard-full-flow.yml | 1 + variables.mk | 3 ++- 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/scripts/defaults.sh b/.github/scripts/defaults.sh index 6ca434fb..57fdfaa8 100755 --- a/.github/scripts/defaults.sh +++ b/.github/scripts/defaults.sh @@ -23,6 +23,11 @@ LOCAL_CHIPYARD_DIR=$GITHUB_WORKSPACE LOCAL_SIM_DIR=$LOCAL_CHIPYARD_DIR/sims/verilator LOCAL_FIRESIM_DIR=$LOCAL_CHIPYARD_DIR/sims/firesim/sim +# CI uses temp directories with very long names +# explicitly force socket creation to use /tmp to avoid name length errors +# https://github.com/sbt/sbt/pull/6887 +JAVA_TMP_DIR=$(mktemp -d -t ci-cy-XXXXXXXX) + # key value store to get the build groups declare -A grouping grouping["group-cores"]="chipyard-cva6 chipyard-ibex chipyard-rocket chipyard-hetero chipyard-boom chipyard-sodor chipyard-digitaltop chipyard-multiclock-rocket chipyard-nomem-scratchpad chipyard-spike chipyard-clone" diff --git a/.github/scripts/remote-do-rtl-build.sh b/.github/scripts/remote-do-rtl-build.sh index 0e887e9a..b5755d01 100755 --- a/.github/scripts/remote-do-rtl-build.sh +++ b/.github/scripts/remote-do-rtl-build.sh @@ -53,5 +53,5 @@ read -a keys <<< ${grouping[$1]} for key in "${keys[@]}" do export COURSIER_CACHE=$REMOTE_WORK_DIR/.coursier-cache - make -j$REMOTE_MAKE_NPROC -C $REMOTE_MAKE_DIR FIRRTL_LOGLEVEL=info JAVA_OPTS="$REMOTE_JAVA_OPTS" SBT_OPTS="$REMOTE_SBT_OPTS" ${mapping[$key]} + make -j$REMOTE_MAKE_NPROC -C $REMOTE_MAKE_DIR FIRRTL_LOGLEVEL=info JAVA_TMP_DIR=$JAVA_TMP_DIR SBT_OPTS="$REMOTE_SBT_OPTS" ${mapping[$key]} done diff --git a/.github/workflows/chipyard-full-flow.yml b/.github/workflows/chipyard-full-flow.yml index cc2168e8..22382571 100644 --- a/.github/workflows/chipyard-full-flow.yml +++ b/.github/workflows/chipyard-full-flow.yml @@ -13,6 +13,7 @@ defaults: env: REMOTE_WORK_DIR: ${{ secrets.BUILDDIR }}/cy-ci-shared/cy-${{ github.sha }} + JAVA_TMP_DIR: /tmp/cy-${{ github.sha }}-full jobs: cancel-prior-workflows: diff --git a/variables.mk b/variables.mk index f10cbfa9..1312cbe3 100644 --- a/variables.mk +++ b/variables.mk @@ -202,7 +202,8 @@ sim_common_files ?= $(build_dir)/sim_files.common.f # java arguments used in sbt ######################################################################################### JAVA_HEAP_SIZE ?= 8G -export JAVA_TOOL_OPTIONS ?= -Xmx$(JAVA_HEAP_SIZE) -Xss8M -Djava.io.tmpdir=$(base_dir)/.java_tmp +JAVA_TMP_DIR ?= $(base_dir)/.java_tmp +export JAVA_TOOL_OPTIONS ?= -Xmx$(JAVA_HEAP_SIZE) -Xss8M -Djava.io.tmpdir=$(JAVA_TMP_DIR) ######################################################################################### # default sbt launch command From f0b9f604873ba4a8f83dadc57ae84c004c307656 Mon Sep 17 00:00:00 2001 From: Jerry Zhao Date: Tue, 21 Feb 2023 14:48:15 -0800 Subject: [PATCH 2/2] Fix firesim sbt builds --- .github/scripts/remote-run-firesim-scala-tests.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/scripts/remote-run-firesim-scala-tests.sh b/.github/scripts/remote-run-firesim-scala-tests.sh index 6d475921..960d1706 100755 --- a/.github/scripts/remote-run-firesim-scala-tests.sh +++ b/.github/scripts/remote-run-firesim-scala-tests.sh @@ -16,4 +16,5 @@ cd $REMOTE_CHIPYARD_DIR # Run Firesim Scala Tests export FIRESIM_ENV_SOURCED=1; export COURSIER_CACHE=$REMOTE_WORK_DIR/.coursier-cache -make -C $REMOTE_FIRESIM_DIR JAVA_OPTS="$REMOTE_JAVA_OPTS" SBT_OPTS="$REMOTE_SBT_OPTS" TARGET_SBT_PROJECT="{file:$REMOTE_CHIPYARD_DIR}firechip" testOnly ${mapping[$1]} +JAVA_TOOL_OPTIONS="$REMOTE_JAVA_OPTS -Djava.io.tmpdir=$(mktemp -d -t cy-fsim-XXXXXXXX)" +make -C $REMOTE_FIRESIM_DIR JAVA_TOOL_OPTIONS="$JAVA_TOOL_OPTIONS" SBT_OPTS="$REMOTE_SBT_OPTS" TARGET_SBT_PROJECT="{file:$REMOTE_CHIPYARD_DIR}firechip" testOnly ${mapping[$1]}