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

Add script for regenerating bindings #91

Merged
merged 3 commits into from
May 16, 2022

Conversation

ionut-arm
Copy link
Member

This builds on #82 which did the same thing for the 0.2.x version of the crates.

@ionut-arm ionut-arm requested review from wiktor-k and hug-dev May 4, 2022 09:22
Copy link
Member

@hug-dev hug-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty cool!! Will make so easy to add new bindings

Copy link
Collaborator

@wiktor-k wiktor-k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, looks good and nice! 👍 (I do miss the LF at the end of regenerate_bindings.sh but it's a minor thing).

@ionut-arm
Copy link
Member Author

I do miss the LF at the end of regenerate_bindings.sh but it's a minor thing

Fixed!

Will make so easy to add new bindings

I need to have a look at adding the same for the other FFI crates.

@wiktor-k
Copy link
Collaborator

wiktor-k commented May 4, 2022

Btw I ran the script through shellcheck and got the following:


In /tmp/x.sh line 15:
        rustup target install $target
                              ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
        rustup target install "$target"


In /tmp/x.sh line 19:
    cargo build --target $target --features generate-bindings
                         ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
    cargo build --target "$target" --features generate-bindings


In /tmp/x.sh line 20:
    find ../target/$target/ -name pkcs11_bindings.rs | xargs -I '{}' cp '{}' src/bindings/$target.rs
    ^-- SC2038 (warning): Use -print0/-0 or -exec + to allow for non-alphanumeric filenames.
                   ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.
                                                                                          ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
    find ../target/"$target"/ -name pkcs11_bindings.rs | xargs -I '{}' cp '{}' src/bindings/"$target".rs


In /tmp/x.sh line 23:
        rustup target remove $target
                             ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
        rustup target remove "$target"

I'm not a shell expert by any means so you'd have to decide if these lints are something to listen to but I wanted to provide yet another angle :)

Signed-off-by: Ionut Mihalcea <[email protected]>
@ionut-arm
Copy link
Member Author

Ok, fixed those problems flagged by shellcheck.

@ionut-arm ionut-arm merged commit 617efa8 into parallaxsecond:main May 16, 2022
@ionut-arm ionut-arm deleted the regenerate-bindings branch May 16, 2022 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants