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

Use enum definition of SEXPTYPE instead of macro-mess #207

Closed
wants to merge 56 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
df9b236
Added `[generate bindings]` command for CI
CGMossa Nov 17, 2023
948ca93
Make C-enums into idiomatic rust enums
CGMossa Nov 16, 2023
37290ad
Update bindings [skip ci]
CGMossa Nov 16, 2023
be68e8c
Added `[generate bindings]` command for CI
CGMossa Nov 17, 2023
822c7ba
hopefully, a GHA commit shouldn't follow
CGMossa Nov 17, 2023
a76d378
maybe it needs to be an expression?
CGMossa Nov 17, 2023
4e315ab
what's happening...
CGMossa Nov 17, 2023
db2dc3c
please xplain.
CGMossa Nov 17, 2023
01d7b21
right sha..
CGMossa Nov 17, 2023
98715ee
hopefully, a GHA commit shouldn't follow
CGMossa Nov 17, 2023
339505e
hopefully, a GHA commit shouldn't follow
CGMossa Nov 17, 2023
b5ca5a2
no generating of anything
CGMossa Nov 17, 2023
aa7207d
use enum definition of `SEXPTYPE`.
CGMossa Nov 16, 2023
6223dda
Added a PR generating mechanism instead
CGMossa Nov 16, 2023
00bad0b
Fixed it? [generate bindings]
CGMossa Nov 16, 2023
de9dd80
[generate bindings]
CGMossa Nov 16, 2023
bab8129
let's see what's going on
CGMossa Nov 16, 2023
6b3d04d
what's going on?
CGMossa Nov 16, 2023
8fa4e2b
only on the job
CGMossa Nov 16, 2023
5e9afed
[generate bindings]
CGMossa Nov 16, 2023
a2121c6
[generate bindings]
CGMossa Nov 16, 2023
6eec0d5
[generate bindings]
CGMossa Nov 16, 2023
44ef9cb
[generate bindings]
CGMossa Nov 16, 2023
bfbfaa3
[generate bindings]
CGMossa Nov 16, 2023
2e372e9
now? [generate bindings]
CGMossa Nov 16, 2023
e836203
[generate bindings]
CGMossa Nov 16, 2023
9705aff
[generate bindings]
CGMossa Nov 16, 2023
1a19c8e
echo twice? [generate bindings]
CGMossa Nov 16, 2023
4db91c2
[generate bindings]
CGMossa Nov 16, 2023
9f22048
[generate bindings]
CGMossa Nov 16, 2023
859c206
[generate bindings]
CGMossa Nov 16, 2023
0b87e0d
this
CGMossa Nov 16, 2023
1e62cc1
now
CGMossa Nov 16, 2023
e0f4b15
again
CGMossa Nov 16, 2023
175712b
use `env.` before environment variable
CGMossa Nov 16, 2023
35e876c
noooow
CGMossa Nov 16, 2023
087b70b
like this?
CGMossa Nov 16, 2023
36e50ce
why?
CGMossa Nov 16, 2023
fafd883
just work you stupid
CGMossa Nov 16, 2023
a2ea0e7
now that I give up
CGMossa Nov 16, 2023
823928b
[generate bindings]
CGMossa Nov 16, 2023
a510b8d
[generate bindings] finally...
CGMossa Nov 16, 2023
99afd16
[generate bindings]
CGMossa Nov 16, 2023
626ad98
[generate bindings]
CGMossa Nov 17, 2023
860d1c2
now? [generate bindings]
CGMossa Nov 17, 2023
548f02b
[generate bindings]
CGMossa Nov 17, 2023
143256a
[generate bindings]
CGMossa Nov 17, 2023
b6d71a7
Remove debug workflow.
CGMossa Nov 17, 2023
0bb10cb
add github token [generate bindings]
CGMossa Nov 17, 2023
32e26fa
don't propose a PR with the merge commit
CGMossa Nov 17, 2023
6c613c4
[generate bindings]
CGMossa Nov 17, 2023
31bb610
it doesn't actually download any artifacts
CGMossa Nov 17, 2023
4701d0b
[generate bindings]
CGMossa Nov 17, 2023
1760f50
Update bindings [skip ci]
CGMossa Nov 17, 2023
67419a5
Clean-up
CGMossa Nov 17, 2023
6768865
Update bindings [skip ci]
CGMossa Nov 17, 2023
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
24 changes: 19 additions & 5 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,15 +245,30 @@ 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.sha }}
- name: Get Head Commit Message
id: get_head_commit_message
run: echo "HEAD_COMMIT_MESSAGE=$(git show -s --format=%s)" >> "$GITHUB_OUTPUT"

pr_generated_bindings:
name: Make PR with generated bindings
needs: [test_with_bindgen, check_generate_bindings_flag]
if: ${{ contains(needs.check_generate_bindings_flag.outputs.head_commit_message, '[generate bindings]') }}
if: needs.check_generate_bindings_flag.outputs.generate_bindings
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}

- uses: actions/download-artifact@v3

- name: Update bindings
Expand All @@ -277,7 +291,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
27 changes: 0 additions & 27 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
27 changes: 0 additions & 27 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
32 changes: 2 additions & 30 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 @@ -164,8 +136,8 @@ pub const R_MINOR: &[u8; 4] = b"4.0\0";
pub const R_STATUS: &[u8; 29] = b"Under development (unstable)\0";
pub const R_YEAR: &[u8; 5] = b"2023\0";
pub const R_MONTH: &[u8; 3] = b"11\0";
pub const R_DAY: &[u8; 3] = b"16\0";
pub const R_SVN_REVISION: u32 = 85542;
pub const R_DAY: &[u8; 3] = b"14\0";
pub const R_SVN_REVISION: u32 = 85524;
pub const R_GE_definitions: u32 = 13;
pub const R_GE_deviceClip: u32 = 14;
pub const R_GE_group: u32 = 15;
Expand Down
27 changes: 0 additions & 27 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
27 changes: 0 additions & 27 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
32 changes: 2 additions & 30 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 @@ -164,8 +136,8 @@ pub const R_MINOR: &[u8; 4] = b"4.0\0";
pub const R_STATUS: &[u8; 29] = b"Under development (unstable)\0";
pub const R_YEAR: &[u8; 5] = b"2023\0";
pub const R_MONTH: &[u8; 3] = b"11\0";
pub const R_DAY: &[u8; 3] = b"16\0";
pub const R_SVN_REVISION: u32 = 85542;
pub const R_DAY: &[u8; 3] = b"14\0";
pub const R_SVN_REVISION: u32 = 85524;
pub const R_GE_definitions: u32 = 13;
pub const R_GE_deviceClip: u32 = 14;
pub const R_GE_group: u32 = 15;
Expand Down
27 changes: 0 additions & 27 deletions bindings/bindings-macos-aarch64-R4.3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,33 +100,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
27 changes: 0 additions & 27 deletions bindings/bindings-macos-x86_64-R4.2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,33 +99,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
Loading