-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[Breaking Change] Targets that run after ResolveReferences to manipulate references are broken after upgrading to 15.3 #2134
Comments
This is indeed a consequence of #2039. I'm not sure what to do about it. This target is arguably wrong--it's manipulating an item after the rollup target that logically produces that item. I'd rather see it as Being "wrong" in a non-obvious way doesn't mean we can just break things with impunity. But we also need to be able to modify the build process. Thinking about fixes. @davkean You can work around for the moment by adding a |
One possibility would be to move Would that make it happen too late for some uses? I can't think of any offhand, since cc @jcouv |
e3a3d69 added a new FindReferenceAssembliesForReferences target, which ran just before ResolveReferences. Dogfooding this revealed targets in the VS SDK (at least) that manipulate @(ReferencePath) and are hooked in as AfterTargets of ResolveReferences. That was silently ignored, corrupting the user's build. Fixes dotnet#2134 by moving FindReferenceAssembliesForReferences later in the process, so anyone hooking ResolveReferences will see the changes they make in the compiler. This is not a fully general solution to the problem that someone might hook an arbitrary point and manipulate @(ReferencePath), but it unbreaks an obvious hook point.
Confirmed by patching my |
Naive question: why not just have compilation tasks use @(ReferencePath->'%(ReferenceAssembly)') and eliminate the separate item group? |
e3a3d69 added a new FindReferenceAssembliesForReferences target, which ran just before ResolveReferences. Dogfooding this revealed targets in the VS SDK (at least) that manipulate @(ReferencePath) and are hooked in as AfterTargets of ResolveReferences. That was silently ignored, corrupting the user's build. Fixes #2134 by moving FindReferenceAssembliesForReferences later in the process, so anyone hooking ResolveReferences will see the changes they make in the compiler. This is not a fully general solution to the problem that someone might hook an arbitrary point and manipulate @(ReferencePath), but it unbreaks an obvious hook point.
e3a3d69 added a new FindReferenceAssembliesForReferences target, which ran just before ResolveReferences. Dogfooding this revealed targets in the VS SDK (at least) that manipulate @(ReferencePath) and are hooked in as AfterTargets of ResolveReferences. That was silently ignored, corrupting the user's build. Fixes dotnet#2134 by moving FindReferenceAssembliesForReferences later in the process, so anyone hooking ResolveReferences will see the changes they make in the compiler. This is not a fully general solution to the problem that someone might hook an arbitrary point and manipulate @(ReferencePath), but it unbreaks an obvious hook point.
e3a3d69 added a new FindReferenceAssembliesForReferences target, which ran just before ResolveReferences. Dogfooding this revealed targets in the VS SDK (at least) that manipulate @(ReferencePath) and are hooked in as AfterTargets of ResolveReferences. That was silently ignored, corrupting the user's build. Fixes #2134 by moving FindReferenceAssembliesForReferences later in the process, so anyone hooking ResolveReferences will see the changes they make in the compiler. This is not a fully general solution to the problem that someone might hook an arbitrary point and manipulate @(ReferencePath), but it unbreaks an obvious hook point. Port of a618289 to the release branch for 15.3 preview 2.
@nguerrera That's discussed in #1986 (comment), but the short version is "target incrementality" + "backward compat". In retrospect, it could have been done that way by applying the transform everywhere (including in the inputs) and making the compat shim in Roslyn populate that metadata on the item. |
Version 15.3.0-pre.1.0+26524.3003.d15prerel
This target which we copied from a package that comes in the VS SDK is broken in this build:
ie Changes this target makes to the ReferencePath item are not respected at compile time.
This silently breaks the product until runtime, after building with this binary - it fails to load because Visual Studio doesn't ship with any of the .DesignTime dlls, hence why they are embedded. Manipulating
ReferencePath
is a pretty common extension point.I'm guessing this was broken in the references assembly changes - haven't fully groked what changes we made there and where we landed with all this.
The text was updated successfully, but these errors were encountered: