Skip to content

Commit

Permalink
Split rules_rust_ext into granular sub-workspaces.
Browse files Browse the repository at this point in the history
  • Loading branch information
UebelAndre committed Nov 25, 2024
1 parent 594b001 commit d2abc05
Show file tree
Hide file tree
Showing 580 changed files with 5,391 additions and 4,227 deletions.
120 changes: 101 additions & 19 deletions .bazelci/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -824,20 +824,20 @@ tasks:
- "--compile_one_dependency"
build_targets:
- "tools/rust_analyzer/main.rs"
extensions_linux:
name: Extensions
extensions_bindgen_linux:
platform: ubuntu2004
working_directory: extensions
name: Extensions Bindgen
working_directory: extensions/bindgen
build_flags: *aspects_flags
test_flags: *aspects_flags
build_targets:
- "//..."
test_targets:
- "//..."
extensions_linux_rbe:
name: Extensions
extensions_bindgen_linux_rbe:
platform: rbe_ubuntu2004
working_directory: extensions
name: Extensions Bindgen
working_directory: extensions/bindgen
shell_commands:
- sed -i 's/^# load("@bazel_ci_rules/load("@bazel_ci_rules/' WORKSPACE.bazel
- sed -i 's/^# rbe_preconfig/rbe_preconfig/' WORKSPACE.bazel
Expand All @@ -847,34 +847,116 @@ tasks:
- "//..."
test_targets:
- "//..."
extensions_macos:
name: Extensions
extensions_bindgen_macos:
platform: macos_arm64
working_directory: extensions
name: Extensions Bindgen
working_directory: extensions/bindgen
build_flags: *aspects_flags
test_flags: *aspects_flags
build_targets:
- "//..."
test_targets:
- "//..."
extensions_windows:
name: Extensions
# # TODO: https://github.com/bazelbuild/rules_rust/issues/2009
# # The bindgen rules are currently broken on windows
# extensions_bindgen_windows:
# platform: windows
# name: Extensions Bindgen
# working_directory: extensions/bindgen
# build_flags: *aspects_flags
# test_flags: *aspects_flags
# build_targets:
# - "--"
# - "//..."
# test_targets:
# - "--"
# - "//..."
extensions_protobuf_linux:
platform: ubuntu2004
name: Extensions Protobuf
working_directory: extensions/protobuf
build_flags: *aspects_flags
test_flags: *aspects_flags
build_targets:
- "//..."
test_targets:
- "//..."
extensions_protobuf_linux_rbe:
platform: rbe_ubuntu2004
name: Extensions Protobuf
working_directory: extensions/protobuf
shell_commands:
- sed -i 's/^# load("@bazel_ci_rules/load("@bazel_ci_rules/' WORKSPACE.bazel
- sed -i 's/^# rbe_preconfig/rbe_preconfig/' WORKSPACE.bazel
build_flags: *aspects_flags
test_flags: *aspects_flags
build_targets:
- "//..."
test_targets:
- "//..."
extensions_protobuf_macos:
platform: macos_arm64
name: Extensions Protobuf
working_directory: extensions/protobuf
build_flags: *aspects_flags
test_flags: *aspects_flags
build_targets:
- "//..."
test_targets:
- "//..."
extensions_protobuf_windows:
platform: windows
name: Extensions Protobuf
working_directory: extensions/protobuf
build_flags: *aspects_flags
test_flags: *aspects_flags
build_targets:
- "//..."
test_targets:
- "//..."
extensions_wasm_bindgen_linux:
platform: ubuntu2004
name: Extensions wasm-bindgen
working_directory: extensions/wasm_bindgen
build_flags: *aspects_flags
test_flags: *aspects_flags
build_targets:
- "//..."
test_targets:
- "//..."
extensions_wasm_bindgen_linux_rbe:
platform: rbe_ubuntu2004
name: Extensions wasm-bindgen
working_directory: extensions/wasm_bindgen
shell_commands:
- sed -i 's/^# load("@bazel_ci_rules/load("@bazel_ci_rules/' WORKSPACE.bazel
- sed -i 's/^# rbe_preconfig/rbe_preconfig/' WORKSPACE.bazel
build_flags: *aspects_flags
test_flags: *aspects_flags
build_targets:
- "//..."
test_targets:
- "//..."
extensions_wasm_bindgen_macos:
platform: macos_arm64
name: Extensions wasm-bindgen
working_directory: extensions
build_flags: *aspects_flags
test_flags: *aspects_flags
build_targets:
- "--"
- "//..."
# The bindgen rules are currently broken on windows
# https://github.com/bazelbuild/rules_rust/issues/2009
- "-//bindgen/..."
test_targets:
- "--"
- "//..."
# The bindgen rules are currently broken on windows
# https://github.com/bazelbuild/rules_rust/issues/2009
- "-//bindgen/..."
extensions_wasm_bindgen_windows:
platform: windows
name: Extensions wasm-bindgen
working_directory: extensions/wasm_bindgen
build_flags: *aspects_flags
test_flags: *aspects_flags
build_targets:
- "//..."
test_targets:
- "//..."

buildifier:
version: latest
Expand Down
23 changes: 23 additions & 0 deletions .bcr/extensions/bindgen/metadata.template.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"homepage": "https://github.com/bazelbuild/rules_rust/extensions/bindgen",
"maintainers": [
{
"email": "[email protected]",
"github": "UebelAndre",
"name": "UebelAndre"
},
{
"email": "[email protected]",
"github": "illicitonion",
"name": "Daniel Wagner-Hall"
},
{
"email": "[email protected]",
"github": "scentini",
"name": "Rosica Dejanovska"
}
],
"repository": ["github:bazelbuild/rules_rust"],
"versions": [],
"yanked_versions": {}
}
15 changes: 15 additions & 0 deletions .bcr/extensions/bindgen/presubmit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
bcr_test_module:
module_path: "extensions/bindgen"
matrix:
platform: ["macos_arm64", "ubuntu2004", "windows"]
bazel: ["7.x"]
tasks:
run_tests:
name: "Run test module"
platform: ${{ platform }}
bazel: ${{ bazel }}
# Remove the lockfile because we generate on Bazel 7, but test on Bazel 6 which may not be able to parse a future-generated lockfile.
shell_commands:
- "rm MODULE.bazel.lock"
test_targets:
- "//..."
5 changes: 5 additions & 0 deletions .bcr/extensions/bindgen/source.template.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"integrity": "**leave this alone**",
"strip_prefix": "",
"url": "https://github.com/{OWNER}/{REPO}/releases/download/{TAG}/{REPO}_bindgen-{VERSION}.tar.gz"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"homepage": "https://github.com/bazelbuild/rules_rust/extensions",
"homepage": "https://github.com/bazelbuild/rules_rust/extensions/prost",
"maintainers": [
{
"email": "[email protected]",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
bcr_test_module:
module_path: "extensions"
module_path: "extensions/prost"
matrix:
platform: ["macos_arm64", "ubuntu2004", "windows"]
bazel: ["7.x"]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"integrity": "**leave this alone**",
"strip_prefix": "",
"url": "https://github.com/{OWNER}/{REPO}/releases/download/{TAG}/{REPO}_ext-{VERSION}.tar.gz"
"url": "https://github.com/{OWNER}/{REPO}/releases/download/{TAG}/{REPO}_prost-{VERSION}.tar.gz"
}
23 changes: 23 additions & 0 deletions .bcr/extensions/protobuf/metadata.template.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"homepage": "https://github.com/bazelbuild/rules_rust/extensions/protobuf",
"maintainers": [
{
"email": "[email protected]",
"github": "UebelAndre",
"name": "UebelAndre"
},
{
"email": "[email protected]",
"github": "illicitonion",
"name": "Daniel Wagner-Hall"
},
{
"email": "[email protected]",
"github": "scentini",
"name": "Rosica Dejanovska"
}
],
"repository": ["github:bazelbuild/rules_rust"],
"versions": [],
"yanked_versions": {}
}
15 changes: 15 additions & 0 deletions .bcr/extensions/protobuf/presubmit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
bcr_test_module:
module_path: "extensions/protobuf"
matrix:
platform: ["macos_arm64", "ubuntu2004", "windows"]
bazel: ["7.x"]
tasks:
run_tests:
name: "Run test module"
platform: ${{ platform }}
bazel: ${{ bazel }}
# Remove the lockfile because we generate on Bazel 7, but test on Bazel 6 which may not be able to parse a future-generated lockfile.
shell_commands:
- "rm MODULE.bazel.lock"
test_targets:
- "//..."
5 changes: 5 additions & 0 deletions .bcr/extensions/protobuf/source.template.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"integrity": "**leave this alone**",
"strip_prefix": "",
"url": "https://github.com/{OWNER}/{REPO}/releases/download/{TAG}/{REPO}_protobuf-{VERSION}.tar.gz"
}
23 changes: 23 additions & 0 deletions .bcr/extensions/wasm_bindgen/metadata.template.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"homepage": "https://github.com/bazelbuild/rules_rust/extensions/wasm_bindgen",
"maintainers": [
{
"email": "[email protected]",
"github": "UebelAndre",
"name": "UebelAndre"
},
{
"email": "[email protected]",
"github": "illicitonion",
"name": "Daniel Wagner-Hall"
},
{
"email": "[email protected]",
"github": "scentini",
"name": "Rosica Dejanovska"
}
],
"repository": ["github:bazelbuild/rules_rust"],
"versions": [],
"yanked_versions": {}
}
15 changes: 15 additions & 0 deletions .bcr/extensions/wasm_bindgen/presubmit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
bcr_test_module:
module_path: "extensions/wasm_bindgen"
matrix:
platform: ["macos_arm64", "ubuntu2004", "windows"]
bazel: ["7.x"]
tasks:
run_tests:
name: "Run test module"
platform: ${{ platform }}
bazel: ${{ bazel }}
# Remove the lockfile because we generate on Bazel 7, but test on Bazel 6 which may not be able to parse a future-generated lockfile.
shell_commands:
- "rm MODULE.bazel.lock"
test_targets:
- "//..."
5 changes: 5 additions & 0 deletions .bcr/extensions/wasm_bindgen/source.template.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"integrity": "**leave this alone**",
"strip_prefix": "",
"url": "https://github.com/{OWNER}/{REPO}/releases/download/{TAG}/{REPO}_wasm_bindgen-{VERSION}.tar.gz"
}
69 changes: 64 additions & 5 deletions .github/release_notes.template
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,78 @@ http_archive(

## Extensions

### Bzlmod
### Bindgen

#### Bzlmod

```python
bazel_dep(name = "rules_rust_bindgen", version = "{version}")
```

#### WORKSPACE

```python
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_rust_bindgen",
integrity = "sha256-{ext_bindgen_sha256_base64}",
urls = ["https://github.com/bazelbuild/rules_rust/releases/download/{version}/rules_rust_bindgen-{version}.tar.gz"],
)
```

### Prost

#### Bzlmod

```python
bazel_dep(name = "rules_rust_prost", version = "{version}")
```

#### WORKSPACE

```python
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_rust_prost",
integrity = "sha256-{ext_prost_sha256_base64}",
urls = ["https://github.com/bazelbuild/rules_rust/releases/download/{version}/rules_rust_prost-{version}.tar.gz"],
)
```

### Protobuf

#### Bzlmod

```python
bazel_dep(name = "rules_rust_protobuf", version = "{version}")
```

#### WORKSPACE

```python
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_rust_protobuf",
integrity = "sha256-{ext_protobuf_sha256_base64}",
urls = ["https://github.com/bazelbuild/rules_rust/releases/download/{version}/rules_rust_protobuf-{version}.tar.gz"],
)
```

### Wasm-Bindgen

#### Bzlmod

```python
bazel_dep(name = "rules_rust_ext", version = "{version}")
bazel_dep(name = "rules_rust_wasm_bindgen", version = "{version}")
```

### WORKSPACE
#### WORKSPACE

```python
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_rust",
integrity = "sha256-{ext_sha256_base64}",
urls = ["https://github.com/bazelbuild/rules_rust/releases/download/{version}/rules_rust_ext-{version}.tar.gz"],
integrity = "sha256-{ext_wasm_bindgen_sha256_base64}",
urls = ["https://github.com/bazelbuild/rules_rust/releases/download/{version}/rules_rust_wasm_bindgen-{version}.tar.gz"],
)
```
Loading

0 comments on commit d2abc05

Please sign in to comment.