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

[SM-1236] - Add new targets for Go wrapper #772

Merged
merged 6 commits into from May 14, 2024

Conversation

tangowithfoxtrot
Copy link
Contributor

@tangowithfoxtrot tangowithfoxtrot commented May 10, 2024

Tracking

SM-1236

Type of change

  • Bug fix
  • New feature development
  • Tech debt (refactoring, code cleanup, dependency upgrades, etc)
  • Build/deploy pipeline (DevOps)
  • Other

Objective

Add the following targets to the build workflow:

  • x86_64-pc-windows-gnu
  • x86_64-unknown-linux-musl
  • aarch64-unknown-linux-musl

These are needed to produced statically-linked binaries with our Go language wrapper.

Code changes

  • Cross-compile the MUSL targets with Zig and add the Windows GNU target.
  • Adjusted the workflow to just build the bitwarden-c crate. Previously, it was building every crate in the workspace.

Before you submit

  • Please add unit tests where it makes sense to do so

Copy link
Contributor

github-actions bot commented May 10, 2024

Logo
Checkmarx One – Scan Summary & Details3183ceda-06ee-4495-a3d7-33f7155d46ff

No New Or Fixed Issues Found

Copy link

codecov bot commented May 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 58.69%. Comparing base (f01c270) to head (91ccfa7).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #772   +/-   ##
=======================================
  Coverage   58.69%   58.69%           
=======================================
  Files         177      177           
  Lines       11501    11501           
=======================================
  Hits         6751     6751           
  Misses       4750     4750           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tangowithfoxtrot tangowithfoxtrot changed the title add new targets for Go wrapper [SM-1236] - dd new targets for Go wrapper May 13, 2024
@tangowithfoxtrot tangowithfoxtrot changed the title [SM-1236] - dd new targets for Go wrapper [SM-1236] - Add new targets for Go wrapper May 13, 2024
env:
RUSTFLAGS: "-D warnings"
run: cargo build --target ${{ matrix.settings.target }} --release
run: cargo build -p bitwarden-c --target ${{ matrix.settings.target }} --release
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I adjusted this workflow so that it only builds the artifacts for the bitwarden-c crate. Let me know if the other builds are actually necessary in this workflow. As far as I can tell, they aren't getting used anywhere else, but I could have missed something

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, we are only uploading artifacts for files matching *bitwarden_c*, so this seems fine to me.

@tangowithfoxtrot tangowithfoxtrot marked this pull request as ready for review May 13, 2024 16:34
@tangowithfoxtrot tangowithfoxtrot requested a review from a team as a code owner May 13, 2024 16:34
@tangowithfoxtrot tangowithfoxtrot requested review from a team, dani-garcia and Hinton May 13, 2024 16:35
Copy link
Member

@dani-garcia dani-garcia left a comment

Choose a reason for hiding this comment

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

LGTM!

env:
RUSTFLAGS: "-D warnings"
run: cargo build --target ${{ matrix.settings.target }} --release
run: cargo build -p bitwarden-c --target ${{ matrix.settings.target }} --release
Copy link
Member

Choose a reason for hiding this comment

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

Yeah, we are only uploading artifacts for files matching *bitwarden_c*, so this seems fine to me.

Copy link
Member

@coltonhurst coltonhurst left a comment

Choose a reason for hiding this comment

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

@tangowithfoxtrot and I discussed how we are adding more toolchains and a desire to reduce the surface in this area. We'll address this idea after this project as Zig has already been introduced in a recent PR.

Thanks for the work on this!

@tangowithfoxtrot tangowithfoxtrot merged commit 57bcbeb into main May 14, 2024
111 checks passed
@tangowithfoxtrot tangowithfoxtrot deleted the add-cross-compilation-targets branch May 14, 2024 15:26
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.

None yet

4 participants