From d79674ce9e04332d9c306418a06e66a45f6aab09 Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Wed, 15 Jan 2025 10:15:54 -0500 Subject: [PATCH 1/3] Add a cbindgen Rake task --- Rakefile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Rakefile b/Rakefile index 6135499..5fd8139 100644 --- a/Rakefile +++ b/Rakefile @@ -39,6 +39,12 @@ namespace :install do task(release: :"compile:release", &install_task) end +task :cbindgen do + Dir.chdir("gc/mmtk") do + sh("cbindgen --config cbindgen.toml --output mmtk.h") + end +end + RUBY_HEADERS = %w[ ccan/check_type/check_type.h ccan/container_of/container_of.h ccan/list/list.h ccan/str/str.h gc/gc_impl.h gc/gc.h gc/extconf_base.rb From 49cf43f83eda12d4f03d2e8a9df4e08701bd3997 Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Wed, 15 Jan 2025 10:20:27 -0500 Subject: [PATCH 2/3] Add a GitHub Actions workflow to check the cbindgen --- .github/workflows/cbindgen.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/workflows/cbindgen.yml diff --git a/.github/workflows/cbindgen.yml b/.github/workflows/cbindgen.yml new file mode 100644 index 0000000..ba83248 --- /dev/null +++ b/.github/workflows/cbindgen.yml @@ -0,0 +1,17 @@ +name: cbindgen +on: [push, pull_request] + +jobs: + header_check: + runs-on: ubuntu-latest + name: Check cbindgen + steps: + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: "3.4" + bundler-cache: true + - uses: actions-rust-lang/setup-rust-toolchain@v1 + - run: cargo install --force cbindgen + - run: bundle exec rake cbindgen + - run: git diff --no-ext-diff --ignore-submodules --exit-code From dbb4036be9e8fe145772a04205f132fbf0e6c1c1 Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Wed, 15 Jan 2025 10:23:33 -0500 Subject: [PATCH 3/3] Fix mmtk.h --- gc/mmtk/mmtk.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gc/mmtk/mmtk.h b/gc/mmtk/mmtk.h index 872c273..02927f5 100644 --- a/gc/mmtk/mmtk.h +++ b/gc/mmtk/mmtk.h @@ -149,4 +149,4 @@ size_t mmtk_worker_count(void); bool mmtk_is_mmtk_object(MMTk_Address addr); -#endif /* MMTK_H */ +#endif /* MMTK_H */