diff --git a/.github/workflows/l10n.yml b/.github/workflows/l10n.yml index 9ffd6aaf742..57c4d51ef21 100644 --- a/.github/workflows/l10n.yml +++ b/.github/workflows/l10n.yml @@ -11,7 +11,8 @@ on: env: # * style job configuration STYLE_FAIL_ON_FAULT: true ## (bool) fail the build if a style job contains a fault (error or warning); may be overridden on a per-job basis - + CARGO_INCREMENTAL: "0" + RUST_BACKTRACE: "1" permissions: contents: read # to fetch code (actions/checkout) @@ -25,8 +26,6 @@ jobs: l10n_build_test: name: L10n/Build and Test runs-on: ${{ matrix.job.os }} - env: - CARGO_INCREMENTAL: 0 strategy: fail-fast: false matrix: @@ -38,7 +37,6 @@ jobs: - uses: actions/checkout@v6 with: persist-credentials: false - - uses: dtolnay/rust-toolchain@stable - uses: taiki-e/install-action@nextest - uses: Swatinem/rust-cache@v2 - name: Run sccache-cache @@ -75,8 +73,6 @@ jobs: ## Test l10n functionality cargo test -p uucore locale cargo test - env: - RUST_BACKTRACE: "1" l10n_fluent_syntax: name: L10n/Fluent Syntax Check @@ -98,7 +94,7 @@ jobs: shell: bash run: | - fluent_dirs=$(find . -name "*.ftl" -type f -exec dirname {} \; | sort | uniq 2>/dev/null || true) + fluent_dirs=$(find . -name "*.ftl" -type f -exec dirname {} \; | sort | uniq 2>/dev/null || :) if [ -n "$fluent_dirs" ]; then echo "Found Fluent directories:" @@ -133,13 +129,10 @@ jobs: l10n_clap_error_localization: name: L10n/Clap Error Localization Test runs-on: ubuntu-latest - env: - CARGO_INCREMENTAL: 0 steps: - uses: actions/checkout@v6 with: persist-credentials: false - - uses: dtolnay/rust-toolchain@stable - uses: Swatinem/rust-cache@v2 - name: Run sccache-cache id: sccache-setup @@ -206,8 +199,6 @@ jobs: echo "✗ ERROR: English clap error localization not working properly" exit 1 fi - env: - RUST_BACKTRACE: "1" - name: Test French clap error localization shell: bash @@ -271,8 +262,6 @@ jobs: echo "✗ No ANSI color codes found - colors may not be working" echo "::warning::ANSI color codes not detected in clap error output" fi - env: - RUST_BACKTRACE: "1" - name: Test clap localization with multiple utilities shell: bash @@ -303,19 +292,14 @@ jobs: echo "✗ ERROR: Clap localization not working for enough utilities" exit 1 fi - env: - RUST_BACKTRACE: "1" l10n_french_integration: name: L10n/French Integration Test runs-on: ubuntu-latest - env: - CARGO_INCREMENTAL: 0 steps: - uses: actions/checkout@v6 with: persist-credentials: false - - uses: dtolnay/rust-toolchain@stable - uses: Swatinem/rust-cache@v2 - name: Run sccache-cache id: sccache-setup @@ -418,14 +402,10 @@ jobs: echo "✗ ERROR: No French strings were detected, but commands executed successfully" exit 1 fi - env: - RUST_BACKTRACE: "1" l10n_multicall_binary_install: name: L10n/Multi-call Binary Install Test runs-on: ${{ matrix.job.os }} - env: - CARGO_INCREMENTAL: 0 strategy: fail-fast: false matrix: @@ -436,7 +416,6 @@ jobs: - uses: actions/checkout@v6 with: persist-credentials: false - - uses: dtolnay/rust-toolchain@stable - uses: Swatinem/rust-cache@v2 - name: Run sccache-cache id: sccache-setup @@ -477,7 +456,7 @@ jobs: # First check if binary exists after build echo "Checking if coreutils was built..." - ls -la target/release-small/coreutils || echo "No coreutils binary in target/release-small/" + target/release-small/coreutils --version || echo "No coreutils binary in target/release-small/" make FEATURES="${{ matrix.job.features }}" PROFILE=release-small MULTICALL=y @@ -486,7 +465,7 @@ jobs: echo "Running make install..." echo "Before install - checking what we have:" - ls -la target/release-small/coreutils 2>/dev/null || echo "No coreutils in target/release-small" + target/release-small/coreutils --version 2>/dev/null || echo "No coreutils in target/release-small" # Run make install with verbose output to see what happens echo "About to run: make install DESTDIR=\"$INSTALL_DIR\" PREFIX=/usr PROFILE=release-small MULTICALL=y" @@ -506,9 +485,8 @@ jobs: echo "Current directory: $(pwd)" echo "INSTALL_DIR: $INSTALL_DIR" echo "Checking if build succeeded..." - if [ -f "target/release-small/coreutils" ]; then + if target/release-small/coreutils --version; then echo "✓ Build succeeded - coreutils binary exists in target/release-small/" - ls -la target/release-small/coreutils else echo "✗ Build failed - no coreutils binary in target/release-small/" echo "Contents of target/release-small/:" @@ -542,7 +520,7 @@ jobs: find "$INSTALL_DIR" -type f 2>/dev/null | head -50 # As a last resort, check if it's in the build directory - if [ -f "target/release/coreutils" ]; then + if "target/release/coreutils" --version; then echo "Using binary from build directory as fallback" COREUTILS_BIN="$(pwd)/target/release/coreutils" export COREUTILS_BIN @@ -581,8 +559,6 @@ jobs: l10n_installation_test: name: L10n/Installation Test (Make & Cargo) runs-on: ${{ matrix.job.os }} - env: - CARGO_INCREMENTAL: 0 strategy: fail-fast: false matrix: @@ -593,7 +569,6 @@ jobs: - uses: actions/checkout@v6 with: persist-credentials: false - - uses: dtolnay/rust-toolchain@stable - uses: Swatinem/rust-cache@v2 - name: Run sccache-cache id: sccache-setup @@ -635,9 +610,8 @@ jobs: # Verify installation echo "Testing make-installed binaries..." - if [ -f "$MAKE_INSTALL_DIR/usr/bin/coreutils" ]; then + if "$MAKE_INSTALL_DIR/usr/bin/coreutils" --version; then echo "✓ coreutils binary installed via make successfully" - "$MAKE_INSTALL_DIR/usr/bin/coreutils" --version else echo "✗ coreutils binary not found after make install" exit 1 @@ -736,9 +710,8 @@ jobs: # Verify installation echo "Testing cargo-installed binaries..." - if [ -f "$CARGO_INSTALL_DIR/bin/coreutils" ]; then + if "$CARGO_INSTALL_DIR/bin/coreutils" --version; then echo "✓ coreutils binary installed successfully" - "$CARGO_INSTALL_DIR/bin/coreutils" --version else echo "✗ coreutils binary not found after cargo install" exit 1 @@ -778,7 +751,7 @@ jobs: echo "Checking structure of coreutils-l10n-repo:" ls -la coreutils-l10n-repo/ | head -10 echo "Looking for locales directory:" - find coreutils-l10n-repo -name "*.ftl" -type f 2>/dev/null | head -10 || true + find coreutils-l10n-repo -name "*.ftl" -type f 2>/dev/null | head -10 || : echo "Checking specific utilities:" ls -la coreutils-l10n-repo/src/uu/ls/locales/ 2>/dev/null || echo "No ls directory in correct location" find coreutils-l10n-repo -path "*/ls/*.ftl" 2>/dev/null | head -5 || echo "No ls ftl files found" @@ -812,7 +785,7 @@ jobs: # Debug: Show what was actually installed echo "Files installed in locale directory:" - find "$LOCALE_DIR" -name "*.ftl" 2>/dev/null | head -10 || true + find "$LOCALE_DIR" -name "*.ftl" 2>/dev/null | head -10 || : # Fallback: If no files were installed from l10n repo, try copying from main repo if [ -z "$(find "$LOCALE_DIR" -name "*.ftl" 2>/dev/null)" ]; then @@ -822,11 +795,11 @@ jobs: if [ -d "$util_dir/locales" ]; then echo "Copying locales for $util_name from main repo..." mkdir -p "$LOCALE_DIR/$util_name" - cp "$util_dir/locales"/*.ftl "$LOCALE_DIR/$util_name/" 2>/dev/null || true + cp "$util_dir/locales"/*.ftl "$LOCALE_DIR/$util_name/" 2>/dev/null || : fi done echo "Files after fallback:" - find "$LOCALE_DIR" -name "*.ftl" 2>/dev/null | head -10 || true + find "$LOCALE_DIR" -name "*.ftl" 2>/dev/null | head -10 || : fi echo "✓ Additional locale files installed" @@ -841,7 +814,7 @@ jobs: LOCALE_DIR="$CARGO_INSTALL_DIR/share/locales" echo "Checking installed binary..." - if [ ! -f "$CARGO_INSTALL_DIR/bin/coreutils" ]; then + if ! "$CARGO_INSTALL_DIR/bin/coreutils" --version; then echo "✗ coreutils binary not found" exit 1 fi @@ -926,13 +899,10 @@ jobs: l10n_locale_support_verification: name: L10n/Locale Support Verification runs-on: ubuntu-latest - env: - CARGO_INCREMENTAL: 0 steps: - uses: actions/checkout@v6 with: persist-credentials: false - - uses: dtolnay/rust-toolchain@stable - uses: Swatinem/rust-cache@v2 - name: Run sccache-cache id: sccache-setup @@ -969,7 +939,7 @@ jobs: # Debug: Show what was installed echo "Contents of installation directory:" - find "$INSTALL_DIR" -type f -name "coreutils" -o -name "ls" 2>/dev/null | head -20 || true + find "$INSTALL_DIR" -type f -name "coreutils" -o -name "ls" 2>/dev/null | head -20 || : echo "Looking for binaries in: $INSTALL_DIR/usr/bin/" ls -la "$INSTALL_DIR/usr/bin/" || echo "Directory not found" @@ -1157,19 +1127,14 @@ jobs: fi echo "✓ All locale-specific functionality tests passed" - env: - RUST_BACKTRACE: "1" l10n_embedded_locale_regression_test: name: L10n/Embedded Locale Regression Test runs-on: ubuntu-latest - env: - CARGO_INCREMENTAL: 0 steps: - uses: actions/checkout@v6 with: persist-credentials: false - - uses: dtolnay/rust-toolchain@stable - uses: Swatinem/rust-cache@v2 - name: Run sccache-cache id: sccache-setup @@ -1196,7 +1161,6 @@ jobs: - uses: actions/checkout@v6 with: persist-credentials: false - - uses: dtolnay/rust-toolchain@stable - uses: Swatinem/rust-cache@v2 with: # Use different cache key for each build to avoid conflicts @@ -1228,7 +1192,6 @@ jobs: - uses: actions/checkout@v6 with: persist-credentials: false - - uses: dtolnay/rust-toolchain@stable - uses: Swatinem/rust-cache@v2 with: # Use different cache key for each build to avoid conflicts @@ -1260,7 +1223,6 @@ jobs: - uses: actions/checkout@v6 with: persist-credentials: false - - uses: dtolnay/rust-toolchain@stable - uses: Swatinem/rust-cache@v2 with: # Use different cache key for each build to avoid conflicts @@ -1290,13 +1252,10 @@ jobs: l10n_locale_embedding_cargo_install: name: L10n/Locale Embedding - Cargo Install runs-on: ubuntu-latest - env: - CARGO_INCREMENTAL: 0 steps: - uses: actions/checkout@v6 with: persist-credentials: false - - uses: dtolnay/rust-toolchain@stable - uses: Swatinem/rust-cache@v2 with: key: cargo-install-locale-embedding