-
Notifications
You must be signed in to change notification settings - Fork 13
Update rules_spm
to build fetched dependencies using Bazel instead of Swift Package Manager
#149
Comments
Looks like I will need to parse the Package.swift to get any C-specific settings/options. Example: swift-nio with CSetting |
Notes on getting
includes = [
"include/webp",
"libwebp",
"libwebp/src",
], |
Over the past week or so, I have been working on a proof-of-concept to understand what it would take to introduce a To be able to properly build clang targets with custom build settings, one needs to retrieve and apply these settings (e.g. defines, public header paths). The current scheme for downloading and reading these manifest files during the repository fetch phase requires code that can parse the manifest and present the information in a means that is readable by Starlark code. Unfortunately, there is no Swift package manifest parser written in Starlark. One can write a parser in Starlark and maintain it as SPM evolves. The question is whether that is the best path forward. This conundrum is not new to this project. The same decision had to be made when figuring out how to read data from To avoid having to write a custom parser, I wrote a simple Swift binary that reads a Swift package manifest and dumps information about it to JSON. The JSON is then read by Starlark code. The approach works. The problem is how one gets and uses the binary from code that is run during Bazel's fetch phase. As of this writing, the current code uses So, I am left with one of a few options:
|
Created #157 asking the community how they would like to move forward. |
Goals
https://github.com/grpc/grpc-swift
becomescom_github_grpc_grpc_swift
)Reasoning
Tasks
CSetting
).spm_parser
to a separate repository.rules_spm
to downloadspm_parser
.interesting_deps
example that useslibwebp
. exampleCSetting
).spm_parser
.build_mode
set tobazel
.Working Examples
simple
simple_with_dev_dir
simple_revision
interesting_deps
- Need to derive the source package name from the repo URL and not the pkg_name.simple_with_binary
- The binary that we define works. Theswiftformat
andswiftlint
do not work due to special C settings.ios_sim
- Requires support for special C settings.local_package
- Requires support for special C settings.public_hdrs
- Need to find source path frompath
setting in thePackage.swift
. (e.g. TrustKit)vapor
- Requires support for special C settings.The text was updated successfully, but these errors were encountered: