Support for Windows development environment#33021
Conversation
|
Hi @johnwparent! I noticed that the following package(s) don't yet have maintainers:
Are you interested in adopting any of these package(s)? If so, simply add the following to the package class: maintainers = ['johnwparent']If not, could you contact the developers of this package and see if they are interested? You can quickly see who has worked on a package with $ spack blame wdkThank you for your help! Please don't add maintainers without their consent. You don't have to be a Spack expert or package developer in order to be a "maintainer," it just gives us a list of users willing to review PRs or debug issues relating to this package. A package can have multiple maintainers; just add a list of GitHub handles of anyone who wants to volunteer. |
8988753 to
837d81f
Compare
scheibelp
left a comment
There was a problem hiding this comment.
I mostly have comments about readability, although there appears to be a couple issues (more detail in comments).
| def install(self, spec, prefix): | ||
| install_args = ["/features", "+", "/quiet", "/installpath", self.prefix] | ||
| with working_dir(self.stage.source_path): | ||
| Executable("wdksetup.exe")(*install_args) |
There was a problem hiding this comment.
You mentioned that users can't install wdk if it's already on the system: could the error message be augmented with a suggestion to run spack external find --not-buildable wdk?
There was a problem hiding this comment.
I tested this, and the installer will report that scenario to the users prior to closure without Spack needing to do so. When spack runs Executable("wdksetup.exe")(*install_args) execution is handed over to the Windows installer and gui, which then detects other installations of the WDK and reports to that effect. Context is not returned to spack until a user acknowledges that scenario, so I don't believe reporting that would be necessary. Additionally, I don't know if the installer returns enough info to Spack via stdout that we would be able to differentiate that failure from another.
There was a problem hiding this comment.
Now that this PR includes windows_registry could this be updated? That doesn't have to happen in this PR, I just wanted to check if that made this possible (I assume that for this to make sense, it would also need to run -unattended, if that or an equivalent option is available for the install).
There was a problem hiding this comment.
Yes, we would be able to search for the registry key and report the already installed version. Windows installer APIs are not consistent across packages, each package creates their own. The WDK does not have the -unattended flag, instead the -quiet flag that I've already added handled both the normal interface and any error messages that may crop up. There are two to dos here, the first is the registry stuff, and the second is piping errors to the spack log file. I'll try to do both in this PR.
There was a problem hiding this comment.
If you point the log at spack's log it blows things away, that will be saved for a later PR.
bedc37a to
0177f74
Compare
scheibelp
left a comment
There was a problem hiding this comment.
Some preliminary comments. Some are more straightforward changes and others might merit discussion. Let me know if you agree.
| def install(self, spec, prefix): | ||
| install_args = ["/features", "+", "/quiet", "/installpath", self.prefix] | ||
| with working_dir(self.stage.source_path): | ||
| Executable("wdksetup.exe")(*install_args) |
There was a problem hiding this comment.
Now that this PR includes windows_registry could this be updated? That doesn't have to happen in this PR, I just wanted to check if that made this possible (I assume that for this to make sense, it would also need to run -unattended, if that or an equivalent option is available for the install).
scheibelp
left a comment
There was a problem hiding this comment.
Additional requests - hopefully all minor. Let me know if you disagree.
Update spack external find heuristics to account for Windows drivers Update external find for Windows kits
scheibelp
left a comment
There was a problem hiding this comment.
Some additional requests: if any of them don't seem minor let me know.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
|
Seems like the build tests are still hitting some intermittent download issues. I'll retry the pipeline. |
|
@spackbot run pipeline |
|
I've started that pipeline for you! |
| """ | ||
| if not is_windows or _win32_can_symlink(): | ||
| os.symlink(real_path, link_path) | ||
| os.symlink(real_path, link_path, target_is_directory=os.path.isdir(real_path)) |
There was a problem hiding this comment.
Why was this added? It's a really bad idea, cause this way dangling symlinks cannot be created. Ok, I mistakenly thought isdir throws if the file doesn't exist. In any case, I submitted #34321.
In general I'd like to ask you to never introduce changes for Windows support that cause performance regressions for non-Windows. Just assume that every file system operation is the bottleneck in some part of Spack, whether it's views, post-install hooks, buildcaches, ...
There was a problem hiding this comment.
In general I'd like to ask you to never introduce changes for Windows support that cause performance regressions for non-Windows.
This request is impossible to satisfy, or even to break down into something realistic or manageable. It is equivalent to saying "don't introduce bugs" (I'm already trying to do that).
As for the specific issue, I personally think a mistake at this level is unavoidable. Even if your original complaint was true. We have this code, and then we have you noticing and making an adjustment that avoids the issue (presumably because you have a benchmark which detects that something started slowing down). If you're worried about dangling symlinks and the tests don't have it, then they should have it; if you think there should be a benchmark for tracking this type of slowdown and we don't have it, then we should have one.
There was a problem hiding this comment.
I guess what I'm saying is: be mindful about filesystem operations.
* Add a WindowsRegistryView class, which can query for existing package installations on Windows. This is particularly important because some Windows packages (including those added here) do not allow two simultaneous installs, and this can be queried in order to provide a clear error message. * Consolidate external path detection logic for Windows into WindowsKitExternalPaths and WindowsCompilerExternalPaths objects. * Add external-only packages win-sdk and wgl * Add win-wdk (including external detection) which depends on win-sdk * Replace prior msmpi implementation with a source-based install (depends on win-wdk). This install can control the install destination (unlike the binary installation). * Update MSVC compiler to choose vcvars based on win-sdk dependency * Provide "msbuild" module-level variable to packages during build * When creating symlinks on Windows, need to explicitly specify when a symlink target is a directory * executables_in_path no-longer defaults to using PATH (this is now expected to be taken care of by the caller)
| return [] | ||
| program_files = os.environ["PROGRAMFILES(x86)"] | ||
| kit_base = os.path.join( | ||
| program_files, "Windows Kits", WindowsKitExternalPaths.plat_major_ver | ||
| ) | ||
| return kit_base |
There was a problem hiding this comment.
Is there any reason this function returns either an empty list or a string?
There was a problem hiding this comment.
Nope, and that's definitely a mistake we missed. IMO we should actually always be returning a list from a glob over the base kits directory so we can support SDK 10 and SDK 11.
I'll refactor, PR, and tag you.
This establishes a base of support for a Windows development environment and introduces some fundamental Windows tools to Spack as packages and externally locatable components. This will support packages relying on low level Windows development components such as the Windows OpenGL driver, third party GL drivers, the driver development kit, and the Windows software development kit. This components will introduce new support or expand support for such packages as MSMPI, HDF5, Glew, Paraview, and VTK.