diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 99e7e239..e6b7729f 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -22,6 +22,11 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true + +env: + FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true + + jobs: analyze: name: Analyze @@ -30,20 +35,18 @@ jobs: actions: read contents: read security-events: write - strategy: - fail-fast: false steps: - - name: Harden Runner - uses: step-security/harden-runner@fe104658747b27e96e4f7e80cd0a94068e53901d # v2.16.1 - with: - egress-policy: audit - + - name: Harden Runner + uses: step-security/harden-runner@fe104658747b27e96e4f7e80cd0a94068e53901d # v2.16.1 + with: + egress-policy: audit + - name: Checkout repository - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Initialize CodeQL - uses: github/codeql-action/init@c10b8064de6f491fea524254123dbe5e09572f13 # v3.29.5 + uses: github/codeql-action/init@c10b8064de6f491fea524254123dbe5e09572f13 # v3.29.5 with: languages: go queries: security-and-quality @@ -53,4 +56,4 @@ jobs: go build ./cmd/cbuild - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@c10b8064de6f491fea524254123dbe5e09572f13 # v3.29.5 + uses: github/codeql-action/analyze@c10b8064de6f491fea524254123dbe5e09572f13 # v3.29.5 diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml index 2987bbab..6a76e1b4 100644 --- a/.github/workflows/dependency-review.yml +++ b/.github/workflows/dependency-review.yml @@ -6,6 +6,9 @@ on: permissions: contents: write +env: + FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true + jobs: dependency-review: if: github.repository_owner == 'Open-CMSIS-Pack' diff --git a/.github/workflows/global.yaml b/.github/workflows/global.yaml index b5bdb980..c26cec9b 100644 --- a/.github/workflows/global.yaml +++ b/.github/workflows/global.yaml @@ -12,6 +12,9 @@ on: # Declare default permissions as read only. permissions: read-all +env: + FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true + jobs: copyright: runs-on: ubuntu-latest diff --git a/.github/workflows/markdown.yml b/.github/workflows/markdown.yml index eade1bb9..20b1f0c9 100644 --- a/.github/workflows/markdown.yml +++ b/.github/workflows/markdown.yml @@ -10,6 +10,9 @@ on: # Declare default permissions as read only. permissions: read-all +env: + FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true + jobs: markdown-check: uses: Open-CMSIS-Pack/workflows-and-actions-collection/.github/workflows/markdown-lint.yml@v1.0.3 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 91e88f0b..2eb4ea3f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,6 +13,9 @@ on: permissions: contents: read +env: + FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true + jobs: build-and-verify: permissions: diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 4e18cc26..224a3ee1 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -14,6 +14,9 @@ on: # Declare default permissions as read only. permissions: read-all +env: + FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true + jobs: analysis: # Avoid running this on forks diff --git a/.github/workflows/tpip-check.yml b/.github/workflows/tpip-check.yml index 5fd164ee..c9fc7217 100644 --- a/.github/workflows/tpip-check.yml +++ b/.github/workflows/tpip-check.yml @@ -13,6 +13,7 @@ on: env: tpip_report: "third_party_licenses.md" + FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true permissions: contents: read diff --git a/.gitignore b/.gitignore index 66fd13c9..15e93696 100644 --- a/.gitignore +++ b/.gitignore @@ -1,15 +1,23 @@ # Binaries for programs and plugins -*.exe -*.exe~ -*.dll -*.so -*.dylib +**/*.bat +**/*.exe +**/*.exe~ +**/*.dll +**/*.so +**/*.dylib # Test binary, built with `go test -c` *.test # Output of the go coverage tool, specifically when used with LiteIDE *.out +**/.clangd # Dependency directories (remove the comment below to include it) # vendor/ + +# Folders +**/etc/* +.vscode +test/*/ +!test/data/ diff --git a/cmd/cbuild/commands/list/list_contexts.go b/cmd/cbuild/commands/list/list_contexts.go index a8d952b3..fd0efb10 100644 --- a/cmd/cbuild/commands/list/list_contexts.go +++ b/cmd/cbuild/commands/list/list_contexts.go @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023-2024 Arm Limited. All rights reserved. + * Copyright (c) 2023-2026 Arm Limited. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 */ @@ -52,7 +52,9 @@ func listContexts(cmd *cobra.Command, args []string) error { filter, _ := cmd.Flags().GetString("filter") p := csolution.CSolutionBuilder{ BuilderParams: builder.BuilderParams{ - Runner: utils.Runner{}, + Runner: utils.Runner{ + IsListCmd: true, + }, Options: builder.Options{ SchemaChk: !noSchemaChk, Filter: filter, diff --git a/cmd/cbuild/commands/list/list_environment.go b/cmd/cbuild/commands/list/list_environment.go index b3ffacbf..1e30fd16 100644 --- a/cmd/cbuild/commands/list/list_environment.go +++ b/cmd/cbuild/commands/list/list_environment.go @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023-2024 Arm Limited. All rights reserved. + * Copyright (c) 2023-2026 Arm Limited. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 */ @@ -26,7 +26,9 @@ func listEnvironment(cmd *cobra.Command, args []string) error { p := csolution.CSolutionBuilder{ BuilderParams: builder.BuilderParams{ - Runner: utils.Runner{}, + Runner: utils.Runner{ + IsListCmd: true, + }, InstallConfigs: configs, }, } diff --git a/cmd/cbuild/commands/list/list_target_sets.go b/cmd/cbuild/commands/list/list_target_sets.go index 38ef41ca..75ce51e4 100644 --- a/cmd/cbuild/commands/list/list_target_sets.go +++ b/cmd/cbuild/commands/list/list_target_sets.go @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025 Arm Limited. All rights reserved. + * Copyright (c) 2025-2026 Arm Limited. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 */ @@ -55,7 +55,9 @@ func listTargetSets(cmd *cobra.Command, args []string) error { p := csolution.CSolutionBuilder{ BuilderParams: builder.BuilderParams{ - Runner: utils.Runner{}, + Runner: utils.Runner{ + IsListCmd: true, + }, Options: builder.Options{ SchemaChk: !noSchemaChk, Filter: filter, diff --git a/cmd/cbuild/commands/list/list_toolchains.go b/cmd/cbuild/commands/list/list_toolchains.go index a80121b2..04880189 100644 --- a/cmd/cbuild/commands/list/list_toolchains.go +++ b/cmd/cbuild/commands/list/list_toolchains.go @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023-2024 Arm Limited. All rights reserved. + * Copyright (c) 2023-2026 Arm Limited. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 */ @@ -53,7 +53,9 @@ func listToolchains(cmd *cobra.Command, args []string) error { p := csolution.CSolutionBuilder{ BuilderParams: builder.BuilderParams{ - Runner: utils.Runner{}, + Runner: utils.Runner{ + IsListCmd: true, + }, Options: builder.Options{ Contexts: contexts, UseContextSet: useContextSet, diff --git a/pkg/utils/exec.go b/pkg/utils/exec.go index 6099ff8f..6d216f18 100644 --- a/pkg/utils/exec.go +++ b/pkg/utils/exec.go @@ -26,8 +26,9 @@ type RunnerInterface interface { } type Runner struct { - outBytes []byte - quiet bool + outBytes []byte // Captures the output bytes from the executed command + quiet bool // If true, suppresses output to the standard logger + IsListCmd bool // Indicates if the current command is a 'list' command } func (r *Runner) Write(bytes []byte) (n int, err error) { @@ -50,7 +51,7 @@ func (r Runner) ExecuteCommand(program string, quiet bool, args ...string) (stri } var err error - if !quiet && isTerminal() { + if !r.IsListCmd && isTerminal() { // Use pty to preserve colors and interactive output ptmx, ptyErr := pty.New() if ptyErr == nil {