Skip to content

Commit

Permalink
Merge pull request dotnet#3 from pgavlin/sn2
Browse files Browse the repository at this point in the history
Merge corefx/master into sn2.
  • Loading branch information
pgavlin committed Aug 7, 2015
2 parents c64f774 + d9f103c commit 909101b
Show file tree
Hide file tree
Showing 483 changed files with 46,181 additions and 23,747 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Want to make your libraries multi-platform? Want to see how much work is require

## New Targets

- [.NET Core 5](https://www.dotnetfoundation.org/netcore5): Has a modular design, employs side-by-side, and targets cross-platform scenarios. Side-by-side allows you to adopt new .NET Core versions without breaking other apps.
- [.NET Core 5](https://www.dotnetfoundation.org/netcore): Has a modular design, employs side-by-side, and targets cross-platform scenarios. Side-by-side allows you to adopt new .NET Core versions without breaking other apps.
- [ASP.NET 5](https://www.dotnetfoundation.org/aspnet-5): is a modern web-framework built on .NET Core 5 thus giving developers the same benefits.
- [.NET Native](http://blogs.msdn.com/b/dotnet/archive/2014/04/24/dotnetnative-performance.aspx): Improve performance of your Windows Store apps that run on x64 and ARM machines by using .NET Native's static compilation.

Expand Down
7 changes: 6 additions & 1 deletion dir.props
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<!-- Build Tools Versions -->
<PropertyGroup>
<BuildToolsVersion>1.0.25-prerelease-00066</BuildToolsVersion>
<BuildToolsVersion>1.0.25-prerelease-00069</BuildToolsVersion>
<DnxVersion>1.0.0-beta5-12101</DnxVersion>
<DnxPackageName Condition="'$(DnxPackageName)' == '' and '$(OsEnvironment)'!='Unix'">dnx-coreclr-win-x86.$(DnxVersion)</DnxPackageName>
<DnxPackageName Condition="'$(DnxPackageName)' == '' and '$(OsEnvironment)'=='Unix'">dnx-mono.$(DnxVersion)</DnxPackageName>
Expand Down Expand Up @@ -235,6 +235,11 @@
<TargetsUnix Condition="'$(TargetsLinux)' == 'true' or '$(TargetsOSX)' == 'true' or '$(TargetsFreeBSD)' == 'true'">true</TargetsUnix>
</PropertyGroup>

<PropertyGroup>
<!-- Don't run tests if we're building another platform's binaries on Windows -->
<SkipTests Condition="'$(SkipTests)'=='' and ('$(OsEnvironment)'=='Windows_NT' and '$(TargetsWindows)'!='true')">true</SkipTests>
</PropertyGroup>

<PropertyGroup>
<!-- Work around known Dev14 bug - see
https://connect.microsoft.com/VisualStudio/feedback/details/1000796/connect-file-uap-props-not-found-cant-build-a-portable-lib-on-vs14
Expand Down
52 changes: 32 additions & 20 deletions run-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,25 @@ usage()
echo "usage: run-test [options]"
echo
echo "Input sources:"
echo " --coreclr-bins <location> Location of root of the binaries directory"
echo " containing the linux/mac coreclr build"
echo " default: <repo_root>/bin/Product/<OS>.x64.<Configuration>"
echo " --mscorlib-bins <location> Location of the root binaries directory containing"
echo " the linux/mac mscorlib.dll"
echo " default: <repo_root>/bin/Product/<OS>.x64.<Configuration>"
echo " --corefx-tests <location> Location of the root binaries location containing"
echo " the windows tests"
echo " default: <repo_root>/bin/tests/Windows_NT.AnyCPU.<Configuration>"
echo " --corefx-bins <location> Location of the linux/mac corefx binaries"
echo " default: <repo_root>/bin/<OS>.AnyCPU.<Configuration>"
echo " --coreclr-bins <location> Location of root of the binaries directory"
echo " containing the linux/mac coreclr build"
echo " default: <repo_root>/bin/Product/<OS>.x64.<Configuration>"
echo " --mscorlib-bins <location> Location of the root binaries directory containing"
echo " the linux/mac mscorlib.dll"
echo " default: <repo_root>/bin/Product/<OS>.x64.<Configuration>"
echo " --corefx-tests <location> Location of the root binaries location containing"
echo " the windows tests"
echo " default: <repo_root>/bin/tests/Windows_NT.AnyCPU.<Configuration>"
echo " --corefx-bins <location> Location of the linux/mac corefx binaries"
echo " default: <repo_root>/bin/<OS>.AnyCPU.<Configuration>"
echo " --corefx-native-bins <location> Location of the linux/mac native corefx binaries"
echo " default: <repo_root>/bin/<OS>.x64.<Configuration>"
echo
echo "Flavor/OS options:"
echo " --configuration <config> Configuration to run (Debug/Release)"
echo " default: Debug"
echo " --os <os> OS to run (OSX/Linux)"
echo " default: detect current OS"
echo " --configuration <config> Configuration to run (Debug/Release)"
echo " default: Debug"
echo " --os <os> OS to run (OSX/Linux)"
echo " default: detect current OS"
echo
echo "Execution options:"
echo " --restrict-proj <regex> Run test projects that match regex"
Expand Down Expand Up @@ -130,13 +132,15 @@ create_test_overlay()
echo "Corefx binaries not found at $CoreFxBins"
exit 1
fi
find $CoreFxBins -name '*.dll' -exec cp '{}' "$OverlayDir" ";"
find $CoreFxBins -name '*.dll' -and -not -name "*Test*" -exec cp '{}' "$OverlayDir" ";"

# Then the native CoreFX binaries
#
# TODO: Currently, CI does not build the native CoreFX components so build them here
# in the test phase for now.
( $ProjectRoot/src/Native/build.sh && cp $ProjectRoot/bin/$OS.x64.$Configuration/Native/* $OverlayDir ) || exit 1
if [ ! -d $CoreFxNativeBins ]
then
echo "Corefx native binaries should be built (use build.sh in root)"
exit 1
fi
cp $CoreFxNativeBins/* $OverlayDir
}

copy_test_overlay()
Expand Down Expand Up @@ -220,6 +224,9 @@ do
--corefx-bins)
CoreFxBins=$2
;;
--corefx-native-bins)
CoreFxNativeBins=$2
;;
--restrict-proj)
TestSelection=$2
;;
Expand Down Expand Up @@ -257,6 +264,11 @@ then
CoreFxBins="$ProjectRoot/bin/$OS.AnyCPU.$Configuration"
fi

if [ "$CoreFxNativeBins" == "" ]
then
CoreFxNativeBins="$ProjectRoot/bin/$OS.x64.$Configuration/Native"
fi

# Check parameters up front for valid values:

if [ ! "$Configuration" == "Debug" ] && [ ! "$Configuration" == "Release" ]
Expand Down
2 changes: 1 addition & 1 deletion src/.nuget/packages.Unix.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.DotNet.BuildTools" version="1.0.25-prerelease-00066" />
<package id="Microsoft.DotNet.BuildTools" version="1.0.25-prerelease-00069" />
<package id="Microsoft.DotNet.BuildTools.ApiTools" version="1.0.0-prerelease" />
<package id="dnx-mono" version="1.0.0-beta5-12101" />
<package id="Microsoft.Net.ToolsetCompilers" version="1.0.0-rc3-20150510-01" />
Expand Down
2 changes: 1 addition & 1 deletion src/.nuget/packages.Windows_NT.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.DotNet.BuildTools" version="1.0.25-prerelease-00066" />
<package id="Microsoft.DotNet.BuildTools" version="1.0.25-prerelease-00069" />
<package id="dnx-coreclr-win-x86" version="1.0.0-beta5-12101" />
<package id="Microsoft.DotNet.BuildTools.ApiTools" version="1.0.0-prerelease" />
</packages>
68 changes: 68 additions & 0 deletions src/Common/src/Interop/Interop.CheckedAccess.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System;

internal static partial class Interop
{
public static unsafe void CheckBounds(byte* buffer, int bufferSize, byte* offset, int accessSize)
{
var start = checked((int)(IntPtr)(offset - buffer));
var end = checked(start + accessSize);
if (start < 0 || end > bufferSize)
{
throw new IndexOutOfRangeException();
}
}

public static unsafe void CheckBounds(byte* buffer, int bufferSize, byte* offset)
{
CheckBounds(buffer, bufferSize, offset, sizeof(byte));
}

public static unsafe void CheckBounds(byte* buffer, int bufferSize, ushort* offset)
{
CheckBounds(buffer, bufferSize, (byte*)offset, sizeof(ushort));
}

public static unsafe void CheckBounds(byte* buffer, int bufferSize, uint* offset)
{
CheckBounds(buffer, bufferSize, (byte*)offset, sizeof(uint));
}

public static unsafe byte CheckedRead(byte* buffer, int bufferSize, byte* offset)
{
CheckBounds(buffer, bufferSize, offset);
return *offset;
}

public static unsafe ushort CheckedRead(byte* buffer, int bufferSize, ushort* offset)
{
CheckBounds(buffer, bufferSize, offset);
return *offset;
}

public static unsafe uint CheckedRead(byte* buffer, int bufferSize, uint* offset)
{
CheckBounds(buffer, bufferSize, offset);
return *offset;
}

public static unsafe void CheckedWrite(byte* buffer, int bufferSize, byte* offset, byte value)
{
CheckBounds(buffer, bufferSize, offset);
*offset = value;
}

public static unsafe void CheckedWrite(byte* buffer, int bufferSize, ushort* offset, ushort value)
{
CheckBounds(buffer, bufferSize, offset);
*offset = value;
}

public static unsafe void CheckedWrite(byte* buffer, int bufferSize, uint* offset, uint value)
{
CheckBounds(buffer, bufferSize, offset);
*offset = value;
}
}
73 changes: 0 additions & 73 deletions src/Common/src/Interop/Interop.PlatformDetection.cs

This file was deleted.

1 change: 1 addition & 0 deletions src/Common/src/Interop/Linux/libc/Interop.inotify.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ internal enum NotifyEvents
IN_Q_OVERFLOW = 0x00004000,
IN_IGNORED = 0x00008000,
IN_ONLYDIR = 0x01000000,
IN_DONT_FOLLOW = 0x02000000,
IN_EXCL_UNLINK = 0x04000000,
IN_ISDIR = 0x40000000,
}
Expand Down
34 changes: 34 additions & 0 deletions src/Common/src/Interop/OSX/libc/Interop.addrinfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System;
using System.Runtime.InteropServices;
using System.Text;

using socklen_t = System.UInt32;

internal static partial class Interop
{
internal static partial class libc
{
public const int AI_NUMERICHOST = 0x0004; // Don't use name resolution.
public const int AI_NUMERICSERV = 0x1000; // Don't use name resolution.

public const int NI_NUMERICHOST = 2; // Don't try to look up hostname.

public const int EAI_BADFLAGS = 3; // Invalid value for `ai_flags' field.
public const int EAI_NONAME = 8; // NAME or SERVICE is unknown.

public unsafe struct addrinfo
{
public int ai_flags;
public int ai_family;
public int ai_socktype;
public int ai_protocol;
public socklen_t ai_addrlen;
public byte* ai_canonname;
public sockaddr* ai_addr;
public addrinfo* ai_next;
}
}
}
65 changes: 65 additions & 0 deletions src/Common/src/Interop/OSX/libc/Interop.sockaddr.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System;
using System.Runtime.InteropServices;
using System.Text;

using in_port_t = System.UInt16;
using sa_family_t = System.Byte;

internal static partial class Interop
{
internal static partial class libc
{
public const sa_family_t AF_UNSPEC = 0; // Unspecified.
public const sa_family_t AF_UNIX = 1; // Local to host.
public const sa_family_t AF_INET = 2; // IP protocol family.
public const sa_family_t AF_INET6 = 30; // IP version 6.

// NOTE: this type is incomplete, and its values should never be used directly.
// Specific sockaddr types (e.g. sockaddr_in or sockaddr_in6) should be used instead.
public unsafe struct sockaddr
{
// Disable CS0649: Field 'Interop.libc.sockaddr.sa_family' is never assigned to,
// and will always have its default value 0
#pragma warning disable 649
public byte sa_len;
public sa_family_t sa_family;
#pragma warning restore 649
}

public struct in_addr
{
public uint s_addr; // Address in network byte order.
}

public struct sockaddr_in
{
public const int Size = 16;

public byte sin_len; // sizeof(sockaddr_in)
public sa_family_t sin_family; // Address family: AF_INET
public in_port_t sin_port; // Port in network byte order
public in_addr sin_addr; // Internet address
private ulong padding; // 8 bytes of padding
}

public unsafe struct in6_addr
{
public fixed byte s6_addr[16]; // IPv6 address
}

public struct sockaddr_in6
{
public const int Size = 28;

public byte sin6_len; // sizeof(sockaddr_in6)
public sa_family_t sin6_family; // AF_INET6
public in_port_t sin6_port; // Port number
public uint sin6_flowinfo; // IPv6 flow information
public in6_addr sin6_addr; // IPv6 address
public uint sin6_scope_id; // Scope ID
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,8 @@ internal enum FileStatsFlags

[DllImport(Libraries.IOInterop, SetLastError = true)]
internal static extern int Stat(string path, out FileStats output);

[DllImport(Libraries.IOInterop, SetLastError = true)]
internal static extern int LStat(string path, out FileStats output);
}
}
Loading

0 comments on commit 909101b

Please sign in to comment.