diff --git a/.cargo/config.toml b/.cargo/config.toml index 77777bb81..34d3f913b 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -22,3 +22,5 @@ rustflags = [ "-Z", "threads=8", ] +[unstable] +build-std = ["std", "panic_abort"] diff --git a/.cargo/config.toml.bak b/.cargo/config.toml.bak new file mode 100644 index 000000000..77777bb81 --- /dev/null +++ b/.cargo/config.toml.bak @@ -0,0 +1,24 @@ +# Possibly enable -Zshare-generics=y? + +[target.x86_64-pc-windows-msvc] +linker = "rust-lld" +rustflags = ["-Z", "threads=8"] + +[target.x86_64-unknown-linux-gnu] +rustflags = [ + "-C", + "linker=clang", + "-C", + "link-arg=-fuse-ld=mold", + "-Z", + "threads=8", +] + +[target.'cfg(target_arch = "wasm32")'] +rustflags = [ + "--cfg=web_sys_unstable_apis", + "-C", + "target-feature=+atomics,+bulk-memory,+mutable-globals", + "-Z", + "threads=8", +] diff --git a/Trunk.toml b/Trunk.toml index 0621c299a..484ee7b4f 100644 --- a/Trunk.toml +++ b/Trunk.toml @@ -7,8 +7,8 @@ ignore = [".cargo"] [[hooks]] stage = "pre_build" -command = "./hooks/trunk_enable_build_std_pre.sh" +command = "./hooks/trunk_enable_build_std_pre.sh.cmd" [[hooks]] stage = "build" -command = "./hooks/trunk_enable_build_std.sh" +command = "./hooks/trunk_enable_build_std.sh.cmd" diff --git a/crates/filesystem/src/project.rs b/crates/filesystem/src/project.rs index 88b4acc6e..152f8d3b4 100644 --- a/crates/filesystem/src/project.rs +++ b/crates/filesystem/src/project.rs @@ -15,6 +15,9 @@ // You should have received a copy of the GNU General Public License // along with Luminol. If not, see . +#[cfg(target_arch = "wasm32")] +use itertools::Itertools; + use crate::FileSystem as _; use crate::{archiver, host, list, path_cache}; use crate::{DirEntry, Error, Metadata, OpenFlags, Result};