mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-06 14:58:03 +00:00
Contracts rename riscv-experimental and enable ci tests (#2879)
- Keep feature name short s/riscv-experimental/riscv - Add to feature to CI build --------- Co-authored-by: Bastian Köcher <git@kchr.de>
This commit is contained in:
@@ -29,7 +29,7 @@ test-linux-stable:
|
||||
--locked \
|
||||
--release \
|
||||
--no-fail-fast \
|
||||
--features try-runtime,experimental,ci-only-tests \
|
||||
--features try-runtime,experimental,riscv,ci-only-tests \
|
||||
--partition count:${CI_NODE_INDEX}/${CI_NODE_TOTAL}
|
||||
# Upload tests results to Elasticsearch
|
||||
- echo "Upload test results to Elasticsearch"
|
||||
|
||||
@@ -21,9 +21,8 @@ parity-wasm = "0.45.0"
|
||||
tempfile = "3.8.1"
|
||||
toml = "0.8.2"
|
||||
twox-hash = "1.6.3"
|
||||
polkavm-linker = "0.3.0"
|
||||
polkavm-linker = { version = "0.3.0", optional = true }
|
||||
anyhow = "1.0.0"
|
||||
|
||||
[features]
|
||||
# Enable experimental RISCV fixtures build
|
||||
riscv-experimental = []
|
||||
riscv = ["polkavm-linker"]
|
||||
|
||||
@@ -91,7 +91,7 @@ impl Entry {
|
||||
}
|
||||
|
||||
/// Return the name of the RISC-V polkavm file.
|
||||
#[cfg(feature = "riscv-experimental")]
|
||||
#[cfg(feature = "riscv")]
|
||||
fn out_riscv_filename(&self) -> String {
|
||||
format!("{}.polkavm", self.name())
|
||||
}
|
||||
@@ -232,7 +232,7 @@ fn post_process_wasm(input_path: &Path, output_path: &Path) -> Result<()> {
|
||||
}
|
||||
|
||||
/// Build contracts for RISC-V.
|
||||
#[cfg(feature = "riscv-experimental")]
|
||||
#[cfg(feature = "riscv")]
|
||||
fn invoke_riscv_build(current_dir: &Path) -> Result<()> {
|
||||
let encoded_rustflags =
|
||||
["-Crelocation-model=pie", "-Clink-arg=--emit-relocs", "-Clink-arg=-Tmemory.ld"]
|
||||
@@ -267,7 +267,7 @@ fn invoke_riscv_build(current_dir: &Path) -> Result<()> {
|
||||
bail!("Failed to build contracts");
|
||||
}
|
||||
/// Post-process the compiled wasm contracts.
|
||||
#[cfg(feature = "riscv-experimental")]
|
||||
#[cfg(feature = "riscv")]
|
||||
fn post_process_riscv(input_path: &Path, output_path: &Path) -> Result<()> {
|
||||
let mut config = polkavm_linker::Config::default();
|
||||
config.set_strip(true);
|
||||
@@ -286,7 +286,7 @@ fn write_output(build_dir: &Path, out_dir: &Path, entries: Vec<Entry>) -> Result
|
||||
&out_dir.join(&wasm_output),
|
||||
)?;
|
||||
|
||||
#[cfg(feature = "riscv-experimental")]
|
||||
#[cfg(feature = "riscv")]
|
||||
post_process_riscv(
|
||||
&build_dir.join("target/riscv32em-unknown-none-elf/release").join(entry.name()),
|
||||
&out_dir.join(entry.out_riscv_filename()),
|
||||
@@ -340,7 +340,7 @@ fn main() -> Result<()> {
|
||||
|
||||
invoke_wasm_build(tmp_dir_path)?;
|
||||
|
||||
#[cfg(feature = "riscv-experimental")]
|
||||
#[cfg(feature = "riscv")]
|
||||
invoke_riscv_build(tmp_dir_path)?;
|
||||
|
||||
write_output(tmp_dir_path, &out_dir, entries)?;
|
||||
|
||||
Reference in New Issue
Block a user