Skip to content

Commit

Permalink
Merge pull request #16 from ruby/cbindgen
Browse files Browse the repository at this point in the history
Add a cbindgen Rake task
  • Loading branch information
peterzhu2118 authored Jan 15, 2025
2 parents 6191ee9 + dbb4036 commit 22ceb28
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
17 changes: 17 additions & 0 deletions .github/workflows/cbindgen.yml
Original file line number Diff line number Diff line change
@@ -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
6 changes: 6 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion gc/mmtk/mmtk.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,4 +149,4 @@ size_t mmtk_worker_count(void);

bool mmtk_is_mmtk_object(MMTk_Address addr);

#endif /* MMTK_H */
#endif /* MMTK_H */

0 comments on commit 22ceb28

Please sign in to comment.