Skip to content
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

Make build more coherent with same "dotnet sdk" on all CI machine. #396

Closed

Conversation

MarcoRossignoli
Copy link
Collaborator

@MarcoRossignoli MarcoRossignoli commented May 3, 2019

Related to #390 (comment)

We have two script

// default is debug
./build.sh debug/release <- unix 
build.cmd debug/release  <- win

They download sdk to reporoot\.tools\ and run dotnet cli from there, this should lead to more coherent build/test result because build is "machine dotnet runtime version agnostic".

/cc @tonerdo @petli

@MarcoRossignoli MarcoRossignoli requested review from tonerdo and petli May 3, 2019 15:57
@@ -0,0 +1,71 @@
# Resolve any symlinks in the given path.
Copy link
Collaborator Author

@MarcoRossignoli MarcoRossignoli May 3, 2019

Choose a reason for hiding this comment

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

took idea from corefx repo

wget -q -O "$install_script" "$install_script_url"
fi

bash "$install_script" --version 2.2.203 --install-dir "$dotnet_root" || {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

we could move version in a simple text file on eng folder and take version from there.

Create-Directory $toolsRoot
$scriptPath = Join-Path $toolsRoot "dotnet-install.ps1"
Invoke-WebRequest "https://dot.net/v1/dotnet-install.ps1" -OutFile $scriptPath
& $toolsRoot\dotnet-install.ps1 -InstallDir $toolsRoot\dotnet -Version 2.2.203
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

we could move version in a simple text file on eng folder and take version from there.

@codecov
Copy link

codecov bot commented May 3, 2019

Codecov Report

Merging #396 into master will increase coverage by 1.12%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master     #396      +/-   ##
==========================================
+ Coverage   85.85%   86.98%   +1.12%     
==========================================
  Files          17       16       -1     
  Lines        2234     2182      -52     
==========================================
- Hits         1918     1898      -20     
+ Misses        316      284      -32

@MarcoRossignoli MarcoRossignoli force-pushed the newbuild branch 3 times, most recently from f9c2d6c to ef60fb2 Compare May 6, 2019 09:58
@MarcoRossignoli
Copy link
Collaborator Author

@tonerdo seems work, I moved docs under Documentation in line with Join foundation issue.

@MarcoRossignoli
Copy link
Collaborator Author

@tonerdo we should move to AzurePipelines https://azure.microsoft.com/en-us/blog/announcing-azure-pipelines-with-unlimited-ci-cd-minutes-for-open-source/
I use AzurePipelines in my day by day job...if you link the repo and add me as admin of pipeline I could try to setup.

@MarcoRossignoli
Copy link
Collaborator Author

Another plus of this approach is that we can run CI on a list of SDK which could produce different IL and invalidate code assumptions and again in future we could have different instrumentation related to different SDK(we can read it runtime).

@MarcoRossignoli
Copy link
Collaborator Author

@tonerdo PTAL

@MarcoRossignoli
Copy link
Collaborator Author

@tonerdo merged and fixed azp

@MarcoRossignoli
Copy link
Collaborator Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@MarcoRossignoli
Copy link
Collaborator Author

@tonerdo woot command works!

@MarcoRossignoli
Copy link
Collaborator Author

@tonerdo I think it's ready to go!

@AArnott
Copy link
Contributor

AArnott commented May 25, 2019

I wonder if you're trying too hard. Your repo's build requirements really aren't that strange to justify all these custom build scripts.

Add a global.json file to your repo to "pin" the right .NET Core SDK used to build with. Here's an example.

Then modify your azure pipelines YAML file to install that version. Here's an example.

@MarcoRossignoli
Copy link
Collaborator Author

MarcoRossignoli commented May 25, 2019

@AArnott the idea of download sdk is for future use...I mean instrumenting code and verify coverage depends on compiler version, different version of compilers generage different pdb and in future we would like to have a way to run tests with more than one sdk version...for instance take a look at this PR #389 #390 behaviour of hide sequence point is changed and our tests started to fail.
This is a "first step" but my idea is to have the possibility to run build/tests with a list of sdks and maybe add some "outerloop" CI.

@AArnott
Copy link
Contributor

AArnott commented May 25, 2019

Here's what it looks like in full for your repo

Disclaimer: not fully tested yet.

@AArnott
Copy link
Contributor

AArnott commented May 25, 2019

It's now tested.

@MarcoRossignoli
Copy link
Collaborator Author

MarcoRossignoli commented May 25, 2019

@AArnott do you have better way to provide a CI with more than one SDK(locally runnable)?
My idea as I've explained above is the possibility to have more than one SDK, so download from a list and rebuild/test for every different version and in case amend tests with assertion related to version number(i.e. line x is not covered in version x.y.x due to different pdb, this plus some new update #420 on tests we should reach a hight quality of coverage).

@AArnott
Copy link
Contributor

AArnott commented May 25, 2019

Yes, I think we can handle that too.

My personal recommendation is that you build with exactly one SDK version (that you've pinned for consistency). Then you test on as many SDKs as you need your coverlet build extension to support for your target customers.

@MarcoRossignoli
Copy link
Collaborator Author

MarcoRossignoli commented May 27, 2019

Now CI depends on custom sdk that is one of the goal of this PR.
Close for the moment we'll pickup some script idea when/if we'll decide how to approach to multi sdk tests scenario.

@MarcoRossignoli MarcoRossignoli deleted the newbuild branch May 28, 2019 19:13
@MarcoRossignoli MarcoRossignoli mentioned this pull request Aug 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants