-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[ABLD-267] Create bazel rules for curl #42546
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
Draft
aiuto
wants to merge
3
commits into
main
Choose a base branch
from
aiuto/curl
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| load("@bazel_skylib//rules:diff_test.bzl", "diff_test") | ||
| load("//bazel/tools:generate_module_bazel.bzl", "generate_module_bazel") | ||
|
|
||
| VERSION = "8.16.0" | ||
|
|
||
| generate_module_bazel( | ||
| name = "curl_module_bazel_new", | ||
| out = "curl.MODULE.bazel.new", | ||
| module = "curl", | ||
| sha256 = "a21e20476e39eca5a4fc5cfb00acf84bbc1f5d8443ec3853ad14c26b3c85b970", | ||
| strip_prefix = "curl-%s" % VERSION, | ||
| tags = ["manual"], | ||
| target_compatible_with = ["@platforms//os:linux"], | ||
| url = "https://curl.haxx.se/download/curl-%s.tar.gz" % VERSION, | ||
| ) | ||
|
|
||
| diff_test( | ||
| name = "module_file_up_to_date_test", | ||
| file1 = ":curl.MODULE.bazel.new", | ||
| file2 = "curl.MODULE.bazel", | ||
| target_compatible_with = ["@platforms//os:linux"], | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| # Hints for how to update curl from first principles | ||
| # | ||
| # This is not part of any build process. Think of it as a readme with | ||
| # executable parts. | ||
|
|
||
| # A tool to look at configure output and create parts to support bazel targets | ||
| C2B=$(HOME)/ws/experimental/teams/agent-supply-chain/configure2bazel | ||
|
|
||
| PRISTINE=curl-8.18.0 | ||
|
|
||
| next: | ||
| echo Do both steps on each platform. | ||
| echo Adjust overlay/overlay.BUILD.bazel | ||
| echo Adjust overlay/lib/curl_config.h | ||
|
|
||
| # Run configure and grab the generated files to the overlay tree | ||
| # Run make to create the library outputs | ||
| macos_step1: | ||
| python3 $(C2B)/add_configuration.py \ | ||
| --pristine_dir=$(PRISTINE) \ | ||
| --configure_options=config_opts.txt | ||
| echo Now do: '(cd linux_aarch64 ; make)' | ||
| echo Now do: '(cd darwin_arm64 ; make)' | ||
|
|
||
|
|
||
| # Step 3 | ||
| # Do some reasoning about the generated config.h. For almost every project, | ||
| # the file should be identical for x86 and arm within each OS. | ||
| # Then look at config.h differences per OS. They should almost always be | ||
| # very simliar. What might differ is the inclusion of packages which are | ||
| # os specific. Basic stuff should be in both. | ||
| # Look for HAVE_* settings which are wrong because configure can not find | ||
| # the bazel built dependency. This happens often. Edit config.h as needed | ||
| # to match the goal you want, rather than what configure finds. | ||
|
|
||
| # Analyze the built libraries to map library content back to the source files | ||
| # in them. Save lists by library name and arch back to lib_contents.bzl | ||
| macos_step3: | ||
| python3 $(C2B)/analyze.py \ | ||
| --pristine_dir=$(PRISTINE) \ | ||
| --configured_dir=darwin_arm64 \ | ||
| --configured_name=darwin_arm64 \ | ||
| --overlay=overlay | ||
| git diff overlay/lib_contents.bzl | ||
|
|
||
| # For linux, do the same as macos, but with different config names. | ||
|
|
||
| # Step 4 | ||
| # Create your cc_library() target. Use any of the other projects using | ||
| # configure2bazel as an sample starting point. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| --disable-manual | ||
| --disable-debug | ||
| --enable-optimize | ||
| --disable-static | ||
| --disable-ldap | ||
| --disable-ldaps | ||
| --disable-rtsp | ||
| --enable-proxy | ||
| --disable-dependency-tracking | ||
| --enable-ipv6 | ||
| --without-applic-idn | ||
| --without-libidn2 | ||
| --without-gnutls | ||
| --without-librtmp | ||
| --without-libssh2 | ||
| --without-libpsl | ||
| --without-libuv | ||
| --without-winidn | ||
| --without-zsh-functions-dir | ||
| --without-fish-functions-dir | ||
| --with-ssl | ||
| --with-zlib | ||
| --with-nghttp2 | ||
| --disable-docs | ||
| --disable-libcurl-option | ||
| --disable-versioned-symbols | ||
| --disable-libuv | ||
| --disable-verbose | ||
| --disable-progress-meter | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| # This file is generated. Do not hand edit. | ||
|
|
||
| http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") | ||
|
|
||
| http_archive( | ||
| name = "curl", | ||
| files = { | ||
| "BUILD.bazel": "//deps/curl:overlay/curl.BUILD.bazel", | ||
| "darwin_arm64/lib/curl_config.h": "//deps/curl:overlay/darwin_arm64/lib/curl_config.h", | ||
| "lib/curl_config.h": "//deps/curl:overlay/lib/curl_config.h", | ||
| "lib_contents.bzl": "//deps/curl:overlay/lib_contents.bzl", | ||
| "linux_arm64/lib/curl_config.h": "//deps/curl:overlay/linux_arm64/lib/curl_config.h", | ||
| }, | ||
| sha256 = "e9274a5f8ab5271c0e0e6762d2fce194d5f98acc568e4ce816845b2dcc0cf88f", | ||
| strip_prefix = "curl-8.18.0", | ||
| url = "https://curl.haxx.se/download/curl-8.18.0.tar.gz", | ||
| ) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.