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

Add Windows 10/11 support for Python from MS Store (solution inside) #27747

Closed
camAtGitHub opened this issue Mar 6, 2024 · 6 comments
Closed
Labels
closed:wontfix current behavior is by design, and change is not desired enhancement feature request platform:windows status:blocked-external Needs a third-party / external change or fix

Comments

@camAtGitHub
Copy link

camAtGitHub commented Mar 6, 2024

Problem

As mentioned in my comment and solution on another post On Windows 10/11 and using Python3 from the Microsoft Store, the python3.exe installed into $PATH is a 0 byte sized file that i s actually a reparse point (like a hardlink) to a semi-dynamic path to the exe installed elsewhere by the app store.

Checking for ourselves we can see:

C:\Users\cam\AppData\Local\Microsoft\WindowsApps>fsutil reparsepoint /?
/? is an invalid parameter.
---- REPARSEPOINT Commands Supported ----

delete          Delete a reparse point
query           Query a reparse point

C:\Users\cam\AppData\Local\Microsoft\WindowsApps>fsutil reparsepoint query python.exe
Reparse Tag Value : 0x8000001b
Tag value: Microsoft

Reparse Data Length: 0x1c2
Reparse Data:
0000:  03 00 00 00 50 00 79 00  74 00 68 00 6f 00 6e 00  ....P.y.t.h.o.n.
0010:  53 00 6f 00 66 00 74 00  77 00 61 00 72 00 65 00  S.o.f.t.w.a.r.e.
0020:  46 00 6f 00 75 00 6e 00  64 00 61 00 74 00 69 00  F.o.u.n.d.a.t.i.
0030:  6f 00 6e 00 2e 00 50 00  79 00 74 00 68 00 6f 00  o.n...P.y.t.h.o.
0040:  6e 00 2e 00 33 00 2e 00  31 00 31 00 5f 00 71 00  n...3...1.1._.q.
0050:  62 00 7a 00 35 00 6e 00  32 00 6b 00 66 00 72 00  b.z.5.n.2.k.f.r.
0060:  61 00 38 00 70 00 30 00  00 00 50 00 79 00 74 00  a.8.p.0...P.y.t.
0070:  68 00 6f 00 6e 00 53 00  6f 00 66 00 74 00 77 00  h.o.n.S.o.f.t.w.
0080:  61 00 72 00 65 00 46 00  6f 00 75 00 6e 00 64 00  a.r.e.F.o.u.n.d.
0090:  61 00 74 00 69 00 6f 00  6e 00 2e 00 50 00 79 00  a.t.i.o.n...P.y.
00a0:  74 00 68 00 6f 00 6e 00  2e 00 33 00 2e 00 31 00  t.h.o.n...3...1.
00b0:  31 00 5f 00 71 00 62 00  7a 00 35 00 6e 00 32 00  1._.q.b.z.5.n.2.
00c0:  6b 00 66 00 72 00 61 00  38 00 70 00 30 00 21 00  k.f.r.a.8.p.0.!.
00d0:  50 00 79 00 74 00 68 00  6f 00 6e 00 00 00 43 00  P.y.t.h.o.n...C.
00e0:  3a 00 5c 00 50 00 72 00  6f 00 67 00 72 00 61 00  :.\.P.r.o.g.r.a.
00f0:  6d 00 20 00 46 00 69 00  6c 00 65 00 73 00 5c 00  m. .F.i.l.e.s.\.
0100:  57 00 69 00 6e 00 64 00  6f 00 77 00 73 00 41 00  W.i.n.d.o.w.s.A.
0110:  70 00 70 00 73 00 5c 00  50 00 79 00 74 00 68 00  p.p.s.\.P.y.t.h.
0120:  6f 00 6e 00 53 00 6f 00  66 00 74 00 77 00 61 00  o.n.S.o.f.t.w.a.
0130:  72 00 65 00 46 00 6f 00  75 00 6e 00 64 00 61 00  r.e.F.o.u.n.d.a.
0140:  74 00 69 00 6f 00 6e 00  2e 00 50 00 79 00 74 00  t.i.o.n...P.y.t.
0150:  68 00 6f 00 6e 00 2e 00  33 00 2e 00 31 00 31 00  h.o.n...3...1.1.
0160:  5f 00 33 00 2e 00 31 00  31 00 2e 00 32 00 32 00  _.3...1.1...2.2.
0170:  38 00 38 00 2e 00 30 00  5f 00 78 00 36 00 34 00  8.8...0._.x.6.4.
0180:  5f 00 5f 00 71 00 62 00  7a 00 35 00 6e 00 32 00  _._.q.b.z.5.n.2.
0190:  6b 00 66 00 72 00 61 00  38 00 70 00 30 00 5c 00  k.f.r.a.8.p.0.\.
01a0:  70 00 79 00 74 00 68 00  6f 00 6e 00 33 00 2e 00  p.y.t.h.o.n.3...
01b0:  31 00 31 00 2e 00 65 00  78 00 65 00 00 00 30 00  1.1...e.x.e...0.
01c0:  00 00

So thats the problem in a nutshell. (More details on my original comment).
The "Feature Request" would be to add support to follow(?) / support(?) reparse points to determine the correct exe to use.

Thanks

Expected behavior

When python3.exe is found in $PATH on Windows 10/11 Neovim supports it 'out of the box'.

@zeertzjq
Copy link
Member

zeertzjq commented Mar 6, 2024

It seems that libuv doesn't follow reparse points: libuv/libuv#1980 (comment)

But I may be understanding that comment incorrectly.

@camAtGitHub
Copy link
Author

Hello,
to me is seems like it is supported - but I'm no expert...
For example the below commit talks explicitly about adding support for the 'microsoft' tagged reparse points (ie not symlink tagged reparse points).

libuv/libuv#2812 - "win, fs: add IO_REPARSE_TAG_APPEXECLINK support"

@zeertzjq
Copy link
Member

zeertzjq commented Mar 6, 2024

#23808 seems related

@camAtGitHub
Copy link
Author

Sure, seems related but IMHO not a blocker, as we arent editing the file merely following it, to the 'real' path....?
Anyway I'll leave it up to you guys (the dev team) as to whether or not to try and implement.

It was just a nice feature request to help simplify the running for Neovim on Windows for less technical users.
Please reach out if want my two cents on anything - otherwise I'll probably just watch from the sidelines.
Thanx and Cheers!

@zeertzjq
Copy link
Member

zeertzjq commented Mar 8, 2024

This doesn't seems possible because Nvim doesn't have the permission to access these files: https://stackoverflow.com/questions/56974927/permission-denied-trying-to-run-python-on-windows-10

There is nothing that can be done in Nvim to make this work.

@zeertzjq zeertzjq closed this as not planned Won't fix, can't repro, duplicate, stale Mar 8, 2024
@zeertzjq zeertzjq added the closed:wontfix current behavior is by design, and change is not desired label Mar 8, 2024
@zeertzjq
Copy link
Member

zeertzjq commented Mar 8, 2024

Also libuv/libuv#3874

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed:wontfix current behavior is by design, and change is not desired enhancement feature request platform:windows status:blocked-external Needs a third-party / external change or fix
Projects
None yet
Development

No branches or pull requests

3 participants