Skip to content
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

Remove riscv feature flag #6305

Merged
merged 8 commits into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
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
2 changes: 1 addition & 1 deletion .config/zepter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ workflows:
]
# The umbrella crate uses more features, so we to check those too:
check_umbrella:
- [ $check.0, '--features=serde,experimental,riscv,runtime,with-tracing,tuples-96,with-tracing', '-p=polkadot-sdk' ]
- [ $check.0, '--features=serde,experimental,runtime,with-tracing,tuples-96,with-tracing', '-p=polkadot-sdk' ]
# Same as `check_*`, but with the `--fix` flag.
default:
- [ $check.0, '--fix' ]
Expand Down
26 changes: 13 additions & 13 deletions .github/scripts/cmd/test_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"path": "substrate/frame",
"header": "substrate/HEADER-APACHE2",
"template": "substrate/.maintain/frame-weight-template.hbs",
"bench_features": "runtime-benchmarks,riscv",
"bench_features": "runtime-benchmarks",
"bench_flags": "--flag1 --flag2"
},
{
Expand Down Expand Up @@ -67,7 +67,7 @@ def setUp(self):
self.patcher6 = patch('importlib.util.spec_from_file_location', return_value=MagicMock())
self.patcher7 = patch('importlib.util.module_from_spec', return_value=MagicMock())
self.patcher8 = patch('cmd.generate_prdoc.main', return_value=0)

self.mock_open = self.patcher1.start()
self.mock_json_load = self.patcher2.start()
self.mock_parse_args = self.patcher3.start()
Expand Down Expand Up @@ -101,27 +101,27 @@ def test_bench_command_normal_execution_all_runtimes(self):
clean=False,
image=None
), [])

self.mock_popen.return_value.read.side_effect = [
"pallet_balances\npallet_staking\npallet_something\n", # Output for dev runtime
"pallet_balances\npallet_staking\npallet_something\n", # Output for westend runtime
"pallet_staking\npallet_something\n", # Output for rococo runtime - no pallet here
"pallet_balances\npallet_staking\npallet_something\n", # Output for asset-hub-westend runtime
"./substrate/frame/balances/Cargo.toml\n", # Mock manifest path for dev -> pallet_balances
]

with patch('sys.exit') as mock_exit:
import cmd
cmd.main()
mock_exit.assert_not_called()

expected_calls = [
# Build calls
call("forklift cargo build -p kitchensink-runtime --profile release --features=runtime-benchmarks,riscv"),
call("forklift cargo build -p kitchensink-runtime --profile release --features=runtime-benchmarks"),
call("forklift cargo build -p westend-runtime --profile release --features=runtime-benchmarks"),
call("forklift cargo build -p rococo-runtime --profile release --features=runtime-benchmarks"),
call("forklift cargo build -p asset-hub-westend-runtime --profile release --features=runtime-benchmarks"),

call(get_mock_bench_output(
runtime='kitchensink',
pallets='pallet_balances',
Expand Down Expand Up @@ -162,7 +162,7 @@ def test_bench_command_normal_execution(self):
self.mock_popen.return_value.read.side_effect = [
"pallet_balances\npallet_staking\npallet_something\n", # Output for westend runtime
]

with patch('sys.exit') as mock_exit:
import cmd
cmd.main()
Expand All @@ -171,7 +171,7 @@ def test_bench_command_normal_execution(self):
expected_calls = [
# Build calls
call("forklift cargo build -p westend-runtime --profile release --features=runtime-benchmarks"),

# Westend runtime calls
call(get_mock_bench_output(
runtime='westend',
Expand Down Expand Up @@ -205,7 +205,7 @@ def test_bench_command_normal_execution_xcm(self):
self.mock_popen.return_value.read.side_effect = [
"pallet_balances\npallet_staking\npallet_something\npallet_xcm_benchmarks::generic\n", # Output for westend runtime
]

with patch('sys.exit') as mock_exit:
import cmd
cmd.main()
Expand All @@ -214,7 +214,7 @@ def test_bench_command_normal_execution_xcm(self):
expected_calls = [
# Build calls
call("forklift cargo build -p westend-runtime --profile release --features=runtime-benchmarks"),

# Westend runtime calls
call(get_mock_bench_output(
runtime='westend',
Expand All @@ -241,7 +241,7 @@ def test_bench_command_two_runtimes_two_pallets(self):
"pallet_staking\npallet_balances\n", # Output for westend runtime
"pallet_staking\npallet_balances\n", # Output for rococo runtime
]

with patch('sys.exit') as mock_exit:
import cmd
cmd.main()
Expand Down Expand Up @@ -309,7 +309,7 @@ def test_bench_command_one_dev_runtime(self):

expected_calls = [
# Build calls
call("forklift cargo build -p kitchensink-runtime --profile release --features=runtime-benchmarks,riscv"),
call("forklift cargo build -p kitchensink-runtime --profile release --features=runtime-benchmarks"),
# Westend runtime calls
call(get_mock_bench_output(
runtime='kitchensink',
Expand Down Expand Up @@ -429,4 +429,4 @@ def test_prdoc_command(self, mock_system, mock_parse_args):
self.mock_generate_prdoc_main.assert_called_with(mock_parse_args.return_value[0])

if __name__ == '__main__':
unittest.main()
unittest.main()
2 changes: 1 addition & 1 deletion .github/workflows/runtimes-matrix.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"path": "substrate/frame",
"header": "substrate/HEADER-APACHE2",
"template": "substrate/.maintain/frame-weight-template.hbs",
"bench_features": "runtime-benchmarks,riscv",
"bench_features": "runtime-benchmarks",
"bench_flags": "--genesis-builder-policy=none --exclude-pallets=pallet_xcm,pallet_xcm_benchmarks::fungible,pallet_xcm_benchmarks::generic,pallet_nomination_pools,pallet_remark,pallet_transaction_storage",
"uri": null,
"is_relay": false
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests-linux-stable-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
--no-report --release
--workspace
--locked --no-fail-fast
--features try-runtime,ci-only-tests,experimental,riscv
--features try-runtime,ci-only-tests,experimental
--filter-expr "
!test(/.*benchmark.*/)
- test(/recovers_from_only_chunks_if_pov_large::case_1/)
Expand Down Expand Up @@ -120,4 +120,4 @@ jobs:
- uses: actions/checkout@v4
- uses: actions-ecosystem/action-remove-labels@v1
with:
labels: GHA-coverage
labels: GHA-coverage
4 changes: 2 additions & 2 deletions .github/workflows/tests-linux-stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ jobs:
--release \
--no-fail-fast \
--cargo-quiet \
--features try-runtime,experimental,riscv,ci-only-tests \
--features try-runtime,experimental,ci-only-tests \
--partition count:${{ matrix.partition }}
# run runtime-api tests with `enable-staging-api` feature on the 1st node
- name: runtime-api tests
Expand Down Expand Up @@ -129,7 +129,7 @@ jobs:
--release \
--no-fail-fast \
--cargo-quiet \
--features experimental,riscv,ci-only-tests \
--features experimental,ci-only-tests \
--filter-expr " !test(/all_security_features_work/) - test(/nonexistent_cache_dir/)" \
--partition count:${{ matrix.partition }} \

Expand Down
17 changes: 17 additions & 0 deletions prdoc/pr_6305.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
title: Remove `riscv` feature flag
doc:
- audience: Runtime Dev
description: Since https://github.com/paritytech/polkadot-sdk/pull/6266 we no longer
require a custom toolchain to build the `pallet-revive-fixtures`. Hence we no
longer have to guard the build behind a feature flag.
crates:
- name: pallet-revive
bump: major
- name: pallet-revive-fixtures
bump: major
- name: pallet-revive-mock-network
bump: major
- name: pallet-revive-eth-rpc
bump: major
- name: polkadot-sdk
bump: major
2 changes: 0 additions & 2 deletions scripts/generate-umbrella.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ def main(path, version):
"runtime": list([f"{d.name}" for d, _ in runtime_crates]),
"node": ["std"] + list([f"{d.name}" for d, _ in std_crates]),
"tuples-96": [],
"riscv": [],
}

manifest = {
Expand Down Expand Up @@ -207,4 +206,3 @@ def parse_args():
if __name__ == "__main__":
args = parse_args()
main(args.sdk, args.version)

1 change: 0 additions & 1 deletion substrate/bin/node/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@ try-runtime = [
"polkadot-sdk/try-runtime",
"substrate-cli-test-utils/try-runtime",
]
riscv = ["kitchensink-runtime/riscv", "polkadot-sdk/riscv"]

[[bench]]
name = "transaction_pool"
Expand Down
1 change: 0 additions & 1 deletion substrate/bin/node/runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,3 @@ experimental = [
"pallet-example-tasks/experimental",
]
metadata-hash = ["substrate-wasm-builder/metadata-hash"]
riscv = ["polkadot-sdk/riscv"]
4 changes: 0 additions & 4 deletions substrate/frame/revive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,6 @@ xcm-builder = { workspace = true, default-features = true }

[features]
default = ["std"]
# enabling this feature will require having a riscv toolchain installed
# if no tests are ran and runtime benchmarks will not work
# apart from this the pallet will stay functional
riscv = ["pallet-revive-fixtures/riscv"]
std = [
"codec/std",
"environmental/std",
Expand Down
4 changes: 0 additions & 4 deletions substrate/frame/revive/fixtures/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,5 @@ anyhow = { workspace = true, default-features = true }

[features]
default = ["std"]
# only if the feature is set we are building the test fixtures
# this is because it requires a custom toolchain supporting polkavm
# we will remove this once there is an upstream toolchain
riscv = []
# only when std is enabled all fixtures are available
std = ["anyhow", "frame-system", "log/std", "sp-core", "sp-io", "sp-runtime"]
Loading
Loading