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

"path too long" error on Windows from cargo prisma "generate" #118

Closed
ilkka opened this issue May 5, 2022 · 4 comments
Closed

"path too long" error on Windows from cargo prisma "generate" #118

ilkka opened this issue May 5, 2022 · 4 comments
Labels

Comments

@ilkka
Copy link
Contributor

ilkka commented May 5, 2022

Describe the bug

Running pnpm prep for 6c7b224 causes the following on my Windows 11 machine:

> spacedrive@0.0.0 prep C:\Users\ilkka.poutanen\Code\spacedrive
> pnpm db:gen


> spacedrive@0.0.0 db:gen C:\Users\ilkka.poutanen\Code\spacedrive
> pnpm core prisma generate


> spacedrive@0.0.0 core C:\Users\ilkka.poutanen\Code\spacedrive
> pnpm --filter @sd/core --  "prisma" "generate"


> @sd/core@0.0.0 prisma C:\Users\ilkka.poutanen\Code\spacedrive\core
> cargo prisma "generate"

    Updating git repository `https://github.com/Brendonovich/prisma-client-rust.git`
    Updating git repository `https://github.com/Brendonovich/prisma-engines`
error: failed to get `datamodel` as a dependency of package `prisma-client-rust v0.4.0 (https://github.com/Brendonovich/prisma-client-rust.git?tag=0.4.0#4c6c4bf9)`
    ... which satisfies git dependency `prisma-client-rust` (locked to 0.4.0) of package `sdcore v0.1.0 (C:\Users\ilkka.poutanen\Code\spacedrive\core)`
    ... which satisfies path dependency `sdcore` (locked to 0.1.0) of package `spacedrive v0.1.0 (C:\Users\ilkka.poutanen\Code\spacedrive\apps\desktop\src-tauri)`

Caused by:
  failed to load source for dependency `datamodel`

Caused by:
  Unable to update https://github.com/Brendonovich/prisma-engines?rev=8b94a80a2d8f12a2916fe28e3218162aa71e8539#8b94a80a

Caused by:
  path too long: 'C:/Users/ilkka.poutanen/scoop/persist/rustup/.cargo/git/checkouts/prisma-engines-8e1416dd0e571d11/8b94a80/migration-engine/connectors/mongodb-migration-connector/tests/migrations/scenarios/composite_indexes_can_be_changed_from_descending_to_ascending/.gitattributes'; class=Filesystem (30)
C:\Users\ilkka.poutanen\Code\spacedrive\core:
 ERR_PNPM_RECURSIVE_RUN_FIRST_FAIL  @sd/core@0.0.0 prisma: `cargo prisma "generate"`
Exit status 101
 ELIFECYCLE  Command failed with exit code 1.
 ELIFECYCLE  Command failed with exit code 1.
 ELIFECYCLE  Command failed with exit code 1.

I'm not super well versed on Windows particulars, but based on some Googling I believe this might be caused by something down in there using old APIs that don't allow paths longer than 260 characters. I do have the registry key for long path support turned on.

Anyway, I do understand that letting Windows users build the app at this point is probably quite low down on your list of priorities, just though I'd report this to give you a heads up on possible future problems wrt making Windows binaries :)

Cheers!

Reproduction

  1. Clone repo
  2. pnpm i
  3. rustup override set nightly
  4. pnpm prep

Expected behavior

No response

Platform and versions

Windows 11 Pro 21H2 (22000.613)

$ pnpm --version
7.0.0
$ cargo --version
cargo 1.62.0-nightly (a44758ac8 2022-05-04)
$ rustc --version
rustc 1.62.0-nightly (4c60a0ea5 2022-05-04)

Stack trace

No response

Additional context

No response

@Brendonovich
Copy link
Member

This is strange considering that others have had success with building Spacedrive on Windows. I notice you're using 1.62.0-nightly rather than 1.60.0 stable, is there a particular reason you are doing so? The recommended Rust version for Spacedrive is 1.60.0. I doubt that is causing the path length issue though.

@oscartbeaumont Any ideas?

@ilkka
Copy link
Contributor Author

ilkka commented May 6, 2022

Ah, no other reason for the nightly than pnpm prep earlier complaining about needing something from the nightly toolchain, but I guess my stuff was just plain too old :)

FWIW got the same thing on 1.60.0, but since:

  • the offending pathname is just over the limit at 265 chars
  • I've got a long username due to corporate policy :D
  • both scoop and rustup make the path longer

...I can easily believe that I'd just be the first unlucky sod to hit this limit.

@Brendonovich
Copy link
Member

From what I can tell, long file paths are an outstanding issue in Cargo and there's not really anything we can do about it 😅

Progress is being tracked here: rust-lang/cargo#9770

@maxichrome
Copy link
Contributor

Will close this for now due to the previous comment about it being an issue within Cargo — nothing we will be able to do until this gets fixed upstream :( #118 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants