| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
Steve Lee (@SteveL-MSFT) Do you agree to merge the PR before GA? |
Sorry, something went wrong.
|
Aditya Patwardhan (@adityapatwardhan) Please review the PR again. After looking in depth how the method is used I very wonder that we implement the conversion of these two enums if we can request current value from an assembly using Reflection. |
Sorry, something went wrong.
|
Ilya (@iSazonov) , can you please double check that currently GetProcessorArchitecture() returns system-wide info and comment on this function is wrong?
|
Sorry, something went wrong.
|
Andrew (@anmenaga) If the name confuses you we could remove the method at all because it is used in one place/scenario. Th scenario is a module loading. We read ProcessorArchitecture parameter from the module manifest and check that we can load the module. The check is to compare the ProcessorArchitecture parameter and ProcessorArchitecture property from current assembly. And we can do this directly. I pulled the commit. |
Sorry, something went wrong.
|
Andrew (@anmenaga) Please update your review. |
Sorry, something went wrong.
|
Andrew (@anmenaga) Could you please continue? |
Sorry, something went wrong.
|
Steve Lee (@SteveL-MSFT) Andrew (@anmenaga) I think the PR could be in 7.0. |
Sorry, something went wrong.
|
Steve Lee (@SteveL-MSFT) Sorry, I did not saw the issue. New tests are added. |
Sorry, something went wrong.
|
Steve Lee (@SteveL-MSFT) It seems I need help to fix tests on Unix-s. :-( I guess SMA compiled to MSIL on Unix-s. In the case I don't know how make functional tests on Unix-s. |
Sorry, something went wrong.
| Get-TP -ErrorAction SilentlyContinue | Should -BeExactly "$arch" | ||
|
|
||
| Remove-Module "TP_$arch" | ||
| Remove-Item -LiteralPath $testFolder -Recurse -Force -ErrorAction SilentlyContinue > $null |
There was a problem hiding this comment.
Should have in finally to ensure this cleans up if test fails for some reason
Sorry, something went wrong.
There was a problem hiding this comment.
Done.
Sorry, something went wrong.
| Add-Type -TypeDefinition $a -CompilerOptions "/platform:$roslynArch" -OutputAssembly $assemblyPath | ||
| New-ModuleManifest -Path $modulePath -NestedModules "TP_$arch.dll" -RequiredAssemblies "TP_$arch.dll" -ProcessorArchitecture $arch -CmdletsToExport "Get-TP" | ||
| Import-Module $modulePath | ||
|
|
There was a problem hiding this comment.
Extra whitespace
Sorry, something went wrong.
There was a problem hiding this comment.
Done.
Sorry, something went wrong.
|
Ilya (@iSazonov) You can probably not even worry about Add-Type, the module manifest issue was at validation time when it is imported so you can just generate the module manifest with ProcessorArchitecture and it should succeed on compatible arch and fail on not-compatible arch |
Sorry, something went wrong.
|
Steve Lee (@SteveL-MSFT) I try to create functional tests to ensure that scenario like #6533 really works. But test failures show that perhaps the PR doesn't fix #6533 in general (the PR only removes broken p/invoke but do not ensure that import-module works) because Roslyn works in another way on Unix-s and probably loader too. Now I set to skip new tests on Unix-s. |
Sorry, something went wrong.
|
Notice. The code was not covered by tests. Now only Windows on Intel is covered. Unix-s and Arm are not covered. |
Sorry, something went wrong.
|
🎉v7.0.0-rc.2 has been released which incorporates this pull request.:tada: Handy links: |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
PR Summary
Fix #4474
Fix #6533
Before the change GetProcessorArchitecture() call Windows P/Invoke so on Unix it would throw if user loaded a module with ProcessorArchitecture value in the module manifest. Now we use ProcessorArchitecture from current assembly.
PR Context
PR Checklist