Skip to content

Under WSL2, host files on \\wsl$ #1226

Open
@Emilgardis

Description

@Emilgardis

Checklist

Describe your request

In #1225 it was suggested to make wsl2 integration and compilation faster by copying files to a linux fs and then back to windows for speedier compilation.

I found the problem. It consisted in the fact that the project uses files hosted in Windows, so the delays were due to the file system driver in WSL.
I assembled the project in WSL from a mounted section, for example "/mnt/c/Projects/my-project" - it was going to be like in "cross" for about 7 minutes. Then I copied the project and built it from the home directory, for example "~/my-project" - the build took about 40 seconds.
A wonderful article prompted me to this idea - https://markentier.tech/posts/2022/01/speedy-rust-builds-under-wsl2/

I think the following steps need to be added for this project:

  • copying the project folder to the virtual machine
  • compilation
  • copy back

For example, here is the CPU load with the command "cross build --target x86_64-unknown-linux-gnu" or "cargo build" from under the mounted disk: >20 minutes
2023-03-22_15-41-46

And so from under the copied project: 1 minute, 34 seconds
image

Originally posted by @mars1211 in #1225 (comment)

Describe why this would be a good inclusion for cross

This would make compilation for file heavy crates better.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions