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

Use unicode Paths on Windows #2101

Closed
abergmeier-dsfishlabs opened this issue Nov 17, 2016 · 6 comments
Closed

Use unicode Paths on Windows #2101

abergmeier-dsfishlabs opened this issue Nov 17, 2016 · 6 comments
Assignees
Labels
P2 We'll consider working on this in future. (Assignee optional) platform: windows type: bug
Milestone

Comments

@abergmeier-dsfishlabs
Copy link
Contributor

Description of the problem / feature request / question:

Bazel on Windows currently passes paths to Windows using postfix A names (C:/whatever). We found that it is REALLY easy to get to a point where you exceed the MAX_PATH limit. So you should always use Unicode paths on Windows using the prefix \\?\.
And please change it now because afterwards I feel it will be too hard to change anymore.

If possible, provide a minimal example to reproduce the problem:

Install Visual Studio to:

C:/Program Files/1234567890_and_life_is_great/and_I_am_creating_a_really_horrible_path_which_is_actually_not_that_uncommon_on/yes_it_is_horrible_but_hey_a_bit_of_horrible_is_always_fun_right_right_yessss_sure_it_is_just_perfect_and_should_be_really_great_so_do_it_like_this.windows

and set BAZEL_VS to this path.

Environment info

  • Operating System: Windows 8.1

  • Bazel version (output of bazel info release): 0.4.0

Have you found anything relevant by searching the web? (e.g. GitHub issues, email threads in the bazel-discuss@googlegroups.com archive)

There are tons of discussions online for when and how you should use this.

Anything else, information or logs or outputs that would be helpful?

Not sure whether Java does this under the hood already. Then mostly only the direct interfacing with Windows (tools) needs to be fixed.

@kchodorow kchodorow added platform: windows P2 We'll consider working on this in future. (Assignee optional) type: bug labels Nov 17, 2016
@dslomov
Copy link
Contributor

dslomov commented Nov 18, 2016

Yes, thanks, we are aware of this. Unfortunately, the problem is kind of endemic: at least on Windows 7 cmd.exe does not work with ?\ paths well. I also think cl.exe had problems with those paths, esp in versions before 2015.

Are you running into issues without artificially installing VS into crazy locations?

@abergmeier-dsfishlabs
Copy link
Contributor Author

Yes, thanks, we are aware of this.

Great.

Unfortunately, the problem is kind of endemic: at least on Windows 7 cmd.exe does not work with ?\ paths well. I also think cl.exe had problems with those paths, esp in versions before 2015.

Another reason to switch from cmd.exe to PowerShell as much as possible. Perhaps there also needs to be global --experimental_unicode_paths switch to select whether one wants to use them on Windows?

Are you running into issues without artificially installing VS into crazy locations?

The VS was just an example.
We do have these problems in our own built tool and really long source file paths. Had to do some Junctions in the past to shorten the path lengths.

Chances are good that we might encounter these problems when using Bazel to built these files.

@Helcaraxan
Copy link

Helcaraxan commented Dec 1, 2016

This is also becoming an issue on my side with @petemounce. We don't have any crazy paths (i.e the path to our WORKSPACE is only 2 folders deep and has 23 chars (including the WORKSPACE dir's name). This is on Windows 10.

If we want to use this more widely for builds on Windows we can not expect developers to systematically make junctions like C:\A\<workspace-dir> to make it work.

TL;DR +1 on the issue.

@petemounce
Copy link
Contributor

I'm on Windows 10 and suffer this.

@dslomov dslomov added this to the 0.5 milestone Dec 6, 2016
@petemounce
Copy link
Contributor

Related to #2145?

bazel-io pushed a commit that referenced this issue Dec 15, 2016
Implement a JNI method that can resolve 8dot3
style paths. This is necessary because we need to
be able to compare 8dot3 style paths and long
paths [1], and because implementing this correctly
in Java seems to be impossible [2].

This change also adds tests for the JNI isJunction
implementation.

See #2101

[1] #2145
[2] #2145 (comment)

--
PiperOrigin-RevId: 142123750
MOS_MIGRATED_REVID=142123750
@dslomov dslomov assigned laszlocsomor and unassigned dslomov Feb 14, 2017
@laszlocsomor
Copy link
Contributor

@petemounce : Yes it is related, though not the same. #2181 is the same issue as this one. Closing this in favor of that, since I've been submitting fixes referencing that bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 We'll consider working on this in future. (Assignee optional) platform: windows type: bug
Projects
None yet
Development

No branches or pull requests

6 participants