From d6f3b7a3eaf7ba0a973976ffa65d3cb850dcb2a1 Mon Sep 17 00:00:00 2001 From: Mm2PL Date: Thu, 14 Aug 2025 21:00:26 +0200 Subject: [PATCH 1/7] Try building with c++ compilers (ideally with old standards) --- .github/workflows/nob.yaml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/nob.yaml b/.github/workflows/nob.yaml index 28fcdd7..0f778ac 100644 --- a/.github/workflows/nob.yaml +++ b/.github/workflows/nob.yaml @@ -4,22 +4,25 @@ on: [push, pull_request] jobs: macos: runs-on: macos-latest + strategy: + matrix: + cc: [clang, clang++] steps: - name: Clone GIT repo uses: actions/checkout@v4 - name: Run tests run: | - clang -o nob nob.c + ${{ matrix.cc }} -o nob nob.c ./nob - name: Build how_to-s run: | cd how_to/ - clang -o nob nob.c + ${{ matrix.cc }} -o nob nob.c ./nob ubuntu: strategy: matrix: - cc: [gcc, clang] + cc: [gcc, clang, g++, clang++] runs-on: ubuntu-latest steps: - name: Clone GIT repo @@ -35,6 +38,9 @@ jobs: ./nob windows: runs-on: windows-latest + strategy: + matrix: + standard: [c++14, c11] steps: - name: Clone GIT repo uses: actions/checkout@v4 @@ -46,12 +52,12 @@ jobs: # https://learn.microsoft.com/en-us/cpp/build/building-on-the-command-line?view=msvc-170#create-your-own-command-prompt-shortcut run: | call "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Auxiliary\\Build\\vcvars64.bat" - cl.exe ${{ matrix.hotreload }} /Fe:nob nob.c + cl.exe /std:${{ matrix.standard }} /Fe:nob nob.c nob.exe - name: Build how_to-s shell: cmd run: | call "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Auxiliary\\Build\\vcvars64.bat" cd how_to/ - cl.exe ${{ matrix.hotreload }} /Fe:nob nob.c + cl.exe /std:${{ matrix.standard }} /Fe:nob nob.c nob.exe From 5068e001e78f0409549c9d719d62a5f14a641224 Mon Sep 17 00:00:00 2001 From: Mm2PL Date: Thu, 14 Aug 2025 21:08:32 +0200 Subject: [PATCH 2/7] Insert space to make two stage howto work. --- how_to/010_nob_two_stage/nob.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/how_to/010_nob_two_stage/nob.c b/how_to/010_nob_two_stage/nob.c index 6aada33..227d3e7 100644 --- a/how_to/010_nob_two_stage/nob.c +++ b/how_to/010_nob_two_stage/nob.c @@ -33,7 +33,7 @@ int main(int argc, char **argv) const char *input_path = SRC_BUILD_FOLDER"nob_configed.c"; nob_cc(&cmd); nob_cc_flags(&cmd); - nob_cmd_append(&cmd, "-I.", "-I"BUILD_FOLDER, "-I"SRC_BUILD_FOLDER); // -I is usually the same across all compilers + nob_cmd_append(&cmd, "-I.", "-I" BUILD_FOLDER, "-I" SRC_BUILD_FOLDER); // -I is usually the same across all compilers nob_cc_output(&cmd, output_path); nob_cc_inputs(&cmd, input_path); if (!cmd_run_sync_and_reset(&cmd)) return 1; From 115266926504824a11ff30a9661420e8ec8ed19f Mon Sep 17 00:00:00 2001 From: Mm2PL Date: Thu, 14 Aug 2025 22:40:09 +0200 Subject: [PATCH 3/7] test --- .github/workflows/nob.yaml | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/.github/workflows/nob.yaml b/.github/workflows/nob.yaml index 0f778ac..f12093a 100644 --- a/.github/workflows/nob.yaml +++ b/.github/workflows/nob.yaml @@ -6,35 +6,45 @@ jobs: runs-on: macos-latest strategy: matrix: - cc: [clang, clang++] + - compiler: clang + standard: c99 + - compiler: clang++ + standard: c++20 steps: - name: Clone GIT repo uses: actions/checkout@v4 - name: Run tests run: | - ${{ matrix.cc }} -o nob nob.c + ${{ matrix.compiler }} -o nob nob.c ./nob - name: Build how_to-s run: | cd how_to/ - ${{ matrix.cc }} -o nob nob.c + ${{ matrix.compiler }} -o nob nob.c ./nob ubuntu: strategy: matrix: - cc: [gcc, clang, g++, clang++] + - compiler: clang + standard: c99 + - compiler: clang++ + standard: c++20 + - compiler: gcc + standard: c99 + - compiler: g++ + standard: c++20 runs-on: ubuntu-latest steps: - name: Clone GIT repo uses: actions/checkout@v4 - name: Build tests run: | - ${{ matrix.cc }} -o nob nob.c + ${{ matrix.compiler }} -o nob nob.c ./nob - name: Build how_to-s run: | cd how_to/ - ${{ matrix.cc }} -o nob nob.c + ${{ matrix.compiler }} -o nob nob.c ./nob windows: runs-on: windows-latest From f8e1c8fc410a67f157adb4717cc970b728a741b0 Mon Sep 17 00:00:00 2001 From: Mm2PL Date: Thu, 14 Aug 2025 22:44:19 +0200 Subject: [PATCH 4/7] test2 --- .github/workflows/nob.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/nob.yaml b/.github/workflows/nob.yaml index f12093a..189b908 100644 --- a/.github/workflows/nob.yaml +++ b/.github/workflows/nob.yaml @@ -15,12 +15,12 @@ jobs: uses: actions/checkout@v4 - name: Run tests run: | - ${{ matrix.compiler }} -o nob nob.c + ${{ matrix.compiler }} -o nob nob.c -std=${{ matrix.standard }} ./nob - name: Build how_to-s run: | cd how_to/ - ${{ matrix.compiler }} -o nob nob.c + ${{ matrix.compiler }} -o nob nob.c -std=${{ matrix.standard }} ./nob ubuntu: strategy: @@ -39,12 +39,12 @@ jobs: uses: actions/checkout@v4 - name: Build tests run: | - ${{ matrix.compiler }} -o nob nob.c + ${{ matrix.compiler }} -o nob nob.c -std=${{ matrix.standard }} ./nob - name: Build how_to-s run: | cd how_to/ - ${{ matrix.compiler }} -o nob nob.c + ${{ matrix.compiler }} -o nob nob.c -std=${{ matrix.standard }} ./nob windows: runs-on: windows-latest From 9c28f314e070f936475e71e1d4d08b30a95df83d Mon Sep 17 00:00:00 2001 From: Mm2PL Date: Thu, 14 Aug 2025 22:47:20 +0200 Subject: [PATCH 5/7] test3 --- .github/workflows/nob.yaml | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/.github/workflows/nob.yaml b/.github/workflows/nob.yaml index 189b908..c7b216f 100644 --- a/.github/workflows/nob.yaml +++ b/.github/workflows/nob.yaml @@ -6,10 +6,11 @@ jobs: runs-on: macos-latest strategy: matrix: - - compiler: clang - standard: c99 - - compiler: clang++ - standard: c++20 + compiler: + - exec: clang + std: c99 + - exec: clang++ + std: c++20 steps: - name: Clone GIT repo uses: actions/checkout@v4 @@ -25,14 +26,15 @@ jobs: ubuntu: strategy: matrix: - - compiler: clang - standard: c99 - - compiler: clang++ - standard: c++20 - - compiler: gcc - standard: c99 - - compiler: g++ - standard: c++20 + compiler: + - exec: clang + std: c99 + - exec: clang++ + std: c++20 + - exec: gcc + std: c99 + - exec: g++ + std: c++20 runs-on: ubuntu-latest steps: - name: Clone GIT repo From aafe1f24bfcc649c9ea8c42a8681b7de45cccfb6 Mon Sep 17 00:00:00 2001 From: Mm2PL Date: Thu, 14 Aug 2025 22:49:30 +0200 Subject: [PATCH 6/7] test5 --- .github/workflows/nob.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/nob.yaml b/.github/workflows/nob.yaml index c7b216f..72874b0 100644 --- a/.github/workflows/nob.yaml +++ b/.github/workflows/nob.yaml @@ -16,12 +16,12 @@ jobs: uses: actions/checkout@v4 - name: Run tests run: | - ${{ matrix.compiler }} -o nob nob.c -std=${{ matrix.standard }} + ${{ matrix.compiler.exec.exec }} -o nob nob.c -std=${{ matrix.compiler.std }} ./nob - name: Build how_to-s run: | cd how_to/ - ${{ matrix.compiler }} -o nob nob.c -std=${{ matrix.standard }} + ${{ matrix.compiler.exec }} -o nob nob.c -std=${{ matrix.compiler.std }} ./nob ubuntu: strategy: @@ -41,12 +41,12 @@ jobs: uses: actions/checkout@v4 - name: Build tests run: | - ${{ matrix.compiler }} -o nob nob.c -std=${{ matrix.standard }} + ${{ matrix.compiler.exec }} -o nob nob.c -std=${{ matrix.compiler.std }} ./nob - name: Build how_to-s run: | cd how_to/ - ${{ matrix.compiler }} -o nob nob.c -std=${{ matrix.standard }} + ${{ matrix.compiler.exec }} -o nob nob.c -std=${{ matrix.compiler.std }} ./nob windows: runs-on: windows-latest @@ -64,12 +64,12 @@ jobs: # https://learn.microsoft.com/en-us/cpp/build/building-on-the-command-line?view=msvc-170#create-your-own-command-prompt-shortcut run: | call "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Auxiliary\\Build\\vcvars64.bat" - cl.exe /std:${{ matrix.standard }} /Fe:nob nob.c + cl.exe /std:${{ matrix.compiler.std }} /Fe:nob nob.c nob.exe - name: Build how_to-s shell: cmd run: | call "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Auxiliary\\Build\\vcvars64.bat" cd how_to/ - cl.exe /std:${{ matrix.standard }} /Fe:nob nob.c + cl.exe /std:${{ matrix.compiler.std }} /Fe:nob nob.c nob.exe From 4307eb11908e7148212ef5e92e9c14abe8a2d682 Mon Sep 17 00:00:00 2001 From: Mm2PL Date: Thu, 14 Aug 2025 22:51:14 +0200 Subject: [PATCH 7/7] IDIOT --- .github/workflows/nob.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/nob.yaml b/.github/workflows/nob.yaml index 72874b0..30f36a9 100644 --- a/.github/workflows/nob.yaml +++ b/.github/workflows/nob.yaml @@ -16,7 +16,7 @@ jobs: uses: actions/checkout@v4 - name: Run tests run: | - ${{ matrix.compiler.exec.exec }} -o nob nob.c -std=${{ matrix.compiler.std }} + ${{ matrix.compiler.exec }} -o nob nob.c -std=${{ matrix.compiler.std }} ./nob - name: Build how_to-s run: | @@ -64,12 +64,12 @@ jobs: # https://learn.microsoft.com/en-us/cpp/build/building-on-the-command-line?view=msvc-170#create-your-own-command-prompt-shortcut run: | call "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Auxiliary\\Build\\vcvars64.bat" - cl.exe /std:${{ matrix.compiler.std }} /Fe:nob nob.c + cl.exe /std:${{ matrix.standard }} /Fe:nob nob.c nob.exe - name: Build how_to-s shell: cmd run: | call "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Auxiliary\\Build\\vcvars64.bat" cd how_to/ - cl.exe /std:${{ matrix.compiler.std }} /Fe:nob nob.c + cl.exe /std:${{ matrix.standard }} /Fe:nob nob.c nob.exe