-
Notifications
You must be signed in to change notification settings - Fork 7.1k
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
Update Language Version to 10 and fix related issues #15886
Conversation
build.psm1
Outdated
$Arguments = @("publish","/property:GenerateFullPaths=true", "/property:ErrorOnDuplicatePublishOutputFiles=false") | ||
# Add --self-contained due to "warning NETSDK1179: One of '--self-contained' or '--no-self-contained' options are required when '--runtime' is used." | ||
$Arguments = @("publish","/property:GenerateFullPaths=true", "/property:ErrorOnDuplicatePublishOutputFiles=false", "--self-contained") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is going to be a change in the resulting build format going forward, isn't it? I don't think we've previously had self-contained executables for pwsh.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the --self-contained
switch was implicit when we specify --runtime. Now if moving to .NET 6 Preview 7 we get an error for that. --self-contained
creates a package with the required .NET framework assemblies, where are --no-self-contained
creates a framework dependent package.
@@ -619,7 +619,7 @@ internal virtual bool CallShouldProcess(string path) | |||
notSupported.ErrorRecord, | |||
notSupported)); | |||
} | |||
catch (DriveNotFoundException driveNotFound) | |||
catch (System.Management.Automation.DriveNotFoundException driveNotFound) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see a lot of conflicts with System.IO.DriveNotFoundException.
Can we rename System.Management.Automation.DriveNotFoundException to PSDriveNotFoundException?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would be a breaking change. I do not believe it is needed right now.
@@ -217,7 +217,7 @@ protected override void ProcessRecord() | |||
{ | |||
// Mark untrusted values for assignments to 'Global:' variables, and 'Script:' variables in | |||
// a module scope, if it's necessary. | |||
ExecutionContext.MarkObjectAsUntrustedForVariableAssignment(variable, scope, Context.EngineSessionState); | |||
System.Management.Automation.ExecutionContext.MarkObjectAsUntrustedForVariableAssignment(variable, scope, Context.EngineSessionState); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, maybe ask .Net team rename new System.Threading.ExecutionContext to System.Threading.ThreadExecutionContext before they release 6.0?
I created dotnet/runtime#57017
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<DisableImplicitNamespaceImports>true</DisableImplicitNamespaceImports>
<DisableImplicitNamespaceImports_DotNet>true</DisableImplicitNamespaceImports_DotNet>
and remove the workaround after Preview7.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will add this workaround and file an issue to remove it after releases after preview 7, as it will be disabled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah it feels to me like, at the very least, we should be preferring our namespace for the fully qualified type names. Even if we can't get changes from .NET, it should be possible to configure the namespace imports in a way that avoids all these changes to the type names in code.
4e91abb
to
174e9c7
Compare
@rjmholt As per the suggestion in dotnet/runtime#57017 I have added the workaround for disabling the implicit namespace addition feature. I also have filed an issue to remove the work around when the next preview build of .NET is available. Issue: #15894 |
🎉 Handy links: |
🎉 Handy links: |
PR Summary
Update the language version to 10 and add --self-contained switch.
Updating language version required to make some changes as it caused build break.
PR Context
These changes were required to take the .NET 6 preview 7 daily builds.
PR Checklist
.h
,.cpp
,.cs
,.ps1
and.psm1
files have the correct copyright headerWIP:
or[ WIP ]
to the beginning of the title (theWIP
bot will keep its status check atPending
while the prefix is present) and remove the prefix when the PR is ready.(which runs in a different PS Host).