dotnet / source-build

A repository to track efforts to produce a source tarball of the .NET Core SDK and all its components
MIT License
265 stars 132 forks source link

"Rebuild" fails on patches #121

Closed SteveDesmond-ca closed 6 years ago

SteveDesmond-ca commented 7 years ago

Related to #113, it looks like in general this repo expects a clean environment.

Steps to reproduce:

Expected result:

Observed result:

Not sure what's better, a git reset --hard of the submodules that get patched (as ./clean-submodules.sh does), or just continuing on if the patch fails (|| true) -- I'd suggest the latter, as then things that have already been built don't need to be rebuilt, and users can always explicitly call ./clean-submodules.sh themselves.

Console output:

...
Done building target "BuildReferenceAssemblies" in project "build.proj".
Target "Build" in project "/home/vtsv/source-build/build.proj" (entry point):
Using "Message" task from assembly "Microsoft.Build.Tasks.Core, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
Task "Message"
  Build Environment: arm Release Linux ubuntu.16.04-x64
Done executing task "Message".
Using "MSBuild" task from assembly "Microsoft.Build.Tasks.Core, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
Task "MSBuild"
  Additional Properties for project "/home/vtsv/source-build/targets/repository.proj":
    RepositoryName=core-setup
    PathToRepo=
    RepositoryOrganization=dotnet
    RepositoryBranch=release/2.0.0
Property reassignment: $(DefaultRepository)="core-setup" (previous value: "cli") at /home/vtsv/source-build/dir.props (71,5)
Property reassignment: $(BuildArguments)="-ConfigurationGroup=Release -PortableBuild=false -strip-symbols -SkipTests=true  -TargetArchitecture=arm -DistroRid=linux-arm -DisableCrossgen=true -SkipTests=true -CrossBuild=true" (previous value: "-ConfigurationGroup=Release -PortableBuild=false -strip-symbols -SkipTests=true ") at /home/vtsv/source-build/targets/core-setup.props (6,5)
Property reassignment: $(BuildCommand)="ROOTFS_DIR=/home/vtsv/source-build/cross/rootfs/arm /home/vtsv/source-build/src/core-setup/build.sh -ConfigurationGroup=Release -PortableBuild=false -strip-symbols -SkipTests=true  -TargetArchitecture=arm -DistroRid=linux-arm -DisableCrossgen=true -SkipTests=true -CrossBuild=true -- /p:BuildDebPackage=false" (previous value: "/home/vtsv/source-build/src/core-setup/build.sh -ConfigurationGroup=Release -PortableBuild=false -strip-symbols -SkipTests=true  -TargetArchitecture=arm -DistroRid=linux-arm -DisableCrossgen=true -SkipTests=true -CrossBuild=true -- /p:BuildDebPackage=false") at /home/vtsv/source-build/targets/core-setup.props (8,5)
Project "/home/vtsv/source-build/build.proj" (1) is building "/home/vtsv/source-build/targets/repository.proj" (2) on node 1 (BuildRepositoryAndDependencies target(s)).
Building with tools version "15.0".
Target "SetNuGetPackagesEnvironment" skipped, due to false condition; ('$(ArchiveDownloadedPackages)' == 'true') was evaluated as ('' == 'true').
Target "BuildRepositoryReferences" in project "/home/vtsv/source-build/targets/repository.proj" (target "BuildRepositoryAndDependencies" depends on it):
Task "MSBuild"
  Additional Properties for project "repository.proj":
    RepositoryName=standard
    PathToRepo=
    RepositoryOrganization=dotnet
    RepositoryBranch=release/2.0.0
Property reassignment: $(DefaultRepository)="core-setup" (previous value: "cli") at /home/vtsv/source-build/dir.props (71,5)
Project "/home/vtsv/source-build/targets/repository.proj" (2) is building "/home/vtsv/source-build/targets/repository.proj" (2:2) on node 1 (BuildRepositoryAndDependencies target(s)).
Building with tools version "15.0".
Target "SetNuGetPackagesEnvironment" skipped, due to false condition; ('$(ArchiveDownloadedPackages)' == 'true') was evaluated as ('' == 'true').
Target "BuildRepositoryReferences" skipped, due to false condition; ('@(RepositoryReference)' != '' and '$(BuildDependentRepositories)' != 'false') was evaluated as ('' != '' and '' != 'false').
Target "ApplyPatches" in project "/home/vtsv/source-build/targets/repository.proj" (target "Build" depends on it):
Task "Exec"
  Environment Variables passed to tool:
    DOTNET_RUNTIME_ID=ubuntu.16.04-x64
    DOTNET_TOOL_DIR=/home/vtsv/source-build/Tools/dotnetcli/
    BUILD_TOOLS_TOOL_DIR=/home/vtsv/source-build/Tools/
    BUILDTOOLS_SKIP_CROSSGEN=1
    LatestCommit=d318b764a689cfe285d8484bda918646905664e7
    OfficialBuildId=20170719-03
    VersionSeedDate=20170719-03
    OverridePackageSource=/home/vtsv/source-build/bin/obj/arm/Release/source-built/
  patch -p1 --ignore-whitespace -i /home/vtsv/source-build/patches/standard/0001-Respect-NUGET_PACKAGES-if-it-is-set.patch
  patching file dir.props
  Reversed (or previously applied) patch detected!  Assume -R? [n]
  Apply anyway? [n]
  Skipping patch.
  2 out of 2 hunks ignored -- saving rejects to file dir.props.rej
/home/vtsv/source-build/targets/repository.proj(49,5): error MSB3073: The command "patch -p1 --ignore-whitespace -i /home/vtsv/source-build/patches/standard/0001-Respect-NUGET_PACKAGES-if-it-is-set.patch" exited with code 1.
Done executing task "Exec" -- FAILED.
Done building target "ApplyPatches" in project "repository.proj" -- FAILED.
Done Building Project "/home/vtsv/source-build/targets/repository.proj" (BuildRepositoryAndDependencies target(s)) -- FAILED.
BuildRepositoryReferences:
  Additional Properties for project "repository.proj":
    RepositoryName=coreclr
    PathToRepo=
    RepositoryOrganization=dotnet
    RepositoryBranch=release/2.0.0
Property reassignment: $(DefaultRepository)="core-setup" (previous value: "cli") at /home/vtsv/source-build/dir.props (71,5)
Property reassignment: $(BuildArguments)="arm Release skiptests -PortableBuild=false  skipnuget cross -skiprestore stripSymbols" (previous value: "arm Release skiptests -PortableBuild=false ") at /home/vtsv/source-build/targets/coreclr.props (6,5)
Property reassignment: $(BuildCommand)="ROOTFS_DIR=/home/vtsv/source-build/cross/rootfs/arm /home/vtsv/source-build/src/coreclr/build.sh arm Release skiptests -PortableBuild=false  skipnuget cross -skiprestore stripSymbols" (previous value: "/home/vtsv/source-build/src/coreclr/build.sh arm Release skiptests -PortableBuild=false  skipnuget cross -skiprestore stripSymbols") at /home/vtsv/source-build/targets/coreclr.props (8,5)
Project "/home/vtsv/source-build/targets/repository.proj" (2) is building "/home/vtsv/source-build/targets/repository.proj" (2:3) on node 1 (BuildRepositoryAndDependencies target(s)).
Building with tools version "15.0".
Target "SetNuGetPackagesEnvironment" skipped, due to false condition; ('$(ArchiveDownloadedPackages)' == 'true') was evaluated as ('' == 'true').
Target "BuildRepositoryReferences" skipped, due to false condition; ('@(RepositoryReference)' != '' and '$(BuildDependentRepositories)' != 'false') was evaluated as ('' != '' and '' != 'false').
Target "ApplyPatches" in project "/home/vtsv/source-build/targets/repository.proj" (target "Build" depends on it):
Task "Exec"
  Environment Variables passed to tool:
    DOTNET_RUNTIME_ID=ubuntu.16.04-x64
    DOTNET_TOOL_DIR=/home/vtsv/source-build/Tools/dotnetcli/
    BUILD_TOOLS_TOOL_DIR=/home/vtsv/source-build/Tools/
    BUILDTOOLS_SKIP_CROSSGEN=1
    LatestCommit=36f70fa4be4bd37d4d76d06dd2cc433ff46351bd
    OfficialBuildId=20170719-03
    VersionSeedDate=20170719-03
  patch -p1 --ignore-whitespace -i /home/vtsv/source-build/patches/coreclr/0001-Respect-NUGET_PACKAGES-if-it-is-set.patch
  patching file build.sh
  Reversed (or previously applied) patch detected!  Assume -R? [n]
  Apply anyway? [n]
  Skipping patch.
  1 out of 1 hunk ignored -- saving rejects to file build.sh.rej
  patching file dir.props
  Reversed (or previously applied) patch detected!  Assume -R? [n]
  Apply anyway? [n]
  Skipping patch.
  1 out of 1 hunk ignored -- saving rejects to file dir.props.rej
/home/vtsv/source-build/targets/repository.proj(49,5): error MSB3073: The command "patch -p1 --ignore-whitespace -i /home/vtsv/source-build/patches/coreclr/0001-Respect-NUGET_PACKAGES-if-it-is-set.patch" exited with code 1.
Done executing task "Exec" -- FAILED.
Done building target "ApplyPatches" in project "repository.proj" -- FAILED.
Done Building Project "/home/vtsv/source-build/targets/repository.proj" (BuildRepositoryAndDependencies target(s)) -- FAILED.
BuildRepositoryReferences:
  Additional Properties for project "repository.proj":
    RepositoryName=corefx
    PathToRepo=
    RepositoryOrganization=dotnet
    RepositoryBranch=release/2.0.0
Property reassignment: $(DefaultRepository)="core-setup" (previous value: "cli") at /home/vtsv/source-build/dir.props (71,5)
Property reassignment: $(BuildCommand)="ROOTFS_DIR=/home/vtsv/source-build/cross/rootfs/arm /home/vtsv/source-build/src/corefx/build.sh -Release -buildArch=arm -portable=false -- /p:ILLinkTrimAssembly=false" (previous value: "/home/vtsv/source-build/src/corefx/build.sh -Release -buildArch=arm -portable=false -- /p:ILLinkTrimAssembly=false") at /home/vtsv/source-build/targets/corefx.props (6,5)
Project "/home/vtsv/source-build/targets/repository.proj" (2) is building "/home/vtsv/source-build/targets/repository.proj" (2:4) on node 1 (BuildRepositoryAndDependencies target(s)).
Building with tools version "15.0".
Target "SetNuGetPackagesEnvironment" skipped, due to false condition; ('$(ArchiveDownloadedPackages)' == 'true') was evaluated as ('' == 'true').
Target "BuildRepositoryReferences" in project "/home/vtsv/source-build/targets/repository.proj" (target "BuildRepositoryAndDependencies" depends on it):
Task "MSBuild"
  Additional Properties for project "repository.proj":
    RepositoryName=standard
    PathToRepo=
    RepositoryOrganization=dotnet
    RepositoryBranch=release/2.0.0
Project "/home/vtsv/source-build/targets/repository.proj" (2:4) is building "/home/vtsv/source-build/targets/repository.proj" (2:5) on node 1 (BuildRepositoryAndDependencies target(s)).
Building with tools version "15.0".
Target "SetNuGetPackagesEnvironment" skipped, due to false condition; ('$(ArchiveDownloadedPackages)' == 'true') was evaluated as ('' == 'true').
Target "BuildRepositoryAndDependencies" skipped. Previously built unsuccessfully.
Done Building Project "/home/vtsv/source-build/targets/repository.proj" (BuildRepositoryAndDependencies target(s)) -- FAILED.
BuildRepositoryReferences:
  Additional Properties for project "repository.proj":
    RepositoryName=coreclr
    PathToRepo=
    RepositoryOrganization=dotnet
    RepositoryBranch=release/2.0.0
Project "/home/vtsv/source-build/targets/repository.proj" (2:4) is building "/home/vtsv/source-build/targets/repository.proj" (2:6) on node 1 (BuildRepositoryAndDependencies target(s)).
Building with tools version "15.0".
Target "SetNuGetPackagesEnvironment" skipped, due to false condition; ('$(ArchiveDownloadedPackages)' == 'true') was evaluated as ('' == 'true').
Target "BuildRepositoryAndDependencies" skipped. Previously built unsuccessfully.
Done Building Project "/home/vtsv/source-build/targets/repository.proj" (BuildRepositoryAndDependencies target(s)) -- FAILED.
Done executing task "MSBuild" -- FAILED.
Done building target "BuildRepositoryReferences" in project "repository.proj" -- FAILED.
Done Building Project "/home/vtsv/source-build/targets/repository.proj" (BuildRepositoryAndDependencies target(s)) -- FAILED.
BuildRepositoryReferences:
  Additional Properties for project "repository.proj":
    RepositoryName=newtonsoft-json
    PathToRepo=
    RepositoryOrganization=JamesNK
    RepositoryBranch=master
Property reassignment: $(DefaultRepository)="core-setup" (previous value: "cli") at /home/vtsv/source-build/dir.props (71,5)
Project "/home/vtsv/source-build/targets/repository.proj" (2) is building "/home/vtsv/source-build/targets/repository.proj" (2:7) on node 1 (BuildRepositoryAndDependencies target(s)).
Building with tools version "15.0".
Target "SetNuGetPackagesEnvironment" skipped, due to false condition; ('$(ArchiveDownloadedPackages)' == 'true') was evaluated as ('' == 'true').
Target "BuildRepositoryReferences" skipped, due to false condition; ('@(RepositoryReference)' != '' and '$(BuildDependentRepositories)' != 'false') was evaluated as ('' != '' and '' != 'false').
Target "ApplyPatches" in project "/home/vtsv/source-build/targets/repository.proj" (target "Build" depends on it):
Task "Exec"
  Environment Variables passed to tool:
    DOTNET_RUNTIME_ID=ubuntu.16.04-x64
    DOTNET_TOOL_DIR=/home/vtsv/source-build/Tools/dotnetcli/
    BUILD_TOOLS_TOOL_DIR=/home/vtsv/source-build/Tools/
    BUILDTOOLS_SKIP_CROSSGEN=1
  patch -p1 --ignore-whitespace -i /home/vtsv/source-build/patches/newtonsoft-json/0001-Run-dotnet-migrate-to-generate-Newtonsoft.Json.Dotne.patch
  The next patch would create the file Src/Newtonsoft.Json/Newtonsoft.Json.Dotnet.csproj,
  which already exists!  Assume -R? [n]
  Apply anyway? [n]
  Skipping patch.
  1 out of 1 hunk ignored
  The next patch would delete the file Src/Newtonsoft.Json/Newtonsoft.Json.Dotnet.xproj,
  which does not exist!  Assume -R? [n]
  Apply anyway? [n]
  Skipping patch.
  1 out of 1 hunk ignored
  The next patch would delete the file Src/Newtonsoft.Json/project.json,
  which does not exist!  Assume -R? [n]
  Apply anyway? [n]
  Skipping patch.
  1 out of 1 hunk ignored
/home/vtsv/source-build/targets/repository.proj(49,5): error MSB3073: The command "patch -p1 --ignore-whitespace -i /home/vtsv/source-build/patches/newtonsoft-json/0001-Run-dotnet-migrate-to-generate-Newtonsoft.Json.Dotne.patch" exited with code 1.
Done executing task "Exec" -- FAILED.
Done building target "ApplyPatches" in project "repository.proj" -- FAILED.
Done Building Project "/home/vtsv/source-build/targets/repository.proj" (BuildRepositoryAndDependencies target(s)) -- FAILED.
Done executing task "MSBuild" -- FAILED.
Done building target "BuildRepositoryReferences" in project "repository.proj" -- FAILED.
Done Building Project "/home/vtsv/source-build/targets/repository.proj" (BuildRepositoryAndDependencies target(s)) -- FAILED.
Done executing task "MSBuild" -- FAILED.
Done building target "Build" in project "build.proj" -- FAILED.
Done Building Project "/home/vtsv/source-build/build.proj" (default targets) -- FAILED.

Build FAILED.

"/home/vtsv/source-build/build.proj" (default target) (1) ->
(BuildReferenceAssemblies target) ->
  /home/vtsv/source-build/Tools/dotnetcli/sdk/2.0.0-preview3-006845/Microsoft.Common.CurrentVersion.targets(1987,5): warning MSB3277: Found conflicts between different versions of the same dependent assembly that could not be resolved.  These reference conflicts are listed in the build log when log verbosity is set to detailed. [/home/vtsv/source-build/src/reference-assemblies/System.Security.Cryptography.Cng/netstandard1.6/4.2.0.0/System.Security.Cryptography.Cng.csproj] [/home/vtsv/source-build/build.proj]
  /home/vtsv/source-build/Tools/dotnetcli/sdk/2.0.0-preview3-006845/Microsoft.Common.CurrentVersion.targets(1987,5): warning MSB3277: Found conflicts between different versions of the same dependent assembly that could not be resolved.  These reference conflicts are listed in the build log when log verbosity is set to detailed. [/home/vtsv/source-build/src/reference-assemblies/System.Security.Cryptography.OpenSsl/netstandard1.6/4.0.0.0/System.Security.Cryptography.OpenSsl.csproj] [/home/vtsv/source-build/build.proj]
  /home/vtsv/source-build/Tools/dotnetcli/sdk/2.0.0-preview3-006845/Microsoft.Common.CurrentVersion.targets(1987,5): warning MSB3277: Found conflicts between different versions of the same dependent assembly that could not be resolved.  These reference conflicts are listed in the build log when log verbosity is set to detailed. [/home/vtsv/source-build/src/reference-assemblies/System.Security.Cryptography.Cng/netstandard1.6/4.2.0.0/System.Security.Cryptography.Cng.csproj] [/home/vtsv/source-build/build.proj]
  /home/vtsv/source-build/Tools/dotnetcli/sdk/2.0.0-preview3-006845/Microsoft.Common.CurrentVersion.targets(1987,5): warning MSB3277: Found conflicts between different versions of the same dependent assembly that could not be resolved.  These reference conflicts are listed in the build log when log verbosity is set to detailed. [/home/vtsv/source-build/src/reference-assemblies/System.Security.Cryptography.OpenSsl/netstandard1.6/4.0.0.0/System.Security.Cryptography.OpenSsl.csproj] [/home/vtsv/source-build/build.proj]

"/home/vtsv/source-build/build.proj" (default target) (1) ->
"/home/vtsv/source-build/targets/repository.proj" (BuildRepositoryAndDependencies target) (2) ->
"/home/vtsv/source-build/targets/repository.proj" (BuildRepositoryAndDependencies target) (2:2) ->
(ApplyPatches target) ->
  /home/vtsv/source-build/targets/repository.proj(49,5): error MSB3073: The command "patch -p1 --ignore-whitespace -i /home/vtsv/source-build/patches/standard/0001-Respect-NUGET_PACKAGES-if-it-is-set.patch" exited with code 1.

"/home/vtsv/source-build/build.proj" (default target) (1) ->
"/home/vtsv/source-build/targets/repository.proj" (BuildRepositoryAndDependencies target) (2) ->
"/home/vtsv/source-build/targets/repository.proj" (BuildRepositoryAndDependencies target) (2:3) ->
  /home/vtsv/source-build/targets/repository.proj(49,5): error MSB3073: The command "patch -p1 --ignore-whitespace -i /home/vtsv/source-build/patches/coreclr/0001-Respect-NUGET_PACKAGES-if-it-is-set.patch" exited with code 1.

"/home/vtsv/source-build/build.proj" (default target) (1) ->
"/home/vtsv/source-build/targets/repository.proj" (BuildRepositoryAndDependencies target) (2) ->
"/home/vtsv/source-build/targets/repository.proj" (BuildRepositoryAndDependencies target) (2:7) ->
  /home/vtsv/source-build/targets/repository.proj(49,5): error MSB3073: The command "patch -p1 --ignore-whitespace -i /home/vtsv/source-build/patches/newtonsoft-json/0001-Run-dotnet-migrate-to-generate-Newtonsoft.Json.Dotne.patch" exited with code 1.

    4 Warning(s)
    3 Error(s)
dseefeld commented 6 years ago

Rebuild can be accomplished by setting SkipPatches=true.