FileSystem.DriveInfo.dll coverage raised to at or near testable maximum. Added several scenarios that weren't present before and also split up Volume Label setting/getting to several tests so that errors can be better diagnosed.
Commit migrated from https://github.com/dotnet/corefx/commit/6a0beb6b176ad555abe6ba7d9992245400d8f442
This change updates the assembly versions of all of the corefx assemblies
as needed after we shipped stable versions. Assemblies with API differences
get a minor version bump. Assemblies with only bugfixes get a build version
bump.
In order to facilitate this I had to update the reference assemblies, so I took
the opportunity to port them all to the open.
[tfs-changeset: 1514419]
Commit migrated from https://github.com/dotnet/corefx/commit/40723b795917f2e98b64d45c17effb2546dd0cae
This change modifies the build to consume the stable version where available.
This disables building the dowlevel packages since we shipped them once as stable and we're done.
From here on out, we'll only build the latest version (except for a servicing event, which would
be handled by syncing to a hash).
I can't rev the package versions in the normal way yet (by modifying the assembly version of the contents)
because that turned out to be too big of a problem to tackle in this change. Instead I added a
parameter to the task that calculates package versions to do the rev for anything that was
stable, but only when building the package itself, not when calculating the dependencies.
This has the downside of not permitting a dependency on a incremented pre-release version if we've
shipped a stable version, but that is a small point in time problem until I can rev the assembly
versions.
[tfs-changeset: 1508664]
Commit migrated from https://github.com/dotnet/corefx/commit/ee1ec2891c7c65b46fa9dfb078636be503bb2a60
Start on unblocking extended syntax. Moves some shared code to PathInternal.
Start adding tests for key scenarios. Temporarily use local libraries when
testing FileSystem (until we get an updated Runtime.Extensions package).
Commit migrated from https://github.com/dotnet/corefx/commit/72429b2ba76ebecb4c422a1d5eec05daf279b05e
Previously, System.IO.Path was implemented in mscorlib (with calls into Win32 on Windows / the Win32 PAL layer in libcoreclr on Unix) and type-forwarded from System.Runtime.Extensions. With dotnet/corefx#2234, we switched the Windows build to using System.IO.Path from System.Runtime.Extensions and Path.cs from corefx, but the Unix version was left still using the mscorlib implementation. One of the reasons for switching to the Path.cs in corefx, however, was to better enable a bunch of fixes to the behavior of the Unix implementation.
This change implements Path.cs in corefx for Unix and switches the Unix builds (Linux, OS X, and FreeBSD) over to using the implementation in corefx rather than type-forwarding to mscorlib.
Primary changes:
- Defined MaxPath / MaxComponent length in the Unix build in terms of pathconf
- Implemented the Unix build's NormalizePath to properly handle normalizing unnecessary "/", ".", and ".."s in the path.
- Implemented the Unix build's GetTempPath in terms of the TMPDIR environment variable (same logic that's in the Win32 PAL layer's implementation).
- Implemented the Unix build's GetTempFileName in terms of mkstemps.
- Implemented the Unix build's GetRandomFileName in terms of OpenSSL's RAND_pseudo_bytes, same as is done in System.Security.Cryptography.RandomNumberGenerator (which we can't reference due to layering).
- Centralized the wrapping of getcwd, which is now used from both System.Runtime.Extensions and System.IO.FileSystem. The previous usage of it always created a temporary array of size MaxPath, which can now be quite big, so the wrapper first tries to use stack space, and then graduates to retrying with larger and larger buffer sizes.
- Centralized the MaxPath and MaxName logic, which is now used by three libraries: System.Diagnostics.Process, System.IO.FileSystem, and now System.Runtime.Extensions.
- Centralized the throwing of PathTooLongException, as it now requires arguments for how long are the maximum path and component names.
- Cleaned up a few other minor things in the shared Path.cs (e.g. naming Boolean arguments) that were confusing me as I was working through the code.
- Added FreeBSD to the .sln and .csproj files, as otherwise the FreeBSD build for this library would be broken (previously it inherited the mscorlib implementation as did the other Unix OSes).
- Added a bunch of tests, some general across both Windows and Unix, but others specifically focused on Unix, which is more lenient than is Windows in the paths it allows.
Commit migrated from https://github.com/dotnet/corefx/commit/c4bc3bbfae8a9bf50defcfb8d6e13905f1209240
This change adds the lock files to repo to ensure we build against a stable set of dependencies. To explicitly update dependencies use build.cmd /T:RestorePackages /P:LockDependencies=true and this will pick up the latest depenedencies.
Existing projects adding new dependencies will automatically update the lock file incrementally.
New projects should make sure to check their lock file in with locked set to true.
[tfs-changeset: 1474296]
Commit migrated from https://github.com/dotnet/corefx/commit/d2fbc005707933db1cebca035d6cd6073af6cae4
Latest packages are now on dotnet-core myget feed.
This should address a many of the warnings in the build. I will follow up with another change to address the rest.
This change brings in the latest build tools with updates to consume "latest" packages (* versions).
I've updated every project in the repo to use * versioning for dependencies.
The new packages can be used to resolve runtime assets as well (like clrcompression.dll) so I have removed the custom code in System.IO.Compression to copy this dll. Instead the test project references the actual System.IO.Compression package and sets the correct runtime IDs to pull out the resources. The System.IO.Compression.dll from the package is not used since the project reference takes precedence.
I had to workaround an issue in System.Xml.XmlSerializer with the current packages: System.Runtime.WindowsRuntime 4.0.0 has a depedendency on "windows" package which doesn't exist. This was caused by our auto-generation task not filtering the winrt reference in the reference assembly's surface area. I've fixed this in a separate change and we can remove the workaround once we have a new set of packages. https://github.com/dotnet/corefx/issues/1761
I also had to add a dependency to System.Security.Cryptography.Hashing.Algorithms\tests due to an issue with DNX. It's not honoring the dependency group with no targetFramework when another dependency group exists in the nuspec. This is inconsistent with nuget v2 and should be fixed in DNX. https://github.com/aspnet/dnx/issues/1881
[tfs-changeset: 1471885]
Commit migrated from https://github.com/dotnet/corefx/commit/08c0d8628ef621fbd44d7aaa85b3239616a6b108
DNX and BuildTools now support all of the nuget v2 conventions that we depend on so we can
move all remaining nuget v2 packages to the project.json file and eliminate packages.config.
This change also adds "frameworks" to the project.json so that dnu restore can calculate
applicable assets. I am not yet using "runtimes" in the project.json since we are still resolving
our runtime assets manually (eg: build tools copies known files from packages). A future
change will move us to using our runtime packages and add runtimes sections to projects
as appropriate.
Commit migrated from https://github.com/dotnet/corefx/commit/eb35a304c7e89e8b4335ed13c5d23706360d49a4
There are ~110 tests that have been disabled with an ActiveIssue for PlatformID.Linux | PlatformID.OSX. To simplify this and to avoid lots of additional churn when additional Unix-based platforms are added, I've added PlatformID.AnyUnix = Linux | OSX, and replaced all usage of Linux | OSX with just AnyUnix. When new platforms are added, we can simply add to the enum, expand the meaning of AnyUnix, and most tests meant to be disabled for Unix will automatically be disabled.
Commit migrated from https://github.com/dotnet/corefx/commit/c96932da11940e0bae05de8e364eac90a6e1786b
Most test projects should now successfully run on both Linux and OSX. Updated the csproj files to indicate the few places that's not the case. Microsoft.Win32.Registry and System.ServiceProcess.ServiceController are both Windows-only, and System.IO.FileSystem.DriveInfo currently lacks an OSX-based implementation.
Commit migrated from https://github.com/dotnet/corefx/commit/d60a1a09a6588d38aa6e355517da51d6dfd544eb
Most of our testing until now has been on Linux. This PR represents a pass through the tests on OSX and provides fixes to get the System.IO.FileSystem, System.IO.Pipes, and System.IO.MemoryMappedFiles tests passing at 100%. Most of these fixes are product fixes, with just a few test fixes.
Primary src fixes:
- Lots of named values (errors, open flags, sysconf names, etc.) have different values across Linux and OSX: I've fixed those to be specific to the platform being compiled for. (In the future, we should consider introducing a native shim layer through which we make _all_ calls to Unix and have it surface a consistent view, so that we don't have to worry about this kind of issue.)
- Some functions or options to functions being used on Linux don't exist on OSX, e.g. madvise's DONTFORK, posix_fadvise, etc.; these have either been removed if not truly needed or moved behind the PAL layer to only be used on Linux.
- Some functions (e.g. shm_open) have different behavior from Linux. For example, shm_open doesn't appear to work well with shared memory objects, such as not allowing MAP_PRIVATE and not supporting PROT_EXEC (though the OSX man pages don't mention this). In such cases, I've implemented a fallback, e.g. on OSX we use a temporary file rather than a shared memory object.
- Some functions have subtle differences around edge cases, e.g. mmap on Linux appears to allow the creation of a map with length that goes beyond that of the underlying medium, but then fails when trying to use it, whereas OSX moves the failure to the mmap call itself. I've implemented workarounds to smooth over these differences.
- Various error conditions were resulting in the wrong exception type based on different exception codes being returned on OSX than on Linux, e.g. additional error codes needed to be mapped to IOException when rmdir fails.
- Replaced direct usage of getenv through P/Invoke with calls to Environment.GetEnvironmentVariable. (These are a holdover from when we didn't yet have GetEnvironmentVariable available.)
- Fixed up a few places we could be using CheckIo but instead had effectively written out its implementation manually.
Primary test fixes:
- Some of the file system tests are just plain buggy, regardless of platform, with timing issues that are more likely to show up on a debug runtime. I've fixed the ones that manifested while I was doing this testing, but the file system tests really deserved to be overhauled in general.
- Windows' implementation of File/DirectoryInfo returns default values for CreationTime when created for a file that doesn't exist; this appears to be purely for back compat with previously buggy behavior, so I changed the test to only verify this on Windows, rather than implement similar buggy behavior on Linux/OSX.
- A few test cases that were previously exempted for Linux also needed to be exempted for OSX.
- Re-enabled the System.Dynamic.Runtime.Tests now that the associated runtime error that was causing them to fail has been fixed.
Commit migrated from https://github.com/dotnet/corefx/commit/5a912670b442f7f7984b6d7f0be190213f726fd4
This change updates all projects to the latest CoreFx packages which make use of nuget v3 features and thus require project.json. Packages.config remains for the packages which are not yet compatible with the new build task (mainly because we need to resolve to PCL folders).
The entire change was done by a tool in order to not miss any dependencies, and ensure we have project items for the packages.config/project.json. One side effect of using the tool is some reformatting of whitespace in the projects.
Commit migrated from https://github.com/dotnet/corefx/commit/e729c5353070b71aedff8f1300ae838573813faf
Working through the tests on Unix revealed some minor issues in the library, e.g. a missing parameter name in an exception, an exception not being thrown when it should. This commit fixes those issues, and removes some unnecessary code.
Commit migrated from https://github.com/dotnet/corefx/commit/9376089a139de6afdbe8d7e69169cc9a488b2f8a
This change removes the closed libraries sources for libraries which we are now building in the open. Stub project files are left in the closed libraries which improt sources from the open for various build configurations.
Also includes these two changes which were not yet ported to open:
- [Serialization]: DCS/DCJS fails to serialize/deserialize XElement type - regression
- Change namespace of System.Xml.XPath.XmlDocument extensions
Validated by pre-checkin gauntlet build dotnet/corefx#150320.14337
[tfs-changeset: 1437136]
Commit migrated from https://github.com/dotnet/corefx/commit/89881048ba6bb6adca5253024ea59e8aa8790a6a
Previously, we used the catch all OS=Unix property in MSBuild to
determine if we were building for Windows vs Unix, and we shared the
same MSIL between Linux and OSX. However, we have already started to
take dependencies on Linux specific APIs and we plan on using OSX
specific APIs very soon.
We don't want to try to ship MSIL that contains both Linux and OSX
specific implementations of a feature, so the build system needs to
change a little.
We'll continue to use the OS property as the entry point for the build
to specificy what platform you want to build for. However, we now have
three platforms:
1. Windows_NT
2. Linux
3. OSX
However, the value of the OS property should not be tested directly,
instead we introduce properties about the target platform itself:
1. TargetsWindows
2. TargetsUnix
3. TargetsLinux
4. TargetsOSX
Code which works the same across Linux and OSX should be guarded by
TargetsUnix (which is true when OS is either 'Linux' or 'OSX'). Code
specific to one OS can be guarded with either TargetsLinux or
TargetsUnix.
In this change, I have simply rewritten all the '$(OS)' == 'Unix'
conditions to '$(TargetsUnix)' == 'true'. A few libraries may do Linux
specific stuff, but we will clean up that debt when we go to flesh out
the OSX implementations.
Commit migrated from https://github.com/dotnet/corefx/commit/4d07173fbf86631d49ed56623581eff9cb7d3f87