Skip to content

avoid PATH_MAX limitations on windows #3430

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

Closed
dcoutts opened this issue May 14, 2016 · 7 comments
Closed

avoid PATH_MAX limitations on windows #3430

dcoutts opened this issue May 14, 2016 · 7 comments

Comments

@dcoutts
Copy link
Contributor

dcoutts commented May 14, 2016

When using nix style package ids, we get very long paths, e.g.

C:\Users\hvr\AppData\Roaming/cabal/store/ghc-8.0.0.20160421/unordered-containers-0.2.7.0-983a8e913817af8e0a8d0bb61ab730ac015f7cd650d0c8e1f28eac6ab8b068a8/lib/libHSunordered-containers-0.2.7.0-983a8e913817af8e0a8d0bb61ab730ac015f7cd650d0c8e1f28eac6ab8b068a8.a

This is 258 chars long. The Windows max path is 260 (including the driver letter etc).

While it's certainly possible to use the Windows APIs to get long file name support, all the programs that work with these files have to support that, this includes not just cabal but ghc, gcc, linker utils etc. So it is impractical to take that approach. The only workable approach is to keep the lengths down.

Given that we are using a nix style store, there is no reason to include the full package id into the paths within each store entry. While we can link multiple versions of a package into one exe, we cannot link multiple instances of the same package (right @ezyang) in which case we don't need to duplicate the id into the .a library name.

When did this change incidentally? We used to only use the package name + version for the lib name.

@sopvop
Copy link
Collaborator

sopvop commented May 14, 2016

I believe thats one of the resons why nix uses hash-clampedname format

@dcoutts
Copy link
Contributor Author

dcoutts commented May 14, 2016

@sopvop Can you point me to more details about that?

What I'm trying in the patch #3431 is to truncate both the package name (and version) and also truncate the hash size. So the max package id is 64 chars. How does that compare to what nix does?

@sopvop
Copy link
Collaborator

sopvop commented May 15, 2016

Nix did same as you do. And I'm not sure they clamp name anymore, at least not on my new nixos machine.

And I guess you should have used base32 after all.

nix uses hash first so it's easier to find store path by 2-4 letter prefix FAQ

@dcoutts
Copy link
Contributor Author

dcoutts commented May 15, 2016

Thanks, interesting reference.

dcoutts added a commit that referenced this issue May 17, 2016
Try using smaller package ids on Windows (see #3430)
@23Skidoo
Copy link
Member

Fixed by #3431, I believe.

@23Skidoo 23Skidoo added this to the cabal-install 1.24.0.1 milestone Sep 4, 2016
@23Skidoo
Copy link
Member

23Skidoo commented Sep 4, 2016

Reopening because I want to backport this into 1.24.0.1.

@23Skidoo 23Skidoo reopened this Sep 4, 2016
@ezyang ezyang modified the milestones: cabal-install 1.24.0.1, Soon Sep 6, 2016
@23Skidoo
Copy link
Member

23Skidoo commented Oct 9, 2016

Backported to 1.24 in #3954, closing.

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

No branches or pull requests

4 participants