Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Rename musl-builder -> binary-builder
  • Loading branch information
mrcnski committed Apr 28, 2023
commit f17005a137f68c1ae3bdbd805d1262c676aa4125
34 changes: 17 additions & 17 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ members = [
"node/core/provisioner",
"node/core/pvf",
"node/core/pvf/common",
"node/core/pvf/musl-builder",
"node/core/pvf/binary-builder",
"node/core/pvf/execute-worker",
"node/core/pvf/prepare-worker",
"node/core/pvf-checker",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "polkadot-node-core-pvf-musl-builder"
name = "polkadot-node-core-pvf-binary-builder"
version.workspace = true
authors.workspace = true
edition.workspace = true
Expand Down
18 changes: 18 additions & 0 deletions node/core/pvf/binary-builder/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# binary-builder

binary-builder is a tool that integrates the process of building the binary of a
crate into the main `cargo` build process. The binary can then be embedded into
other crates and extracted at runtime.

<!-- TODO: add project setup -->

## Prerequisites

binary-builder requires the chosen toolchain (e.g. `x86_64-unknown-linux-musl`)
to be installed:

```sh
rustup target add x86_64-unknown-linux-musl
```

<!-- TODO: What to do with License? (wasm-builder is Apache-2.0) -->
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.

// TODO: Extract common parts into a generalized builder that wasm/musl builders are based on.
// TODO: Extract common parts into a generalized builder that wasm-builder is based on.

// TODO: Make sure we build with O2 and LTO.

Expand All @@ -33,6 +33,8 @@ use std::{
};
use version::Version;

// TODO: Allow customizing the env vars, for wasm-builder.

/// Environment variable that tells us to skip building the binary.
const SKIP_BUILD_ENV: &str = "BUILDER_SKIP_BUILD";

Expand Down Expand Up @@ -195,7 +197,7 @@ impl CargoCommand {
///
/// Assumes that cargo version matches the rustc version.
fn supports_env(&self) -> bool {
// TODO: Just a stub for now -- not sure this is needed for musl-builder.
// TODO: Just a stub for now -- generalize.
true
}
}
Expand Down
2 changes: 1 addition & 1 deletion node/core/pvf/execute-worker/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ sp-maybe-compressed-blob = { git = "https://github.com/paritytech/substrate", br
tikv-jemalloc-ctl = "0.5.0"

[build-dependencies]
polkadot-node-core-pvf-musl-builder = { path = "../musl-builder" }
polkadot-node-core-pvf-binary-builder = { path = "../binary-builder" }

[features]
builder = []
2 changes: 1 addition & 1 deletion node/core/pvf/execute-worker/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.

fn main() {
let builder = polkadot_node_core_pvf_musl_builder::Builder::new()
let builder = polkadot_node_core_pvf_binary_builder::Builder::new()
// Tell the builder to build the project (crate) this `build.rs` is part of.
.with_current_project();

Expand Down
16 changes: 0 additions & 16 deletions node/core/pvf/musl-builder/README.md

This file was deleted.

2 changes: 1 addition & 1 deletion node/core/pvf/prepare-worker/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ sp-tracing = { git = "https://github.com/paritytech/substrate", branch = "master
tikv-jemalloc-ctl = "0.5.0"

[build-dependencies]
polkadot-node-core-pvf-musl-builder = { path = "../musl-builder" }
polkadot-node-core-pvf-binary-builder = { path = "../binary-builder" }

substrate-build-script-utils = { git = "https://github.com/paritytech/substrate", branch = "master" }

Expand Down
2 changes: 1 addition & 1 deletion node/core/pvf/prepare-worker/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
fn main() {
substrate_build_script_utils::generate_cargo_keys();

let builder = polkadot_node_core_pvf_musl_builder::Builder::new()
let builder = polkadot_node_core_pvf_binary_builder::Builder::new()
// Tell the builder to build the project (crate) this `build.rs` is part of.
.with_current_project();

Expand Down
4 changes: 2 additions & 2 deletions node/core/pvf/src/host.rs
Original file line number Diff line number Diff line change
Expand Up @@ -916,7 +916,7 @@ async fn extract_worker_binaries(prepare_worker_path: &Path, execute_worker_path
let prepare_exe = decompress(
PREPARE_EXE.expect(
"prepare-worker binary is not available. \
This means it was built with `SKIP_BUILD` flag",
This means it was built with `BUILDER_SKIP_BUILD` flag",
),
CODE_BLOB_BOMB_LIMIT,
)
Expand All @@ -935,7 +935,7 @@ async fn extract_worker_binaries(prepare_worker_path: &Path, execute_worker_path
let execute_exe = decompress(
EXECUTE_EXE.expect(
"execute-worker binary is not available. \
This means it was built with `SKIP_BUILD` flag",
This means it was built with `BUILDER_SKIP_BUILD` flag",
),
CODE_BLOB_BOMB_LIMIT,
)
Expand Down