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 detect-or-install-riscv-toolchain.sh #201

Conversation

jarkkojs
Copy link
Contributor

Left-overs from #184.

@jarkkojs
Copy link
Contributor Author

@koute Need help/tips on how to fix "Rust / pallet-revive-tests (pull_request)" (no rush).

@jarkkojs jarkkojs requested a review from koute October 25, 2024 18:49
@koute
Copy link
Collaborator

koute commented Oct 26, 2024

@koute Need help/tips on how to fix "Rust / pallet-revive-tests (pull_request)" (no rush).

You (or someone else) have to update the build scripts and the toolchain in polkadot-sdk, then update the pallet revive test script here to pull with the new commit hash to pull in that new code.

@jarkkojs
Copy link
Contributor Author

@koute Need help/tips on how to fix "Rust / pallet-revive-tests (pull_request)" (no rush).

You (or someone else) have to update the build scripts and the toolchain in polkadot-sdk, then update the pallet revive test script here to pull with the new commit hash to pull in that new code.

OK, let's sync on Monday.

@athei
Copy link
Member

athei commented Oct 28, 2024

We are talking about the build script for test fixtures, right?

@jarkkojs
Copy link
Contributor Author

We are talking about the build script for test fixtures, right?

Not sure what you are talking about.

@koute Need help/tips on how to fix "Rust / pallet-revive-tests (pull_request)" (no rush).

You (or someone else) have to update the build scripts and the toolchain in polkadot-sdk, then update the pallet revive test script here to pull with the new commit hash to pull in that new code.

OK, let's sync on Monday.

$ git --no-pager grep  riscv32ema
substrate/frame/revive/fixtures/build.rs:				"--target=riscv32ema-unknown-none-elf",
substrate/frame/revive/fixtures/build.rs:				&build_dir.join("target/riscv32ema-unknown-none-elf/release").join(entry.name()),
substrate/utils/wasm-builder/src/lib.rs:		target_list.contains("riscv32ema-unknown-none-elf")
substrate/utils/wasm-builder/src/lib.rs:			RuntimeTarget::Riscv => "riscv32ema-unknown-none-elf",

Questions:

  1. Where riscv32emac-unknown-none-polkavm.json should be placed in the directory tree?
  2. How to pass --target riscv32emac-unknown-none-polkavm.json?

@jarkkojs
Copy link
Contributor Author

We are talking about the build script for test fixtures, right?

error: override toolchain 'riscv32em-nightly-2024-01-05-r0-x86_64-unknown-linux-gnu' is not installed: the RUSTUP_TOOLCHAIN environment variable specifies an uninstalled toolchain

@koute
Copy link
Collaborator

koute commented Oct 28, 2024

@jarkkojs

1. Where `riscv32emac-unknown-none-polkavm.json` should be placed in the directory tree?

Hm, probably somewhere relative to the build.rs? (So that the crate is standalone.)

2. How to pass `--target riscv32emac-unknown-none-polkavm.json`?

Modify build.rs. See where --target is passed and replace the triplet with the path to the JSON.

$ git --no-pager grep riscv32ema

The priority is changing it in substrate/frame/revive/fixtures (that's used for smart contracts). You could also do it in substrate/utils/wasm-builder, but for that you'll probably have to also update the polkavm executor in substrate/client/executor/polkavm (which, to be fair, shouldn't be too hard).

(Background: Polkadot currently runs on WASM; some time ago I've added an experimental PolkaVM-based executor where you can run the runtime under PolkaVM instead of under Wasmtime. The code in wasm-builder is used to build the runtime for running under PolkaVM. This code is not used in production and is pretty much experimental, but we will need it once we'll be migrating to JAM.)

@athei
Copy link
Member

athei commented Oct 28, 2024

We are talking about the build script for test fixtures, right?

error: override toolchain 'riscv32em-nightly-2024-01-05-r0-x86_64-unknown-linux-gnu' is not installed: the RUSTUP_TOOLCHAIN environment variable specifies an uninstalled toolchain

This has to be fixed in pallet-contracts-fixtures. I will do a PR.

@athei
Copy link
Member

athei commented Oct 28, 2024

Fixed by paritytech/polkadot-sdk#6266

@jarkkojs jarkkojs force-pushed the refactor/rm-detect-or-install-riscv-toolchain.sh branch 3 times, most recently from 7f7ce23 to a0037e3 Compare October 29, 2024 23:28
@jarkkojs
Copy link
Contributor Author

@koute, @athei:

error: failed to run custom build command for `pallet-revive-fixtures v0.1.0 (/home/runner/work/polkavm/polkavm/target/test-pallet-revive/polkadot-sdk/substrate/frame/revive/fixtures)`
Caused by:
  process didn't exit successfully: `/home/runner/work/polkavm/polkavm/target/test-pallet-revive/polkadot-sdk/target/debug/build/pallet-revive-fixtures-0ad3767b3ce8a461/build-script-build` (exit status: 1)
  --- stdout
  cargo::rerun-if-env-changed=PALLET_REVIVE_FIXTURES_RUSTUP_TOOLCHAIN
  cargo::rerun-if-env-changed=PALLET_REVIVE_FIXTURES_STRIP
  cargo::rerun-if-env-changed=PALLET_REVIVE_FIXTURES_OPTIMIZE
  cargo::rerun-if-changed=/home/runner/work/polkavm/polkavm/target/test-pallet-revive/polkadot-sdk/substrate/frame/revive/fixtures
  cargo::rerun-if-changed=/home/runner/work/polkavm/polkavm/target/test-pallet-revive/polkadot-sdk/substrate/frame/revive/uapi
  --- stderr
  error: process didn't exit successfully: `rustc -vV` (exit status: 1)
  --- stderr
  error: override toolchain 'riscv32em-nightly-2024-01-05-r0-x86_64-unknown-linux-gnu' is not installed: the RUSTUP_TOOLCHAIN environment variable specifies an uninstalled toolchain
  Error: Failed to build contracts
warning: build failed, waiting for other jobs to finish...
Error: Process completed with exit code 101.

This is after updating the commit ID in ci/jobs/build-and-test-pallet-revive.sh. Unfortunately most of the day went on re-configuring OpenPGP to be compatible with this new work (but it is one thing that is better to do with care, caution and offline).

Anyway, I just put this transcript of the test here for commentary, tips and remarks.

@athei
Copy link
Member

athei commented Oct 30, 2024

I assume somewhere you are setting PALLET_REVIVE_FIXTURES_RUSTUP_TOOLCHAIN to riscv32em-nightly-2024-01-05-r0-x86_64-unknown-linux-gnu. This has to be removed.

@jarkkojs jarkkojs closed this Nov 1, 2024
@jarkkojs jarkkojs force-pushed the refactor/rm-detect-or-install-riscv-toolchain.sh branch from a0037e3 to 5f9681b Compare November 1, 2024 14:26
@jarkkojs jarkkojs deleted the refactor/rm-detect-or-install-riscv-toolchain.sh branch November 1, 2024 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants