Open gnunicorn opened 3 years ago
I have a plan in mind for this. The gist:
latest
tag in the template for a known working version with all examples in the docs.git diff <older_commit>..<newer_commit> <optional filename> > patches/<step+file name>.patch
git am patches/*
patches/example_name/*
in the template root dir so that *these can easily be applied by anyone, and are in sync if the version of the template at any release tag, including latest**latest
tag, not hard coded rust
blocks
latest
tag, all docs known to work with examples.Example of a git diff > patch file look (use diff
codebock to get this FYI):
diff --git a/shell.nix b/shell.nix
index bc289fc..9f3f563 100644
--- a/shell.nix
+++ b/shell.nix
@@ -6,7 +6,6 @@ let
});
pinned = builtins.fetchGit {
# Descriptive name to make the store path easier to identify
- name = "nixos-unstable-2020-04-26";
url = "https://github.com/nixos/nixpkgs/";
# Commit hash for nixos-unstable as of 2020-04-26
# `git ls-remote https://github.com/nixos/nixpkgs nixos-unstable`
@@ -14,20 +13,23 @@ let
rev = "1fe6ed37fd9beb92afe90671c0c2a662a03463dd";
};
nixpkgs = import pinned { overlays = [ mozillaOverlay ]; };
- rust-nightly = with nixpkgs; ((rustChannelOf { date = "2021-03-01"; channel = "nightly"; }).rust.override {
+ toolchain = with nixpkgs; (rustChannelOf { date = "2021-03-01"; channel = "nightly"; });
+ rust-wasm = toolchain.rust.override {
targets = [ "wasm32-unknown-unknown" ];
- });
+ };
in
with nixpkgs; pkgs.mkShell {
buildInputs = [
clang
pkg-config
- rust-nightly
+ rust-wasm
] ++ stdenv.lib.optionals stdenv.isDarwin [
darwin.apple_sdk.frameworks.Security
];
LIBCLANG_PATH = "${llvmPackages.libclang}/lib";
PROTOC = "${protobuf}/bin/protoc";
+ RUST_SRC_PATH = "${toolchain.rust-src}/lib/rustlib/src/rust/library/";
ROCKSDB_LIB_DIR = "${rocksdb}/lib";
+
}
I'm all for doing includes for code inside of docs, but this seems a bit heavyweight process-wise )at least to me).
I will get a PoC made for the add nicks tutorials to demonstrate the flow here :soon:
This is a very rough README and NOTES.md describing the the tool
Basically if a full substrate node exists, you can use this tool to "fork" it into a new independent repo in a one liner setting the config you want: https://github.com/paritytech/substrate-template-generator/tree/main/config
With this template generated using any upstream commit, we can then with scripts/CI apply git patches for the devhub examples on top of and test them. As it's a full node, we can extend tests to full integration test as well, not just mock
runtime and unit testing :rocket:
So it is the foundation for the outlined workflow (above)
Content request
We want to make sure that all code examples and tutorials in the docs can be (automatically) compiled, so we can easily test that they still build. Little is worth than having people copy paste a tutorial or example and find the code not building at all because we broke that without noticing.
Refs https://github.com/paritytech/substrate/issues/10165
Are you willing to help with this request?
Maybe (please specify)