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

bazel: enable rules_foreign_cc vendored tools #20517

Merged

Conversation

keith
Copy link
Member

@keith keith commented Mar 25, 2022

This makes it so you don't have to have cmake, make, or ninja installed,
or worry about version issues between them.

Since 0.1.0 rules_foreign_cc has supported vendoring these tools https://github.com/bazelbuild/rules_foreign_cc/releases/tag/0.1.0 and it builds them with cross platform scripts for bootstrapping.

Signed-off-by: Keith Smiley keithbsmiley@gmail.com

@repokitteh-read-only
Copy link

As a reminder, PRs marked as draft will not be automatically assigned reviewers,
or be handled by maintainer-oncall triage.

Please mark your PR as ready when you want it to be reviewed!

🐱

Caused by: #20517 was opened by keith.

see: more, trace.

@repokitteh-read-only repokitteh-read-only bot added the deps Approval required for changes to Envoy's external dependencies label Mar 25, 2022
@repokitteh-read-only
Copy link

CC @envoyproxy/dependency-shepherds: Your approval is needed for changes made to (bazel/.*repos.*\.bzl)|(bazel/dependency_imports\.bzl)|(api/bazel/.*\.bzl)|(.*/requirements\.txt)|(.*\.patch).
envoyproxy/dependency-shepherds assignee is @htuch

🐱

Caused by: #20517 was opened by keith.

see: more, trace.

@htuch
Copy link
Member

htuch commented Mar 25, 2022

@keith this seems magically good. Can you link to the upstream description in rules_foreign_cc around how this works? Are we pulling in things like cmake via the rules_foreign_cc dependency? How does that work across all platforms?

@keith keith force-pushed the ks/bazel-enable-rules_foreign_cc-vendored-tools branch from 4ced78c to 38dbd9f Compare April 16, 2022 04:12
@keith
Copy link
Member Author

keith commented Apr 16, 2022

Updated the description a bit! Yea it should work cross platform, they use some scripts for make, and then make for cmake.

@htuch
Copy link
Member

htuch commented Apr 18, 2022

LGTM - should https://github.com/envoyproxy/envoy/blob/main/bazel/README.md#quick-start-bazel-build-for-developers also be updated to reduce packages that are subsumed here?

This makes it so you don't have to have cmake, make, or ninja installed,
or worry about version issues between them.

Signed-off-by: Keith Smiley <keithbsmiley@gmail.com>
Signed-off-by: Keith Smiley <keithbsmiley@gmail.com>
@keith keith force-pushed the ks/bazel-enable-rules_foreign_cc-vendored-tools branch from ae4f7c6 to e089579 Compare April 19, 2022 17:06
@keith
Copy link
Member Author

keith commented Apr 19, 2022

Ah yes! updated here. I'm not actually sure how automake played into things though 🤔 that one might still be required.

@keith keith marked this pull request as ready for review April 19, 2022 17:06
@moderation
Copy link
Contributor

/lgtm deps

@repokitteh-read-only repokitteh-read-only bot removed the deps Approval required for changes to Envoy's external dependencies label Apr 19, 2022
Copy link
Member

@htuch htuch left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@htuch htuch merged commit 9141f23 into envoyproxy:main Apr 20, 2022
@keith keith deleted the ks/bazel-enable-rules_foreign_cc-vendored-tools branch April 20, 2022 03:08
@moderation
Copy link
Contributor

I'm getting the following error on Apple M1. Maybe I need a bazel clean --expunge ?

ERROR: /private/var/tmp/_bazel_moderation/3335c71f4281d4576473beb63d032778/external/rules_foreign_cc/toolchains/BUILD.bazel:147:11: BootstrapNinjaBuild external/rules_foreign_cc/toolchains/ninja failed: (Exit 127): bash failed: error executing command /bin/bash -c bazel-out/darwin_arm64-opt-exec-2B5CBBC6/bin/external/rules_foreign_cc/toolchains/ninja_tool_foreign_cc/wrapper_build_script.sh

Use --sandbox_debug to see verbose messages from the sandbox
rules_foreign_cc: Build failed!
rules_foreign_cc: Keeping temp build directory and dependencies directory for debug.
rules_foreign_cc: Please note that the directories inside a sandbox are still cleaned unless you specify --sandbox_debug Bazel command line flag.
rules_foreign_cc: Printing build logs:
_____ BEGIN BUILD LOGS _____
+ ./configure.py --bootstrap
env: python: No such file or directory
_____ END BUILD LOGS _____
rules_foreign_cc: Build wrapper script location: bazel-out/darwin_arm64-opt-exec-2B5CBBC6/bin/external/rules_foreign_cc/toolchains/ninja_tool_foreign_cc/wrapper_build_script.sh
rules_foreign_cc: Build script location: bazel-out/darwin_arm64-opt-exec-2B5CBBC6/bin/external/rules_foreign_cc/toolchains/ninja_tool_foreign_cc/build_script.sh
rules_foreign_cc: Build log location: bazel-out/darwin_arm64-opt-exec-2B5CBBC6/bin/external/rules_foreign_cc/toolchains/ninja_tool_foreign_cc/BootstrapNinjaBuild.log

Target //source/exe:envoy-static.stripped failed to build
Use --verbose_failures to see the command lines of failed build steps.
ERROR: /private/var/tmp/_bazel_moderation/3335c71f4281d4576473beb63d032778/external/envoy_api/envoy/type/v3/BUILD:7:18 Middleman _middlemen/@envoy_Uapi_S_Senvoy_Stype_Sv3_Cpkg-BazelCppSemantics_build_arch_darwin_arm64-opt failed: (Exit 127): bash failed: error executing command /bin/bash -c bazel-out/darwin_arm64-opt-exec-2B5CBBC6/bin/external/rules_foreign_cc/toolchains/ninja_tool_foreign_cc/wrapper_build_script.sh

Use --sandbox_debug to see verbose messages from the sandbox
INFO: Elapsed time: 4.012s, Critical Path: 2.36s
INFO: 37 processes: 13 internal, 24 darwin-sandbox.
FAILED: Build did NOT complete successfully

@keith
Copy link
Member Author

keith commented Apr 20, 2022

Oof. Something depends on python2 it looks like:

 ./configure.py --bootstrap
env: python: No such file or directory

I haven't updated to the version that drops it yet. I'll submit a revert.

keith added a commit that referenced this pull request Apr 20, 2022
This reverts commit 9141f23.

Signed-off-by: Keith Smiley <keithbsmiley@gmail.com>
@keith
Copy link
Member Author

keith commented Apr 20, 2022

#20899

keith added a commit that referenced this pull request Apr 20, 2022
This reverts commit 9141f23.

Signed-off-by: Keith Smiley <keithbsmiley@gmail.com>
@keith
Copy link
Member Author

keith commented Apr 20, 2022

working on the new version here #20910

ravenblackx pushed a commit to ravenblackx/envoy that referenced this pull request Jun 8, 2022
This makes it so you don't have to have cmake, make, or ninja installed,
or worry about version issues between them.

Since 0.1.0 rules_foreign_cc has supported vendoring these tools https://github.com/bazelbuild/rules_foreign_cc/releases/tag/0.1.0 and it builds them with cross platform scripts for bootstrapping.

Signed-off-by: Keith Smiley <keithbsmiley@gmail.com>
ravenblackx pushed a commit to ravenblackx/envoy that referenced this pull request Jun 8, 2022
…)"

This reverts commit 9141f23.

Signed-off-by: Keith Smiley <keithbsmiley@gmail.com>
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