Merge pull request #13864 from dotnet/marcpopMSFT-fixdebbuild

Fix the deb build
This commit is contained in:
Marc Paine 2022-06-08 13:05:42 -07:00 committed by GitHub
commit fd0c042c55
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 10 additions and 144 deletions

View file

@ -156,13 +156,6 @@ stages:
strategy: strategy:
matrix: matrix:
${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}: ${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}:
Build_Ubuntu_16_04_Debug_x64:
_BuildConfig: Debug
_DockerParameter: '--docker ubuntu.16.04'
_LinuxPortable: ''
_RuntimeIdentifier: ''
_BuildArchitecture: 'x64'
_TestArg: $(_NonWindowsTestArg)
Build_Ubuntu_18_04_Debug_x64: Build_Ubuntu_18_04_Debug_x64:
_BuildConfig: Debug _BuildConfig: Debug
_DockerParameter: '--docker ubuntu.18.04' _DockerParameter: '--docker ubuntu.18.04'
@ -190,6 +183,7 @@ stages:
_LinuxPortable: '' _LinuxPortable: ''
_RuntimeIdentifier: '' _RuntimeIdentifier: ''
_BuildArchitecture: 'x64' _BuildArchitecture: 'x64'
_AdditionalBuildParameters: '/p:BuildSdkDeb=true'
_TestArg: $(_NonWindowsTestArg) _TestArg: $(_NonWindowsTestArg)
Build_Rhel_7_2_Release_x64: Build_Rhel_7_2_Release_x64:
_BuildConfig: Release _BuildConfig: Release
@ -297,13 +291,13 @@ stages:
_AdditionalBuildParameters: '/p:HostOSName="linux-musl"' _AdditionalBuildParameters: '/p:HostOSName="linux-musl"'
Build_Linux_Portable_Deb_Release_x64: Build_Linux_Portable_Deb_Release_x64:
_BuildConfig: Release _BuildConfig: Release
_DockerParameter: '--docker ubuntu.16.04' _DockerParameter: '--docker ubuntu.18.04'
_LinuxPortable: '--linux-portable' _LinuxPortable: '--linux-portable'
_RuntimeIdentifier: '' _RuntimeIdentifier: ''
_BuildArchitecture: 'x64' _BuildArchitecture: 'x64'
# Do not publish zips and tarballs. The linux-x64 binaries are # Do not publish zips and tarballs. The linux-x64 binaries are
# already published by Build_LinuxPortable_Release_x64 # already published by Build_LinuxPortable_Release_x64
_AdditionalBuildParameters: '/p:PublishBinariesAndBadge=false' _AdditionalBuildParameters: '/p:PublishBinariesAndBadge=false;BuildSdkDeb=true'
_TestArg: $(_NonWindowsTestArg) _TestArg: $(_NonWindowsTestArg)
Build_Linux_Portable_Rpm_Release_x64: Build_Linux_Portable_Rpm_Release_x64:
_BuildConfig: Release _BuildConfig: Release

View file

@ -1,65 +0,0 @@
#
# Copyright (c) .NET Foundation and contributors. All rights reserved.
# Licensed under the MIT license. See LICENSE file in the project root for full license information.
#
FROM ubuntu:16.04
# Install the base toolchain we need to build anything (clang, cmake, make and the like)
# this does not include libraries that we need to compile different projects, we'd like
# them in a different layer.
RUN rm -rf rm -rf /var/lib/apt/lists/* && \
apt-get clean && \
apt-get update && \
apt-get install -y cmake \
make \
llvm-3.5 \
clang-3.5 \
git \
curl \
tar \
sudo && \
apt-get clean
# Install Build Prereqs
RUN apt-get -qqy install \
debhelper \
build-essential \
devscripts && \
apt-get clean
# Dependencies for CoreCLR and CoreFX
RUN apt-get install -y libunwind8 \
libkrb5-3 \
libicu55 \
liblttng-ust0 \
libssl1.0.0 \
zlib1g \
libuuid1 \
liblldb-3.6 && \
apt-get clean
# Setup User to match Host User, and give superuser permissions
ARG USER_ID=0
RUN useradd -m code_executor -u ${USER_ID} -g sudo
RUN echo 'code_executor ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
# With the User Change, we need to change permissions on these directories
RUN chmod -R a+rwx /usr/local
RUN chmod -R a+rwx /home
RUN chmod -R 755 /usr/lib/sudo
# Set working directory
ARG WORK_DIR
WORKDIR ${WORK_DIR}
# Set up Azure Artifacts credential provider.
# We download the installer and execute it using ${USER_ID} so that the installer
# put the NuGet plugins in the correct $HOME/.nuget folder.
RUN curl -O https://raw.githubusercontent.com/Microsoft/artifacts-credprovider/master/helpers/installcredprovider.sh
RUN chmod +x ./installcredprovider.sh
# Set user to the one we just created
USER ${USER_ID}
RUN ./installcredprovider.sh

View file

@ -1,64 +0,0 @@
#
# Copyright (c) .NET Foundation and contributors. All rights reserved.
# Licensed under the MIT license. See LICENSE file in the project root for full license information.
#
# Dockerfile that creates a container suitable to build dotnet-cli
FROM ubuntu:16.10
# Misc Dependencies for build
RUN apt-get update && \
apt-get -qqy install \
curl \
unzip \
gettext \
sudo && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# This could become a "microsoft/coreclr" image, since it just installs the dependencies for CoreCLR (and stdlib)
RUN apt-get update && \
apt-get -qqy install \
libunwind8 \
libkrb5-3 \
libicu57 \
liblttng-ust0 \
libssl1.0.0 \
zlib1g \
libuuid1 \
liblldb-3.5 && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Install Build Prereqs
RUN apt-get update && \
apt-get -qqy install \
debhelper \
build-essential \
devscripts \
git \
cmake \
clang-3.5 && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Use clang as c++ compiler
RUN update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-3.5 100
RUN update-alternatives --set c++ /usr/bin/clang++-3.5
# Setup User to match Host User, and give superuser permissions
ARG USER_ID=0
RUN useradd -m code_executor -u ${USER_ID} -g sudo
RUN echo 'code_executor ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
# With the User Change, we need to change permissions on these directories
RUN chmod -R a+rwx /usr/local
RUN chmod -R a+rwx /home
RUN chmod -R 755 /usr/lib/sudo
# Set user to the one we just created
USER ${USER_ID}
# Set working directory
ARG WORK_DIR
WORKDIR ${WORK_DIR}

View file

@ -10,6 +10,8 @@ RUN apt-get update && \
apt-get -qqy install \ apt-get -qqy install \
curl \ curl \
libcurl4 \ libcurl4 \
devscripts \
debhelper \
sudo && \ sudo && \
apt-get clean && \ apt-get clean && \
rm -rf /var/lib/apt/lists/* rm -rf /var/lib/apt/lists/*

View file

@ -228,7 +228,7 @@
</Target> </Target>
<Target Name="BuildSdkDeb" <Target Name="BuildSdkDeb"
Condition=" '$(IsDebianBaseDistro)' == 'True' AND '$(DebuildPresent)' == 'true' " Condition=" '$(IsDebianBaseDistro)' == 'True' AND '$(BuildSdkDeb)' == 'true' "
DependsOnTargets="PrepareDotnetDebDirectories; DependsOnTargets="PrepareDotnetDebDirectories;
GetAspNetSharedFxInstallArgs;" GetAspNetSharedFxInstallArgs;"
Inputs="@(CLISdkFiles);@(TemplatesFiles);@(ManifestFiles)" Inputs="@(CLISdkFiles);@(TemplatesFiles);@(ManifestFiles)"
@ -342,7 +342,7 @@
</Target> </Target>
<Target Name="TestSdkDeb" <Target Name="TestSdkDeb"
Condition=" '$(CLIBUILD_SKIP_TESTS)' != 'true' and '$(IsDebianBaseDistro)' == 'True' and '$(DebuildPresent)' == 'true' " Condition=" '$(CLIBUILD_SKIP_TESTS)' != 'true' and '$(IsDebianBaseDistro)' == 'True' and '$(BuildSdkDeb)' == 'true' "
DependsOnTargets="GetAspNetSharedFxInstallArgs" DependsOnTargets="GetAspNetSharedFxInstallArgs"
Inputs="$(DownloadedRuntimeDepsInstallerFile); Inputs="$(DownloadedRuntimeDepsInstallerFile);
$(DownloadedNetCoreAppHostPackInstallerFile); $(DownloadedNetCoreAppHostPackInstallerFile);
@ -436,13 +436,12 @@
<!-- Check if it returned 0 --> <!-- Check if it returned 0 -->
<PropertyGroup> <PropertyGroup>
<DebuildPresent>false</DebuildPresent> <BuildSdkDeb Condition=" '$(BuildSdkDeb)' == '' or '$(DebuildExitCode)' != '0' ">false</BuildSdkDeb>
<DebuildPresent Condition=" '$(DebuildExitCode)' == '0' ">true</DebuildPresent>
</PropertyGroup> </PropertyGroup>
<!-- Workaround for Ubuntu16 Jenkins https://github.com/dotnet/core-setup/issues/167 --> <!-- Workaround for Ubuntu16 Jenkins https://github.com/dotnet/core-setup/issues/167 -->
<Message Condition=" '$(DebuildPresent)' != 'true' " <Message Condition=" '$(BuildSdkDeb)' == 'false' "
Text="Debuild Not found, Debian packages will not be built." Text="Debuild Not found or BuildSdkDeb not set, Debian packages will not be built."
Importance="High" /> Importance="High" />
</Target> </Target>
</Project> </Project>