framesurge / perseus

A state-driven web development framework for Rust with full support for server-side rendering and static generation.
https://framesurge.sh/perseus/en-US
MIT License
2.18k stars 89 forks source link

How to prevent the cli to redownload the crates #320

Closed afidegnum closed 4 months ago

afidegnum commented 6 months ago

This issue is reporting a bug in the code of Perseus. Details of the scope will be available in issue labels. The author described their issue as follows:

running perseus build or perseus serve redownloads wasb-bindgen is there a way to stop the download to instead work with already downloaded crates? For some of us using metered bandwidth, it can be costly.

The steps to reproduce this issue are as follows:

perseus build perseus serve

A minimum reproducible example is available at <>.

Tribble internal data dHJpYmJsZS1yZXBvcnRlZCxDLWJ1ZyxBLWNsaQ==
arctic-hen7 commented 6 months ago

Redownloading should only happen when the cached artefacts are no longer available. Assuming you're on Linux, what's the output of ls ~/.cache/perseus_cli/tools?

If this is happening continuously, it might be that your cache is being cleared very regularly, which might be to do with the amount of storage space left on your system? If that is the case, you could always copy the artefacts out of the cache path in the above command and provide paths to the binaries manually with the --wasm-bindgen-path and --wasm-opt-path arguments (both take a path afterward). The cache will contain folders for wasm-bindgen-<version> and wasm-opt-<version>. You should copy the appropriate binaries (wasm-bindgen for bindgen and bin/wasm-opt for wasm-opt) and then put those somewhere that won't be cleared. Then you could alias perseus="perseus --wasm-bindgen-path <path> --wasm-opt-path <path>" so you don't have to type that every time.

arctic-hen7 commented 4 months ago

Closing this because it's been a while, feel free to reopen if you're still having this problem!