Skip to content
This repository has been archived by the owner on Aug 2, 2023. It is now read-only.

AzCopyCore updates #2171

Merged
merged 1 commit into from
Mar 20, 2018
Merged

Conversation

KrzysztofCwalina
Copy link
Member

  • updated the sample to new packages and runtime
  • refactored HTTP code into a separate wrapper for IDuplexPipe
  • small resulting renames

@KrzysztofCwalina KrzysztofCwalina merged commit ea28ffe into dotnet:master Mar 20, 2018
<PackageReference Include="System.Text.Http.Parser" Version="$(CoreFxLabPackageVersion)" />
<PackageReference Include="System.Text.Utf8String" Version="$(CoreFxLabPackageVersion)" />
<PackageReference Include="System.IO.Pipelines" Version="$(CoreFxLabPackageVersion)" />
<PackageReference Include="System.Azure.Experimental" Version="0.1.0-preview2-180320-2" />
Copy link
Member

@ahsonkhan ahsonkhan Mar 21, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update and use the CoreFxLabPackageVersion property to make it easier to update in the future.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, but there is a trade off here. I think it's good that we have some samples that validate how our customers are using and demonstrate how they should be using our packages.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand the trade off here. We have all these package version numbers here, and they point to the same version. We have a property in this csproj called CoreFxLabPackageVersion. I was just suggesting we use that so that it becomes a single point of edit in the future, if we ever want to upgrade them again. Note, this is still isolated from the rest of the repo and would still demonstrate the customer's use of our packages.

<PackageReference Include="System.Memory" Version="$(CoreFxPackageVersion)" />
<PackageReference Include="System.Threading.Tasks.Extensions" Version="$(CoreFxPackageVersion)" />
<PackageReference Include="Microsoft.DotNet.ILCompiler" Version="1.0.0-alpha-26320-02" />
<PackageReference Include="System.Buffers.ReaderWriter" Version="0.1.0-preview2-180320-2" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Move this down to the other ItemGroup with the rest of the corefxlab packages

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will do

<PackageReference Include="System.Text.Http" Version="0.1.0-preview2-180320-2" />
<PackageReference Include="System.Text.Http.Parser" Version="0.1.0-preview2-180320-2" />
<PackageReference Include="System.Text.Utf8String" Version="0.1.0-preview2-180320-2" />
<PackageReference Include="System.IO.Pipelines" Version="4.5.0-preview3-26319-04" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Move this up to the other ItemGroup with the rest of the CoreFX packages

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will do

<PackageReference Include="Microsoft.DotNet.ILCompiler" Version="1.0.0-alpha-26320-02" />
<PackageReference Include="System.Buffers.ReaderWriter" Version="0.1.0-preview2-180320-2" />
<PackageReference Include="System.Memory" Version="4.5.0-preview3-26319-04" />
<PackageReference Include="System.Threading.Tasks.Extensions" Version="4.5.0-preview3-26319-04" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update and use the CoreFxPackageVersion property to make it easier to update in the future.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I said above, I like how the sample shows VS experience that our customers will get.

Copy link
Member

@ahsonkhan ahsonkhan Mar 21, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if someone would go and manually update each individual referenced packages using VS/NuGet package manager. Once they are added (which can be done by using VS/NuGet package manager), it would make sense to create a property to update the versions, no?

@@ -3,7 +3,9 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<!--
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this commented out? This should be the same as https://github.com/dotnet/corefxlab/blob/master/SharedRuntimeVersion.txt (or import the common.props file).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's @terrajobst's fault. :-) I removed it now.

<PackageReference Include="System.Text.Utf8String" Version="$(CoreFxLabPackageVersion)" />
<PackageReference Include="System.IO.Pipelines" Version="$(CoreFxLabPackageVersion)" />
<PackageReference Include="System.Azure.Experimental" Version="0.1.0-preview2-180320-2" />
<PackageReference Include="System.Buffers.Experimental" Version="0.1.0-preview2-180320-2" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can these be project references instead of package references?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above: I think samples should show customer experience that does not require cloning the whole repo.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. In that case, package references make sense. Thanks.


var options = new CommandLine(args);
ReadOnlySpan<char> source = options.GetSpan("/Source:");
ReadOnlySpan<char> destination = options.GetSpan("/Dest:");

long before = GC.GetAllocatedBytesForCurrentThread();
var sw = Stopwatch.StartNew();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: use of var

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will fix

{
client.Log = Log;
//var files = new Files(directoryPath);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clean up commented out code

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will do.

keyBytes = options["/DestKey:"].ComputeKeyBytes();
ReadOnlySpan<char> key = options["/DestKey:"];
var str = key.ToString();
keyBytes = key.ComputeKeyBytes();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this change necessary?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

leftover from debugging. I removed now. thanks.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI, I just confirmed, debugging works as expected and shows the string. So, hopefully, these types of changes won't be necessary anymore.

image

KrzysztofCwalina added a commit to KrzysztofCwalina/corefxlab that referenced this pull request Mar 22, 2018
@KrzysztofCwalina KrzysztofCwalina deleted the SocketClient branch March 22, 2018 17:52
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants