Fable: `/verbosity:minimal` hides error

Created on 20 Sep 2017  路  6Comments  路  Source: fable-compiler/Fable

Description

Create a new fsproj file with target netappcore2.0 and OutputType>exe</O...

dotnet restore, dotnet fable npm-run build, get some error.

Change it to netstandard2.0, remove output type, run build again. Get a crash such as:

ERROR: MSBuild failed with exitCode 1 Working Directory: './site' Exe Path: 'dotnet' Args: 'msbuild site/Fable.fsproj /p:SkipCompilerExecution=true /p:ProvideCommandLineArgs=true /p:CopyBuildOutputToOutputDirectory=false /p:UseCommonOutputDirectory=true /t:_Inspect_FscArgs /p:_Inspect_FscArgs_OutFile=/var/folders/c1/wxqsbv6n7ygdp32gwgb0y85w0000gn/T/tmpuxjViy.tmp.FscArgs.txt /p:DesignTimeBuild=true /t:_Inspect_GetResolvedProjectReferences /p:_Inspect_GetResolvedProjectReferences_OutFile=/var/folders/c1/wxqsbv6n7ygdp32gwgb0y85w0000gn/T/tmp56Xau4.tmp.GetResolvedProjectReferences.txt /t:_Inspect_GetProperties /p:_Inspect_GetProperties_OutFile=/var/folders/c1/wxqsbv6n7ygdp32gwgb0y85w0000gn/T/tmpG4CBRW.tmp.GetProperties.txt /nologo /verbosity:quiet'
   at Fable.CLI.ProjectCoreCracker.projInfo(FSharpList`1 additionalMSBuildProps, String file)
   at Fable.CLI.ProjectCracker.fullyCrackFsproj(String projFile)
   at Fable.CLI.ProjectCracker.getProjectOptionsFromFsproj(Message msg, String projFile)
   at Fable.CLI.ProjectCracker.retry@286(FSharpChecker checker, Message msg, String projFile, DateTime retryUntil, Unit unitVar0)
   at Fable.CLI.ProjectCracker.retryGetProjectOpts(FSharpChecker checker, Message msg, String projFile)
   at Fable.CLI.ProjectCracker.getFullProjectOpts(FSharpChecker checker, Message msg, String projFile)
   at Fable.CLI.StateUtil.createProject(FSharpChecker checker, Boolean isWatchCompile, FSharpOption`1 prevProject, Message msg, String projFile)
   at Fable.CLI.StateUtil.updateState(FSharpChecker checker, FSharpMap`2 state, Message msg)
   at [email protected](Tuple`2 _arg1)

Now run the mentioned msbuild command without the minimal verbosity. It complains it cannot find some generated file.

Either:

  • output that error and not just exited with code 2
  • or rerun dotnet restore automatically.

Most helpful comment

Anyway I think I have seen such an error when invoking Dotnet.ProjInfo without restoring the project first.

@alfonsogarciacaro yes, i gracefully handle not restored project in FSAC ( https://github.com/fsharp/FsAutoComplete/blob/master/src/FsAutoComplete.Core/ProjectCoreCracker.fs#L133-L135 ), but not yet in Dotnet.ProjInfo (ref https://github.com/enricosada/dotnet-proj-info/issues/3 for cli version issue)
for next version i'll move improvements from fsac into Dotnet.ProjInfo

All 6 comments

Sorry, the repro instructions don't mention anything about Fable, when do you exactly run it?

Anyway I think I have seen such an error when invoking Dotnet.ProjInfo without restoring the project first. We could make the error more informative, or maybe do it directly in Dotnet.ProjInfo? @enricosada

Yeah, sorry, wrong command mentioned; updated issue.

Anyway I think I have seen such an error when invoking Dotnet.ProjInfo without restoring the project first.

@alfonsogarciacaro yes, i gracefully handle not restored project in FSAC ( https://github.com/fsharp/FsAutoComplete/blob/master/src/FsAutoComplete.Core/ProjectCoreCracker.fs#L133-L135 ), but not yet in Dotnet.ProjInfo (ref https://github.com/enricosada/dotnet-proj-info/issues/3 for cli version issue)
for next version i'll move improvements from fsac into Dotnet.ProjInfo

Now that you said that, @enricosada, I remembered Fable should also raise a similar error (I copy&pasted the code and just made it a general exception to avoid dependencies). It's strange this message wasn't displayed. Maybe there was already a project.assets.json file but generated by dotnet SDK 1?

@alfonsogarciacaro can be, the dotnet build should see the tfm is different, and redo restore.
i'll try to check how to handle that scenario, added https://github.com/enricosada/dotnet-proj-info/issues/8

Closed in favor of the dotnet-proj-info issue 鈽濓笍

Was this page helpful?
0 / 5 - 0 ratings

Related issues

SCullman picture SCullman  路  49Comments

alfonsogarciacaro picture alfonsogarciacaro  路  37Comments

sergey-tihon picture sergey-tihon  路  70Comments

tomcl picture tomcl  路  26Comments

ed-ilyin picture ed-ilyin  路  48Comments