Skip to content

Pin GitLink version to speed up Cake script #3249

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

Merged
merged 1 commit into from
May 28, 2019

Conversation

jnm2
Copy link
Contributor

@jnm2 jnm2 commented May 20, 2019

Based on a tip from the Cake team.

@jnm2 jnm2 requested a review from a team May 20, 2019 00:52
@mikkelbu
Copy link
Member

mikkelbu commented May 27, 2019

Are we sure about this tip? For this PR the current build on AppVeyor takes almost 2 minutes in the GitLink target

Task                          Duration            
--------------------------------------------------
Setup                         00:00:02.1671101    
NuGetRestore                  00:00:09.3710531    
Build                         00:00:32.3807515    
Test45                        00:00:34.0428569    
Test40                        00:00:33.9991150    
Test35                        00:00:37.3628111    
TestNetStandard14             00:00:43.5626333    
TestNetStandard20             00:00:32.0430121    
CheckForError                 00:00:00.0011337    
CreateImage                   00:00:00.2438897    
GitLink                       00:01:54.8829918    
PackageFramework              00:00:02.5229281    
PackageZip                    00:00:02.8158967    
UploadArtifacts               00:00:07.5772104    
Teardown                      00:00:00.0007935    
--------------------------------------------------
Total:                        00:05:52.9750139  

Usually, this takes between 35 and 40 seconds (I looked at 6 other builds). I'll just try to rebuild this PR on AppVeyor to see if it changes anything.

EDIT: Two rebuilds of the PR gives 36.16 and 36.52 for the GitLink target, so I don't see the speed up unless it is from the time the script is invoked and to the first target "Setup" (but this also varies a lot).

@jnm2
Copy link
Contributor Author

jnm2 commented May 27, 2019

I don't see the speed up unless it is from the time the script is invoked and to the first target "Setup" (but this also varies a lot).

This is where the speedup is, before the build script is compiled. It removes the need for an additional nuget.org gallery query to determine the latest version.

I also just saw this tip as a warning printed out in the console in recent versions of Cake:

The 'tool' directive is attempting to install the 'GitLink' package
without specifying a package version number.
More information on this can be found at https://cakebuild.net/docs/tutorials/pinning-cake-version
It's not recommended, but you can explicitly override this warning
by configuring the Skip Package Version Check setting to true
(i.e. command line parameter "--settings_skippackageversioncheck=true",
environment variable "CAKE_SETTINGS_SKIPPACKAGEVERSIONCHECK=true",
read more about configuration at https://cakebuild.net/docs/fundamentals/configuration)

Copy link
Member

@mikkelbu mikkelbu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but primarily to get the warning to disappear as we have enough output as it is :)

@mikkelbu mikkelbu merged commit 07b2d2a into nunit:master May 28, 2019
@mikkelbu mikkelbu added this to the 3.13 milestone May 28, 2019
@jnm2 jnm2 deleted the pin_cake_tool_version branch May 28, 2019 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants