From 3467ab15518c55e16991440a8044d8a23d359b30 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Tue, 28 Sep 2021 15:23:16 +0300 Subject: [PATCH] ci: fix the `g++` build and the `alpine-musl` task --- .github/workflows/ci.yml | 16 +++++++++------- vlib/v/builder/cc.v | 17 ++++++++++------- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7d5e580765..6369876ee8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -257,18 +257,20 @@ jobs: - name: Checkout uses: actions/checkout@v2 - - name: Build V - run: | - make CC=clang - - name: Show PWD and Environment + - name: Show Environment run: | echo "PWD:" pwd - echo "ENVIRONMENT" + echo "ENVIRONMENT:" env + echo "C Compiler:" + gcc --version + + - name: Build V + run: CC=gcc make + - name: Test V fixed tests - run: | - ./v -silent test-self + run: ./v -silent test-self macos: needs: no-scheduling diff --git a/vlib/v/builder/cc.v b/vlib/v/builder/cc.v index 7b8166f219..4e4187982f 100644 --- a/vlib/v/builder/cc.v +++ b/vlib/v/builder/cc.v @@ -552,13 +552,16 @@ fn (mut v Builder) cc() { v.setup_output_name() if v.pref.os != .windows && ccompiler.contains('++') { - for file in v.parsed_files { - if file.imports.any(it.mod.contains('sync')) { - x := @VEXE + ' run ' + - os.join_path(@VEXEROOT, 'thirdparty', 'stdatomic', 'nix', 'cpp', 'gen.v') + - ' ' + ccompiler - os.execute(x) - break + cpp_atomic_h_path := '${@VEXEROOT}/thirdparty/stdatomic/nix/cpp/atomic.h' + if !os.exists(cpp_atomic_h_path) { + for file in v.parsed_files { + if file.imports.any(it.mod.contains('sync')) { + $if trace_stdatomic_gen { + eprintln('> creating $cpp_atomic_h_path ...') + } + os.execute('$vexe run ${@VEXEROOT}/thirdparty/stdatomic/nix/cpp/gen.v $ccompiler') + break + } } } }