diff --git a/.github/workflows/foss.yaml b/.github/workflows/foss.yaml index 8463e740..cfc9c1cf 100644 --- a/.github/workflows/foss.yaml +++ b/.github/workflows/foss.yaml @@ -57,7 +57,17 @@ jobs: uses: ./.github/platform_environment_setup/ubuntu - name: Set Bazel version - run: echo ${{ matrix.bazel_version }} >> test/foss/templates/.bazelversion + run: echo ${{ matrix.bazel_version }} > .bazelversion + + - name: Print versions + run: | + bazel version + which bazel + CodeChecker version + echo "[NOTE]: CodeChecker may find different analyzer binaries" \ + "when invoking directly, or in bazel's sandbox environment!" \ + "Be sure to double check during debugging." + CodeChecker analyzers - name: Run Test On Opensource Projects working-directory: test @@ -83,7 +93,17 @@ jobs: uses: ./.github/platform_environment_setup/rhel9 - name: Set Bazel version - run: echo ${{ matrix.bazel_version }} >> test/foss/templates/.bazelversion + run: echo ${{ matrix.bazel_version }} > .bazelversion + + - name: Print versions + run: | + bazel version + which bazel + CodeChecker version + echo "[NOTE]: CodeChecker may find different analyzer binaries" \ + "when invoking directly, or in bazel's sandbox environment!" \ + "Be sure to double check during debugging." + CodeChecker analyzers - name: Run Test On Opensource Projects working-directory: test diff --git a/test/common/base.py b/test/common/base.py index 5e335a2e..0b25d59c 100644 --- a/test/common/base.py +++ b/test/common/base.py @@ -135,10 +135,14 @@ def run_command( cwd=working_dir, ) as process: stdout, stderr = process.communicate() + stdout = stdout.decode("utf-8") + stderr = stderr.decode("utf-8") + logging.debug("stdout: %s", stdout) + logging.debug("stderr: %s", stderr) return ( process.returncode, - f"stdout: {stdout.decode('utf-8')}", - f"stderr: {stderr.decode('utf-8')}", + f"stdout: {stdout}", + f"stderr: {stderr}", ) @classmethod diff --git a/test/foss/templates/.bazelversion b/test/foss/templates/.bazelversion deleted file mode 100644 index f22d756d..00000000 --- a/test/foss/templates/.bazelversion +++ /dev/null @@ -1 +0,0 @@ -6.5.0 diff --git a/test/foss/yaml-cpp/init.sh b/test/foss/yaml-cpp/init.sh index 6321f8dc..671bc8ec 100755 --- a/test/foss/yaml-cpp/init.sh +++ b/test/foss/yaml-cpp/init.sh @@ -14,12 +14,16 @@ # See the License for the specific language governing permissions and # limitations under the License. +set -x + git clone --recurse https://github.com/jbeder/yaml-cpp.git test-proj cd test-proj git checkout yaml-cpp-0.7.0 # This file must be in the root of the project to be analyzed for bazelisk to work -cp ../../templates/.bazelversion ./.bazelversion +bazelversion="../../../../.bazelversion" +[ -f $bazelversion ] && cp $bazelversion . +cat .bazelversion # Add codechecker to the project cat <> BUILD.bazel @@ -52,3 +56,7 @@ EOF # Add codechecker_bazel repo to WORKSPACE cat ../../templates/WORKSPACE.template >> WORKSPACE + +# Check +bazel version +which bazel diff --git a/test/foss/zlib-module/init.sh b/test/foss/zlib-module/init.sh index 080fe172..49e52774 100644 --- a/test/foss/zlib-module/init.sh +++ b/test/foss/zlib-module/init.sh @@ -14,12 +14,17 @@ # See the License for the specific language governing permissions and # limitations under the License. +set -x + git clone --recurse https://github.com/madler/zlib.git test-proj cd test-proj git checkout 5a82f71ed1dfc0bec044d9702463dbdf84ea3b71 # This file must be in the root of the project to be analyzed for bazelisk to work -cp ../../templates/.bazelversion ./.bazelversion +bazelversion="../../../../.bazelversion" +[ -f $bazelversion ] && cp $bazelversion . +cat .bazelversion + # Add codechecker to the project cat <> BUILD.bazel #------------------------------------------------------- @@ -51,3 +56,7 @@ EOF echo "common --enable_bzlmod" > .bazelrc # Add codechecker_bazel repo MODULE.bazel cat ../../templates/MODULE.template >> MODULE.bazel + +# Check +bazel version +which bazel diff --git a/test/foss/zlib/init.sh b/test/foss/zlib/init.sh index ccdb0fe5..773cd75a 100644 --- a/test/foss/zlib/init.sh +++ b/test/foss/zlib/init.sh @@ -14,12 +14,16 @@ # See the License for the specific language governing permissions and # limitations under the License. +set -x + git clone --recurse https://github.com/madler/zlib.git test-proj cd test-proj git checkout 5a82f71ed1dfc0bec044d9702463dbdf84ea3b71 # This file must be in the root of the project to be analyzed for bazelisk to work -cp ../../templates/.bazelversion ./.bazelversion +bazelversion="../../../../.bazelversion" +[ -f $bazelversion ] && cp $bazelversion . +cat .bazelversion # Add codechecker to the project cat <> BUILD.bazel @@ -52,3 +56,7 @@ EOF # Add codechecker_bazel repo to WORKSPACE cat ../../templates/WORKSPACE.template >> WORKSPACE + +# Check +bazel version +which bazel diff --git a/test/unit/external_repository/test_external_repo.py b/test/unit/external_repository/test_external_repo.py index 0028bd3c..e6d9a570 100644 --- a/test/unit/external_repository/test_external_repo.py +++ b/test/unit/external_repository/test_external_repo.py @@ -53,7 +53,7 @@ def setUpClass(cls): logging.debug("No bazel version set, using system default") _, stdout, _ = cls.run_command("bazel --version") cls.BAZEL_VERSION = stdout.split(' ')[2].strip() - logging.debug("Using Bazel", cls.BAZEL_VERSION) + logging.debug("Using Bazel %s", cls.BAZEL_VERSION) @final @classmethod