Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Refactor coreclr packaging #9263

Merged
merged 22 commits into from
Feb 15, 2017
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
1359351
Only consider /etc/os-release for distro info
ellismg Dec 12, 2016
9497910
Refactor coreclr packaging
chcosta Feb 1, 2017
b7bd7ff
Default runtimeos, remove unused variables from jit pkgproj
chcosta Feb 1, 2017
91dafc4
Cleanup jit package, remove redundant includes
chcosta Feb 1, 2017
12a37e3
Use __distrorid, distrorid is not set on osx
chcosta Feb 1, 2017
f20878d
add arm packageplatform for ubuntu 14.04 and 16.04
chcosta Feb 1, 2017
9d8b1f4
Add missing dependency to ilasm / ildasm packages, parse distrorid
chcosta Feb 1, 2017
ef57f44
Break projectreference traversal when building a lineup package
chcosta Feb 2, 2017
5bfce2c
Fix index logic bug
chcosta Feb 2, 2017
b93cbfe
Update usage info
chcosta Feb 2, 2017
8ce3fab
default derivedpackagetargetosgroup to __buildos
chcosta Feb 2, 2017
458a972
tweak derivedpackagetargetosgroup definition
chcosta Feb 2, 2017
6458745
Respond to PR feedback
chcosta Feb 14, 2017
cdb4728
Merge branch 'master' of https://github.com/dotnet/coreclr into refac…
chcosta Feb 14, 2017
7f2137c
Always specify a default for derivedpackagetargetosgroup
chcosta Feb 14, 2017
03a5ce1
Default distrorid on osx
chcosta Feb 14, 2017
409ba7e
Fix typo
chcosta Feb 14, 2017
f361873
Add arch to distrorid
chcosta Feb 14, 2017
8dcf966
Remove PackagePlatforms property
chcosta Feb 14, 2017
6a54a44
Exclude binaries not built on armel
chcosta Feb 15, 2017
5623099
change package_platform to platform
chcosta Feb 15, 2017
3ec9032
Rename dir.targets -> dir.traversal.targets
chcosta Feb 15, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ usage()
echo "cmakeargs - user-settable additional arguments passed to CMake."
echo "bindir - output directory (defaults to $__ProjectRoot/bin)"
echo "buildstandalonegc - builds the GC in a standalone mode. Can't be used with \"cmakeargs\"."

echo "msbuildonunsupportedplatform - build managed binaries even if distro is not officially supported."
exit 1
}

Expand Down Expand Up @@ -341,6 +341,7 @@ isMSBuildOnNETCoreSupported()
__isMSBuildOnNETCoreSupported=1
;;
*)
__isMSBuildOnNETCoreSupported=$__msbuildonunsupportedplatform
esac
elif [ "$__HostOS" == "OSX" ]; then
__isMSBuildOnNETCoreSupported=1
Expand Down Expand Up @@ -559,6 +560,7 @@ __cmakeargs=""
__SkipGenerateVersion=0
__DoCrossArchBuild=0
__PortableLinux=0
__msbuildonunsupportedplatform=0

while :; do
if [ $# -le 0 ]; then
Expand Down Expand Up @@ -729,6 +731,9 @@ while :; do
buildstandalonegc)
__cmakeargs="-DFEATURE_STANDALONE_GC=1"
;;
msbuildonunsupportedplatform)
__msbuildonunsupportedplatform=1
;;
*)
__UnprocessedBuildArgs="$__UnprocessedBuildArgs $1"
;;
Expand Down
1 change: 0 additions & 1 deletion dir.props
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@

<Platform Condition="'$(Platform)' == ''">$(BuildArch)</Platform>
<Platform Condition="'$(Platform)' == 'amd64'">x64</Platform>

</PropertyGroup>

<!-- Output paths -->
Expand Down
1 change: 0 additions & 1 deletion dir.traversal.targets
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,4 @@
</Target>

<Target Name="Rebuild" DependsOnTargets="Clean;Build" />

</Project>
26 changes: 13 additions & 13 deletions init-tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,45 +18,45 @@ __INIT_TOOLS_DONE_MARKER=$__PROJECT_JSON_PATH/done
# Extended version of platform detection logic from dotnet/cli/scripts/obtain/dotnet-install.sh 16692fc
get_current_linux_name() {
# Detect Distro
if [ "$(cat /etc/*-release | grep -cim1 ubuntu)" -eq 1 ]; then
if [ "$(cat /etc/*-release | grep -cim1 16.04)" -eq 1 ]; then
if [ "$(cat /etc/os-release | grep -cim1 ubuntu)" -eq 1 ]; then
if [ "$(cat /etc/os-release | grep -cim1 16.04)" -eq 1 ]; then
echo "ubuntu.16.04"
return 0
fi
if [ "$(cat /etc/*-release | grep -cim1 16.10)" -eq 1 ]; then
if [ "$(cat /etc/os-release | grep -cim1 16.10)" -eq 1 ]; then
echo "ubuntu.16.10"
return 0
fi

echo "ubuntu"
return 0
elif [ "$(cat /etc/*-release | grep -cim1 centos)" -eq 1 ]; then
elif [ "$(cat /etc/os-release | grep -cim1 centos)" -eq 1 ]; then
echo "centos"
return 0
elif [ "$(cat /etc/*-release | grep -cim1 rhel)" -eq 1 ]; then
elif [ "$(cat /etc/os-release | grep -cim1 rhel)" -eq 1 ]; then
echo "rhel"
return 0
elif [ "$(cat /etc/*-release | grep -cim1 debian)" -eq 1 ]; then
elif [ "$(cat /etc/os-release | grep -cim1 debian)" -eq 1 ]; then
echo "debian"
return 0
elif [ "$(cat /etc/*-release | grep -cim1 alpine)" -eq 1 ]; then
elif [ "$(cat /etc/os-release | grep -cim1 alpine)" -eq 1 ]; then
echo "alpine"
return 0
elif [ "$(cat /etc/*-release | grep -cim1 fedora)" -eq 1 ]; then
if [ "$(cat /etc/*-release | grep -cim1 23)" -eq 1 ]; then
elif [ "$(cat /etc/os-release | grep -cim1 fedora)" -eq 1 ]; then
if [ "$(cat /etc/os-release | grep -cim1 23)" -eq 1 ]; then
echo "fedora.23"
return 0
fi
if [ "$(cat /etc/*-release | grep -cim1 24)" -eq 1 ]; then
if [ "$(cat /etc/os-release | grep -cim1 24)" -eq 1 ]; then
echo "fedora.24"
return 0
fi
elif [ "$(cat /etc/*-release | grep -cim1 opensuse)" -eq 1 ]; then
if [ "$(cat /etc/*-release | grep -cim1 13.2)" -eq 1 ]; then
elif [ "$(cat /etc/os-release | grep -cim1 opensuse)" -eq 1 ]; then
if [ "$(cat /etc/os-release | grep -cim1 13.2)" -eq 1 ]; then
echo "opensuse.13.2"
return 0
fi
if [ "$(cat /etc/*-release | grep -cim1 42.1)" -eq 1 ]; then
if [ "$(cat /etc/os-release | grep -cim1 42.1)" -eq 1 ]; then
echo "opensuse.42.1"
return 0
fi
Expand Down
92 changes: 3 additions & 89 deletions src/.nuget/Microsoft.NETCore.ILAsm/Microsoft.NETCore.ILAsm.builds
Original file line number Diff line number Diff line change
Expand Up @@ -2,96 +2,10 @@
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />

<PropertyGroup>
<!-- This property must be set to the same value as $(PackageOutputPath) for the nuspecs and nupkgs to be binplaced to the intended location. -->
<OutputPath>$(PackageOutputPath)</OutputPath>
</PropertyGroup>

<!-- We always build the identity/redirection package. However, the platform specific runtime-*.nupkg is built based upon the target OS we are building the product for. -->
<ItemGroup>
<Project Include="Microsoft.NETCore.ILAsm.pkgproj">
</Project>
<Project Condition="'$(TargetsWindows)' == 'true'" Include="win/Microsoft.NETCore.ILAsm.pkgproj">
<OSGroup>Windows_NT</OSGroup>
<Platform>amd64</Platform>
</Project>
<Project Condition="'$(TargetsWindows)' == 'true'" Include="win/Microsoft.NETCore.ILAsm.pkgproj">
<OSGroup>Windows_NT</OSGroup>
<Platform>arm64</Platform>
</Project>
<Project Condition="'$(TargetsWindows)' == 'true'" Include="win/Microsoft.NETCore.ILAsm.pkgproj">
<OSGroup>Windows_NT</OSGroup>
<Platform>x86</Platform>
</Project>
<Project Condition="'$(TargetsWindows)' == 'true'" Include="win/Microsoft.NETCore.ILAsm.pkgproj">
<OSGroup>Windows_NT</OSGroup>
<Platform>arm</Platform>
</Project>
<Project Condition="'$(TargetsLinux)' == 'true' and '$(DistroRid)' == 'linux-x64'" Include="linux/Microsoft.NETCore.ILAsm.pkgproj">
<OSGroup>Linux</OSGroup>
<Platform>amd64</Platform>
</Project>
<Project Condition="'$(TargetsLinux)' == 'true' and '$(DistroRid)' == 'debian.8-x64'" Include="debian/Microsoft.NETCore.ILAsm.pkgproj">
<OSGroup>Linux</OSGroup>
<Platform>amd64</Platform>
</Project>
<Project Condition="'$(TargetsLinux)' == 'true' and '$(DistroRid)' == 'debian.8-armel'" Include="debian/Microsoft.NETCore.ILAsm.pkgproj">
<OSGroup>Linux</OSGroup>
<Platform>armel</Platform>
</Project>
<Project Condition="'$(TargetsLinux)' == 'true' and '$(DistroRid)' == 'fedora.23-x64'" Include="fedora/23/Microsoft.NETCore.ILAsm.pkgproj">
<OSGroup>Linux</OSGroup>
<Platform>amd64</Platform>
</Project>
<Project Condition="'$(TargetsLinux)' == 'true' and '$(DistroRid)' == 'fedora.24-x64'" Include="fedora/24/Microsoft.NETCore.ILAsm.pkgproj">
<OSGroup>Linux</OSGroup>
<Platform>amd64</Platform>
</Project>
<Project Condition="'$(TargetsLinux)' == 'true' and '$(DistroRid)' == 'opensuse.13.2-x64'" Include="opensuse/13.2/Microsoft.NETCore.ILAsm.pkgproj">
<OSGroup>Linux</OSGroup>
<Platform>amd64</Platform>
</Project>
<Project Condition="'$(TargetsLinux)' == 'true' and '$(DistroRid)' == 'opensuse.42.1-x64'" Include="opensuse/42.1/Microsoft.NETCore.ILAsm.pkgproj">
<OSGroup>Linux</OSGroup>
<Platform>amd64</Platform>
</Project>
<Project Condition="'$(TargetsLinux)' == 'true' and $(DistroRid.StartsWith('rhel.7'))" Include="rhel/Microsoft.NETCore.ILAsm.pkgproj">
<OSGroup>Linux</OSGroup>
<Platform>amd64</Platform>
</Project>
<Project Condition="'$(TargetsLinux)' == 'true' and '$(DistroRid)' == 'ubuntu.14.04-x64'" Include="ubuntu/14.04/Microsoft.NETCore.ILAsm.pkgproj">
<OSGroup>Linux</OSGroup>
<Platform>amd64</Platform>
</Project>
<Project Condition="'$(TargetsLinux)' == 'true' and '$(DistroRid)' == 'ubuntu.14.04-arm'" Include="ubuntu/14.04/Microsoft.NETCore.ILAsm.pkgproj">
<OSGroup>Linux</OSGroup>
<Platform>arm</Platform>
</Project>
<Project Condition="'$(TargetsLinux)' == 'true' and '$(DistroRid)' == 'ubuntu.16.04-x64'" Include="ubuntu/16.04/Microsoft.NETCore.ILAsm.pkgproj">
<OSGroup>Linux</OSGroup>
<Platform>amd64</Platform>
</Project>
<Project Condition="'$(TargetsLinux)' == 'true' and '$(DistroRid)' == 'ubuntu.16.04-arm'" Include="ubuntu/16.04/Microsoft.NETCore.ILAsm.pkgproj">
<OSGroup>Linux</OSGroup>
<Platform>arm</Platform>
</Project>
<Project Condition="'$(TargetsLinux)' == 'true' and '$(DistroRid)' == 'ubuntu.16.10-x64'" Include="ubuntu/16.10/Microsoft.NETCore.ILAsm.pkgproj">
<OSGroup>Linux</OSGroup>
<Platform>amd64</Platform>
</Project>
<Project Condition="'$(TargetsLinux)' == 'true' and '$(DistroRid)' == 'alpine.3.4.3-x64'" Include="alpine/3.4.3/Microsoft.NETCore.ILAsm.pkgproj">
<OSGroup>Linux</OSGroup>
<Platform>amd64</Platform>
</Project>
<Project Condition="'$(TargetsLinux)' == 'true' and '$(DistroRid)' == 'tizen.4.0.0-armel'" Include="tizen/4.0.0/Microsoft.NETCore.ILAsm.pkgproj">
<OSGroup>Linux</OSGroup>
<Platform>armel</Platform>
</Project>
<Project Condition="'$(TargetsOSX)' == 'true'" Include="osx/Microsoft.NETCore.ILAsm.pkgproj">
<OSGroup>OSX</OSGroup>
<Platform>amd64</Platform>
</Project>
<!-- identity project, runtime specific projects are included by props above -->
<Project Include="$(MSBuildProjectName).pkgproj" />
</ItemGroup>

<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.traversal.targets))\dir.traversal.targets" />
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
</Project>
80 changes: 12 additions & 68 deletions src/.nuget/Microsoft.NETCore.ILAsm/Microsoft.NETCore.ILAsm.pkgproj
Original file line number Diff line number Diff line change
@@ -1,75 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<PropertyGroup>
<SkipPackageFileCheck>true</SkipPackageFileCheck>
<SkipValidatePackage>true</SkipValidatePackage>
<PackagePlatforms>x64;x86;arm64;arm;armel;</PackagePlatforms>
<OutputPath>$(PackagesOutputPath)</OutputPath>
<IncludeRuntimeJson>true</IncludeRuntimeJson>

<PropertyGroup Condition="'$(PackageTargetRuntime)' == ''">
<IsLineupPackage Condition="'$(IsLineupPackage)' == ''">true</IsLineupPackage>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Microsoft.NETCore.Runtime.CoreCLR\Microsoft.NETCore.Runtime.CoreCLR.pkgproj" />
<ProjectReference Include="win\Microsoft.NETCore.ILAsm.pkgproj">
<Platform>amd64</Platform>
</ProjectReference>
<ProjectReference Include="win\Microsoft.NETCore.ILAsm.pkgproj">
<Platform>arm64</Platform>
</ProjectReference>
<ProjectReference Include="win\Microsoft.NETCore.ILAsm.pkgproj">
<Platform>x86</Platform>
</ProjectReference>
<ProjectReference Include="win\Microsoft.NETCore.ILAsm.pkgproj">
<Platform>arm</Platform>
</ProjectReference>
<ProjectReference Include="linux\Microsoft.NETCore.ILAsm.pkgproj">
<Platform>amd64</Platform>
</ProjectReference>
<ProjectReference Include="debian\Microsoft.NETCore.ILAsm.pkgproj">
<Platform>amd64</Platform>
</ProjectReference>
<ProjectReference Include="debian\Microsoft.NETCore.ILAsm.pkgproj">
<Platform>armel</Platform>
</ProjectReference>
<ProjectReference Include="fedora\23\Microsoft.NETCore.ILAsm.pkgproj">
<Platform>amd64</Platform>
</ProjectReference>
<ProjectReference Include="fedora\24\Microsoft.NETCore.ILAsm.pkgproj">
<Platform>amd64</Platform>
</ProjectReference>
<ProjectReference Include="opensuse\13.2\Microsoft.NETCore.ILAsm.pkgproj">
<Platform>amd64</Platform>
</ProjectReference>
<ProjectReference Include="opensuse\42.1\Microsoft.NETCore.ILAsm.pkgproj">
<Platform>amd64</Platform>
</ProjectReference>
<ProjectReference Include="rhel\Microsoft.NETCore.ILAsm.pkgproj">
<Platform>amd64</Platform>
</ProjectReference>
<ProjectReference Include="ubuntu\14.04\Microsoft.NETCore.ILAsm.pkgproj">
<Platform>amd64</Platform>
</ProjectReference>
<ProjectReference Include="ubuntu\14.04\Microsoft.NETCore.ILAsm.pkgproj">
<Platform>arm</Platform>
</ProjectReference>
<ProjectReference Include="ubuntu\16.04\Microsoft.NETCore.ILAsm.pkgproj">
<Platform>amd64</Platform>
</ProjectReference>
<ProjectReference Include="ubuntu\16.04\Microsoft.NETCore.ILAsm.pkgproj">
<Platform>arm</Platform>
</ProjectReference>
<ProjectReference Include="ubuntu\16.10\Microsoft.NETCore.ILAsm.pkgproj">
<Platform>amd64</Platform>
</ProjectReference>
<ProjectReference Include="alpine\3.4.3\Microsoft.NETCore.ILAsm.pkgproj">
<Platform>amd64</Platform>
</ProjectReference>
<ProjectReference Include="tizen\4.0.0\Microsoft.NETCore.ILAsm.pkgproj">
<Platform>armel</Platform>
</ProjectReference>
<ProjectReference Include="osx\Microsoft.NETCore.ILAsm.pkgproj">
<Platform>amd64</Platform>

<ItemGroup Condition="'$(IsLineupPackage)' == 'true'">
<ProjectReference Include="..\Microsoft.NETCore.Runtime.CoreCLR\Microsoft.NETCore.Runtime.CoreCLR.pkgproj" >
<!-- we should look at moving this into packaging.targets instead of having to carry this around for every pkgproj project reference -->
<AdditionalProperties>%(ProjectReference.AdditionalProperties);IsLineupPackage=false</AdditionalProperties>
</ProjectReference>
</ItemGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />

<Import Condition="'$(_packageTargetOSGroup)' != ''" Project="$(MSBuildThisFileDirectory)runtime.$(_packageTargetOSGroup).$(MSBuildProjectName).props" />

<Import Project="$(MSBuildThisFileDirectory)..\..\..\dir.targets" />
Copy link
Member

Choose a reason for hiding this comment

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

Why not GetDirectoryNameOfFileAbove?

Copy link
Member Author

Choose a reason for hiding this comment

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

we don't want ..\..\dir.targets, we want ..\..\..\dir.targets. This was part of the reason I had named ..\..\dir.targets as ..\..\packaging.targets.

</Project>

This file was deleted.

This file was deleted.

This file was deleted.

Loading