Skip to content
This repository has been archived by the owner on Apr 16, 2020. It is now read-only.

Error with SourceLink with BouncyCastle #175

Closed
clairernovotny opened this issue Mar 20, 2017 · 3 comments
Closed

Error with SourceLink with BouncyCastle #175

clairernovotny opened this issue Mar 20, 2017 · 3 comments
Milestone

Comments

@clairernovotny
Copy link

Getting an error here with the 2.0.2 version:
https://ci.appveyor.com/project/onovotny/bc-csharp/build/1.8.2-beta.30.build.30#L343

No idea...?

@ctaggart
Copy link
Owner

I'm hoping to get others involved. Troubleshooting this should be pretty easy. The error message shows dotnet sourcelink-git create -u "https://raw.githubusercontent.com/onovotny/bc-csharp/{commit}/*" -f "obj\Release\net4\sourcelink.json" -s "asn1\anssi\ANSSINamedCurves.cs"

To reproduce, do the checkout that AppVeyor shows:

git config --global core.autocrlf input
git clone -q --branch=netstandard https://github.com/onovotny/bc-csharp.git C:\projects\bc-csharp
git checkout -qf 89ac3e3ab9620bea43654ded53975f881726fc27

Then simply set dotnet-sourcelink-git as the startup program with create -u "https://raw.githubusercontent.com/onovotny/bc-csharp/{commit}/*" -f "obj\Release\net4\sourcelink.json" -s "asn1\anssi\ANSSINamedCurves.cs"... as the arguments.

@ctaggart
Copy link
Owner

The underlying error is produced with this Create-SourceLink.ps1

Unhandled Exception: System.ComponentModel.Win32Exception: The filename or extension is
too long
   at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
   at System.Diagnostics.Process.Start()
   at Microsoft.DotNet.Cli.Utils.Command.Execute()
   at Microsoft.DotNet.Cli.Program.ProcessArgs(String[] args, ITelemetry telemetryClient
)
   at Microsoft.DotNet.Cli.Program.Main(String[] args)

If you comment out the last line 898, it works. Looks like we've hit a limitation in the args length. Any official documentation on this limit?

I created that script with this one:

open System.IO

let create() =
    use sw = new StreamWriter "Create-SourceLink.ps1"

    fprintfn sw "dotnet sourcelink-git create `"
    fprintfn sw "-f \"obj\\Debug\\net4\\sourcelink.json\" `"
    fprintfn sw "-u \"https://raw.githubusercontent.com/onovotny/bc-csharp/{commit}/*\" `"

    let files = Directory.GetFiles(".", "*.cs", SearchOption.AllDirectories) |> List.ofSeq
    printfn "%d files" files.Length
    for f in files do
        fprintfn sw "-s \"%s\" `" f
    
create()

ctaggart pushed a commit that referenced this issue Mar 26, 2017
@clairernovotny
Copy link
Author

@ctaggart We've hit that all over the place...the only real answer is to write the args to a response file and suck them in as a parameter.

For example, in Refit: https://github.com/paulcbetts/refit/blob/master/Refit/targets/refit.targets#L19

That's the real reason most of the compiler tool chain takes .rsp files as args.

@ctaggart ctaggart added this to the 2.1.0 milestone Mar 26, 2017
ctaggart added a commit that referenced this issue Mar 26, 2017
* compile for netcoreapp 1.1
fix #157

* switch to sourcelink.compile file #175

* File.OpenStream for netstandard 1.4

* back to netcoreapp1.0 #157
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants