Commit Graph
82 Commits
Author SHA1 Message Date
Christopher Costa 7e2dd3ad7b Delete closed libraries sources and reference open sources.
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
2015-03-20 17:07:34 -07:00
Matt Ellis 53a9f1fe9a Refactor build properties for Linux and OSX builds
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
2015-03-19 14:07:07 -07:00
Stephen Toub 806eeb620e Fix null deref in UnixFileStream ctor
UnixFileStream's ctor that accepts a SafefileHandle was calling
_parent.CanSeek, but no calls to _parent should be made in the ctor
of a FileStreamBase because the _parent FileStream's _innerStream
hasn't yet been assigned to this FileStreamBase instance being
constructed.


Commit migrated from https://github.com/dotnet/corefx/commit/fd63109117869fc732e53247d3b77ff754efd19d
2015-03-18 19:22:25 -04:00
Tarek Mahmoud Sayed b3120f73dd Remove checked in resources generated code file (SR.cs)
After this change it is no longer required to include the resources
generated code file SR.cs inside the project tree as such files
will get automatically generated in the intermediate folder


Commit migrated from https://github.com/dotnet/corefx/commit/e7513c213c16f5ca4bd35c6c4eace534b4d94ed5
2015-03-17 16:24:08 -07:00
Pallavi Taneja 6de41a0f16 Consolidate Interop calls for Microsoft.Win32.Primitives and System.Console
Commit migrated from https://github.com/dotnet/corefx/commit/4048ca85577f53539d6e4c511836f326643a0024
2015-03-13 10:18:59 -07:00
Christopher Costa dfb68f88ad Port CS dotnet/corefx#1384848 from ProjectN
1384848	Eric St. John	12/11/2014 13:31	Recent FI broke my hack for FileOptions.Encrypted.  I'm undoing the workaround for this.  Recent discussions have been t...

[tfs-changeset: 1426493]


Commit migrated from https://github.com/dotnet/corefx/commit/34ad0bb3a783401caa469824cb7adb140242c675
2015-03-05 15:58:44 -08:00
Stephen Toub 3758e27cc0 Implement System.IO.Pipes on Unix
Commit migrated from https://github.com/dotnet/corefx/commit/c473c8d50d997c66722fdf9bee50f91b707c903c
2015-03-04 22:59:48 -05:00
Tarek Mahmoud Sayed d52779a137 Cleanup project files from empty items with resource comments
Commit migrated from https://github.com/dotnet/corefx/commit/47b1663630ab0a6089d1a95c8d9934af3c6bc92b
2015-03-04 11:34:17 -08:00
Tarek Mahmoud Sayed 12598db216 Cleanup resources across all projects
After this change we are going to have unified model for handling resources which is we always use resx files placed under Resources folder and the code will be automatically generated in SR.cs file.
We’ll access ant string resource using the SR class (e.g. SR.ArgumentException).


Commit migrated from https://github.com/dotnet/corefx/commit/db7180f04ef9789a7f199fcd9f8c527990e14673
2015-03-04 11:34:16 -08:00
Nick Guerrera f022d5bba7 Bump package versions to latest
Commit migrated from https://github.com/dotnet/corefx/commit/a4d211e9a250c5975022f32d3d7b036e2ba12488
2015-03-04 11:02:12 -08:00
Eric StJohn 55dff7e34e Clarify behavior of ShouldUseWinRT and eliminate redundant calls to GetLastError.
Commit migrated from https://github.com/dotnet/corefx/commit/d88fbe95b3a202e48ba43e050f908091aca3730f
2015-03-03 14:29:37 -08:00
Eric StJohn 2cb7047d92 Don't recurse when Selecting a FileSystem implementation for opening a file
In MultiplexingWin32WinRTFileSystem we were treating all Opens as potentially
creating a file.  As a result we would walk up the path until we found some
existing folder (or failure) so that we could give the FileSystem implementation
a chance to fill in the entire missing path on a create.  This was incorrect
for Open operations (FileMode.Open and FileMode.Truncate) and resulted
in poorer performance for Open as well as incorrect exceptions.


Commit migrated from https://github.com/dotnet/corefx/commit/ee3e4566814cf96c0f517d340f221a9472a4df2d
2015-03-03 12:37:16 -08:00
Eric StJohn 186128a7fd Fix UseWinRT heuristic to better handle app container roots
We were using FindFirstFileEx to get file attributes in order to determine if
the file/directory is accessible by Win32.  This is failing for root folders in
ApplicationData locations, even though they are accessible by Win32.  The
reason seems to be that FindFirstFileEx on a full path requires that the parent
have permission to enumerate contents, even though we've passed a full
path and have full access to that path (likely a bug in FindFirstFileEx).
Using GetFileAttributesEx is better in most cases since it is faster and does
not require permission to enumerate contents.  I've switched to using
GetFileAttributesEx first and only falling back to FindFirstFile when we might
have a reparse point that could be a placeholder file.


Commit migrated from https://github.com/dotnet/corefx/commit/cd0216d3350ed210f9bdbf6c083ce020655a105d
2015-03-03 12:37:12 -08:00
Stephen Toub fa740f8c72 Separate gnu_get_libc_version into its own file
Commit migrated from https://github.com/dotnet/corefx/commit/3389cbaa146f525f0aa5517b7b4fceeece776bfa
2015-03-01 13:21:29 -05:00
Pallavi Taneja 7f18e72a0c Update resource generation for libraries.
[tfs-changeset: 1422400]


Commit migrated from https://github.com/dotnet/corefx/commit/3ad583086b7b5eebfaca535fea861b871776cc3d
2015-02-26 17:55:48 -08:00
Matt Ellis 2af142d417 Merge pull request dotnet/corefx#917 from Maxwe11/share_handle
Using shared CloseHandle interop

Commit migrated from https://github.com/dotnet/corefx/commit/e050c1c192147bf37a54e4a36578886f957a334e
2015-02-21 13:53:54 -08:00
Maxwe11 6a98eb9ef5 Move *.sln files to the appropriate projects folders
Commit migrated from https://github.com/dotnet/corefx/commit/fb8fb441b3e5414590b8d1af4ec5f52ca52c0dff
2015-02-20 19:52:00 +02:00
Maxwe11 42c28878f7 Split up System.IO.FileSystem solution
Commit migrated from https://github.com/dotnet/corefx/commit/ac61aba0b1c30a27e3d5594d646088a617bc9a91
2015-02-20 03:05:00 +02:00
Maxwe11 0b7f899922 Fix projects to rely on shared CloseHandle interop
Some projects was using its own definition of CloseHandle interop.
This commit changes it to use the shared definition from Common folder.


Commit migrated from https://github.com/dotnet/corefx/commit/7a15b10c05385d399bb664e78e91db03bd6b4a90
2015-02-19 19:27:37 +02:00
Maxwe11 24de629e0f Using shared FormatMessage interop
Commit migrated from https://github.com/dotnet/corefx/commit/ab7f5a2189f990d1ec4c36de5baf31133c86a6cf
2015-02-19 09:18:47 +02:00
Stephen Toub 0188aeb399 Merge pull request dotnet/corefx#818 from stephentoub/os_proj_config
Update solutions/projects with OS-specific configs

Commit migrated from https://github.com/dotnet/corefx/commit/7dc38bf6e203210f987d41a579de1f44c81550e1
2015-02-18 19:39:20 -05:00
Matt Johnson 8d91f6af80 Fix typos in private/internal field names
Commit migrated from https://github.com/dotnet/corefx/commit/ca2ab51da39267d2abc4b2cc72b7b8b0abf72090
2015-02-18 14:38:05 -08:00
Matt Johnson 9111c18563 Fix typos in local variable names
Commit migrated from https://github.com/dotnet/corefx/commit/917f4d4516e6b99e54c70b1c90849f81c8bb70df
2015-02-18 14:37:50 -08:00
Matt Johnson ccd5e9e34a Fix typos in comments
Commit migrated from https://github.com/dotnet/corefx/commit/4a3d2d5b7b53a6d37fcc54553f5d0f62b2d6cff7
2015-02-18 14:37:35 -08:00
Stephen Toub 9d37aa1eeb Move Windows-specific path validation out of shared FileStream
FileStream currently has a few path validation checks that are specific to Windows. This commit moves these checks into a Windows-specific file.


Commit migrated from https://github.com/dotnet/corefx/commit/76e9792630370db053e67254a7b658528a3affdd
2015-02-18 15:01:03 -05:00
Stephen Toub 2c54a7ae72 Update solutions/projects with OS-specific configs
For projects that have OS-specific implementations, this change modifies
their solution and project files to create OS-specific configurations.
Rather than just having a Debug or Release option, in Visual Studio a
developer can now select OS_Debug or OS_Release, e.g. for a project that
has a Windows implementation and a Unix implementation, Windows_Debug,
Windows_Release, Unix_Debug, and Unix_Release will all be available
options.  Changing the configuration will update the properties used to
configure conditional includes, build outputs, etc.


Commit migrated from https://github.com/dotnet/corefx/commit/d3b259b89877e4a52d12c08e0f9031f37cb0905b
2015-02-18 13:01:48 -05:00
Stephen Toub 0e4843b792 Merge pull request dotnet/corefx#800 from stephentoub/fix_cc
Enable code coverage on VS2015 and include more libraries

Commit migrated from https://github.com/dotnet/corefx/commit/f5b26d5afc6abcac978e7c5642bef7dc23e5ee18
2015-02-18 07:20:21 -05:00
Eric StJohn 9106fd0c33 Fix build break for WinRTFileSystem
We aren't building the WinRT filesystem implementation in the open and
I broke it with a previous change to call through derived members of FileStream.


Commit migrated from https://github.com/dotnet/corefx/commit/9d3b4e45ef359ffda861b7d85e158c572a4454e7
2015-02-17 17:09:17 -08:00
Stephen Toub 150a2f4e75 Re-enable code coverage for (most) disabled libraries
Several libraries had their code coverage disabled due to unknown problems.  The change to a more recent version of OpenCover appears to have addressed whatever those issues were, as the problems no longer repro.  This commit just re-enables the code coverage for those libraries.

The only remaining library with its code coverage disabled is System.Diagnostics.Process.dll.  It's either hanging or just taking a really long time to complete.  Investigation still needed.


Commit migrated from https://github.com/dotnet/corefx/commit/01c18f27d5a6c383701e0407b55e6edfae203309
2015-02-17 16:44:44 -05:00
Stephen Toub 8cc26c6cc2 Scrubs [ComVisible] attribution from CoreFX library sources
Commit migrated from https://github.com/dotnet/corefx/commit/9189f0a7f60f217a8cfec2d4bdafaf7132d6d067
2015-02-16 13:20:46 -05:00
chcosta d1620100c8 Sync changes from TFS as of 2015/02/16 9:30:00 AM
[tfs-changeset: 1416076]


Commit migrated from https://github.com/dotnet/corefx/commit/67bd740c6c732e141835521ff34b2cc18591a9cc
2015-02-16 09:51:49 -08:00
Stephen Toub eaeb6391bb Merge pull request dotnet/corefx#654 from stephentoub/process_unix
Implement System.Diagnostics.Process on Linux

Commit migrated from https://github.com/dotnet/corefx/commit/88f0dac59872dcd2ee7f482c5ec6b245e80d5704
2015-02-13 15:21:26 -05:00
Stephen Toub 49be027424 Add support for path resolution in Process.Start
We were previously just using the exact path provided as the ProcessStartInfo.Filename.  With this commit, we now use the same basic path resolution logic as is used on Windows (except for Windows-specific aspects): the specified path if it's absolute, then the executable's directory, then the current directory, and then each of the directories in the PATH environment variable.


Commit migrated from https://github.com/dotnet/corefx/commit/091b73b54451f777f751cf44460211639043e9b9
2015-02-12 15:45:39 -05:00
Stephen Toub 214d0f8c29 Merge pull request dotnet/corefx#742 from ellismg/contract-to-debug-assert
Convert Contract.Assert to Debug.Assert.

Commit migrated from https://github.com/dotnet/corefx/commit/cb9daab7806cd906a1a0abb856e371016f2040e8
2015-02-11 18:19:34 -05:00
Matt Ellis 91409b75fa Replace Contract.Assert with Debug.Assert
Fixes dotnet/corefx#682


Commit migrated from https://github.com/dotnet/corefx/commit/980e41dc6beef8caf4a4369fea2028e1c7cbaf38
2015-02-11 11:55:51 -08:00
Stephen Toub 304df98274 Use lseek instead of lseek64 in Unix I/O
As part of this, changed interop definitions of off_t to be Int64 rather than IntPtr.  For now we're assuming that we'll run either on 64-bit systems and/or where _FILE_OFFSET_BITS == 64.  We can revisit this if that assumption fails.


Commit migrated from https://github.com/dotnet/corefx/commit/198d30af095675a8eaaa387d14c68621065fecbd
2015-02-11 10:04:30 -05:00
Stephen Toub 02d3286c76 Replace open64 usage with open in Unix libs
Use the POSIX-compliant open function instead of open64.


Commit migrated from https://github.com/dotnet/corefx/commit/e2ad5a8a55b7167286dfa3e45af6c97e59485abd
2015-02-10 01:05:33 -05:00
Maxwe11 2d635dae1c Replace relative path to common tests with a variable
Replace relative path "..\..\Common\tests" with $(CommonTestPath) variable.


Commit migrated from https://github.com/dotnet/corefx/commit/56dbc6abc6dcde5874c99c67f379d788c8dd4420
2015-02-08 15:05:37 +02:00
Nick Guerrera 96ee8ecc84 Merge pull request dotnet/corefx#688 from dotnet/v1.0
Merge v1.0 -> master

Commit migrated from https://github.com/dotnet/corefx/commit/bd08ac4fe67dd91dac06681a536683f1baf1dada
2015-02-07 15:05:35 -08:00
Stephen Toub 1634dc508a Remove some allocations during process enumeration
Includes a few allocations potentially removed during file system directory enumeration, since process enumeration is based on enumerating the procfs file system.


Commit migrated from https://github.com/dotnet/corefx/commit/c4fcce7894ded96c94eca56f716f12e5207322f7
2015-02-07 16:31:48 -05:00
Stephen Toub 32e6ad6f48 Implement System.Diagnostics.Process on Linux
This is an initial implementation of the System.Diagnostics.Process
assembly for Linux.  There are some rough edges here: basic process
enumeration and inspection should work, as should waiting for processes
through various means (WaitForExit, Exited event, etc.), but other
functionality isn't ready for primetime yet, namely Start, which has been
roughly implemented but which hasn't been tested yet.

Some of the surface area doesn't have good equivalents on Linux.  Where I
thought it reasonable, in some cases I just left default values in place
or ignore things. In other cases, I throw PlatformNotSupportedException.
We can tweak this over time.

The implementation gets most of its data from the procfs file system.
Suppot for waiting is the most complicated area of the implementation, and
probably still has a few bugs to sort out.


Commit migrated from https://github.com/dotnet/corefx/commit/7a6874e2b84d62b3ece397ae692ee79e330afaa5
2015-02-05 18:47:19 -05:00
Matt Mitchell b2149f1c80 Enable code coverage for the corefx repo
This change enables code coverage for the corefx project using OpenCover.

 * When /p:Coverage=true is passed, we wrap the xunit call in the OpenCover command.
 * OpenCover filters test assemblies but no other default filters.
 * We disable parallel execution of tests within xunit and parallel project building when running coverage. This appears to cause issues with OpenCover (I see spurious failures in tests) and is actually slower than just running execution serially.
 * A few assemblies still have issues even after this.  These have coverage disabled with CoverageEnabledForProject.  Will open an issue for future investigation.
 * After execution is complete, we run the ReportGenerator tool over the set of generated coverage data, creating a full report in bin\tests\coverage.


Commit migrated from https://github.com/dotnet/corefx/commit/60a0bdd4125e39aa1653f2aeffc9eea02f348531
2015-02-05 13:11:18 -08:00
Eric StJohn ec247073ff Fix DirectoryInfo.Exists for search results
We have a seperate codepath for initializing DirectoryInfos when they are the result of
search.  We do this as a performance optimization since we already have the filesystem
data for the directory/file.  I was missing the flag that set the internal field as directory/file
in this codepath, which resulted in DirectoryInfo.Exists treating the item as a file and
returning false since it had the Directory attribute set.

I've fixed this omission and added some tests for DirectoryInfo.Exists.


Commit migrated from https://github.com/dotnet/corefx/commit/ea4b8d6b96c9687b431c1c5785a582caa9a22912
2015-02-04 14:33:14 -08:00
Nick Guerrera 185d6e3315 Merge pull request dotnet/corefx#605 from dotnet/v1.0
Merge v1.0 to master

Commit migrated from https://github.com/dotnet/corefx/commit/4500cb29e292efd68a0df97224bc94a6af864683
2015-02-02 15:09:48 -08:00
Stephen Toub e2750b7176 Change sync File helpers to use sync FileStreams
.NET Core currently uses a default of useAsync=true for FileStreams.  But File has several synchronous helpers, e.g. ReadAllBytes, which create FileStreams using the default, don't hand the FileStream out externally, and only perform synchronous operations.  This means there's unnecessary overhead related to setting up and executing the underlying asynchronous operation.  This commit simply changes those helpers (ReadAllBytes, WriteAllText, etc.) to specify that the file should be opened for synchronous rather than asynchronous I/O.

The performance improvement depends on a variety of factors, including the size of the file being read/written, the number of operations involved in reading/writing the file, etc.  I tried a bunch of combinations and contents, and didn't see any regressions.  In a variety of cases though I did see measurable improvements, e.g.
- ReadAllBytes on a 1K file improved throughput by ~30%.
- ReadAllText on a 10MB file improved throughput by ~20%
- WriteAllBytes on a 4K file improved throughput by ~18%
Note that these were all microbenchmarks, executing these operations repeatedly in order to make them more easily measurable.


Commit migrated from https://github.com/dotnet/corefx/commit/12a1df91cec56ea2dbee6e10160909e1a8b775e6
2015-02-01 16:59:48 -05:00
Stephen Toub 0ce419eaa6 Remove buffer allocation from File.ReadAllBytes
ReadAllBytes is creating a FileStream with the default buffer size of 4K.  Since we've already allocated a byte array large enough to hold the entire file, the internal buffer allocated in FileStream is pure overhead, both for the allocation itself and also for the extra copy of data through the buffer.

This commit fixes this simply by explicitly setting the bufferSize to 1.  FileStream lazily-allocates the buffer, only creating and using it if it needs it.  If a read comes in for a size greater than or equal to the bufferSize, it'll skip the buffer.  So, previously, when reading a file > 4K in size, the buffer would be avoided; now it's also avoided for files <= 4K in size.

A microbenchmark repeatedly caling ReadAllBytes showed that with this fix the number of gen0 GCs caused by its usage dropped anywhere from 0-10x, depending on the size of the file being read.  Throughput improved by a few percentage points as well.

(Note that I also tried this same change for WriteAllBytes.  While it did have a similar effect on gen0 GCs, it caused a surprising regression in throughput, upwards of 20%, and I did not further dig into why.  I also noticed that at the moment FileStream in .NET Core is defaulting to useAsync=true, which is different from the desktop and doesn't make much sense for {Read/Write}AllBytes; if that default remains the same, we should explicitly set useAsync=false for these methods.)


Commit migrated from https://github.com/dotnet/corefx/commit/7f84dfbc13bba30caf8938ca1edd565ba2f42c62
2015-01-31 22:54:44 -05:00
Nick Guerrera 05c7646f02 Merge pull request dotnet/corefx#576 from dotnet/v1.0
Merge v1 to master

Commit migrated from https://github.com/dotnet/corefx/commit/3203415188a03592028795f3e559bad861cf39fa
2015-01-30 14:09:45 -08:00
Stephen Toub 358232dc81 Fix Unix build of file system
Commit migrated from https://github.com/dotnet/corefx/commit/471027bd1d36ce7d69e40e5af9f0b9eafda16ac5
2015-01-30 16:51:14 -05:00
Nick Guerrera f076e50a56 Merge pull request dotnet/corefx#565 from dotnet/v1.0
Merge v1.0 to master

Commit migrated from https://github.com/dotnet/corefx/commit/593d5b40e188ba23f656fd93efabdff390048b34
2015-01-29 19:13:11 -08:00
Eric StJohn 447d1f6d58 Merge branch 'v1.0' into fileSystemTests
Conflicts:
	src/System.IO.FileSystem/tests/packages.config - updated version


Commit migrated from https://github.com/dotnet/corefx/commit/7d8cde6b1684d161a296701dc2666f926bd403da
2015-01-29 11:27:59 -08:00