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

Updated Bazelmod cross compilation to catch MacOS sys dependency issues #2926

Merged
merged 15 commits into from
Oct 21, 2024

Conversation

marvin-hansen
Copy link
Contributor

As discussed in issue #2917,
this updated cross compilation example serves as a bridge until the exact cause of the sys crates not building on Mac issue has been found and better regression testing has been added.

Also, I took the freedom to trim and streamline the LLVM setup making it easier to configure while preserving the property that it caches failing sys crate builds. Updated the Readme accordingly.

Signed-off-by: Marvin Hansen <marvin.hansen@gmail.com>
Signed-off-by: Marvin Hansen <marvin.hansen@gmail.com>
Signed-off-by: Marvin Hansen <marvin.hansen@gmail.com>
Signed-off-by: Marvin Hansen <marvin.hansen@gmail.com>
Signed-off-by: Marvin Hansen <marvin.hansen@gmail.com>
Signed-off-by: Marvin Hansen <marvin.hansen@gmail.com>
Signed-off-by: Marvin Hansen <marvin.hansen@gmail.com>
Signed-off-by: Marvin Hansen <marvin.hansen@gmail.com>
Signed-off-by: Marvin Hansen <marvin.hansen@gmail.com>
Signed-off-by: Marvin Hansen <marvin.hansen@gmail.com>
@marvin-hansen
Copy link
Contributor Author

Update:

  • Apparently none of the Bazelmod examples run on MacOS on CI; at least that explains how things slipped through.
  • I added one MacOS test runner for the cross compile example following the format of all the other tests.
  • Since the MacOS runner uses X86, I updated the LLVM config so that Bazel downloads the correct Intel/Mac version.

However, I am not familiar with BazelCI, but is there a way to add a single MacOS runner that basically runs all Bazelmod tests similar to the crate universe runner for the Workspace examples?

Would be great if someone with a solid understanding of the CI would ensure that all Bazelmod examples get build and tested on MacOS.

Copy link
Collaborator

@krasimirgg krasimirgg left a comment

Choose a reason for hiding this comment

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

Left some comments. Stuff looks largely reasonable, (note unfortunately I'm not really familiar with the bzlmod presubmits).

platform: ubuntu2004
working_directory: examples/bzlmod/proto_with_toolchain
build_targets:
- "//..."
Copy link
Collaborator

Choose a reason for hiding this comment

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

is this removal intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nope, that was an accident. Probably a cut instead of copy.
Good catch. Thanks for point it out.

examples/bzlmod/cross_compile/README.md Outdated Show resolved Hide resolved
examples/bzlmod/cross_compile/README.md Show resolved Hide resolved
examples/bzlmod/cross_compile/.bazelrc Outdated Show resolved Hide resolved
Resolves:
bazelbuild#2926 (comment)

Signed-off-by: Marvin Hansen <marvin.hansen@gmail.com>
Resolves:
bazelbuild#2926 (comment)

Signed-off-by: Marvin Hansen <marvin.hansen@gmail.com>
Resolves:
bazelbuild#2926 (comment)

Signed-off-by: Marvin Hansen <marvin.hansen@gmail.com>
@marvin-hansen
Copy link
Contributor Author

@krasimirgg I addresses all of your issues with the latest commits.
CI is green.

Please review again.
Thank you

Copy link
Collaborator

@krasimirgg krasimirgg left a comment

Choose a reason for hiding this comment

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

Thank you!

In general having a macos CI sounds reasonable.

@krasimirgg krasimirgg added this pull request to the merge queue Oct 21, 2024
Merged via the queue into bazelbuild:main with commit 1134392 Oct 21, 2024
4 checks passed
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.

2 participants