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

Source build support #1241

Merged
merged 11 commits into from
Nov 3, 2017
Merged

Source build support #1241

merged 11 commits into from
Nov 3, 2017

Conversation

codito
Copy link
Contributor

@codito codito commented Oct 30, 2017

Allow vstest repository to build with dotnet/source-build.

Validated these changes with symlink in source-build repo and built it successfully.

Localization requires xlftool (which requires mono to be available). Will fix this outside current PR.

Arun Mahapatra added 4 commits October 30, 2017 08:39
Fake .NET desktop build environment if machine is non-windows.
Fixes microsoft#1222.
Fix names for TestPlatform.nuspec and path to testhost.x86 binaries.
Use multitarget package instead.
fi

# Copy TestHost for desktop targets
local testhost=$packageDir/TestHost
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we publish testhost here as we doing in build.ps1.?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will take this up in another PR.

@@ -39,7 +39,7 @@ def branch = GithubBranchName
Utilities.setMachineAffinity(newJob, 'Windows_NT', 'latest-or-auto')
break;

case "Ubuntu16.04":
case "Ubuntu14.04":
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this required?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Making sure we run our CI in exact same configuration as Source Build repo. This will help catch issues earlier.

scripts/build.sh Outdated
# Source build repo api
# See https://github.com/dotnet/source-build/blob/dev/release/2.0/Documentation/RepoApi.md
#
DOTNETBUILDFROMSOURCE=false
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: DOTNET_BUILD_FROM_SOURCE

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed. Thanks.

;;
-p)
PROJECT_NAME_PATTERNS=$2
shift
;;
-dotnetbuildfromsource)
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry, didn't get it. We can't change the name of this arg, it is sent as is from RepoApi.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we change it to more readable DotNetBuildFromSource.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Please see Line 36. We are ensuring the script continues to run if user passes args in a different case.

@@ -80,8 +108,8 @@ TP_SRC_DIR="$TP_ROOT_DIR/src"
export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
# Dotnet build doesnt support --packages yet. See https://github.com/dotnet/cli/issues/2712
export NUGET_PACKAGES=$TP_PACKAGES_DIR
DOTNET_CLI_VERSION="LATEST"
DOTNET_RUNTIME_VERSION="LATEST"
DOTNET_CLI_VERSION="2.1.0-preview1-007372"
Copy link
Contributor

Choose a reason for hiding this comment

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

While porting this to 15.3, make sure the vstest.console.runtimeconfig.json has compatible runtime with dotnet-cli servicing branch.

Copy link
Contributor Author

@codito codito Nov 1, 2017

Choose a reason for hiding this comment

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

Yes, I will ensure that in the Port PR to 15.3 branch. Current PR is for master.

scripts/build.sh Outdated

log "Installing dotnet cli..."
local start=$SECONDS
if [[ $TP_USE_REPO_API ]]; then
Copy link
Contributor

Choose a reason for hiding this comment

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

!?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed. Thanks!

export FrameworkPathOverride=$TP_PACKAGES_DIR/microsoft.targetingpack.netframework.v4.6/1.0.1/lib/net46/
if [ -z "$PROJECT_NAME_PATTERNS" ]
then
$dotnet build $TPB_Solution --configuration $TPB_Configuration -v:minimal -p:Version=$TPB_Version -p:CIBuild=$TPB_CIBuild -p:LocalizedBuild=$TPB_LocalizedBuild || failed=true
Copy link
Contributor

Choose a reason for hiding this comment

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

Script should exit on build failure?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See line 240.

Copy link
Contributor

Choose a reason for hiding this comment

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

should have explicit check as line 179?

@@ -8,5 +8,7 @@
<!-- Don't include the output.dll and output.runtimeconfig.json files in nuget package -->
<IncludeBuildOutput>false</IncludeBuildOutput>
<GenerateRuntimeConfigurationFiles>false</GenerateRuntimeConfigurationFiles>
<NoPackageAnalysis>true</NoPackageAnalysis>
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We're not building this project, it is only required for dotnet pack, hence disabled all these options.

@@ -17,6 +17,7 @@
<ItemGroup Condition=" '$(TargetFramework)' == 'net451' ">
<ProjectReference Include="..\UnitTestProject\UnitTestProject.csproj" />
<Reference Include="System" />
<Reference Include="System.Runtime" />
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For unix, we are referring multitargeting pack to build desktop assemblies. It requires the dependencies to be explicitly called out.

Copy link
Contributor

Choose a reason for hiding this comment

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

How can we make sure this for future commits?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unix build will break if we add a dependency and not explicitly mention it in csproj. It will fail the PR :)

@@ -24,6 +24,14 @@ CI_BUILD=false
VERBOSE=false
PROJECT_NAME_PATTERNS=

#
Copy link
Contributor

Choose a reason for hiding this comment

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

Need to update test.sh?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not required.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think dotnet cli(dotnet/<any_repo>) runs tests with build.cmd, I think source-build expects tests should run as part of build.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think source-build expects tests should run as part of build.

Didn't see any API related to running tests in the repo api docs: https://github.com/dotnet/source-build/blob/dev/release/2.0/Documentation/RepoApi.md. It only mentions build.cmd/sh.

@@ -39,7 +39,7 @@ def branch = GithubBranchName
Utilities.setMachineAffinity(newJob, 'Windows_NT', 'latest-or-auto')
break;

case "Ubuntu16.04":
case "Ubuntu14.04":
// Define your build/test strings here.
def buildString = """./build.sh -c ${configuration}"""
Copy link
Contributor

Choose a reason for hiding this comment

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

Not going to run tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not as part of this PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think dotnet/cli(dotnet/<any_repo>) runs tests with build.cmd, I think source-build expects tests should run as part of build.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am not sure, let's sync up. Here's the repo API doc I referred.

@codito codito merged commit f614a31 into microsoft:master Nov 3, 2017
@codito codito deleted the source-build branch November 3, 2017 03:17
codito added a commit to codito/vstest that referenced this pull request Nov 13, 2017
* Fix build issue for PlatformAbstractions on non windows environment.
Fake .NET desktop build environment if machine is non-windows.
Fixes microsoft#1222.

* Use Ubuntu 14.04 since it is used in source builds.
* Use exit code from build instead of log function.
Fix names for TestPlatform.nuspec and path to testhost.x86 binaries.

* Remove dependency on Mono for net4x builds.
Use multitarget package instead.

* Single build path for unix.
Removed mono dependency checks. Fixes microsoft#1153.

* Port vstest repo patches.
Add support for repo API.
https://github.com/dotnet/source-build/blob/dev/release/2.0/Documentation/RepoApi.md

* Fix PR comments.
* Use numeric comparisons instead of boolean in bash.
codito added a commit that referenced this pull request Nov 15, 2017
* Fix build issue for PlatformAbstractions on non windows environment.
Fake .NET desktop build environment if machine is non-windows.
Fixes #1222.

* Use Ubuntu 14.04 since it is used in source builds.
* Use exit code from build instead of log function.
Fix names for TestPlatform.nuspec and path to testhost.x86 binaries.

* Remove dependency on Mono for net4x builds.
Use multitarget package instead.

* Single build path for unix.
Removed mono dependency checks. Fixes #1153.

* Port vstest repo patches.
Add support for repo API.
https://github.com/dotnet/source-build/blob/dev/release/2.0/Documentation/RepoApi.md

* Fix PR comments.
* Use numeric comparisons instead of boolean in bash.
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.

3 participants