-
Notifications
You must be signed in to change notification settings - Fork 6
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
Build task dependencies vs target framework #24
Comments
Perhaps we should include some additional nuspec inside the nuget package (or embedded inside the task assembly) explicitly for util pack to use to restore the tool at runtime? This would mean the official nuspec for |
I know that there is also a new DotNetCliTool reference to use for build tools instead of PackageReference, but I havent looked into whether this could potentially solve this issue. |
I did some experimenting, with the However, the element By building twice, I was able to get the Can you get the |
About <packageTypes>
<packageType name="DotnetCliTool" />
</packageTypes> I need to explore the |
Nope. All of the appveyor builds I have setup start completely clean, and do this:
The end result is that, the task fires for some (seemingly dependent on the target framework being netstandard1.5 comaptible) but not others.. I could try adding in an additional |
Hmmmm.. I did Edit: I tried out Oh wait! There is difference in our commands... I always use Edit2: I tried |
Hmm it works for me locally with no special effort |
OK - also make sure it won' try to run different builds in parallel on same folder, although that probably should cause more bizzarre error messages. Mine is the same:
|
AppVeyor msbuild version is: Microsoft (R) Build Engine version 15.5.180.51428 for .NET Core |
By creating {
"sdk": {
"version": "2.1.4"
}
} your Edit: The |
Ok I have just managed to reproduce this.. and I am pretty sure I have figured out the problem in the process.. BTW AppVeyor has also seemingly applied the latest VS2017 update to their images since yesterday so the version of dotnet sdk is now handily the same as our local versions. This is the problem: On an AppVeyor environment, its a clean slate, there are no NuGet packages in the nuget package cache.
Therefore It worked for us because we have the package installed :-) So it looks like I need to change the nuspec to add this:
I am hoping this will fix this issue, and then I will close. One to be careful of :-) |
Nice catch! 👍 I tested almost-this-kind-of-scenario by just removing Let me know if the workaround is successful. I'll sit down and revisit this issue on better time tho to think of proper solution. :) |
Workaround successful! :-) |
Good to hear! I'll leave this issue open until there is some more closure about what could be the proper solution. :) |
According to the issue: GitTools/GitVersion#1454 - the introduction of these dependencies to our nuspec file, has meant that the nuget package is no longer deemed "compatible" with native projects! Just one to consider - I haven't fully investigated it but it seems plausible given our nuspec changes. |
So I have noticed the following issue!
I have a very simple repro project, that consumes
GitVersionTask
I have created multiple branches, in each branch I have amended the project to target a particular target framework/s. The name of the branch is named after the target frameworks that the project is targeting.
These branches all build on appveyor.
I have found that in some scenarios, the task does not run.
netstandard1.1
netstandard1.3
netstandard1.5
netcoreapp20;netstandard1.1
You can see all the relevant builds here: https://ci.appveyor.com/project/dazinator/gitversion-pr1269/history
So what is interesting is that the task doesn't seem to run until the consumer project is targeting atleast
netstandard1.5
or a platform that is compatible with netstandard1.5 (i.e netcoreapp20).I think this is down to the fact that the
GitVersionTask
nuget package has the following in its nuspec:The sole reason this is there is because we rely on UtilPack to use this information to know how to restore / and resolve dependencies for us prior to executing the task.
However this is a problem. By listing dependencies in the nuspec we are effectively telling MsBuild to ingore the package if te consumer is targeting an incompatible framework. This is not what we want as the tool is a build tool, it's dependency chain is fixed based on the build environment, and not the target framework that a consumer is targeting.
The text was updated successfully, but these errors were encountered: