diff --git a/pkgs/by-name/di/dioxus-cli/fix-wasm-opt-target-dir.patch b/pkgs/by-name/di/dioxus-cli/fix-wasm-opt-target-dir.patch new file mode 100644 index 0000000000000..1b1b9763235f9 --- /dev/null +++ b/pkgs/by-name/di/dioxus-cli/fix-wasm-opt-target-dir.patch @@ -0,0 +1,11 @@ +--- a/src/build/bundle.rs ++++ b/src/build/bundle.rs +@@ -334,7 +334,7 @@ impl AppBundle { + // Only run wasm-opt if the feature is enabled + // Wasm-opt has an expensive build script that makes it annoying to keep enabled for iterative dev + // We put it behind the "wasm-opt" feature flag so that it can be disabled when iterating on the cli +- self.run_wasm_opt(&self.build.exe_dir())?; ++ self.run_wasm_opt(&self.build.wasm_bindgen_out_dir())?; + + // Write the index.html file with the pre-configured contents we got from pre-rendering + std::fs::write( diff --git a/pkgs/by-name/di/dioxus-cli/package.nix b/pkgs/by-name/di/dioxus-cli/package.nix index a2b858cab97b2..41d8e9437762d 100644 --- a/pkgs/by-name/di/dioxus-cli/package.nix +++ b/pkgs/by-name/di/dioxus-cli/package.nix @@ -14,16 +14,24 @@ rustPlatform.buildRustPackage rec { pname = "dioxus-cli"; - version = "0.6.0"; + version = "0.6.2"; src = fetchCrate { inherit pname version; - hash = "sha256-0Kg2/+S8EuMYZQaK4Ao+mbS7K48VhVWjPL+LnoVJMSw="; + hash = "sha256-jUS/it2N5o5D7Jon0fKHWEt3f0wdtVgNIkqSNc7u830="; }; useFetchCargoVendor = true; - cargoHash = "sha256-uD3AHHY3edpqyQ8gnsTtxQsen8UzyVIbArSvpMa+B+8="; - buildFeatures = [ "optimizations" ]; + cargoHash = "sha256-izvo092FGZmci1cXLo+qhGlBh8W3A1TeBHrYXcjE6HU="; + cargoPatches = [ + # TODO: Remove once https://github.com/DioxusLabs/dioxus/issues/3659 is fixed upstream. + ./fix-wasm-opt-target-dir.patch + ]; + + buildFeatures = [ + "no-downloads" + "optimizations" + ]; nativeBuildInputs = [ pkg-config @@ -34,11 +42,18 @@ rustPlatform.buildRustPackage rec { OPENSSL_NO_VENDOR = 1; + # wasm-opt-sys build.rs tries to verify C++17 support, but the check appears to be faulty. + postPatch = '' + substituteInPlace $cargoDepsCopy/wasm-opt-sys-*/build.rs \ + --replace-fail 'check_cxx17_support()?;' '// check_cxx17_support()?;' + ''; + nativeCheckInputs = [ rustfmt ]; checkFlags = [ # requires network access "--skip=serve::proxy::test" + "--skip=wasm_bindgen::test" ]; passthru = {