From 39d2b252f262337e3c195fc921c8ef0de6bafffe Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Thu, 25 Sep 2025 20:55:27 +0000 Subject: [PATCH 01/29] Try ccache for lib build --- .circleci/config.yml | 9 ++++++++- test/third_party/posixtestsuite | 2 +- tools/compile.py | 4 ++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 19423fe3d1fd8..a064fcffd8e70 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -169,7 +169,7 @@ commands: command: | ./emcc --clear-cache - pip-install - - run: apt-get install -q -y ninja-build + - run: apt-get install -q -y ninja-build ccache - run: name: embuilder build ALL command: | @@ -207,6 +207,11 @@ commands: - vms/ - wasi-sdk/ - .jsvu/ + - save_cache: + paths: + - ccache_dir/ + key: "ccache" + prepare-for-tests: description: "Setup emscripten tests" steps: @@ -535,6 +540,8 @@ jobs: environment: EMCC_CORES: 16 EMCC_USE_NINJA: 1 + CCACHE_BASE_DIR: "ccache_dir" + EM_COMPILER_WRAPPER: "ccache" steps: - checkout - run: diff --git a/test/third_party/posixtestsuite b/test/third_party/posixtestsuite index 7ac21b152494f..869e266b090a8 160000 --- a/test/third_party/posixtestsuite +++ b/test/third_party/posixtestsuite @@ -1 +1 @@ -Subproject commit 7ac21b152494f22d7778ac35ddf3c04083111a82 +Subproject commit 869e266b090a8d44e51bb040904c942556b1e4ab diff --git a/tools/compile.py b/tools/compile.py index 0cc5d33e336f1..a9daa949dd9a3 100644 --- a/tools/compile.py +++ b/tools/compile.py @@ -140,7 +140,7 @@ def array_contains_any_of(hay, needles): if '-nostdinc' not in user_args: if not settings.USE_SDL: - cflags += ['-Xclang', '-iwithsysroot' + os.path.join('/include', 'fakesdl')] - cflags += ['-Xclang', '-iwithsysroot' + os.path.join('/include', 'compat')] + cflags += ['-Xclang','-iwithsysroot' + os.path.join('/include', 'fakesdl')] + cflags += ['-Xclang','-iwithsysroot' + os.path.join('/include', 'compat')] return cflags From 68d11655dcdf1b4a8170f2ed442b0e46f73c897b Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Thu, 25 Sep 2025 20:58:28 +0000 Subject: [PATCH 02/29] smaller build --- .circleci/config.yml | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a064fcffd8e70..6218bb709f1f1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -173,27 +173,27 @@ commands: - run: name: embuilder build ALL command: | - ./embuilder build ALL - ./test/runner test_hello_world - - run: - name: embuilder (LTO) - command: | - ./embuilder build MINIMAL --lto - ./test/runner test_hello_world - - run: - name: embuilder (WASM64) - command: | - ./embuilder build MINIMAL --wasm64 - - run: - name: embuilder (PIC) - command: | - ./embuilder build MINIMAL_PIC --pic - ./test/runner test_hello_world - - run: - name: embuilder (PIC+LTO) - command: | - ./embuilder build MINIMAL --pic --lto + ./embuilder build MINIMAL ./test/runner test_hello_world + # - run: + # name: embuilder (LTO) + # command: | + # ./embuilder build MINIMAL --lto + # ./test/runner test_hello_world + # - run: + # name: embuilder (WASM64) + # command: | + # ./embuilder build MINIMAL --wasm64 + # - run: + # name: embuilder (PIC) + # command: | + # ./embuilder build MINIMAL_PIC --pic + # ./test/runner test_hello_world + # - run: + # name: embuilder (PIC+LTO) + # command: | + # ./embuilder build MINIMAL --pic --lto + # ./test/runner test_hello_world persist: description: "Persist the emsdk, libraries, and engines" steps: From 3bc90a5ecd9a0727c54bac95efd270eb791f338c Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Thu, 25 Sep 2025 21:08:06 +0000 Subject: [PATCH 03/29] absolute directory, print stats, restore cache --- .circleci/config.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6218bb709f1f1..b4a5863fc6dee 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -175,6 +175,7 @@ commands: command: | ./embuilder build MINIMAL ./test/runner test_hello_world + ccache --print-stats # - run: # name: embuilder (LTO) # command: | @@ -209,7 +210,7 @@ commands: - .jsvu/ - save_cache: paths: - - ccache_dir/ + - ~/ccache_dir/ key: "ccache" prepare-for-tests: @@ -540,7 +541,7 @@ jobs: environment: EMCC_CORES: 16 EMCC_USE_NINJA: 1 - CCACHE_BASE_DIR: "ccache_dir" + CCACHE_BASE_DIR: "~/ccache_dir" EM_COMPILER_WRAPPER: "ccache" steps: - checkout @@ -569,6 +570,8 @@ jobs: tar xvf wasi-sysroot-11.0.tar.gz -C ~/wasi-sdk/ - install-v8 - install-emsdk + - restore_cache: + key: "ccache" - build-libs - run: name: Clean build directory From 7e6a05fa68e598689d43576f445d4e2d61265712 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Thu, 25 Sep 2025 21:17:55 +0000 Subject: [PATCH 04/29] use a new key --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b4a5863fc6dee..520aaa004c3ac 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -211,7 +211,7 @@ commands: - save_cache: paths: - ~/ccache_dir/ - key: "ccache" + key: "ccache2" prepare-for-tests: description: "Setup emscripten tests" @@ -571,7 +571,7 @@ jobs: - install-v8 - install-emsdk - restore_cache: - key: "ccache" + key: "ccache2" - build-libs - run: name: Clean build directory From 7f32ac3080002f4726732fb4f9115d1bca522691 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Thu, 25 Sep 2025 21:29:08 +0000 Subject: [PATCH 05/29] rename phase --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 520aaa004c3ac..2721425a85f49 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -209,6 +209,7 @@ commands: - wasi-sdk/ - .jsvu/ - save_cache: + name: "Save CCache cache" paths: - ~/ccache_dir/ key: "ccache2" From 4312b657d32dd6a975169b1ff2a254cd07dad57a Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Thu, 25 Sep 2025 21:34:16 +0000 Subject: [PATCH 06/29] fix env var --- .circleci/config.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2721425a85f49..db738e56ab237 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -212,7 +212,7 @@ commands: name: "Save CCache cache" paths: - ~/ccache_dir/ - key: "ccache2" + key: "ccache3" prepare-for-tests: description: "Setup emscripten tests" @@ -542,7 +542,7 @@ jobs: environment: EMCC_CORES: 16 EMCC_USE_NINJA: 1 - CCACHE_BASE_DIR: "~/ccache_dir" + CCACHE_DIR: "~/ccache_dir" EM_COMPILER_WRAPPER: "ccache" steps: - checkout @@ -572,7 +572,7 @@ jobs: - install-v8 - install-emsdk - restore_cache: - key: "ccache2" + key: "ccache3" - build-libs - run: name: Clean build directory From 7ae8ffde8e848130d3c5e801546cf7ce21b8239b Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Thu, 25 Sep 2025 21:54:17 +0000 Subject: [PATCH 07/29] debug ccache --- .circleci/config.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index db738e56ab237..e5ced96997fe1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -171,9 +171,9 @@ commands: - pip-install - run: apt-get install -q -y ninja-build ccache - run: - name: embuilder build ALL + name: embuilder build crtbegin command: | - ./embuilder build MINIMAL + ./embuilder build crtbegin ./test/runner test_hello_world ccache --print-stats # - run: @@ -212,7 +212,7 @@ commands: name: "Save CCache cache" paths: - ~/ccache_dir/ - key: "ccache3" + key: "ccache4" prepare-for-tests: description: "Setup emscripten tests" @@ -544,6 +544,7 @@ jobs: EMCC_USE_NINJA: 1 CCACHE_DIR: "~/ccache_dir" EM_COMPILER_WRAPPER: "ccache" + EMCC_DEBUG: 1 steps: - checkout - run: @@ -572,7 +573,7 @@ jobs: - install-v8 - install-emsdk - restore_cache: - key: "ccache3" + key: "ccache4" - build-libs - run: name: Clean build directory From 6fe55442e2df6ebcd8717c634fba703ab6cbf9d2 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Thu, 25 Sep 2025 22:00:42 +0000 Subject: [PATCH 08/29] unset CCACHE_DIR --- .circleci/config.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e5ced96997fe1..dc1e9ac879b3f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -211,8 +211,8 @@ commands: - save_cache: name: "Save CCache cache" paths: - - ~/ccache_dir/ - key: "ccache4" + - ~/.ccache + key: "ccache5" prepare-for-tests: description: "Setup emscripten tests" @@ -542,7 +542,7 @@ jobs: environment: EMCC_CORES: 16 EMCC_USE_NINJA: 1 - CCACHE_DIR: "~/ccache_dir" + #CCACHE_DIR: "~/ccache_dir" EM_COMPILER_WRAPPER: "ccache" EMCC_DEBUG: 1 steps: @@ -573,7 +573,7 @@ jobs: - install-v8 - install-emsdk - restore_cache: - key: "ccache4" + key: "ccache5" - build-libs - run: name: Clean build directory From 81563456805b592904cfed74c4681082d247cac8 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Thu, 25 Sep 2025 22:07:15 +0000 Subject: [PATCH 09/29] name restore step --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index dc1e9ac879b3f..5f0ca30442c7c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -573,6 +573,7 @@ jobs: - install-v8 - install-emsdk - restore_cache: + name: "Restore CCache cache" key: "ccache5" - build-libs - run: From 010f7a2a889d7dc299291a6aa2ea7c1095d67daa Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Thu, 25 Sep 2025 22:14:56 +0000 Subject: [PATCH 10/29] bigger test --- .circleci/config.yml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5f0ca30442c7c..1e18027bb657f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -171,9 +171,9 @@ commands: - pip-install - run: apt-get install -q -y ninja-build ccache - run: - name: embuilder build crtbegin + name: embuilder build MINIMAL command: | - ./embuilder build crtbegin + ./embuilder build MINIMAL ./test/runner test_hello_world ccache --print-stats # - run: @@ -195,6 +195,11 @@ commands: # command: | # ./embuilder build MINIMAL --pic --lto # ./test/runner test_hello_world + - run: + name: "Ccache stats" + command: | + ccache --print-stats + persist: description: "Persist the emsdk, libraries, and engines" steps: @@ -209,10 +214,10 @@ commands: - wasi-sdk/ - .jsvu/ - save_cache: - name: "Save CCache cache" + name: "Save Ccache cache" paths: - ~/.ccache - key: "ccache5" + key: "ccache6" prepare-for-tests: description: "Setup emscripten tests" @@ -542,9 +547,7 @@ jobs: environment: EMCC_CORES: 16 EMCC_USE_NINJA: 1 - #CCACHE_DIR: "~/ccache_dir" EM_COMPILER_WRAPPER: "ccache" - EMCC_DEBUG: 1 steps: - checkout - run: @@ -574,7 +577,7 @@ jobs: - install-emsdk - restore_cache: name: "Restore CCache cache" - key: "ccache5" + key: "ccache6" - build-libs - run: name: Clean build directory From 98ffe312b6901c8fc569e255e2075fc09ba5518f Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Thu, 25 Sep 2025 22:22:15 +0000 Subject: [PATCH 11/29] rename --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1e18027bb657f..b5e8ab71fe3f4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -576,7 +576,7 @@ jobs: - install-v8 - install-emsdk - restore_cache: - name: "Restore CCache cache" + name: "Restore Ccache cache" key: "ccache6" - build-libs - run: From 54d3efc3e216faed2f6df1b9c8237939d8f31828 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Thu, 25 Sep 2025 22:34:48 +0000 Subject: [PATCH 12/29] restore all steps --- .circleci/config.yml | 47 ++++++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b5e8ab71fe3f4..7e3f76afd44e6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -171,30 +171,29 @@ commands: - pip-install - run: apt-get install -q -y ninja-build ccache - run: - name: embuilder build MINIMAL + name: embuilder build ALL command: | - ./embuilder build MINIMAL + ./embuilder build ALL + ./test/runner test_hello_world + - run: + name: embuilder (LTO) + command: | + ./embuilder build MINIMAL --lto + ./test/runner test_hello_world + - run: + name: embuilder (WASM64) + command: | + ./embuilder build MINIMAL --wasm64 + - run: + name: embuilder (PIC) + command: | + ./embuilder build MINIMAL_PIC --pic + ./test/runner test_hello_world + - run: + name: embuilder (PIC+LTO) + command: | + ./embuilder build MINIMAL --pic --lto ./test/runner test_hello_world - ccache --print-stats - # - run: - # name: embuilder (LTO) - # command: | - # ./embuilder build MINIMAL --lto - # ./test/runner test_hello_world - # - run: - # name: embuilder (WASM64) - # command: | - # ./embuilder build MINIMAL --wasm64 - # - run: - # name: embuilder (PIC) - # command: | - # ./embuilder build MINIMAL_PIC --pic - # ./test/runner test_hello_world - # - run: - # name: embuilder (PIC+LTO) - # command: | - # ./embuilder build MINIMAL --pic --lto - # ./test/runner test_hello_world - run: name: "Ccache stats" command: | @@ -217,7 +216,7 @@ commands: name: "Save Ccache cache" paths: - ~/.ccache - key: "ccache6" + key: "ccache7" prepare-for-tests: description: "Setup emscripten tests" @@ -577,7 +576,7 @@ jobs: - install-emsdk - restore_cache: name: "Restore Ccache cache" - key: "ccache6" + key: "ccache7" - build-libs - run: name: Clean build directory From cf6fe4262c3059253c7bebbd3693448576fef796 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Thu, 25 Sep 2025 23:04:03 +0000 Subject: [PATCH 13/29] cache based on clang version --- .circleci/config.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7e3f76afd44e6..9b670fcda8f67 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -140,6 +140,10 @@ commands: cd ~/emsdk ./emsdk install tot ./emsdk activate tot + # Write the version of clang into a file for use in the ccache key + ./upstream/bin/clang --version > clang_version.txt + echo "clang version:" + cat ~/emsdk/clang_version.txt # Remove the emsdk version of emscripten to save space in the # persistent workspace and to avoid any confusion with the version # we are trying to test. @@ -216,7 +220,7 @@ commands: name: "Save Ccache cache" paths: - ~/.ccache - key: "ccache7" + key: clang-{{ checksum "~/emsdk/clang_version.txt" }} prepare-for-tests: description: "Setup emscripten tests" @@ -576,7 +580,7 @@ jobs: - install-emsdk - restore_cache: name: "Restore Ccache cache" - key: "ccache7" + key: clang-{{ checksum "~/emsdk/clang_version.txt" }} - build-libs - run: name: Clean build directory From eaf7d4276a7a6a641123270a625b92417233b10f Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Thu, 25 Sep 2025 23:42:02 +0000 Subject: [PATCH 14/29] remove extraneous change --- tools/compile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/compile.py b/tools/compile.py index a9daa949dd9a3..0cc5d33e336f1 100644 --- a/tools/compile.py +++ b/tools/compile.py @@ -140,7 +140,7 @@ def array_contains_any_of(hay, needles): if '-nostdinc' not in user_args: if not settings.USE_SDL: - cflags += ['-Xclang','-iwithsysroot' + os.path.join('/include', 'fakesdl')] - cflags += ['-Xclang','-iwithsysroot' + os.path.join('/include', 'compat')] + cflags += ['-Xclang', '-iwithsysroot' + os.path.join('/include', 'fakesdl')] + cflags += ['-Xclang', '-iwithsysroot' + os.path.join('/include', 'compat')] return cflags From 588b0f8520547d19c8ccd27ab9097e9c61a90bca Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Fri, 26 Sep 2025 00:10:41 +0000 Subject: [PATCH 15/29] zero the stats before persisting the cache --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9b670fcda8f67..8c6670f48d2dd 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -202,6 +202,7 @@ commands: name: "Ccache stats" command: | ccache --print-stats + ccache --zero-stats persist: description: "Persist the emsdk, libraries, and engines" From be30413db35a6ab030a868bb006b570b9ad60b6f Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Fri, 26 Sep 2025 00:24:29 +0000 Subject: [PATCH 16/29] conditionalize main vs PR --- .circleci/config.yml | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8c6670f48d2dd..bd98213baf600 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -217,11 +217,15 @@ commands: - vms/ - wasi-sdk/ - .jsvu/ - - save_cache: - name: "Save Ccache cache" - paths: - - ~/.ccache - key: clang-{{ checksum "~/emsdk/clang_version.txt" }} + - when: + condition: + equal: [ "main", << pipeline.git.branch >> ] + steps: + - save_cache: + name: "Save Ccache cache" + paths: + - ~/.ccache + key: clang-{{ checksum "~/emsdk/clang_version.txt" }} prepare-for-tests: description: "Setup emscripten tests" @@ -579,9 +583,12 @@ jobs: tar xvf wasi-sysroot-11.0.tar.gz -C ~/wasi-sdk/ - install-v8 - install-emsdk - - restore_cache: - name: "Restore Ccache cache" - key: clang-{{ checksum "~/emsdk/clang_version.txt" }} + - when: + condition: ${CIRCLE_PULL_REQUEST} + steps: + - restore_cache: + name: "Restore Ccache cache" + key: clang-{{ checksum "~/emsdk/clang_version.txt" }} - build-libs - run: name: Clean build directory From 50466f5d5516bd923db3bfc4292064e0a6d8cfe5 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Fri, 26 Sep 2025 00:29:57 +0000 Subject: [PATCH 17/29] do a minimal build --- .circleci/config.yml | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index bd98213baf600..48b52e4c75ba4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -177,27 +177,27 @@ commands: - run: name: embuilder build ALL command: | - ./embuilder build ALL - ./test/runner test_hello_world - - run: - name: embuilder (LTO) - command: | - ./embuilder build MINIMAL --lto - ./test/runner test_hello_world - - run: - name: embuilder (WASM64) - command: | - ./embuilder build MINIMAL --wasm64 - - run: - name: embuilder (PIC) - command: | - ./embuilder build MINIMAL_PIC --pic - ./test/runner test_hello_world - - run: - name: embuilder (PIC+LTO) - command: | - ./embuilder build MINIMAL --pic --lto + ./embuilder build crtbegin ./test/runner test_hello_world + # - run: + # name: embuilder (LTO) + # command: | + # ./embuilder build MINIMAL --lto + # ./test/runner test_hello_world + # - run: + # name: embuilder (WASM64) + # command: | + # ./embuilder build MINIMAL --wasm64 + # - run: + # name: embuilder (PIC) + # command: | + # ./embuilder build MINIMAL_PIC --pic + # ./test/runner test_hello_world + # - run: + # name: embuilder (PIC+LTO) + # command: | + # ./embuilder build MINIMAL --pic --lto + # ./test/runner test_hello_world - run: name: "Ccache stats" command: | From a40889452f2866b0a13352eed8582bcc5c0ce61c Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Fri, 26 Sep 2025 00:35:18 +0000 Subject: [PATCH 18/29] try it with named branch --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 48b52e4c75ba4..582bd43b061f6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -219,7 +219,7 @@ commands: - .jsvu/ - when: condition: - equal: [ "main", << pipeline.git.branch >> ] + equal: [ "ccache-libs", << pipeline.git.branch >> ] steps: - save_cache: name: "Save Ccache cache" From 0ec58b10c5727f0527bfadf85aac6aea1297df3b Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Fri, 26 Sep 2025 00:45:09 +0000 Subject: [PATCH 19/29] try with repo match --- .circleci/config.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 582bd43b061f6..361eb1ed4b488 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -219,7 +219,9 @@ commands: - .jsvu/ - when: condition: - equal: [ "ccache-libs", << pipeline.git.branch >> ] + and: + - equal: [ "ccache-libs", << pipeline.git.branch >> ] + - equal: [ "https://github.com/emscripten-core/emscripten", << pipeline.project.git_url >> ] steps: - save_cache: name: "Save Ccache cache" From e22c0f217001684a37cb9d7778a33c7ae4e869e9 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Fri, 26 Sep 2025 15:59:21 +0000 Subject: [PATCH 20/29] update condition --- .circleci/config.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 361eb1ed4b488..b25900f552869 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -586,7 +586,8 @@ jobs: - install-v8 - install-emsdk - when: - condition: ${CIRCLE_PULL_REQUEST} + condition: + equal: [ "pull_request", << pipeline.event.name >> ] steps: - restore_cache: name: "Restore Ccache cache" From 831178eed68527e3971a000c861e4c64f703036b Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Fri, 26 Sep 2025 16:07:25 +0000 Subject: [PATCH 21/29] switch event --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b25900f552869..0ad17ac5a2662 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -587,7 +587,7 @@ jobs: - install-emsdk - when: condition: - equal: [ "pull_request", << pipeline.event.name >> ] + equal: [ "pull_request", << pipeline.event.action >> ] steps: - restore_cache: name: "Restore Ccache cache" From 6ee7b08060ec8a9bde6e74996f585e4c80ecc443 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Fri, 26 Sep 2025 16:36:37 +0000 Subject: [PATCH 22/29] use name --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0ad17ac5a2662..b25900f552869 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -587,7 +587,7 @@ jobs: - install-emsdk - when: condition: - equal: [ "pull_request", << pipeline.event.action >> ] + equal: [ "pull_request", << pipeline.event.name >> ] steps: - restore_cache: name: "Restore Ccache cache" From 9a5f05a148bec5fdbfdeb3fa02175882f63ef2ad Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Fri, 26 Sep 2025 16:45:10 +0000 Subject: [PATCH 23/29] undo temporary changes --- .circleci/config.yml | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b25900f552869..6a4378d0e17ab 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -177,27 +177,27 @@ commands: - run: name: embuilder build ALL command: | - ./embuilder build crtbegin + ./embuilder build ALL + ./test/runner test_hello_world + - run: + name: embuilder (LTO) + command: | + ./embuilder build MINIMAL --lto + ./test/runner test_hello_world + - run: + name: embuilder (WASM64) + command: | + ./embuilder build MINIMAL --wasm64 + - run: + name: embuilder (PIC) + command: | + ./embuilder build MINIMAL_PIC --pic + ./test/runner test_hello_world + - run: + name: embuilder (PIC+LTO) + command: | + ./embuilder build MINIMAL --pic --lto ./test/runner test_hello_world - # - run: - # name: embuilder (LTO) - # command: | - # ./embuilder build MINIMAL --lto - # ./test/runner test_hello_world - # - run: - # name: embuilder (WASM64) - # command: | - # ./embuilder build MINIMAL --wasm64 - # - run: - # name: embuilder (PIC) - # command: | - # ./embuilder build MINIMAL_PIC --pic - # ./test/runner test_hello_world - # - run: - # name: embuilder (PIC+LTO) - # command: | - # ./embuilder build MINIMAL --pic --lto - # ./test/runner test_hello_world - run: name: "Ccache stats" command: | @@ -220,7 +220,7 @@ commands: - when: condition: and: - - equal: [ "ccache-libs", << pipeline.git.branch >> ] + - equal: [ "main", << pipeline.git.branch >> ] - equal: [ "https://github.com/emscripten-core/emscripten", << pipeline.project.git_url >> ] steps: - save_cache: From 1ec1225152cae622c91b68e536fd31749b710b2e Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Fri, 26 Sep 2025 21:37:17 +0000 Subject: [PATCH 24/29] update condition --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 434b0268ca834..8b5344522c4cb 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -594,9 +594,9 @@ jobs: - install-v8 - install-emsdk - when: - condition: - equal: [ "pull_request", << pipeline.event.name >> ] + condition: ${CIRCLE_PR_NUMBER} steps: + - run: echo "${CIRCLE_PR_NUMBER} ${CIRCLE_PULL_REQUEST} ${CIRCLE_REPOSITORY_URL} ${CIRCLE_BRANCH}" - restore_cache: name: "Restore Ccache cache" key: clang-{{ checksum "~/emsdk/clang_version.txt" }} From 4f7de3db66a763b771ed02e2d31be55fcefad7f4 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Fri, 26 Sep 2025 22:12:31 +0000 Subject: [PATCH 25/29] use PR_NUMBER --- .circleci/config.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8b5344522c4cb..7b083d0f571d4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -594,7 +594,8 @@ jobs: - install-v8 - install-emsdk - when: - condition: ${CIRCLE_PR_NUMBER} + condition: ${CIRCLE_PULL_REQUEST} + #matches: { pattern: "^pull/", value: << pipeline.git.branch >> } steps: - run: echo "${CIRCLE_PR_NUMBER} ${CIRCLE_PULL_REQUEST} ${CIRCLE_REPOSITORY_URL} ${CIRCLE_BRANCH}" - restore_cache: From c79c297bd6b9f61dc0b63314d648448a90359c2c Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Fri, 26 Sep 2025 22:30:47 +0000 Subject: [PATCH 26/29] use not-main --- .circleci/config.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7b083d0f571d4..d336cd82d51fe 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -594,8 +594,9 @@ jobs: - install-v8 - install-emsdk - when: - condition: ${CIRCLE_PULL_REQUEST} - #matches: { pattern: "^pull/", value: << pipeline.git.branch >> } + condition: + not: + equal: [ "main", << pipeline.git.branch >> ] steps: - run: echo "${CIRCLE_PR_NUMBER} ${CIRCLE_PULL_REQUEST} ${CIRCLE_REPOSITORY_URL} ${CIRCLE_BRANCH}" - restore_cache: From 175655126de6dfa2073eb496168e810db24c954b Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Fri, 26 Sep 2025 22:33:43 +0000 Subject: [PATCH 27/29] remove debug prints --- .circleci/config.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d336cd82d51fe..37c6f5061afcc 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -598,7 +598,6 @@ jobs: not: equal: [ "main", << pipeline.git.branch >> ] steps: - - run: echo "${CIRCLE_PR_NUMBER} ${CIRCLE_PULL_REQUEST} ${CIRCLE_REPOSITORY_URL} ${CIRCLE_BRANCH}" - restore_cache: name: "Restore Ccache cache" key: clang-{{ checksum "~/emsdk/clang_version.txt" }} From e9ad0701722d200e93dd88941b27e221fe917051 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Fri, 26 Sep 2025 22:38:01 +0000 Subject: [PATCH 28/29] fix posixtestsuite --- test/third_party/posixtestsuite | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/third_party/posixtestsuite b/test/third_party/posixtestsuite index 869e266b090a8..7ac21b152494f 160000 --- a/test/third_party/posixtestsuite +++ b/test/third_party/posixtestsuite @@ -1 +1 @@ -Subproject commit 869e266b090a8d44e51bb040904c942556b1e4ab +Subproject commit 7ac21b152494f22d7778ac35ddf3c04083111a82 From dfb424482156ee037b448757245dbcf52e3034a9 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Sat, 27 Sep 2025 00:25:03 +0000 Subject: [PATCH 29/29] remove unnecessary condition, and add comment --- .circleci/config.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 37c6f5061afcc..40b489b8ce012 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -220,10 +220,11 @@ commands: - wasi-sdk/ - .jsvu/ - when: + # Only the main branch will store its cache results, and only the non-main branches + # will use cached results. This prevents untrusted PRs from polluting caches used + # by other branches. condition: - and: - - equal: [ "main", << pipeline.git.branch >> ] - - equal: [ "https://github.com/emscripten-core/emscripten", << pipeline.project.git_url >> ] + equal: [ "main", << pipeline.git.branch >> ] steps: - save_cache: name: "Save Ccache cache"