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 documentation and build script for Go wrapper #626
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #626 +/- ##
==========================================
+ Coverage 59.40% 59.50% +0.10%
==========================================
Files 171 171
Lines 10345 10416 +71
==========================================
+ Hits 6145 6198 +53
- Misses 4200 4218 +18 ☔ View full report in Codecov by Sentry. |
New Issues
Fixed Issues
|
|
||
printf '%s\n\n' "Copying Go bindings to $GO_LIB_DIR..." | ||
mkdir -p "$GO_LIB_DIR" | ||
find target/debug -maxdepth 1 -type f -name "libbitwarden_c.*" -exec cp {} "$GO_LIB_DIR"/ \; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a reference to the target/debug
dir here, which should be target/release
when building in release mode.
Also, the libbitwarden_c.*
wildcard copies four files for me (libbitwarden_c.{a,d,dylib,rlib}
), while only the dylib
seems to be needed on Mac.
I don't think the extra copies are necessarily a concern, but only *.dylib
and *.a
are in the gitignore file, so at the very least we should add the two other types to not clutter the working directory (*.d
and *.rlib
).
cargo build | ||
fi | ||
|
||
npm i && npm run schemas |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We never want to run npm i
, and ci
would re-install every dependency. I suggest presuming the environment is. already bootstrapped like our other build scripts.
check_command() { | ||
if ! command -v "$1" &>/dev/null; then | ||
printf '%s\n' "$1 is required to build locally. Please install $2." | ||
exit 1 | ||
fi | ||
} | ||
|
||
check_command cargo Rust | ||
check_command go Go | ||
check_command npm Node.js |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We generally presume the environment is correctly bootstraped. These checks can provide a false confidence since we don't validate the version of the scripts.
Type of change
Objective
Add a build script for building the libs needed for the Go wrapper.
Code changes
Before you submit