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

Nightly web build #2516

Merged
merged 3 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
7 changes: 5 additions & 2 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ jobs:
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v3
- name: Switch to nightly Rust toolchain
run: |
ln -sf toolchains/nightly/rust-toolchain.toml
- uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Compile `linera-client` for the browser
run: |
Expand Down Expand Up @@ -159,7 +162,7 @@ jobs:
| xargs -0 scripts/target/release/check_copyright_header
- name: Put lint toolchain file in place
run: |
ln -sf toolchains/lint/rust-toolchain.toml
ln -sf toolchains/nightly/rust-toolchain.toml
- uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Install cargo-machete
run: |
Expand Down Expand Up @@ -225,7 +228,7 @@ jobs:
- name: Restore `rust-toolchain.toml` file
if: '!cancelled()'
run: |
ln -sf toolchains/build/rust-toolchain.toml
ln -sf toolchains/stable/rust-toolchain.toml
- name: Check linera-service GraphQL schema
run: |
diff <(cargo run --locked --bin linera-schema-export) linera-service-graphql-client/gql/service_schema.graphql
7 changes: 2 additions & 5 deletions default.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{ crane, pkgs }:
let
rust-toolchain = (pkgs.rust-bin.fromRustupToolchainFile
./toolchains/build/rust-toolchain.toml);
in ((crane.mkLib pkgs).overrideToolchain rust-toolchain).buildPackage {
{ crane, pkgs, rust-toolchain }:
((crane.mkLib pkgs).overrideToolchain rust-toolchain).buildPackage {
pname = "linera";
src = ./.;
cargoExtraArgs = "-p linera-service";
Expand Down
41 changes: 20 additions & 21 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,27 +19,22 @@
];
perSystem = { config, self', inputs', pkgs, lib, system, ... }:
let
cargoToml = builtins.fromTOML (builtins.readFile ./Cargo.toml);
nonRustDeps = with pkgs; [
];
linera = pkgs.callPackage ./. { inherit (inputs) crane; };
in {
_module.args.pkgs = import inputs.nixpkgs {
inherit system;
overlays = [ (import inputs.rust-overlay) ];
linera = rust-toolchain: pkgs.callPackage ./. {
inherit (inputs) crane;
inherit rust-toolchain;
};

packages.default = linera;

# Rust dev environment
devShells.default = pkgs.mkShell {
rust-stable = (pkgs.rust-bin.fromRustupToolchainFile
./toolchains/stable/rust-toolchain.toml);
rust-nightly = (pkgs.rust-bin.fromRustupToolchainFile
./toolchains/nightly/rust-toolchain.toml);
devShell = rust-toolchain: pkgs.mkShell {
inputsFrom = [
config.treefmt.build.devShell
linera
(linera rust-toolchain)
];
shellHook = ''
# For rust-analyzer 'hover' tooltips to work.
export RUST_SRC_PATH=${linera.rust-toolchain.availableComponents.rust-src}
export RUST_SRC_PATH=${rust-toolchain.availableComponents.rust-src}
export LIBCLANG_PATH=${pkgs.libclang.lib}/lib
export PATH=$PWD/target/debug:~/.cargo/bin:$PATH
export ROCKSDB_LIB_DIR=${pkgs.rocksdb}/lib
Expand All @@ -48,14 +43,18 @@
rust-analyzer
];
};

devShells.lint = pkgs.mkShell {
nativeBuildInputs = [
(pkgs.rust-bin.fromRustupToolchainFile
./toolchains/lint/rust-toolchain.toml)
];
in {
_module.args.pkgs = import inputs.nixpkgs {
inherit system;
overlays = [ (import inputs.rust-overlay) ];
};

packages.default = linera;

# Rust dev environment
devShells.default = devShell rust-stable;
devShells.nightly = devShell rust-nightly;

# Add your auto-formatters here.
# cf. https://numtide.github.io/treefmt/
treefmt.config = {
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[toolchain]
channel = "nightly-2024-07-11"
components = [ "clippy", "rustfmt" ]
components = [ "clippy", "rustfmt", "rust-src" ]
targets = [ "wasm32-unknown-unknown" ]
profile = "minimal"
Loading