rip out tauri bundle (v2), swc -> esbuild, blacksmith -> warpbuild, FAST CI 🚀 (#5328)
- inline mac, windows, linux bundling in the cli - remove tauri bundle from our dep tree - trim down the rpm crate for fewer dependencies in tree - migrate from blacksmith to warpbuild - move off swc and instead use esbuild via tool - use dev drives in windows CI - use fork of nix action for faster caching - test bundling in CI - fix asset handling in linux - add default APPDATA location for webview2 installs for dioxus apps on windows
This commit is contained in:
1 parent
be7296f4f0
commit
b2d01e6779
83 files changed
+7756
-5403
No files matched your search
@@ -5,8 +5,7 @@
|
||||
systems.url = "github:nix-systems/default";
|
||||
|
||||
rust-overlay.url = "github:oxalica/rust-overlay";
|
||||
# crane.url = "github:ipetkov/crane";
|
||||
# crane.inputs.nixpkgs.follows = "nixpkgs";
|
||||
crane.url = "github:ipetkov/crane";
|
||||
};
|
||||
|
||||
outputs =
|
||||
@@ -16,14 +15,18 @@
|
||||
|
||||
perSystem =
|
||||
{
|
||||
config,
|
||||
self',
|
||||
pkgs,
|
||||
lib,
|
||||
system,
|
||||
...
|
||||
}:
|
||||
let
|
||||
pkgs = import inputs.nixpkgs {
|
||||
inherit system;
|
||||
overlays = [
|
||||
inputs.rust-overlay.overlays.default
|
||||
];
|
||||
};
|
||||
lib = pkgs.lib;
|
||||
rustToolchain = pkgs.rust-bin.stable.latest.default.override {
|
||||
extensions = [
|
||||
"rust-src"
|
||||
@@ -31,6 +34,7 @@
|
||||
"clippy"
|
||||
];
|
||||
};
|
||||
craneLib = (inputs.crane.mkLib pkgs).overrideToolchain rustToolchain;
|
||||
rustBuildInputs = [
|
||||
pkgs.openssl
|
||||
pkgs.libiconv
|
||||
@@ -49,6 +53,26 @@
|
||||
];
|
||||
|
||||
cargoToml = builtins.fromTOML (builtins.readFile ./Cargo.toml);
|
||||
fullSrc = pkgs.lib.cleanSource ./.;
|
||||
cargoSrc = craneLib.cleanCargoSource fullSrc;
|
||||
|
||||
commonArgs = {
|
||||
src = fullSrc;
|
||||
strictDeps = true;
|
||||
buildInputs = rustBuildInputs;
|
||||
nativeBuildInputs = [
|
||||
pkgs.pkg-config
|
||||
];
|
||||
};
|
||||
|
||||
cargoArtifacts = craneLib.buildDepsOnly (
|
||||
commonArgs
|
||||
// {
|
||||
src = cargoSrc;
|
||||
pname = "dioxus-deps";
|
||||
version = cargoToml.package.version;
|
||||
}
|
||||
);
|
||||
|
||||
rustPackage =
|
||||
package:
|
||||
@@ -56,53 +80,32 @@
|
||||
binary ? package,
|
||||
features ? [ ],
|
||||
}:
|
||||
(pkgs.makeRustPlatform {
|
||||
cargo = rustToolchain;
|
||||
rustc = rustToolchain;
|
||||
}).buildRustPackage
|
||||
{
|
||||
craneLib.buildPackage (
|
||||
commonArgs
|
||||
// {
|
||||
pname = package;
|
||||
version = cargoToml.package.version;
|
||||
src = pkgs.lib.cleanSource ./.;
|
||||
cargoLock.lockFile = ./Cargo.lock;
|
||||
buildInputs = rustBuildInputs;
|
||||
nativeBuildInputs = [
|
||||
rustToolchain
|
||||
pkgs.pkg-config
|
||||
];
|
||||
buildPhase = ''
|
||||
mkdir -p .cargo
|
||||
cp ${./Cargo.lock} Cargo.lock
|
||||
cargo build --release --package ${package} ${
|
||||
lib.concatStringsSep " " (map (f: "--features ${f}") features)
|
||||
}
|
||||
'';
|
||||
installPhase = ''
|
||||
inherit cargoArtifacts;
|
||||
cargoExtraArgs = "--locked --package ${package} ${
|
||||
lib.concatStringsSep " " (map (f: "--features ${f}") features)
|
||||
}";
|
||||
doCheck = false; # Disable tests to avoid building deps for them
|
||||
installPhaseCommand = ''
|
||||
mkdir -p $out/bin
|
||||
ls -alR target/release
|
||||
cp target/release/${binary} $out/bin/
|
||||
'';
|
||||
doCheck = false; # Disable tests to avoid building deps for them
|
||||
};
|
||||
|
||||
# This is useful when building crates as packages
|
||||
# Note that it does require a `Cargo.lock` which this repo does not have
|
||||
# craneLib = (inputs.crane.mkLib pkgs).overrideToolchain rustToolchain;
|
||||
}
|
||||
);
|
||||
in
|
||||
{
|
||||
_module.args.pkgs = import inputs.nixpkgs {
|
||||
inherit system;
|
||||
overlays = [
|
||||
inputs.rust-overlay.overlays.default
|
||||
];
|
||||
};
|
||||
|
||||
packages.dioxus-cli = (
|
||||
rustPackage "dioxus-cli" {
|
||||
binary = "dx";
|
||||
features = [ "no-downloads" ];
|
||||
}
|
||||
);
|
||||
packages.default = self'.packages.dioxus-cli;
|
||||
checks.dioxus-cli = self'.packages.dioxus-cli;
|
||||
|
||||
devShells.default = pkgs.mkShell {
|
||||
name = "dioxus-dev";
|
||||
|
||||
Reference in new issue
Block a user