Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pet crate can't be fetched by cargo in GitHub Actions machine with Windows #171

Open
ognevny opened this issue Oct 31, 2024 · 8 comments
Open
Labels
debt Code quality issues help wanted Issues identified as good community contribution opportunities

Comments

@ognevny
Copy link

ognevny commented Oct 31, 2024

cargo fails to checkout this repo because some files have too long path and Windows complains about it

Updating git repository `[https://github.com/microsoft/python-environment-tools.git`](https://github.com/microsoft/python-environment-tools.git%60)
  error: Unable to update https://github.com/microsoft/python-environment-tools.git?rev=ffcbf3f28c46633abd5448a52b1f396c322e0d6c
  Caused by:
    path too long: 'C:/Users/runneradmin/.cargo/git/checkouts/python-environment-tools-903993894b37a7d2/ffcbf3f/crates/pet-conda/tests/unix/conda_env_without_manager_but_found_in_history/some_other_location/conda_install/conda-meta/python-fastjsonschema-2.16.2-py310hca03da5_0.json'; class=Filesystem (30)
@eternalphane
Copy link

I also encountered this error when trying to build zed v0.160.1 on windows.

@ognevny
Copy link
Author

ognevny commented Oct 31, 2024

I also encountered this error when trying to build zed v0.160.1 on windows.

I'm also trying to update zed for msys2!

@ognevny
Copy link
Author

ognevny commented Oct 31, 2024

@eternalphane this is what you can do from your side

  1. change to directory with shortest possible path (e.g C:\_)
  2. clone zed repo to it (so it will be C:\_\zed for example from 1.)
  3. clone this repo to the same directory (so it will be C:\_\python-environment-tools)
  4. change Cargo.toml to use crates from ../python-environment-tools/crates/. you need to set path for each pet* crate
  5. remove source from each pet dependency in Cargo.lock manually

also you can use this patch which is based on v0.159.6 tag source: https://github.com/msys2/MINGW-packages/blob/9fbd2786337c61c69b76ee63a196b3036f7f8f92/mingw-w64-zed/zed-use-vendored-pet.patch

edit: I made it possible ONLY because I have a linux machine which doesn't have this stupid restriction. it's so painful to do things on Windows...

@eternalphane
Copy link

eternalphane commented Oct 31, 2024

@ognevny Or you can set HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem\LongPathsEnabled to 1 in registry and set core.longpaths to true in git

cf. rust-lang/cargo#13141

@ognevny
Copy link
Author

ognevny commented Oct 31, 2024

@ognevny Or you can set HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem\LongPathsEnabled to 1 in registry and set core.longpaths to true in git

this is not a solution in case of GitHub machine and git config probably won't work because cargo use libgit2/gix

@eternalphane
Copy link

... and git config probably won't work because cargo use libgit2/gix

Well it actually works ... just that I didn't make it compile yet 🤣
Image

@ognevny
Copy link
Author

ognevny commented Oct 31, 2024

from_mode is for Unix only. a few #[cfg()] will fix it

update: looks like remote server is not supported on Windows. does cargo build -p zed works?

@ognevny
Copy link
Author

ognevny commented Nov 21, 2024

by the way yes, git config thing works on GHA, but it requires to change global config, which could be bad for local builds ;(

@DonJayamanne DonJayamanne added help wanted Issues identified as good community contribution opportunities debt Code quality issues labels Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
debt Code quality issues help wanted Issues identified as good community contribution opportunities
Projects
None yet
Development

No branches or pull requests

3 participants