-
Notifications
You must be signed in to change notification settings - Fork 5
Add hermetic macos support #6
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
Conversation
|
Hey @kaycebasques, you motivated me into looking a bit more in the issue and, after a bit of refactor inspired by your fork, I produced a solution that satisfies me. |
|
Oh wow! I just submitted my non-working attempt haha #7 Let me try yours |
|
Almost working for us!! need to specify different SHAs for different OSesOne thing not working is that I set it to Linux SHA and it works on Linux. But when I run on Mac I get the "wanted SHA ... but actually got SHA ..." error But when I set it to Mac SHA and run on Mac it works! So your change seems to work for both Mac and Linux need to not clobber lock fileWe use Notice how there's only one To repro in Pigweed:
(this one should work on linux but not on mac) Doxygen-built DMG doesn't seem to support Apple ARM Silicon(we can possibly address this one later, just noting now before I forget) Our CI/CQ tryjobs (presubmits) seem to suggest that the Doxygen-provided DMG was built on an Intel Mac and doesn't actually support Arm-based Apple Silicon. I'm testing locally on a 2021 MacBook with M1 Pro so I don't know how my local builds are passing. Maybe Rosetta was silently enabled on my loaner laptop. Note the (feedback for later) remove non-hermetic optionsI personally got bamboozled by the option to use a non-hermetic Doxygen binary. Pigweed has a workflow that puts Doxygen binary on my path that I forgot about. It would be better for us to just remove the non-hermetic binary option and always force hermetic build (in keeping with Bazel philosophy) to prevent accidents like what I went through |
|
Thank you for your insightful comments.
# My idea. I'm still not sure how it would work exactly
doxygen_extension = use_extension("@rules_doxygen//:extensions.bzl", "doxygen_extension")
doxygen_extension.version(
sha256 = "25ad21fa767bd71208947b848d482b46c6bc523a97ba1aacf803c71c4d043726",
version = "1.9.6",
platform="macos"
)
doxygen_extension.version(
sha256 = "8354583f86416586d35397c8ee7e719f5aa5804140af83cf7ba39a8c5076bdb8",
version = "1.9.6",
platform="linux"
)
use_repo(doxygen_extension, "doxygen")
|
|
Re: 1 your proposed solution could probably work for us, I'll keep an eye out for your updates! Re: 2 I did not mean to suggest it was an error on your part. I encountered the same issue in my implementation. It's just a limitation that will need to be worked around somehow. I don't know yet whether it makes more sense to workaround it here in rules_doxygen or in the Pigweed code. I was just mentioning this as an important FYI for us. Re: 3 sounds good, thanks for considering. Thanks again for helping here, I very much appreciate your work and am looking forward to hopefully adopting all of this in Pigweed!! |
|
Ok, I think I managed to pull it off. Let me know if this works for you. bazel_dep(name = "rules_doxygen", version = "1.3.0", dev_dependency = True)
doxygen_extension = use_extension("@rules_doxygen//:extensions.bzl", "doxygen_extension")
doxygen_extension.version(
sha256 = "8354583f86416586d35397c8ee7e719f5aa5804140af83cf7ba39a8c5076bdb8",
version = "1.9.6",
platform = "linux"
)
doxygen_extension.version(
sha256 = "25ad21fa767bd71208947b848d482b46c6bc523a97ba1aacf803c71c4d043726",
version = "1.9.6",
platform = "mac"
)
use_repo(doxygen_extension, "doxygen") |
|
Local builds on macOS and Linux looked good! The new |
|
Tryjobs all good (except the two that were expected to fail) so I think this is all good to merge as far as I'm concerned! https://pwrev.dev/247192 |
|
Good to hear. If you find a way circumvent the CPU architecture issue let me know and I'll try to implement it in the rule as well. |
[ closes #4 ]