Skip to content

Commit

Permalink
Fix compilation on latest nightly because of stdsimd (#3296)
Browse files Browse the repository at this point in the history
We need to bump `ahash` to make it compile again.

Closes: #3269
  • Loading branch information
bkchr authored Feb 13, 2024
1 parent 4c96dca commit 349132f
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 23 deletions.
40 changes: 20 additions & 20 deletions Cargo.lock

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

File renamed without changes.
9 changes: 9 additions & 0 deletions substrate/bin/node-template/env-setup/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Env setup

Special files for setting up an environment to work with the template:

- `rust-toolchain.toml` when working with `rustup`.
- `flake.nix` when working with `nix`.

These files will be copied by the installer script to the main directory. They are
put into this special directory to not interfere with the normal CI.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[toolchain]
channel = "nightly"
channel = "stable"
components = [
"cargo",
"clippy",
Expand Down
28 changes: 26 additions & 2 deletions substrate/scripts/ci/node-template-release/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

use std::{
collections::HashMap,
ffi::OsString,
fs::{self, File, OpenOptions},
path::{Path, PathBuf},
process::Command,
Expand Down Expand Up @@ -56,9 +57,24 @@ struct Options {
}

/// Copy the `node-template` to the given path.
fn copy_node_template(node_template: &Path, dest_path: &Path) {
fn copy_node_template(node_template: &Path, node_template_folder: &OsString, dest_path: &Path) {
let options = CopyOptions::new();
dir::copy(node_template, dest_path, &options).expect("Copies node-template to tmp dir");

let dest_path = dest_path.join(node_template_folder);

dir::get_dir_content(dest_path.join("env-setup"))
.expect("`env-setup` directory should exist")
.files
.iter()
.for_each(|f| {
fs::copy(
f,
dest_path.join(PathBuf::from(f).file_name().expect("File has a file name.")),
)
.expect("Copying from `env-setup` directory works");
});
dir::remove(dest_path.join("env-setup")).expect("Deleting `env-setup works`");
}

/// Find all `Cargo.toml` files in the given path.
Expand Down Expand Up @@ -195,6 +211,9 @@ fn update_root_cargo_toml(
commit_id: &str,
) {
let mut workspace = Table::new();

workspace.insert("resolver", value("2"));

workspace.insert("members", value(Array::from_iter(members.iter())));
let mut workspace_dependencies = Table::new();
deps.values()
Expand All @@ -216,6 +235,8 @@ fn update_root_cargo_toml(
workspace.insert("package", Item::Table(package));

workspace.insert("dependencies", Item::Table(workspace_dependencies));

workspace.insert("lints", Item::Table(Table::new()));
cargo_toml.insert("workspace", Item::Table(workspace));

let mut panic_unwind = Table::new();
Expand Down Expand Up @@ -294,7 +315,7 @@ fn main() {
.file_name()
.expect("Node template folder is last element of path")
.to_owned();
copy_node_template(&options.node_template, build_dir.path());
copy_node_template(&options.node_template, &node_template_folder, build_dir.path());

// The path to the node-template in the build dir.
let node_template_path = build_dir.path().join(node_template_folder);
Expand Down Expand Up @@ -429,6 +450,7 @@ frame-system = { workspace = true }
);

let expected_toml = r#"[workspace]
resolver = "2"
members = ["node", "pallets/template", "runtime"]
[workspace.package]
Expand All @@ -438,6 +460,8 @@ edition = "2021"
frame-system = { version = "4.0.0-dev", default-features = true, git = "https://github.com/paritytech/polkadot-sdk.git", rev = "commit_id" }
sp-io = { version = "7.0.0", git = "https://github.com/paritytech/polkadot-sdk.git", rev = "commit_id" }
[workspace.lints]
[profile]
[profile.release]
Expand Down

0 comments on commit 349132f

Please sign in to comment.