Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start of process xbuild failed #1213

Closed
kentcb opened this issue Apr 11, 2016 · 9 comments
Closed

Start of process xbuild failed #1213

kentcb opened this issue Apr 11, 2016 · 9 comments

Comments

@kentcb
Copy link
Contributor

kentcb commented Apr 11, 2016

Description

Since the 4.24.1 release at the weekend, my build now fails with:

System.Exception: Start of process xbuild failed. StandardErrorEncoding is only supported when standard error is redirected
  at Fake.ProcessHelper+ExecProcessWithLambdas@80-16.Invoke (System.String message) <0x8883148 + 0x00027> in <filename unknown>:0 
  at Microsoft.FSharp.Core.PrintfImpl+StringPrintfEnv`1[TResult].Finalize () <0x2dd67d8 + 0x00030> in <filename unknown>:0 
  at Microsoft.FSharp.Core.PrintfImpl+Final2@235[TState,TResidue,TResult,A,B].Invoke (Microsoft.FSharp.Core.FSharpFunc`2 env, A a, B b) <0x2dd60f8 + 0x000ca> in <filename unknown>:0 
  at Microsoft.FSharp.Core.OptimizedClosures+Invoke@3266-1[T2,T3,TResult,T1].Invoke (T2 u, T3 v) <0x2dd5ef0 + 0x0002b> in <filename unknown>:0 
  at Microsoft.FSharp.Core.OptimizedClosures+Invoke@3253[T2,TResult,T1].Invoke (T2 u) <0x2dd5e90 + 0x00024> in <filename unknown>:0 
  at Fake.ProcessHelper+ExecProcessWithLambdas@80-18.Invoke (System.String arg20) <0x8883128 + 0x0001a> in <filename unknown>:0 
  at Microsoft.FSharp.Core.FSharpFunc`2[T,TResult].InvokeFast[V] (Microsoft.FSharp.Core.FSharpFunc`2 func, Microsoft.FSharp.Core.T arg1, Microsoft.FSharp.Core.TResult arg2) <0x2dd5b98 + 0x0007b> in <filename unknown>:0 
  at Fake.ProcessHelper.ExecProcessWithLambdas (Microsoft.FSharp.Core.FSharpFunc`2 configProcessStartInfoF, TimeSpan timeOut, Boolean silent, Microsoft.FSharp.Core.FSharpFunc`2 errorF, Microsoft.FSharp.Core.FSharpFunc`2 messageF) <0x8881658 + 0x008ff> in <filename unknown>:0 
  at Fake.MSBuildHelper.build (Microsoft.FSharp.Core.FSharpFunc`2 setParams, System.String project) <0x81fe820 + 0x00323> in <filename unknown>:0 
  at FSI_0005.Build+clo@61-2.Invoke (Microsoft.FSharp.Core.Unit _arg2) <0x81fe7e8 + 0x00027> in <filename unknown>:0 
  at Fake.TargetHelper+targetFromTemplate@195[a].Invoke (Microsoft.FSharp.Core.Unit unitVar0) <0x81fd610 + 0x00020> in <filename unknown>:0 
  at Fake.TargetHelper.runSingleTarget (Fake.TargetTemplate`1 target) <0x81f7478 + 0x000bd> in <filename unknown>:0 

Repro steps

A build that was previously working with V4.23.5 is now failing per above.

  1. Run my build against V4.23.5. All works.
  2. Run my build against V4.24.1. Observe above failure.

Expected behavior

Build should work as in prior versions.

Actual behavior

Build fails with above error.

Known workarounds

Use older version of FAKE.

Related information

  • Mac OS El Capitan
  • Mono
@forki forki closed this as completed in 309c7e3 Apr 11, 2016
juergenhoetzel added a commit to juergenhoetzel/FAKE that referenced this issue Apr 11, 2016
Fixes encoding issues when encoding property is not set: Refs fsprojects#1212.

This is a revised version of commit 2d63a45,
which broke external processes when standard error/output is not redirected: Refs fsprojects#1213

This commit only sets the encoding when output is redirected.
@forki
Copy link
Member

forki commented Apr 11, 2016

can you please retry with 4.24.3? @juergenhoetzel submitted a second patch

@kentcb
Copy link
Contributor Author

kentcb commented Apr 11, 2016

Yes, that does work for me. 👍

@kentcb
Copy link
Contributor Author

kentcb commented Apr 11, 2016

But note that I still get Chinese characters. Was the patch supposed to fix this too?

@juergenhoetzel
Copy link
Contributor

But note that I still get Chinese characters. Was the patch supposed to fix this too?

@kentcb Yes, this should be fixed by the new release. Are you sure you have updated the FAKE package? I can reproduce invalid characters with the old release:

juergen@pidsley:~/fsharp/AndroidTest → mono ./packages/build/FAKE/tools/FAKE.exe --version
FakePath: /home/juergen/fsharp/AndroidTest/packages/build/FAKE/tools/FakeLib.dll
FAKE - F# Make "4.24.2"
juergen@pidsley:~/fsharp/AndroidTest → ./build.sh  android-deploy
No version specified. Downloading latest stable.
Paket.exe 2.60.0.0 is up to date.
Paket version 2.60.0.0
0 seconds - ready.
Building project with version: LocalBuild
Shortened DependencyGraph for Target android-deploy:
<== android-deploy

The resulting target order is:
 - android-deploy
Starting Target: android-deploy 
curl -sL -w "\n%{http_code}\n" -H "X-HockeyAppToken:invalid" -F "ipa=@test.apk" -F "notes=** Continuous integration build" -F "notes_type=0" -F "release_type=0" -F "notify=1" -F "mandatory=0" -F "status=2" -F "private=false" -F "teams=" -F "owner_id=blub.id" https://rink.hockeyapp.net/api/2/apps/upload
Running build failed.
Error:
System.Exception: Error while posting to HockeyApp.
Messages: ≻牥潲獲㨢≻牣摥湥楴污≳嬺愢楰琠歯湥椠癮污摩崢絽㐊〰
Errors: 

After paket update:


juergen@pidsley:~/fsharp/AndroidTest → mono ./packages/build/FAKE/tools/FAKE.exe --version
FakePath: /home/juergen/fsharp/AndroidTest/packages/build/FAKE/tools/FakeLib.dll
FAKE - F# Make "4.25.2"
juergen@pidsley:~/fsharp/AndroidTest → ./build.sh  android-deploy
No version specified. Downloading latest stable.
Paket.exe 2.60.0.0 is up to date.
Paket version 2.60.0.0
0 seconds - ready.
Building project with version: LocalBuild
Shortened DependencyGraph for Target android-deploy:
<== android-deploy

The resulting target order is:
 - android-deploy
Starting Target: android-deploy 
curl -sL -w "\n%{http_code}\n" -H "X-HockeyAppToken:invalid" -F "ipa=@test.apk" -F "notes=** Continuous integration build" -F "notes_type=0" -F "release_type=0" -F "notify=1" -F "mandatory=0" -F "status=2" -F "private=false" -F "teams=" -F "owner_id=blub.id" https://rink.hockeyapp.net/api/2/apps/upload
Running build failed.
Error:
System.Exception: Error while posting to HockeyApp.
Messages: {"errors":{"credentials":["api token invalid"]}}; 400
Errors: 

  at Fake.HockeyAppHelper.HockeyApp (Microsoft.FSharp.Core.FSharpFunc`2 setParams) <0x41613230 + 0x003db> in <filename unknown>:0 
  at FSI_0005.Build+clo@376-33.Invoke (Microsoft.FSharp.Core.Unit unitVar0) <0x41613160 + 0x00017> in <filename unknown>:0 
  at Fake.TargetHelper+targetFromTemplate@195[a].Invoke (Microsoft.FSharp.Core.Unit unitVar0) <0x41613130 + 0x00023> in <filename unknown>:0 
  at Fake.TargetHelper.runSingleTarget (Fake.TargetTemplate`1 target) <0x4160b500 + 0x000ca> in <filename unknown>:0 

@kentcb
Copy link
Contributor Author

kentcb commented Apr 13, 2016

Hmmm, you might be right. I'm struggling to reproduce it now. I may have just confused myself when testing yesterday.

My code base is not quite ready to give it a full run through right now. Let me get back to you ASAP.

@alexsorokoletov
Copy link
Contributor

I am getting this on 4.28.

Output in bad encoding:

Finished Target: Clean
Starting Target: Core (==> Clean, Clean)
义但⠠敲瑳牯⥥›潃灭瑵摥挠潯楫⁥慪⁲慰桴›唯敳獲愯敬⽸砮浡牡湩挭敲敤瑮慩獬䤊䙎⁏爨獥潴敲㨩嬠崪删獥潴楲杮洠摯牥桮瑴捰楬湥⁴㉶㐮㈮䤊䙎⁏爨獥潴敲㨩嬠崪匠捵散獳畦汬⁹敲瑳牯摥洠摯牥桮瑴捰楬湥⁴㉶㐮㈮䤊䙎⁏爨獥潴敲㨩嬠崪删獥潴楲杮匠摩扥牡慎楶慧楴湯瘠⸱ਹ义但⠠敲瑳牯⥥›⩛⁝畓捣獥晳汵祬爠獥潴敲⁤楓敤慢乲癡杩瑡潩ㅶ㤮䤊䙎⁏爨獥潴敲㨩嬠崪删獥潴楲杮稠楸杮渮瑥洮扯汩⁥㉶〮㐮ㄮ਷义但⠠敲瑳牯⥥›⩛⁝畓捣獥晳汵祬爠獥潴敲⁤硺湩⹧敮⹴潭楢敬瘠⸲⸰⸴㜱䤊䙎⁏爨獥潴敲㨩嬠崪删獥潴楲杮猠杩慮畴敲瀭摡瘠⸱⸳ਸ义但⠠敲瑳牯⥥›⩛⁝畓捣獥晳汵祬爠獥潴敲⁤楳湧瑡牵ⵥ慰⁤ㅶ㌮㠮

Code:


let DownloadXamarinComponentExe =
    if not <| File.Exists (Path.Combine(buildDir, "xamarin-component.exe")) then
        let tempXpkgFile = Path.Combine(buildDir, "xpkg.zip")
        DownloadFile "https://components.xamarin.com/submit/xpkg" tempXpkgFile
        ZipHelper.Unzip buildDir tempXpkgFile
        rm tempXpkgFile

Target "Core" (fun _ ->
    DownloadXamarinComponentExe
    RestoreComponents (fun defaults -> defaults) solution 
    RestorePackages()
)

@forki
Copy link
Member

forki commented Jun 17, 2016

/cc @nosami we really need to find the root cause for this.

@alexsorokoletov
Copy link
Contributor

I'm looking at the Shell.Exec code and it calls asyncShellExec function.
https://github.com/fsharp/FAKE/blob/master/src/app/FakeLib/ProcessHelper.fs#L419

I cannot see when during asyncShellExec we specify input and output encoding.
I can see these properties configured in function ExecProcessWithLambdas but not within asyncShellExec
https://github.com/fsharp/FAKE/blob/master/src/app/FakeLib/ProcessHelper.fs#L70

@alexsorokoletov
Copy link
Contributor

@juergenhoetzel I repeated your mistake, should learn history better.

nosami added a commit to nosami/Yaaf.FSharp.Scripting that referenced this issue Oct 7, 2016
See
fsprojects/FAKE#1196,
fsprojects/FAKE#1212,
fsprojects/FAKE#1213 &
fsprojects/FAKE#1194

Not sure of the ramifications of this change, but this fixes the
encoding issues in FAKE for me.

l.Head.Encoding was
`System.IO.StringWriter(new System.Text.StringBuilder()).Encoding`
which evaluates to utf-16
/cc:@forki
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants