Skip to content

Conversation

@boomanaiden154
Copy link
Contributor

These are more idiomatic in bash.

These are more idiomatic in bash.
@llvmbot llvmbot added the infrastructure Bugs about LLVM infrastructure label Nov 18, 2025
@llvmbot
Copy link
Member

llvmbot commented Nov 18, 2025

@llvm/pr-subscribers-infrastructure

Author: Aiden Grossman (boomanaiden154)

Changes

These are more idiomatic in bash.


Full diff: https://github.com/llvm/llvm-project/pull/168575.diff

3 Files Affected:

  • (modified) .ci/monolithic-linux.sh (+3-3)
  • (modified) .ci/monolithic-windows.sh (+2-2)
  • (modified) .ci/utils.sh (+5-5)
diff --git a/.ci/monolithic-linux.sh b/.ci/monolithic-linux.sh
index ca619aa7e98a1..e6a59a2ae1306 100755
--- a/.ci/monolithic-linux.sh
+++ b/.ci/monolithic-linux.sh
@@ -64,13 +64,13 @@ cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
 
 start-group "ninja"
 
-if [[ "${targets}" != "" ]]; then
+if [[ -n "${targets}" ]]; then
   # Targets are not escaped as they are passed as separate arguments.
   ninja -C "${BUILD_DIR}" -k 0 ${targets} |& tee ninja.log
   cp ${BUILD_DIR}/.ninja_log ninja.ninja_log
 fi
 
-if [[ "${runtime_targets}" != "" ]]; then
+if [[ -n "${runtime_targets}" ]]; then
   start-group "ninja Runtimes"
 
   ninja -C "${BUILD_DIR}" ${runtime_targets} |& tee ninja_runtimes.log
@@ -79,7 +79,7 @@ fi
 
 # Compiling runtimes with just-built Clang and running their tests
 # as an additional testing for Clang.
-if [[ "${runtime_targets_needs_reconfig}" != "" ]]; then
+if [[ -n "${runtime_targets_needs_reconfig}" ]]; then
   start-group "CMake Runtimes C++26"
 
   cmake \
diff --git a/.ci/monolithic-windows.sh b/.ci/monolithic-windows.sh
index 99e7758ce8d79..36941644c6a6c 100755
--- a/.ci/monolithic-windows.sh
+++ b/.ci/monolithic-windows.sh
@@ -51,13 +51,13 @@ cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
 
 start-group "ninja"
 
-if [[ "${targets}" != "" ]]; then
+if [[ -n "${targets}" ]]; then
   # Targets are not escaped as they are passed as separate arguments.
   ninja -C "${BUILD_DIR}" -k 0 ${targets} |& tee ninja.log
   cp ${BUILD_DIR}/.ninja_log ninja.ninja_log
 fi
 
-if [[ "${runtimes_targets}" != "" ]]; then
+if [[ -n "${runtimes_targets}" ]]; then
   start-group "ninja runtimes"
   
   ninja -C "${BUILD_DIR}" -k 0 ${runtimes_targets} |& tee ninja_runtimes.log
diff --git a/.ci/utils.sh b/.ci/utils.sh
index c364f9395d67b..713a07ba5d898 100644
--- a/.ci/utils.sh
+++ b/.ci/utils.sh
@@ -33,7 +33,7 @@ function at-exit {
   # If building fails there will be no results files.
   shopt -s nullglob
 
-  if [[ "$GITHUB_ACTIONS" != "" ]]; then
+  if [[ -n "$GITHUB_ACTIONS" ]]; then
     python "${MONOREPO_ROOT}"/.ci/generate_test_report_github.py \
       $retcode "${BUILD_DIR}"/test-results.*.xml "${MONOREPO_ROOT}"/ninja*.log \
       >> $GITHUB_STEP_SUMMARY
@@ -44,7 +44,7 @@ function at-exit {
   fi
 
   if [[ "$retcode" != "0" ]]; then
-    if [[ "$GITHUB_ACTIONS" != "" ]]; then
+    if [[ -n "$GITHUB_ACTIONS" ]]; then
       python "${MONOREPO_ROOT}"/.ci/premerge_advisor_upload.py \
         $(git rev-parse HEAD~1) $GITHUB_RUN_NUMBER \
         "${BUILD_DIR}"/test-results.*.xml "${MONOREPO_ROOT}"/ninja*.log
@@ -59,10 +59,10 @@ trap at-exit EXIT
 
 function start-group {
   groupname=$1
-  if [[ "$GITHUB_ACTIONS" != "" ]]; then
+  if [[ -n "$GITHUB_ACTIONS" ]]; then
     echo "::endgroup"
     echo "::group::$groupname"
-  elif [[ "$POSTCOMMIT_CI" != "" ]]; then
+  elif [[ -n "$POSTCOMMIT_CI" ]]; then
     echo "@@@$STEP@@@"
   else
     echo "Starting $groupname"
@@ -73,6 +73,6 @@ export PIP_BREAK_SYSTEM_PACKAGES=1
 pip install -q -r "${MONOREPO_ROOT}"/.ci/all_requirements.txt
 
 # The ARM64 builders run on AWS and don't have access to the GCS cache.
-if [[ "$GITHUB_ACTIONS" != "" ]] && [[ "$RUNNER_ARCH" != "ARM64" ]]; then
+if [[ -n "$GITHUB_ACTIONS" ]] && [[ "$RUNNER_ARCH" != "ARM64" ]]; then
   python .ci/cache_lit_timing_files.py download
 fi

@github-actions
Copy link

🐧 Linux x64 Test Results

  • 193728 tests passed
  • 5831 tests skipped

@boomanaiden154 boomanaiden154 merged commit 40ed57c into llvm:main Nov 18, 2025
11 of 12 checks passed
@boomanaiden154 boomanaiden154 deleted the premerge-bash-dash-z branch November 18, 2025 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

infrastructure Bugs about LLVM infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants