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 support for bzlmod #27

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

Add support for bzlmod #27

wants to merge 8 commits into from

Conversation

jwnrt
Copy link

@jwnrt jwnrt commented Jul 9, 2024

Summary

This PR does some general cleaning to prepare for and then enable bzlmod support.

WORKSPACE support has been removed to reduce maintenance burden and complexity.

Best reviewed by commit.

Details

The full changes are:

  • CI workflow added to build the firmware in PRs.
  • bazel-release dependency removed, GitHub CLI used directly.
  • crt dependency swapped for toolchains_arm_gnu which supports bzlmod.
  • BUILD files cleaned up with some indirection and hacks removed.
  • WORKSPACE files and infrastructure removed.

Testing

Tested the deployment in my fork here: https://github.com/jwnrt/hyperdebug-firmware/actions/runs/9853140349

Created this release: https://github.com/jwnrt/hyperdebug-firmware/releases/tag/20240709_01

I've tested the release on our FPGA board by running a few tests that go through HyperDebug.

jwnrt added 8 commits July 8, 2024 17:42
Builds the HyperDebug firmware for pull requests.

Signed-off-by: James Wainwright <[email protected]>
I don't think this was adding anything over using the GitHub CLI
directly.

Signed-off-by: James Wainwright <[email protected]>
Signed-off-by: James Wainwright <[email protected]>
Signed-off-by: James Wainwright <[email protected]>
Signed-off-by: James Wainwright <[email protected]>
Signed-off-by: James Wainwright <[email protected]>
Signed-off-by: James Wainwright <[email protected]>
This reduces maintenence burden.

The ARM toolchain was not working entirely correctly in the `WORKSPACE`
configuration either for unknown reasons.

Signed-off-by: James Wainwright <[email protected]>
run: |
git tag ${{ inputs.release_tag }}
bazel build --stamp :release
Copy link

Choose a reason for hiding this comment

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

I don't necessarily have a strong opinion but I can see an advantage to using bazel-release in theory: the release process is part of the build and can be done locally easily. Github/Azure flows are always notorioulsy bad for local reproducibility as they get more complicated.

Copy link
Author

Choose a reason for hiding this comment

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

That makes sense.

I have this PR for adding bzlmod support to bazel-release: lowRISC/bazel-release#5

If that's merged, we could go back to using it.

@jwnrt
Copy link
Author

jwnrt commented Jul 9, 2024

@jesultra this PR changes the toolchain (still GNU ARM) from the one provided by CRT to the one provided by https://github.com/hexdae/toolchains_arm_gnu which I believe is more up to date and generates a different binary.

This is mainly because I couldn't port CRT to bzlmod very easily.

I've tested the binary on our HyperDebug in the office, but wanted to get your opinion on changing the toolchain here.

Copy link

@pamaury pamaury left a comment

Choose a reason for hiding this comment

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

Overall this looks to me though I am no blzmod-expert.

@jesultra
Copy link
Collaborator

@jesultra this PR changes the toolchain (still GNU ARM) from the one provided by CRT to the one provided by https://github.com/hexdae/toolchains_arm_gnu which I believe is more up to date and generates a different binary.

This project already uses a different toolchain than the one found in ChromeOS "chroot" build environment, meaning that when I do local modifications to the source in platform/ec, and build without using this repository, the resulting binary may behave differently than the official one through this release process. One time recently, timing or optimization differences let to a bug not being detected when I compiled locally.

What I am saying is that I do not mind at all the toolchain being changed, and furthermore, if in the process we could make it easier to run the same build process locally, and even with modifications to the source code, then that would be a welcome bonus.

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