-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Invoking SGen creates a dependency on the repo local's shared framework #43137
Comments
Tagging subscribers to this area: @safern, @ViktorHofer |
This sounds better to me. We could make it
This is done today because sgen produces C# which then needs to be compiled and we don't have a full SDK on the test machines.
I'm not a fan of this for the reasons you called out. Also it doesn't work well for source build.
Although this would kick the can, it might buy time if the real issue here (#630) was fixed. |
@ViktorHofer is this something you're blocked on now?
I don't think we've done this yet, right @Anipik? |
Whenever we move to |
Not anymore, I reverted that change as we now consume VSTest directly via a transport package. |
No, I'm not blocked by this at all. It's just something that devs will stumble upon locally. |
Ah that is true 😢 |
It could be considered, you'd still need to figure out how to run the compiler (with appropriate references) in helix. IMHO we should make the smallest possible investment here to workaround this. The right fix is #630 |
I've marked this issue blocking because it's now affecting my ability to create local builds. C:\runtime.io\> .\build.cmd -s clr -c Release ; .\build.cmd -s libs+libs.tests -rc Release
<< snip >>
C:\runtime.io\src\libraries\Microsoft.XmlSerializer.Generator\tests\Microsoft.XmlSerializer.Generator.Tests.csproj(43,5): error : Fail to generate C:\runtime.io\artifacts\bin\Microsoft.XmlSerializer.Generator.Tests\net6.0-Debug\Microsoft.XmlSerializer.Generator.Tests.XmlSerializers.cs
C:\runtime.io\src\libraries\Microsoft.XmlSerializer.Generator\tests\Microsoft.XmlSerializer.Generator.Tests.csproj(44,5): error MSB3030: Could not copy the file "C:\runtime.io\artifacts\bin\Microsoft.XmlSerializer.Generator.Tests\net6.0-Debug\Microsoft.XmlSerializer.Generator.Tests.XmlSerializers.cs" because it was not found.
0 Warning(s)
2 Error(s) |
A trivial fix for this issue could be approach 1 that I listed in the top post by feeding a netstandard2.1 (as Eric recommended, to not complicate source build) assembly in instead of a $(NetCoreAppCurrent) one. @safern or @GrabYourPitchforks do you wanna give it a try? |
Is this just a matter of changing the target framework for the test assembly? I'm not really sure what the proposed workaround is suggesting. |
I believe it is introducing a new helper assembly that we feed into sgen, instead of feeding the test assembly itself. Then make that assembly target netstandard2.1 |
I'm still not sure what the proposed workaround is. Is there a proposed step-by-step set of instructions that I can follow to work around this? This has been blocking my ability to build + run unit tests. |
@GrabYourPitchforks I think I can tackle this one. I have a clear idea of what needs to be done. Should have a PR today. |
When using the repo local SDK (
$(DotNetTool)
) to invokedotnet-Microsoft.XmlSerializer.Generator
which dynamically (via reflection) loads the test assemblyMicrosoft.XmlSerializer.Generator.Tests.dll
we create a dependency between the repo local shared framework and the test assembly.This surfaces in the following error locally:
The exact cause is that the call to
Type.GetTypes
fails with anReflectionTypeLoadException
saying that references with assembly version X can't be resolved.This likely has to do with us bumping the assembly version of our shared framework assemblies to 6.0.0 while the SDK still uses 5.0.0 shared framework assemblies.
There are couple of options:
netcoreapp3.1
test helper assembly.netcoreapp3.1
. This is problematic as we would also need to downgradeTestUtilities
and add support for testing non$(NetCoreAppCurrent)
configurations (unreleated but we might want do this anyway at some point, similar to .NETFramework testing).This needs to be sorted out now as it already started to happen on my machine and because I thought it was related to one of my PRs I already lost multiple hours on that. Others will start noticing this soon as well.
cc @ericstj @Anipik @safern
The text was updated successfully, but these errors were encountered: