Skip to content

Commit

Permalink
fix: 🚨 fix compile error on wasm
Browse files Browse the repository at this point in the history
  • Loading branch information
melody-rs committed Dec 3, 2023
1 parent 15cb4a6 commit 96265cc
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ rustflags = [
"-Z",
"threads=8",
]
[unstable]
build-std = ["std", "panic_abort"]
24 changes: 24 additions & 0 deletions .cargo/config.toml.bak
Original file line number Diff line number Diff line change
@@ -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",
]
4 changes: 2 additions & 2 deletions Trunk.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
3 changes: 3 additions & 0 deletions crates/filesystem/src/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
// You should have received a copy of the GNU General Public License
// along with Luminol. If not, see <http://www.gnu.org/licenses/>.

#[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};
Expand Down

0 comments on commit 96265cc

Please sign in to comment.