Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TYPEOF matching an enum version of SEXPTYPE #211

Closed
wants to merge 70 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
897c871
`SEXPTYPE` is c_uint, and TYPEOF should
CGMossa Nov 17, 2023
85964e4
set it equal to `SEXPTYPE` directly.
CGMossa Nov 17, 2023
a032906
Make C-enums into idiomatic rust enums
CGMossa Nov 16, 2023
fe1b8bc
Update maintainer guide
CGMossa Nov 17, 2023
75ee31f
hopefully, a GHA commit shouldn't follow
CGMossa Nov 17, 2023
dd5330c
hopefully, a GHA commit shouldn't follow
CGMossa Nov 17, 2023
8bbdfc0
hopefully, a GHA commit shouldn't follow
CGMossa Nov 17, 2023
8224d78
no generating of anything
CGMossa Nov 17, 2023
0e3e164
use enum definition of `SEXPTYPE`.
CGMossa Nov 16, 2023
3c187fc
Added a PR generating mechanism instead
CGMossa Nov 16, 2023
b837b77
Fixed it? [generate bindings]
CGMossa Nov 16, 2023
e94794a
[generate bindings]
CGMossa Nov 16, 2023
f72117f
let's see what's going on
CGMossa Nov 16, 2023
f681074
what's going on?
CGMossa Nov 16, 2023
e139026
only on the job
CGMossa Nov 16, 2023
4b6362a
[generate bindings]
CGMossa Nov 16, 2023
e800048
[generate bindings]
CGMossa Nov 16, 2023
5f16263
[generate bindings]
CGMossa Nov 16, 2023
6cfea93
[generate bindings]
CGMossa Nov 16, 2023
c36de2a
[generate bindings]
CGMossa Nov 16, 2023
1fca29c
now? [generate bindings]
CGMossa Nov 16, 2023
7e1e0ad
[generate bindings]
CGMossa Nov 16, 2023
7698325
[generate bindings]
CGMossa Nov 16, 2023
7cf6fe9
echo twice? [generate bindings]
CGMossa Nov 16, 2023
6146db0
[generate bindings]
CGMossa Nov 16, 2023
fa44a03
[generate bindings]
CGMossa Nov 16, 2023
062a8e7
[generate bindings]
CGMossa Nov 16, 2023
662cc62
this
CGMossa Nov 16, 2023
27b9bfb
now
CGMossa Nov 16, 2023
b3d3861
again
CGMossa Nov 16, 2023
ffa4780
use `env.` before environment variable
CGMossa Nov 16, 2023
399f1a3
noooow
CGMossa Nov 16, 2023
646e87a
like this?
CGMossa Nov 16, 2023
fcd8980
why?
CGMossa Nov 16, 2023
eea80c2
just work you stupid
CGMossa Nov 16, 2023
ee16f20
now that I give up
CGMossa Nov 16, 2023
e5c6b0c
[generate bindings]
CGMossa Nov 16, 2023
02c8974
[generate bindings] finally...
CGMossa Nov 16, 2023
d3e9084
[generate bindings]
CGMossa Nov 16, 2023
604bba3
[generate bindings]
CGMossa Nov 17, 2023
550229f
now? [generate bindings]
CGMossa Nov 17, 2023
54e3bb2
[generate bindings]
CGMossa Nov 17, 2023
c714a8d
[generate bindings]
CGMossa Nov 17, 2023
d3a88e8
Remove debug workflow.
CGMossa Nov 17, 2023
171c5b2
add github token [generate bindings]
CGMossa Nov 17, 2023
d60680d
don't propose a PR with the merge commit
CGMossa Nov 17, 2023
6e1d557
[generate bindings]
CGMossa Nov 17, 2023
bb2198a
[generate bindings]
CGMossa Nov 17, 2023
00b1cf1
[generate bindings]
CGMossa Nov 17, 2023
fbe0ef7
[generate bindings]
CGMossa Nov 17, 2023
8fa43c4
it doesn't actually download any artifacts
CGMossa Nov 17, 2023
4497c40
[generate bindings]
CGMossa Nov 17, 2023
43e5e87
[generate bindings]
CGMossa Nov 17, 2023
41a7409
Update bindings [skip ci]
CGMossa Nov 17, 2023
1aa2530
Clean-up
CGMossa Nov 17, 2023
4911adb
Update bindings [skip ci]
CGMossa Nov 17, 2023
d192728
Update bindings [skip ci]
CGMossa Nov 17, 2023
f41d290
[generate bindings]
CGMossa Nov 17, 2023
53e5783
the test shouldn't cast!
CGMossa Nov 18, 2023
8f93fb6
Update bindings [skip ci]
CGMossa Nov 18, 2023
fc3772e
please stop pushing..
CGMossa Nov 18, 2023
7ff5c0a
Update bindings [skip ci]
CGMossa Nov 18, 2023
c1b0e63
hopefully, a GHA commit shouldn't follow
CGMossa Nov 17, 2023
857974e
what's happening...
CGMossa Nov 17, 2023
8a68091
please xplain.
CGMossa Nov 17, 2023
04cc88b
right sha..
CGMossa Nov 17, 2023
92038ac
hopefully, a GHA commit shouldn't follow
CGMossa Nov 17, 2023
87f942d
hopefully, a GHA commit shouldn't follow
CGMossa Nov 17, 2023
78ab189
no generating of anything
CGMossa Nov 17, 2023
c6517d7
`cargo fmt`
CGMossa Apr 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 21 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
name: Tests

on:
push:
branches:
Expand All @@ -19,7 +18,7 @@ on:
workflow_dispatch: {}

jobs:

test_with_bindgen:
# When the event is not issue_comment, always run the tests. When it is,
# check if (1) the comment is on pull request, (2) the comment author is the
Expand All @@ -30,7 +29,7 @@ jobs:
if: |
github.event_name != 'issue_comment'
|| (github.event.issue.pull_request && github.event.comment.author_association == 'MEMBER' && startsWith(github.event.comment.body, '/bindings'))

runs-on: ${{ matrix.config.os }}

name: ${{ matrix.config.os }} (R-${{ matrix.config.r }} rust-${{ matrix.config.rust-version }}-${{ matrix.config.target || 'default' }})
Expand Down Expand Up @@ -246,6 +245,24 @@ jobs:
echo "${{ steps.get_head_commit_message.outputs.HEAD_COMMIT_MESSAGE }}"
echo "${{ contains(steps.get_head_commit_message.outputs.HEAD_COMMIT_MESSAGE, '[generate bindings]') }}"

check_generate_bindings_flag:
name: Check if [generate bindings] is in latest commit message
runs-on: ubuntu-latest
outputs:
head_commit_message: ${{ steps.get_head_commit_message.outputs.HEAD_COMMIT_MESSAGE }}
# generate_bindings: ${{ contains(steps.get_head_commit_message.outputs.HEAD_COMMIT_MESSAGE, '[generate bindings]') }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
- name: Get Head Commit Message
id: get_head_commit_message
run: echo "HEAD_COMMIT_MESSAGE=$(git show -s --format=%s)" >> "$GITHUB_OUTPUT"
- name: Show commit message
run: |
echo "${{ steps.get_head_commit_message.outputs.HEAD_COMMIT_MESSAGE }}"
echo "${{ contains(steps.get_head_commit_message.outputs.HEAD_COMMIT_MESSAGE, '[generate bindings]') }}"

pr_generated_bindings:
name: Make PR with generated bindings
needs: [test_with_bindgen, check_generate_bindings_flag]
Expand Down Expand Up @@ -277,7 +294,7 @@ jobs:
git commit -m "Update bindings [skip ci]"
- name: Push to PR branch
run: git push

# Gather the generated bindings and push them to generated_bindings branch.
# If we need to update the bindings, create a pull request from that branch.
commit_generated_bindings:
Expand Down
14 changes: 0 additions & 14 deletions MAINTAINERS_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,6 @@ git commit -m "[generate bindings]" --allow-empty
Then after successfully running workflows, GitHub Actions will push a commit
with the updated bindings onto your PR branch.

# GUIDE

## Commit newly generated bindings

Your last commit must contain `[generate bindings]`. You can make an empty
commit with this message:

```sh
git commit -m "[generate bindings]" --allow-empty
```

Then after successfully running workflows, GitHub Actions will push a commit
with the updated bindings onto your PR branch.

## Precomputed bindings

### How to update the precomputed bindings?
Expand Down
28 changes: 0 additions & 28 deletions bindings/bindings-linux-aarch64-R4.2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,33 +97,6 @@ pub const HAVE_ALLOCA_H: u32 = 1;
pub const HAVE_UINTPTR_T: u32 = 1;
pub const R_XLEN_T_MAX: u64 = 4503599627370496;
pub const R_SHORT_LEN_MAX: u32 = 2147483647;
pub const NILSXP: u32 = 0;
pub const SYMSXP: u32 = 1;
pub const LISTSXP: u32 = 2;
pub const CLOSXP: u32 = 3;
pub const ENVSXP: u32 = 4;
pub const PROMSXP: u32 = 5;
pub const LANGSXP: u32 = 6;
pub const SPECIALSXP: u32 = 7;
pub const BUILTINSXP: u32 = 8;
pub const CHARSXP: u32 = 9;
pub const LGLSXP: u32 = 10;
pub const INTSXP: u32 = 13;
pub const REALSXP: u32 = 14;
pub const CPLXSXP: u32 = 15;
pub const STRSXP: u32 = 16;
pub const DOTSXP: u32 = 17;
pub const ANYSXP: u32 = 18;
pub const VECSXP: u32 = 19;
pub const EXPRSXP: u32 = 20;
pub const BCODESXP: u32 = 21;
pub const EXTPTRSXP: u32 = 22;
pub const WEAKREFSXP: u32 = 23;
pub const RAWSXP: u32 = 24;
pub const S4SXP: u32 = 25;
pub const NEWSXP: u32 = 30;
pub const FREESXP: u32 = 31;
pub const FUNSXP: u32 = 99;
pub const TYPE_BITS: u32 = 5;
pub const MAX_NUM_SEXPTYPE: u32 = 32;
pub const NAMEDMAX: u32 = 7;
Expand Down Expand Up @@ -1310,7 +1283,6 @@ extern "C" {
pub fn ATTRIB(x: SEXP) -> SEXP;
pub fn OBJECT(x: SEXP) -> ::std::os::raw::c_int;
pub fn MARK(x: SEXP) -> ::std::os::raw::c_int;
pub fn TYPEOF(x: SEXP) -> ::std::os::raw::c_int;
pub fn NAMED(x: SEXP) -> ::std::os::raw::c_int;
pub fn REFCNT(x: SEXP) -> ::std::os::raw::c_int;
pub fn SET_ATTRIB(x: SEXP, v: SEXP);
Expand Down
28 changes: 0 additions & 28 deletions bindings/bindings-linux-aarch64-R4.3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,33 +98,6 @@ pub const HAVE_ALLOCA_H: u32 = 1;
pub const HAVE_UINTPTR_T: u32 = 1;
pub const R_XLEN_T_MAX: u64 = 4503599627370496;
pub const R_SHORT_LEN_MAX: u32 = 2147483647;
pub const NILSXP: u32 = 0;
pub const SYMSXP: u32 = 1;
pub const LISTSXP: u32 = 2;
pub const CLOSXP: u32 = 3;
pub const ENVSXP: u32 = 4;
pub const PROMSXP: u32 = 5;
pub const LANGSXP: u32 = 6;
pub const SPECIALSXP: u32 = 7;
pub const BUILTINSXP: u32 = 8;
pub const CHARSXP: u32 = 9;
pub const LGLSXP: u32 = 10;
pub const INTSXP: u32 = 13;
pub const REALSXP: u32 = 14;
pub const CPLXSXP: u32 = 15;
pub const STRSXP: u32 = 16;
pub const DOTSXP: u32 = 17;
pub const ANYSXP: u32 = 18;
pub const VECSXP: u32 = 19;
pub const EXPRSXP: u32 = 20;
pub const BCODESXP: u32 = 21;
pub const EXTPTRSXP: u32 = 22;
pub const WEAKREFSXP: u32 = 23;
pub const RAWSXP: u32 = 24;
pub const S4SXP: u32 = 25;
pub const NEWSXP: u32 = 30;
pub const FREESXP: u32 = 31;
pub const FUNSXP: u32 = 99;
pub const TYPE_BITS: u32 = 5;
pub const MAX_NUM_SEXPTYPE: u32 = 32;
pub const NAMEDMAX: u32 = 7;
Expand Down Expand Up @@ -1333,7 +1306,6 @@ extern "C" {
pub fn ATTRIB(x: SEXP) -> SEXP;
pub fn OBJECT(x: SEXP) -> ::std::os::raw::c_int;
pub fn MARK(x: SEXP) -> ::std::os::raw::c_int;
pub fn TYPEOF(x: SEXP) -> ::std::os::raw::c_int;
pub fn NAMED(x: SEXP) -> ::std::os::raw::c_int;
pub fn REFCNT(x: SEXP) -> ::std::os::raw::c_int;
pub fn SET_ATTRIB(x: SEXP, v: SEXP);
Expand Down
29 changes: 0 additions & 29 deletions bindings/bindings-linux-aarch64-R4.4-devel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,34 +98,6 @@ pub const HAVE_ALLOCA_H: u32 = 1;
pub const HAVE_UINTPTR_T: u32 = 1;
pub const R_XLEN_T_MAX: u64 = 4503599627370496;
pub const R_SHORT_LEN_MAX: u32 = 2147483647;
pub const NILSXP: u32 = 0;
pub const SYMSXP: u32 = 1;
pub const LISTSXP: u32 = 2;
pub const CLOSXP: u32 = 3;
pub const ENVSXP: u32 = 4;
pub const PROMSXP: u32 = 5;
pub const LANGSXP: u32 = 6;
pub const SPECIALSXP: u32 = 7;
pub const BUILTINSXP: u32 = 8;
pub const CHARSXP: u32 = 9;
pub const LGLSXP: u32 = 10;
pub const INTSXP: u32 = 13;
pub const REALSXP: u32 = 14;
pub const CPLXSXP: u32 = 15;
pub const STRSXP: u32 = 16;
pub const DOTSXP: u32 = 17;
pub const ANYSXP: u32 = 18;
pub const VECSXP: u32 = 19;
pub const EXPRSXP: u32 = 20;
pub const BCODESXP: u32 = 21;
pub const EXTPTRSXP: u32 = 22;
pub const WEAKREFSXP: u32 = 23;
pub const RAWSXP: u32 = 24;
pub const OBJSXP: u32 = 25;
pub const S4SXP: u32 = 25;
pub const NEWSXP: u32 = 30;
pub const FREESXP: u32 = 31;
pub const FUNSXP: u32 = 99;
pub const TYPE_BITS: u32 = 5;
pub const MAX_NUM_SEXPTYPE: u32 = 32;
pub const NAMEDMAX: u32 = 7;
Expand Down Expand Up @@ -1334,7 +1306,6 @@ extern "C" {
pub fn ATTRIB(x: SEXP) -> SEXP;
pub fn OBJECT(x: SEXP) -> ::std::os::raw::c_int;
pub fn MARK(x: SEXP) -> ::std::os::raw::c_int;
pub fn TYPEOF(x: SEXP) -> ::std::os::raw::c_int;
pub fn NAMED(x: SEXP) -> ::std::os::raw::c_int;
pub fn REFCNT(x: SEXP) -> ::std::os::raw::c_int;
pub fn SET_ATTRIB(x: SEXP, v: SEXP);
Expand Down
28 changes: 0 additions & 28 deletions bindings/bindings-linux-x86_64-R4.2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,33 +97,6 @@ pub const HAVE_ALLOCA_H: u32 = 1;
pub const HAVE_UINTPTR_T: u32 = 1;
pub const R_XLEN_T_MAX: u64 = 4503599627370496;
pub const R_SHORT_LEN_MAX: u32 = 2147483647;
pub const NILSXP: u32 = 0;
pub const SYMSXP: u32 = 1;
pub const LISTSXP: u32 = 2;
pub const CLOSXP: u32 = 3;
pub const ENVSXP: u32 = 4;
pub const PROMSXP: u32 = 5;
pub const LANGSXP: u32 = 6;
pub const SPECIALSXP: u32 = 7;
pub const BUILTINSXP: u32 = 8;
pub const CHARSXP: u32 = 9;
pub const LGLSXP: u32 = 10;
pub const INTSXP: u32 = 13;
pub const REALSXP: u32 = 14;
pub const CPLXSXP: u32 = 15;
pub const STRSXP: u32 = 16;
pub const DOTSXP: u32 = 17;
pub const ANYSXP: u32 = 18;
pub const VECSXP: u32 = 19;
pub const EXPRSXP: u32 = 20;
pub const BCODESXP: u32 = 21;
pub const EXTPTRSXP: u32 = 22;
pub const WEAKREFSXP: u32 = 23;
pub const RAWSXP: u32 = 24;
pub const S4SXP: u32 = 25;
pub const NEWSXP: u32 = 30;
pub const FREESXP: u32 = 31;
pub const FUNSXP: u32 = 99;
pub const TYPE_BITS: u32 = 5;
pub const MAX_NUM_SEXPTYPE: u32 = 32;
pub const NAMEDMAX: u32 = 7;
Expand Down Expand Up @@ -1319,7 +1292,6 @@ extern "C" {
pub fn ATTRIB(x: SEXP) -> SEXP;
pub fn OBJECT(x: SEXP) -> ::std::os::raw::c_int;
pub fn MARK(x: SEXP) -> ::std::os::raw::c_int;
pub fn TYPEOF(x: SEXP) -> ::std::os::raw::c_int;
pub fn NAMED(x: SEXP) -> ::std::os::raw::c_int;
pub fn REFCNT(x: SEXP) -> ::std::os::raw::c_int;
pub fn SET_ATTRIB(x: SEXP, v: SEXP);
Expand Down
28 changes: 0 additions & 28 deletions bindings/bindings-linux-x86_64-R4.3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,33 +98,6 @@ pub const HAVE_ALLOCA_H: u32 = 1;
pub const HAVE_UINTPTR_T: u32 = 1;
pub const R_XLEN_T_MAX: u64 = 4503599627370496;
pub const R_SHORT_LEN_MAX: u32 = 2147483647;
pub const NILSXP: u32 = 0;
pub const SYMSXP: u32 = 1;
pub const LISTSXP: u32 = 2;
pub const CLOSXP: u32 = 3;
pub const ENVSXP: u32 = 4;
pub const PROMSXP: u32 = 5;
pub const LANGSXP: u32 = 6;
pub const SPECIALSXP: u32 = 7;
pub const BUILTINSXP: u32 = 8;
pub const CHARSXP: u32 = 9;
pub const LGLSXP: u32 = 10;
pub const INTSXP: u32 = 13;
pub const REALSXP: u32 = 14;
pub const CPLXSXP: u32 = 15;
pub const STRSXP: u32 = 16;
pub const DOTSXP: u32 = 17;
pub const ANYSXP: u32 = 18;
pub const VECSXP: u32 = 19;
pub const EXPRSXP: u32 = 20;
pub const BCODESXP: u32 = 21;
pub const EXTPTRSXP: u32 = 22;
pub const WEAKREFSXP: u32 = 23;
pub const RAWSXP: u32 = 24;
pub const S4SXP: u32 = 25;
pub const NEWSXP: u32 = 30;
pub const FREESXP: u32 = 31;
pub const FUNSXP: u32 = 99;
pub const TYPE_BITS: u32 = 5;
pub const MAX_NUM_SEXPTYPE: u32 = 32;
pub const NAMEDMAX: u32 = 7;
Expand Down Expand Up @@ -1342,7 +1315,6 @@ extern "C" {
pub fn ATTRIB(x: SEXP) -> SEXP;
pub fn OBJECT(x: SEXP) -> ::std::os::raw::c_int;
pub fn MARK(x: SEXP) -> ::std::os::raw::c_int;
pub fn TYPEOF(x: SEXP) -> ::std::os::raw::c_int;
pub fn NAMED(x: SEXP) -> ::std::os::raw::c_int;
pub fn REFCNT(x: SEXP) -> ::std::os::raw::c_int;
pub fn SET_ATTRIB(x: SEXP, v: SEXP);
Expand Down
29 changes: 0 additions & 29 deletions bindings/bindings-linux-x86_64-R4.4-devel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,34 +98,6 @@ pub const HAVE_ALLOCA_H: u32 = 1;
pub const HAVE_UINTPTR_T: u32 = 1;
pub const R_XLEN_T_MAX: u64 = 4503599627370496;
pub const R_SHORT_LEN_MAX: u32 = 2147483647;
pub const NILSXP: u32 = 0;
pub const SYMSXP: u32 = 1;
pub const LISTSXP: u32 = 2;
pub const CLOSXP: u32 = 3;
pub const ENVSXP: u32 = 4;
pub const PROMSXP: u32 = 5;
pub const LANGSXP: u32 = 6;
pub const SPECIALSXP: u32 = 7;
pub const BUILTINSXP: u32 = 8;
pub const CHARSXP: u32 = 9;
pub const LGLSXP: u32 = 10;
pub const INTSXP: u32 = 13;
pub const REALSXP: u32 = 14;
pub const CPLXSXP: u32 = 15;
pub const STRSXP: u32 = 16;
pub const DOTSXP: u32 = 17;
pub const ANYSXP: u32 = 18;
pub const VECSXP: u32 = 19;
pub const EXPRSXP: u32 = 20;
pub const BCODESXP: u32 = 21;
pub const EXTPTRSXP: u32 = 22;
pub const WEAKREFSXP: u32 = 23;
pub const RAWSXP: u32 = 24;
pub const OBJSXP: u32 = 25;
pub const S4SXP: u32 = 25;
pub const NEWSXP: u32 = 30;
pub const FREESXP: u32 = 31;
pub const FUNSXP: u32 = 99;
pub const TYPE_BITS: u32 = 5;
pub const MAX_NUM_SEXPTYPE: u32 = 32;
pub const NAMEDMAX: u32 = 7;
Expand Down Expand Up @@ -1343,7 +1315,6 @@ extern "C" {
pub fn ATTRIB(x: SEXP) -> SEXP;
pub fn OBJECT(x: SEXP) -> ::std::os::raw::c_int;
pub fn MARK(x: SEXP) -> ::std::os::raw::c_int;
pub fn TYPEOF(x: SEXP) -> ::std::os::raw::c_int;
pub fn NAMED(x: SEXP) -> ::std::os::raw::c_int;
pub fn REFCNT(x: SEXP) -> ::std::os::raw::c_int;
pub fn SET_ATTRIB(x: SEXP, v: SEXP);
Expand Down
Loading