提交 dffcfbbb 编写于 作者: J jaredpar

Jenkins cross platform updates

This changes our cross plat build to install the desired version of Mono
on the machine as a part of the CI process.  This lowers the management
overhead of our Mac / Linux machines as we can use any machine in the pool
vs. having reserved, and custom maintained, machines for Roslyn.
上级 83c9c9bd
文件模式从 100644 更改为 100755
......@@ -14,6 +14,7 @@ usage()
XUNIT_VERSION=2.0.0-alpha-build2576
FULL_RUN=true
OS_NAME=$(uname -s)
while [[ $# > 0 ]]
do
opt="$1"
......@@ -132,6 +133,57 @@ build_roslyn()
fi
}
# Install the specified Mono toolset from our Azure blob storage.
install_mono_toolset()
{
TARGET=/tmp/$1
echo "Installing Mono toolset $1"
if [ -d $TARGET ]; then
echo "Already installed"
return
fi
pushd /tmp
rm $TARGET 2>/dev/null
curl -O https://dotnetci.blob.core.windows.net/roslyn/$1.tar.bz2
tar -jxf $1.tar.bz2
if [ $? -ne 0 ]; then
echo "Unable to download toolset"
exit 1
fi
popd
}
# This function will update the PATH variable to put the desired
# version of Mono ahead of the system one.
set_mono_path()
{
if [ "$CUSTOM_MONO_PATH" != "" ]; then
if [ ! -d "$CUSTOM_MONO_PATH" ]; then
echo "Not a valid directory $CUSTOM_MONO_PATH"
exit 1
fi
echo "Using mono path $CUSTOM_MONO_PATH"
PATH=$CUSTOM_MONO_PATH:$PATH
return
fi
if [ "$OS_NAME" = "Darwin" ]; then
MONO_TOOLSET_NAME=mono.mac.1
elif [ "$OS_NAME" = "Linux" ]; then
MONO_TOOLSET_NAME=mono.linux.1
else
echo "Error: Unsupported OS $OS_NAME"
exit 1
fi
install_mono_toolset $MONO_TOOLSET_NAME
PATH=/tmp/$MONO_TOOLSET_NAME/bin:$PATH
}
test_roslyn()
{
if [ "$FULL_RUN" != "true" ]; then
......@@ -170,23 +222,6 @@ if [ "$OS_NAME" = "Linux" ]; then
FULL_RUN=false
fi
if [ "$CUSTOM_MONO_PATH" != "" ]; then
if [ ! -d "$CUSTOM_MONO_PATH" ]; then
echo "Not a valid directory $CUSTOM_MONO_PATH"
exit 1
fi
echo "Using mono path $CUSTOM_MONO_PATH"
PATH=$CUSTOM_MONO_PATH:$PATH
else
echo Changing mono snapshot
. mono-snapshot mono/20150316155603
if [ $? -ne 0 ]; then
echo Could not set mono snapshot
exit 1
fi
fi
# NuGet on mono crashes about every 5th time we run it. This is causing
# Linux runs to fail frequently enough that we need to employ a
# temporary work around.
......@@ -194,6 +229,8 @@ echo Restoring NuGet packages
run_nuget restore src/Roslyn.sln
run_nuget install xunit.runners -PreRelease -Version $XUNIT_VERSION -OutputDirectory packages
set_mono_path
which mono
compile_toolset
save_toolset
clean_roslyn
......
Building a new Mono toolset
====
This document describes building a new Mono toolset for use in our Mac or Linux Jenkins jobs.
### Building
The new *toolset name* will be chosen as one of the following:
- Linux: mono.linux.`<version number>`
- Mac: mono.mac.`<version number>`
The value of *version number* will simply be the one number higher than the current version number of the toolset.
To build the toolset execute the following:
- Set `$PREFIX` to `/tmp/<toolset name>`
- Follow the remainder of the [Compiling Mono](http://www.mono-project.com/docs/compiling-mono/) instructions.
- Install the PCL references: `<roslyn dir>/build/linux/setup-pcl.sh /tmp/<toolset name>`
- Bzip the resulting directory. `tar -jcvf <toolset name>.tar.bz2 /tmp/<toolset name>`
- Upload the file to the Azure in the dotnetci storage account in the roslyn container.
- Send a PR to change [cibuild.sh](https://github.com/dotnet/roslyn/blob/master/cibuild.sh) to use the new toolset.
Note: This process needs to be repeated for both Mac and Linux.
### Existing toolsets
This table describes the existing Mono toolsets and the commit they were built from.
| Version | Linux | Mac |
| --- | --- | --- |
| 1 | [43af8d475d853c8408ddaddbed4cfd61d2919780](https://github.com/jaredpar/mono/commit/43af8d475d853c8408ddaddbed4cfd61d2919780) | [43af8d475d853c8408ddaddbed4cfd61d2919780](https://github.com/jaredpar/mono/commit/43af8d475d853c8408ddaddbed4cfd61d2919780) |
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册