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

We don't have a dedicated Windows bot with disabled symlinks #454

Open
encukou opened this issue Jan 16, 2024 · 7 comments
Open

We don't have a dedicated Windows bot with disabled symlinks #454

encukou opened this issue Jan 16, 2024 · 7 comments

Comments

@encukou
Copy link
Member

encukou commented Jan 16, 2024

Recently, a missing @skip_unless_symlink was caught by a single buildbot -- AMD64 Windows11 Refleaks: python/cpython#114107

Given that no-symlinks (i.e. “developer mode” disabled) is the default on Widows, we should probably have a dedicated builder for it.

Unfortunately I'm currently not in a position to fix this.

@vstinner
Copy link
Member

Given that no-symlinks (i.e. “developer mode” disabled) is the default on Widows, we should probably have a dedicated builder for it.

Strange, I don't recall that I changed this option in my Windows 11 VM and I can create symlinks. Does test.pythoninfo log this "Windows Developer Mode" info?

I'm curious, do you have info on this mode, how to check if it's enabled or not, and how to turn it on or off?

@encukou
Copy link
Member Author

encukou commented Jan 16, 2024

How did you install the VM? Is it a development image?

I suggest that you search the Web for Windows developer mode; when it comes to info about Windows, its better than asking me :)

@vstinner
Copy link
Member

How did you install the VM? Is it a development image?

Hum, I don't recall. Maybe yes, maybe no.

https://learn.microsoft.com/en-us/windows/apps/get-started/enable-your-device-for-development says:

However, if you're writing software with Visual Studio on a computer for the first time, you will need to enable Developer Mode on both the development PC and on any devices you'll use to test your code.

Ah. Maybe installed Visual Studio installs it. So any Windows machine where Python is built with VS has this mode enabled? Good to know.

The issue title is:

We don't have a dedicated Windows bot with disabled symlinks #454

How would Python be built in this case? If VS requires the developer mode to be enabled?

Or another kind of test is needed: get pre-built Python, run tests. That's way more complicated than just "set up a Windows buildbot" since something should frequently build Python on Windows with whatever is needed to run tests (including Python source code?).

@encukou
Copy link
Member Author

encukou commented Jan 16, 2024

Well, AMD64 Windows11 Refleaks caught the issue, so it must be possible somehow :)
Perhaps you can disable it after installing Visual Studio.

@vstinner
Copy link
Member

Well, AMD64 Windows11 Refleaks caught the issue, so it must be possible somehow :)

Oh. That's even more interesting.

@vstinner
Copy link
Member

I wrote python/cpython#114121 to log the Windows Developer Mode in test.pythoninfo.

From what I saw, os.symlink() is allowed if the user is running with Administrator rights or if the Developer Mode is enabled.

I checked again my Windows 11 VM: in fact, the Developer Mode was disabled, and os.symlink() was disallowed. Moreover, can_symlink() of test.support.os_helper returns False as expected. If I enable the Developer Mode, os.symlink() works as expected, and can_symlink() returns True.

@vstinner
Copy link
Member

I checked again my Windows 11 VM: in fact, the Developer Mode was disabled, and os.symlink() was disallowed. Moreover, can_symlink() of test.support.os_helper returns False as expected. If I enable the Developer Mode, os.symlink() works as expected, and can_symlink() returns True.

Oh. I got confused by something...

I'm mostly working on Windows via SSH. But SSH logs me as an administrator. In this case, can_symlink() returns True, even if the Developer Mode is enabled :-) I modified my PR to also log if the user is an adminstrator or not.

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

No branches or pull requests

2 participants