-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Make bazel openssl build work in omnibus #42930
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
Merged
Merged
Changes from all commits
Commits
Show all changes
82 commits
Select commit
Hold shift + click to select a range
2ad5011
Make openssl build work on Windows
JSGette cf4159a
Buildify openssl.BUILD.bazel
JSGette f4ab990
Buildify bzip2.BUILD.bazel
JSGette ffe4fa1
Build openssl for Windows in CI
JSGette bb85147
Use pre-installed toolchains with rules_foreign_cc
JSGette fc3d5da
Fix the comment
JSGette 0cb3cc5
Fix the comment #2
JSGette 7b42a63
Replace PATH with Windows compliant value
JSGette ffc067a
Remove BAZEL_VS as we use MSYS2
JSGette 41bd72b
Add informative hint
JSGette d7f95bc
Print stderr for Windows
JSGette fa0f646
Reduce parallelism on Windows
JSGette 6516183
Use a single thread for openssl on Windows
JSGette 2f3de73
Add windows related options to openssl
JSGette 737c3a6
Add depend to ensure dependencies are built as well
JSGette 65c9052
Try to only build openssl on Windows
JSGette e5b1acb
Use depend and build targets on Windows
JSGette 3716a74
Force enable required macros
JSGette 83ddff2
Use no-asm and targets from omnibus
JSGette 99146f0
Remove no-asm
JSGette 647bbad
Do not use cache for now
JSGette 2f82fff
Use disk cache again
JSGette fcc4e57
Disable repo content cache explicitly
JSGette f25c8c5
Try to use bazel to build openssl in omnibus
JSGette fc4e862
Add missing load statements
JSGette 50f2f9f
Fix openssl pkg_files target
JSGette b13e0e7
Expose configure_make outputs via filegroups
JSGette eac1eec
Finalize installation of openssl
JSGette 326e121
Remove temporary files on Windows
JSGette 7814133
Use lib64 for linux x86 to build openssl
JSGette abe8b11
Merge remote-tracking branch 'origin/main' into jsgette/bazel_openssl…
JSGette f976d58
Vendor rules_foreign_cc
JSGette b491a29
Add entry to DATADOG.md
JSGette 0dce58b
Fix pkgconfig prefix
JSGette 0870e5d
Fix pkgconfig prefix again
JSGette 277ed22
Set --libdir for openssl build
JSGette 8e94ade
Add replace for rules_foreign_cc
JSGette a309078
Build openssl with -O2
JSGette 5613886
Use omnibus build for FIPS on Windows only
JSGette 922db77
Use one sed command instead of 2
JSGette 7559b7a
Merge remote-tracking branch 'origin/main' into jsgette/bazel_openssl…
JSGette de9d84e
Run replace_prefix on macos
JSGette e81fdc4
Fix replace_prefix to make it work on macos
JSGette 59dc848
Fix openssl3.rb file
JSGette 4dfb70c
Fix fips condition
JSGette 21b8d3c
Fix lib_extension
JSGette 16133d3
Fix prefix and config args for linux
JSGette 88acf9a
Replace prefix entirely in pc files
JSGette accf77c
Increase stdouterr bytes
JSGette a92aa01
Use -id to change path to dylib
JSGette 98cb1e8
Show stdout and stderr in bazel
JSGette e900b7f
Replace id and rpath on macos
JSGette 3be942d
Replace id and rpath for deps too
JSGette 2bd8472
Use zlib-dynamic in openssl
JSGette 51fc089
Fix library paths properly
JSGette 1638f3d
Fix Windows cleanup command
JSGette 3842bc1
Fix lib extension on macos
JSGette cea7fe1
Expose dll.a files
JSGette 2c15ccb
Add add_rpath for macos
JSGette 86f3fe9
Expose dll.a files properly this time
JSGette 45039dc
Use proper installation path on Windows
JSGette 8de6c34
Merge remote-tracking branch 'origin/main' into jsgette/bazel_openssl…
JSGette a5884cd
Run mod tidy on lock file
JSGette eb8aa73
Tell buildifier to ignore includes
JSGette 2a68626
Store dlls in bin
JSGette 1a1c58c
Make `so_symlink` installation prefixes OS-specific
rdesgroppes 0a030f4
Merge remote-tracking branch 'origin/regis.desgroppes/configure-os-sp…
JSGette bdea163
Do not set prefix in so_symlink
JSGette df26e32
Fix cleanup function
JSGette 4b0a6e2
Use patch for rules_foreign_cc
JSGette e7b53a8
Remove mentioning from DATADOG.md
JSGette 600e824
Merge remote-tracking branch 'origin/main' into jsgette/bazel_openssl…
JSGette 020fdc2
Do not rename dll in so_symlink
JSGette 75f73fb
Fix the patch for rules_foreign_cc
JSGette 8d9cd02
Do not sign openssl.exe for non-fips
JSGette 68f13b1
Simplify conditions
JSGette 527deb5
Fix ruby syntax errors
JSGette 4126a2e
Introduce MSYS2_PATH attribute
JSGette 5c319ac
Remove commented lines
JSGette bbba19b
Address review comments
JSGette 03a486f
Restore missing end
JSGette 6ad31f9
Merge remote-tracking branch 'origin/main' into jsgette/bazel_openssl…
JSGette 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
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,79 @@ | ||
| diff --git a/foreign_cc/private/framework.bzl b/foreign_cc/private/framework.bzl | ||
| index 6bf25d9..a081d31 100644 | ||
| --- a/foreign_cc/private/framework.bzl | ||
| +++ b/foreign_cc/private/framework.bzl | ||
| @@ -202,6 +202,10 @@ CC_EXTERNAL_RULE_ATTRIBUTES = { | ||
| ), | ||
| mandatory = False, | ||
| ), | ||
| + "out_pc_dir": attr.string( | ||
| + doc = "Optional name of the output directory with the pkgconfig files", | ||
| + mandatory = False, | ||
| + ), | ||
| "postfix_script": attr.string( | ||
| doc = "Optional part of the shell script to be added after the make commands", | ||
| mandatory = False, | ||
| @@ -592,7 +596,8 @@ def cc_external_rule_impl(ctx, attrs): | ||
| outputs.out_binary_files + | ||
| outputs.libraries.static_libraries + | ||
| outputs.libraries.shared_libraries + | ||
| - [outputs.out_include_dir] if outputs.out_include_dir else [] | ||
| + ([outputs.out_include_dir] if outputs.out_include_dir else []) + | ||
| + ([outputs.out_pc_dir] if outputs.out_pc_dir else []) | ||
| ) | ||
| output_groups = _declare_output_groups(installdir_copy.file, output_groups) | ||
| wrapped_files = [ | ||
| @@ -842,6 +847,7 @@ _Outputs = provider( | ||
| out_include_dir = "Directory with header files (relative to install directory)", | ||
| out_binary_files = "Binary files, which will be created by the action", | ||
| libraries = "Library files, which will be created by the action", | ||
| + out_pc_dir = "Directory with pkgconfig files (relative to install directory)", | ||
| declared_outputs = "All output files and directories of the action", | ||
| ), | ||
| ) | ||
| @@ -854,6 +860,7 @@ def _define_outputs(ctx, attrs, lib_name): | ||
| attr_out_data_files = attrs.out_data_files | ||
| attr_shared_libs = attrs.out_shared_libs | ||
| attr_static_libs = attrs.out_static_libs | ||
| + attr_out_pc_dir = attrs.out_pc_dir | ||
|
|
||
| static_libraries = [] | ||
| if not attr_headers_only: | ||
| @@ -875,6 +882,11 @@ def _define_outputs(ctx, attrs, lib_name): | ||
| else: | ||
| out_include_dir = "" | ||
|
|
||
| + if attrs.out_pc_dir and (attr_shared_libs or attr_static_libs): | ||
| + out_pc_dir = ctx.actions.declare_directory(lib_name + "/" + attr_out_pc_dir.lstrip("/")) | ||
| + else: | ||
| + out_pc_dir = "" | ||
| + | ||
| out_data_dirs = [] | ||
| for dir in attr_out_data_dirs: | ||
| out_data_dirs.append(ctx.actions.declare_directory(lib_name + "/" + dir.lstrip("/"))) | ||
| @@ -893,11 +905,13 @@ def _define_outputs(ctx, attrs, lib_name): | ||
| declared_outputs += out_data_dirs + out_binary_files + out_data_files | ||
| declared_outputs += libraries.static_libraries | ||
| declared_outputs += libraries.shared_libraries + libraries.interface_libraries | ||
| + declared_outputs += [out_pc_dir] if out_pc_dir else [] | ||
|
|
||
| return _Outputs( | ||
| out_include_dir = out_include_dir, | ||
| out_binary_files = out_binary_files, | ||
| libraries = libraries, | ||
| + out_pc_dir = out_pc_dir, | ||
| declared_outputs = declared_outputs, | ||
| ) | ||
|
|
||
| diff --git a/foreign_cc/providers.bzl b/foreign_cc/providers.bzl | ||
| index 2de172f..3f49b7d 100644 | ||
| --- a/foreign_cc/providers.bzl | ||
| +++ b/foreign_cc/providers.bzl | ||
| @@ -20,6 +20,7 @@ Instances of ForeignCcArtifactInfo are encapsulated in a depset [ForeignCcDepsIn | ||
| "dll_dir_name": "DLL directory, relative to install directory", | ||
| "gen_dir": "Install directory", | ||
| "include_dir_name": "Include directory, relative to install directory", | ||
| + "pc_dir_name": "Pkgconfig directory, relative to install directory", | ||
| "lib_dir_name": "Lib directory, relative to install directory", | ||
| }, | ||
| ) |
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bazel is way more relaxed in comparison to omnibus, as it doesn't set rpath at all. We also need to replace all bazel-related paths to dependency dylibs to make it work with
pkg_install