From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 8BF271382C5 for ; Tue, 23 Jan 2018 06:42:20 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id F243FE0942; Tue, 23 Jan 2018 06:42:18 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id C1ACCE0942 for ; Tue, 23 Jan 2018 06:42:18 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 3C319335C4D for ; Tue, 23 Jan 2018 06:42:17 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id CB60D1CD for ; Tue, 23 Jan 2018 06:42:13 +0000 (UTC) From: "Mikhail Pukhlikov" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Mikhail Pukhlikov" Message-ID: <1515442192.8b51ac61a6604a63467055837d625ca776f51d9c.cynede@gentoo> Subject: [gentoo-commits] proj/dotnet:master commit in: Documentation/, / X-VCS-Repository: proj/dotnet X-VCS-Files: Documentation/DotnetCore-Bin.md Documentation/DotnetCore-Src.md readme.md X-VCS-Directories: / Documentation/ X-VCS-Committer: cynede X-VCS-Committer-Name: Mikhail Pukhlikov X-VCS-Revision: 8b51ac61a6604a63467055837d625ca776f51d9c X-VCS-Branch: master Date: Tue, 23 Jan 2018 06:42:13 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 87242fe7-629a-4996-ae2d-7e2fb8189a41 X-Archives-Hash: d66e0ea35739249ad05656e1df987e3e commit: 8b51ac61a6604a63467055837d625ca776f51d9c Author: grbd googlemail com> AuthorDate: Mon Jan 8 20:09:52 2018 +0000 Commit: Mikhail Pukhlikov gentoo org> CommitDate: Mon Jan 8 20:09:52 2018 +0000 URL: https://gitweb.gentoo.org/proj/dotnet.git/commit/?id=8b51ac61 Updated Source build docs Documentation/DotnetCore-Bin.md | 2 +- Documentation/DotnetCore-Src.md | 120 ++++++++++++++++++++++++++++++++++++++++ readme.md | 1 + 3 files changed, 122 insertions(+), 1 deletion(-) diff --git a/Documentation/DotnetCore-Bin.md b/Documentation/DotnetCore-Bin.md index d6b95ba..5176851 100644 --- a/Documentation/DotnetCore-Bin.md +++ b/Documentation/DotnetCore-Bin.md @@ -1,4 +1,4 @@ -# DotNet Core +# DotNet Core Binary Builds ## Binary Packages diff --git a/Documentation/DotnetCore-Src.md b/Documentation/DotnetCore-Src.md new file mode 100644 index 0000000..096fb60 --- /dev/null +++ b/Documentation/DotnetCore-Src.md @@ -0,0 +1,120 @@ +# DotNet Core Source Builds + +I've experimented with building .net core from source and put some notes together below for trying to build under gentoo. +Hopefully these might be useful for a future source based ebuild. + +make sure to use llvm/clang 4.0.1 not 5.0.1 which causes issues with the latest stable 2.0 release. +Although I think this has been fixed within master + +## Dotnet core sandbox issues + +One of the issues currently with dotnet core is that applications seem to fail when run from within the sandbox. +This includes dotnet restore or build + + * https://github.com/dotnet/cli/issues/8305 + * https://wiki.gentoo.org/wiki/Knowledge_Base:Overriding_environment_variables_per_package + +To exclude a particular package from the sandbox we can use the following + +First we use this to create a setting called nosandbox +``` +mkdir -p /etc/portage/env +echo 'FEATURES="-sandbox -usersandbox"' >> /etc/portage/env/nosandbox +``` + +Next we apply this to any ebuilds that need it +``` +echo 'dev-dotnet/dotnetcore-runtime nosandbox' >> /etc/portage/package.env +``` + +I should probably mention that as of writing the current source build of dotnetcore-runtime +doesn't use the dotnet restore command so it currently doesn't need this. But future versions may. + + +## CoreSetup + +Coresetup seems to be a set of scripts used to generate the runtime tar.gz +However I don't think these can be used currently to generate the sdk. + +I'm not sure core-setup actually builds source or just partially builds source and partially copies pre-compiled libraries in + +To clone the source +``` +git clone https://github.com/dotnet/core-setup.git +cd core-setup/ +git checkout v2.0.4 +``` + +To trigger the build +``` +./init-tools.sh +./build.sh -ConfigurationGroup=Release -SkipTests +``` + +The place to look for .tar.gz files is + + * Bin/gentoo-x64.Release/packages + * Bin/linux-x64.Release/packages + +From the looks of things the tarball gz is generated by the below target +``` +./Tools/msbuild.sh src/pkg/packaging/dir.proj /p:UsePrebuiltPortableBinariesForInstallers=true /flp:v=diag /p:TargetArchitecture=x64 /p:PortableBuild=false /p:ConfigurationGroup=Release /p:OSGroup=Linux /p:SharedFrameworkPublishDir=/root/test1/core-setup/Bin/obj/linux-x64.Release/sharedFrameworkPublish/ /target:GenerateTarBall +``` + +It's also worth checking out the commands under **buildpipeline/Core-Setup-Linux-BT.json** to see what's being run inside there + + +## Source Build + +Source build seems to be a set of scripts that sits on top of everything else including CoreSetup +But I've not managed to get it to work fully yet. + +``` +git clone https://github.com/dotnet/source-build.git +cd source-build +git checkout dev/release/2.0 +git submodule update --init --recursive +``` + +I've found you may need to edit **tools-local/tasks/Microsoft.DotNet.SourceBuild.Tasks/GetHostInformation.cs** +So that it always returns true and sets the OS to Linux + +To experiment building some stuff +``` +./build.sh /p:RootRepo=coreclr +./build.sh /p:RootRepo=sdk +``` + + +## Building CoreCLR / CoreFX directly + +If you want to try compiling the CoreCLR / CoreFX repo's directly + +In order to build the libraries a version of the dotnet cli / sdk is needed as part of a boostrap process +These typically end up un Tools/ +usually build.sh will call these scripts at the beginning +``` +./init_tools +./sync.sh +``` + +I've found that RuntimeOS needs to be specified for corefx to work right + +coreclr: +``` +./clean.sh -all +./build.sh -release -buildArch=x64 -SkipTests +``` + +corefx: +``` +./clean.sh -all +./build.sh -release -buildArch=x64 -SkipTests -RuntimeOS=rhel.7 +``` + +I've found that for some reason the build defaults to strict mode which treats warnings as errors +If this happens then one way around it is to add the following to the .csproj file +``` +CS8073 +``` + diff --git a/readme.md b/readme.md index da54f37..1604ed3 100644 --- a/readme.md +++ b/readme.md @@ -35,4 +35,5 @@ Dotnet Core For using dotnet core see - [Dotnet Core Binary packages](Documentation/DotnetCore-Bin.md) + - [Dotnet Core Source Build Notes](Documentation/DotnetCore-Src.md)