diff options
-rwxr-xr-x | build-test.sh | 5 | ||||
-rwxr-xr-x | packaging/coreclr.spec | 86 |
2 files changed, 80 insertions, 11 deletions
diff --git a/build-test.sh b/build-test.sh index 59f4fe6bbd..6ef1447b77 100755 --- a/build-test.sh +++ b/build-test.sh @@ -578,6 +578,7 @@ usage() echo "bindir - output directory (defaults to $__ProjectRoot/bin)" echo "msbuildonunsupportedplatform - build managed binaries even if distro is not officially supported." echo "priority1 - include priority=1 tests in the build" + echo "skipgenerateversion - disable version generation even if MSBuild is supported." exit 1 } @@ -933,6 +934,10 @@ while :; do __UnprocessedBuildArgs+=("/p:CLRTestPriorityToBuild=1") ;; + skipgenerateversion) + __SkipGenerateVersion=1 + ;; + *) __UnprocessedBuildArgs+=("$1") ;; diff --git a/packaging/coreclr.spec b/packaging/coreclr.spec index 68d478015d..468c9e047d 100755 --- a/packaging/coreclr.spec +++ b/packaging/coreclr.spec @@ -3,6 +3,12 @@ %define skipnative 0 %define skipmscorlib 0 +%ifarch %{arm} aarch64 +%define skiptests 0 +%else +%define skiptests 1 +%endif + %define pgo_instrument 0 %define pgo_optimize 1 @@ -115,7 +121,7 @@ cp %{SOURCE1} . # Detect interpreter name from cross-gcc LD_INTERPRETER=$(patchelf --print-interpreter /emul/usr/bin/gcc) LD_RPATH=$(patchelf --print-rpath /emul/usr/bin/gcc) -for file in $( find ./Tools ./.dotnet -name "dotnet" -type f) +for file in $( find ./Tools ./.dotnet -name "dotnet" -type f -o -name "ilasm" -type f) do patchelf --set-interpreter ${LD_INTERPRETER} ${file} patchelf --set-rpath ${LD_RPATH}:%{_builddir}/%{name}-%{version}/libicu-57.1/ ${file} @@ -170,6 +176,19 @@ export CLANG_NO_LIBDIR_SUFFIX=1 %endif %endif +%ifarch %{arm} +%define _tarch arm +%endif +%ifarch aarch64 +%define _tarch arm64 +%endif +%ifarch %{ix86} +%define _tarch x86 +%endif +%ifarch x86_64 +%define _tarch x64 +%endif + %define _buildtype %{dotnet_buildtype} %define _reldir bin/Product/Linux.%{_barch}.%{_buildtype} %define _numproc %(getconf _NPROCESSORS_ONLN) @@ -229,6 +248,18 @@ export LD_LIBRARY_PATH=%{_builddir}/%{name}-%{version}/libicu-57.1/ %endif %endif +%if 0%{skiptests} +%else +export NUGET_PACKAGES=%{_builddir}/%{name}-%{version}/.packages/ +export LD_LIBRARY_PATH=%{_builddir}/%{name}-%{version}/libicu-57.1/ + +# Build native part of tests as non-portable (i.e. for Tizen) +ROOTFS_DIR=/ ./build-test.sh portablebuild=false %{_barch} cross %{_buildtype} priority1 msbuildonunsupportedplatform skipgenerateversion skipstressdependencies skipmanaged skiprestorepackages /p:__SkipPackageRestore=true skipgeneratelayout + +# Build managed part of tests as portable (i.e. for Linux) +ROOTFS_DIR=/ ./build-test.sh %{_barch} cross %{_buildtype} priority1 msbuildonunsupportedplatform skipgenerateversion skipstressdependencies skipnative skiprestorepackages /p:__SkipPackageRestore=true +%endif + %install # .NET Core Runtime %define dotnetdir dotnet @@ -236,13 +267,16 @@ export LD_LIBRARY_PATH=%{_builddir}/%{name}-%{version}/libicu-57.1/ %define netcoreappdir %{netshareddir}/Microsoft.NETCore.App/%{dotnet_version} mkdir -p %{buildroot}%{_datadir}/%{netcoreappdir} +# TC directory +%define tcdir coreclr-tc +%define dotnettestdir /opt/usr/%{tcdir} +mkdir -p %{buildroot}/%{dotnettestdir} + # .NET Tizen Runtime %define dotnettizendir dotnet.tizen %define dotnetfwdir %{dotnettizendir}/framework -%define dotnettestdir %{dotnettizendir}/test mkdir -p %{buildroot}%{_datadir}/%{dotnettizendir} mkdir -p %{buildroot}%{_datadir}/%{dotnetfwdir} -mkdir -p %{buildroot}%{_datadir}/%{dotnettestdir} ln -sf %{_datadir}/%{netcoreappdir} %{buildroot}%{_datadir}/%{dotnettizendir}/netcoreapp # symlink to .NET version for compatibility @@ -285,12 +319,42 @@ cp -rf src/pal/src/include %{buildroot}%{_datadir}/%{netcoreappdir}/src/pal/s cp -rf %{_reldir}/lib %{buildroot}%{_datadir}/%{netcoreappdir} # test -cp %{_reldir}/superpmi %{buildroot}%{_datadir}/%{dotnettestdir} -cp %{_reldir}/mcs %{buildroot}%{_datadir}/%{dotnettestdir} -cp %{_reldir}/libsuperpmi-shim-collector.so %{buildroot}%{_datadir}/%{dotnettestdir} -cp %{_reldir}/libsuperpmi-shim-counter.so %{buildroot}%{_datadir}/%{dotnettestdir} -cp %{_reldir}/libsuperpmi-shim-simple.so %{buildroot}%{_datadir}/%{dotnettestdir} -cp %{_reldir}/bin/*.so %{buildroot}%{_datadir}/%{dotnettestdir} +%if 0%{skiptests} +%else +cp tests/runtest.sh %{buildroot}/%{dotnettestdir} +chmod +x %{buildroot}/%{dotnettestdir}/runtest.sh +cp tests/unsupported*.%{_tarch}.txt %{buildroot}/%{dotnettestdir} | true + +%define _tcreldir bin/tests/Linux.%{_barch}.%{_buildtype} +cp -r %{_tcreldir}/* %{buildroot}/%{dotnettestdir} +find %{buildroot}/%{dotnettestdir} -name "*.pdb" -exec rm {} \; +find %{buildroot}/%{dotnettestdir} -name "*.cmd" -exec rm {} \; +find %{buildroot}/%{dotnettestdir} -name "*.so.dbg" -exec rm {} \; +rm -rf %{buildroot}/%{dotnettestdir}/Tests/Core_Root/in +rm -rf %{buildroot}/%{dotnettestdir}/Tests/Core_Root/sharedFramework +rm -rf %{buildroot}/%{dotnettestdir}/Tests/Core_Root/PDB +rm -rf %{buildroot}/%{dotnettestdir}/Tests/Core_Root/x64 +rm -rf %{buildroot}/%{dotnettestdir}/Tests/Core_Root/gcinfo +rm -rf %{buildroot}/%{dotnettestdir}/Tests/Core_Root/inc +rm -rf %{buildroot}/%{dotnettestdir}/Tests/Core_Root/lib +rm -rf %{buildroot}/%{dotnettestdir}/Tests/Core_Root/IL +rm -rf %{buildroot}/%{dotnettestdir}/Tests/Core_Root/bin +rm %{buildroot}/%{dotnettestdir}/Tests/Core_Root/{superpmi,SOS_README.md,mcs,*.a,*.so,corerun,coreconsole,crossgen,ilasm,ildasm,System.Private.CoreLib.dll} + +cp %{buildroot}/%{dotnettestdir}/bin/*.so %{buildroot}/%{dotnettestdir}/Tests/Core_Root +cp %{_reldir}/corerun %{buildroot}/%{dotnettestdir}/Tests/Core_Root + +mv %{buildroot}/%{dotnettestdir}/Tests/Core_Root %{buildroot}/%{dotnettestdir}/coreroot +%endif + +# test native +mkdir -p %{buildroot}/%{dotnettestdir}/bin +cp %{_reldir}/superpmi %{buildroot}/%{dotnettestdir}/bin +cp %{_reldir}/mcs %{buildroot}/%{dotnettestdir}/bin +cp %{_reldir}/libsuperpmi-shim-collector.so %{buildroot}/%{dotnettestdir}/bin +cp %{_reldir}/libsuperpmi-shim-counter.so %{buildroot}/%{dotnettestdir}/bin +cp %{_reldir}/libsuperpmi-shim-simple.so %{buildroot}/%{dotnettestdir}/bin +cp %{_reldir}/bin/*.so %{buildroot}/%{dotnettestdir}/bin %endif %if 0%{skipmscorlib} @@ -322,8 +386,8 @@ cp %{_reldir}/PDB/System.Private.CoreLib.pdb %{buildroot}%{_datadir}/%{netcore %files test %manifest %{name}.manifest -%dir %{_datadir}/%{dotnettestdir} -%{_datadir}/%{dotnettestdir}/* +%dir %{dotnettestdir} +%{dotnettestdir}/* %files devel %manifest %{name}.manifest |