Changed the way the UnixFileSystem does File moving; it was previously implemented using the rename syscall but now uses a combination of link and unlink. The side effect of this change is that the FileSystemWatcher will now treat File.Move as a deletion.
- Resolvesdotnet/corefx#2460
- Removed all tests from FileSystemWatcher that made calls to File.Move and consolidated them into a new file: FileSystemWatcher.MoveFile.cs. This new file separates tests into Windows and Unix categories and uses Theories to supply the input WatcherChangeType and whether a move should trigger an event for the given type. If we later decide to change the Unix behavior of MoveFile, changing the FileSystemWatcher tests will be a simple matter of flipping the boolean values for the affected tests.
- Fixed some comments in UnixFileSystem to be more specific to FileSystemWatcher
- Changed variable names for FSW Move tests to be more descriptive
- Modified FSW MoveFile and Utitlity helper classes to use guids so that they may be run concurrently.
Commit migrated from https://github.com/dotnet/corefx/commit/cae7c5116d46c0d98e6f0fb3526fa2a15945501a
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
Several projects are no longer loading correctly in VS for me. It's happening for projects and only for projects that contain a <ProjectTypeGuids/> node in the .csproj, related to portable libraries. These entries are unnecessary, and I'm simply deleting them, after which the projects load in VS successfully.
Commit migrated from https://github.com/dotnet/corefx/commit/6896000d173190ad945fac32834c2d30815d8a29
In my code review of @sokket's new FileSystemWatcher tests (dotnet/corefx#2347), I'd encouraged him to clean up some of the AutoResetEvents that were being created, in the name of good hygiene. But this introduces a sporadic failure in the tests due to a race condition.
The way that FileSystemWatcher is designed, stopping events on the instance doesn't actually prevent any in-progress operations from being processed, nor does stopping block until all in-process events have completed. As such, if after stopping processing we dispose of an event that's going to be set by one of the callbacks, it's possible such a set could occur from an in-flight operation after we've already disposed of the event, leading to an ObjectDisposedException that crashes the tests.
I contemplated adding synchronization to FSW itself to avoid these kinds of race conditions, e.g. by ensuring that the call to set "Enabled = false;" won't return until all in-progress operations have completed, but that could cause deadlocks not currently possible. As such, I simply stopped explicitly disposing of the events created in the tests, leaving the cleanup to finalization (as is already done for most other events in the tests).
Commit migrated from https://github.com/dotnet/corefx/commit/43bfad63384aee6eb7e20c064054c5e1cd00fbf0
I tried to be clever in the calculation, but really we don't need to be very accurate so long as we can force the error. This is still not fool-proof as it seems a stressed system may drop/coalesce some of these events (perhaps because they are touching the same file & time) but it is close enough.
[tfs-changeset: 1493258]
Commit migrated from https://github.com/dotnet/corefx/commit/0c99692763e17c63f941fe7f52776ad27ae73232
Most test projects don't need unsafe code, but many were forced to allow unsafe blocks due to Interop.PlatformDetection.cs using pointers, and others were allowing it for no apparent reason. I've modified Interop.PlatformDetection.cs to not use unsafe code, and updated the relevant test projects accordingly. (Eventually we'll switch it over to using the new RuntimeInformation assembly, anyway.)
Commit migrated from https://github.com/dotnet/corefx/commit/3ae04f6ec948331c85c5f8441cd6d9eda868603f
Turns out my previous run of the OSX tests wasn't actually running all tests, due to my having an outdated xunit.netcore.extensions.dll and xunit silently not running some tests as a result.
@sokket is investigating. In the meantime, I'm disabling the rest of these on OSX.
Commit migrated from https://github.com/dotnet/corefx/commit/536cfc9118f029c3f91ab9739834b92b3728c8a6
Some of the project.json files were referencing xunit.netcore.extensions with ""1.0.0-prerelease" rather than "1.0.0-prerelease-*". As a result, I was unable to use more recent additions, like PlatformID.AnyUnix. This change just updates them to use the -* versions, and changes the few remaining places that were using PlatformID.Linux | PlatformID.OSX to instead use PlatformID.AnyUnix. The project.lock.json files were automatically updated by my building locally.
Commit migrated from https://github.com/dotnet/corefx/commit/f28722e261368de16adc2600fa1f1d3c0993ee8d
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
When I first added Interop.PlatformDetection while cleaning up tests for Linux, I'd added an OperatingSystem property, and the typical pattern was to compare against an enum, e.g.
```
if (Interop.PlatformDetection.OperatingSystem == Interop.OperatingSystem.Windows)
{
...
}
```
We subsequently added helper Is* properties, e.g. IsWindows, but never went back and substituted into the previous uses. This cleans that up, such that usage like the above instead becomes:
```
if (Interop.IsWindows)
{
...
}
```
Commit migrated from https://github.com/dotnet/corefx/commit/be8e3c9c34fe604e8182fed16ca9026447c6d38d
We now publish downlevel packages that do not contain implementations for coreclr. The expectation is that head projects will bring in a meta package that lifts the versions to the appropriate one for the head. We don't currently use a metapackage for our test projects, logically this should be a replacement for the packages.config/project.json that our test targets inject.
Commit migrated from https://github.com/dotnet/corefx/commit/6c79e0b5422a1af31966df003a422a4fce6ef97b
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
A few tests for FileSystemWatcher are platform-specific, e.g. differences in event coalescing behavior causing a the event buffer to fill on Windows but not on Linux. This commit annotates such tests as Windows-specific. It also fixes up a few other tests that were mostly platform-independent but had a few pieces that were platform-dependent; the platform-dependent pieces are now conditionally invoked.
Commit migrated from https://github.com/dotnet/corefx/commit/2b25b8db0a8e4599a619389cf946f4859090464d
This commit fixes issues highlighted when running the System.IO.FileSystem.Watcher tests on Linux. There are 49 tests that pass on Windows; after these product and test fixes, only 7 of those fail on Linux, all due to Windows-specific tests that will need to be tweaked based on target system or disabled entirely on Linux:
- 2 are P/Invoking to Win32 functions related to security
- 3 are trying to overflow the event buffer but not doing so on Linux
- 2 are expecting case-insensitive file paths
Commit migrated from https://github.com/dotnet/corefx/commit/7176a0dc531a1a9c9032c36330bbf92e7ca57f65