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

Teach fsc/fsi how to use responsefile #831

Merged

Conversation

enricosada
Copy link
Contributor

ref #816

i need feedback on how to test this.

ok in tests\fsharpqa\Source\CompilerOptions\{fsc|fsi}\responseFiles.

But a good test without do output difference?
i think i can try to generate a specific error, and check for that one ( and response file fix the error ), a good candidate?

@@ -13,7 +13,7 @@ echo Build and run a subset of test suites
echo.
echo Usage:
echo.
echo appveyor-build.cmd ^<all^|net40^|portable47^|portable7^|portable78^|portable259^|vs^|cambridge_suite^|qa_suite^|smoke^|smoke_only^>
echo appveyor-build.cmd ^<all^|net40^|portable47^|portable7^|portable78^|portable259^|vs^|cambridge_suite^|qa_suite^|smoke^|smoke_only^|build_only^>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this add build_only argument to appveyor, to build without tests ( compile only ).
can be combined with others arguments, for example net40,portable7,build_only compile only net40 and portable7 instead of compile+tests

@enricosada
Copy link
Contributor Author

ok added tests and doc ( in --help, same text of roslyn )
ready to review/merge.

@dsyme
Copy link
Contributor

dsyme commented Jan 5, 2016

I looked over this briefly and everything looked fine to me. It would be great to have this in.

@enricosada enricosada force-pushed the teach_fsc_how_to_use_responsefile branch from 71dc941 to 502d15b Compare January 7, 2016 14:34
@enricosada
Copy link
Contributor Author

ok, used a completely new error number, some cleanups, and added test for error if response file is missing

@mmitche
Copy link
Member

mmitche commented Jan 7, 2016

@otawfik-ms Any idea what the issue is with the timeouts? Are they real failures or do the tests just take a long time? (We can up the timeouts if necessary)

@OmarTawfik
Copy link
Contributor

@mmitche No. 120 minutes are much longer than what is expected. I'll send a PR to run the smoke tests only, until #697 is done, and I can look into existing failures.

@mmitche
Copy link
Member

mmitche commented Jan 7, 2016

@otawfik-ms I can also give you direct access to a machine for debugging if necessary

@enricosada
Copy link
Contributor Author

@otawfik-ms @mmitche can you can add test log to jenkins build artifacts, no ui, but we can download it if needed. Also the current fsharpqa

the net40,portable, etc

CSC : error CS0006: Metadata file 'd:\j\workspace\Microsoft_visualfsharp\net40' could not be found [d:\j\workspace\Microsoft_visualfsharp\net40,portable7,portable47,portable78,portable259,vs_prtest\vsintegration\src\unittests\Resources.MockTypeProviders\DefinitionLocationAttribute\DefinitionLocationAttribute.csproj]

is because of directory name, d:\j\workspace\Microsoft_visualfsharp\net40,portable7,portable47,portable78,portable259,vs_prtest

@OmarTawfik
Copy link
Contributor

@enricosada you mean this?
http://dotnet-ci.cloudapp.net/job/Microsoft_visualfsharp/job/qa_suite_prtest/6/consoleFull
For test results, I've started #856 to track it.

@enricosada
Copy link
Contributor Author

not the build log, i mean build artifacts. in jenkins you save file in build job, and download it later. for example compiled binaries or test results ( like https://ci.jenkins-ci.org/job/jenkins_2.0/1/ )

@OmarTawfik
Copy link
Contributor

I'll add it in my pending changes now.

@OmarTawfik
Copy link
Contributor

Changes are in. Both test results and build artifacts should be in Jenkins UI now.
I also restricted it to smoke tests for now. LMK if you see any more timeouts and I'll take a look.

@smoothdeveloper
Copy link
Contributor

@enricosada I get a weird stack trace if I call:

fsc.exe @""


Unhandled Exception: System.ArgumentException: The path is not of a legal form.
   at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPath
Length, Boolean expandShortPaths)
   at System.IO.Path.GetFullPathInternal(String path)
   at System.IO.Path.GetFullPath(String path)
   at Microsoft.FSharp.Compiler.AbstractIL.Internal.Library.Shim.DefaultFileSyst
em.Microsoft-FSharp-Compiler-AbstractIL-Internal-Library-Shim-IFileSystem-GetFul
lPathShim(String fileName) in C:\dev\src\projects\github.com\visualfsharp\src\ab
sil\illib.fs:line 978
   at Microsoft.FSharp.Compiler.CompileOptions.processArg@255.Invoke(FSharpList`
1 args) in C:\dev\src\projects\github.com\visualfsharp\src\fsharp\CompileOptions
.fs:line 259
   at Microsoft.FSharp.Compiler.CompileOptions.ParseCompilerOptions(FSharpFunc`2
 collectOtherArgument, FSharpList`1 blocks, FSharpList`1 args) in C:\dev\src\pro
jects\github.com\visualfsharp\src\fsharp\CompileOptions.fs:line 370
   at Microsoft.FSharp.Compiler.Driver.ProcessCommandLineFlags(TcConfigBuilder t
cConfigB, FSharpFunc`2 setProcessThreadLocals, FSharpOption`1 lcidFromCodePage,
String[] argv) in C:\dev\src\projects\github.com\visualfsharp\src\fsharp\fsc.fs:
line 261
   at Microsoft.FSharp.Compiler.Driver.GetTcImportsFromCommandLine(String[] argv
, String defaultFSharpBinariesDir, String directoryBuildingFrom, FSharpOption`1
lcidFromCodePage, FSharpFunc`2 setProcessThreadLocals, FSharpFunc`2 displayBanne
rIfNeeded, Boolean optimizeForMemory, Exiter exiter, ErrorLoggerProvider errorLo
ggerProvider, DisposablesTracker disposables) in C:\dev\src\projects\github.com\
visualfsharp\src\fsharp\fsc.fs:line 321
   at Microsoft.FSharp.Core.Operators.Raise[T](Exception exn)
   at Microsoft.FSharp.Compiler.ErrorLogger.ErrorLoggerExtensions.ReraiseIfWatso
nable(Exception exn) in C:\dev\src\projects\github.com\visualfsharp\src\fsharp\E
rrorLogger.fs:line 299
   at Microsoft.FSharp.Compiler.ErrorLogger.ErrorLoggerExtensions.ErrorLogger.Er
rorRecovery(ErrorLogger x, Exception exn, range m) in C:\dev\src\projects\github
.com\visualfsharp\src\fsharp\ErrorLogger.fs:line 322
   at Microsoft.FSharp.Compiler.Driver.GetTcImportsFromCommandLine(String[] argv
, String defaultFSharpBinariesDir, String directoryBuildingFrom, FSharpOption`1
lcidFromCodePage, FSharpFunc`2 setProcessThreadLocals, FSharpFunc`2 displayBanne
rIfNeeded, Boolean optimizeForMemory, Exiter exiter, ErrorLoggerProvider errorLo
ggerProvider, DisposablesTracker disposables) in C:\dev\src\projects\github.com\
visualfsharp\src\fsharp\fsc.fs:line 328
   at Microsoft.FSharp.Compiler.Driver.main0(String[] argv, Boolean bannerAlread
yPrinted, Exiter exiter, ErrorLoggerProvider errorLoggerProvider, DisposablesTra
cker disposables) in C:\dev\src\projects\github.com\visualfsharp\src\fsharp\fsc.
fs:line 1769
   at Microsoft.FSharp.Compiler.Driver.typecheckAndCompile(String[] argv, Boolea
n bannerAlreadyPrinted, Exiter exiter, ErrorLoggerProvider errorLoggerProvider)
in C:\dev\src\projects\github.com\visualfsharp\src\fsharp\fsc.fs:line 1977
   at Microsoft.FSharp.Compiler.Driver.mainCompile(String[] argv, Boolean banner
AlreadyPrinted, Exiter exiter) in C:\dev\src\projects\github.com\visualfsharp\sr
c\fsharp\fsc.fs:line 1989
   at Microsoft.FSharp.Compiler.CommandLineMain.Driver.main(String[] argv) in C:
\dev\src\projects\github.com\visualfsharp\src\fsharp\fscmain.fs:line 270
   at Microsoft.FSharp.Compiler.CommandLineMain.main(String[] argv) in C:\dev\sr
c\projects\github.com\visualfsharp\src\fsharp\fscmain.fs:line 285
   at Microsoft.FSharp.Core.Operators.Raise[T](Exception exn)
   at Microsoft.FSharp.Compiler.ErrorLogger.ErrorLoggerExtensions.ReraiseIfWatso
nable(Exception exn) in C:\dev\src\projects\github.com\visualfsharp\src\fsharp\E
rrorLogger.fs:line 299
   at Microsoft.FSharp.Compiler.ErrorLogger.ErrorLoggerExtensions.ErrorLogger.Er
rorRecovery(ErrorLogger x, Exception exn, range m) in C:\dev\src\projects\github
.com\visualfsharp\src\fsharp\ErrorLogger.fs:line 322
   at Microsoft.FSharp.Compiler.CommandLineMain.main(String[] argv) in C:\dev\sr
c\projects\github.com\visualfsharp\src\fsharp\fscmain.fs:line 287

It seems something special is done when the file doesn't exist (it gives a short informative error message), it would be nice if it was doing the same (maybe with another message).

For example, csc does this:

C:\dev\src\projects\github.com\visualfsharp>csc @""
Microsoft (R) Visual C# Compiler version 1.1.0.51204
Copyright (C) Microsoft Corporation. All rights reserved.

error CS2021: File name '' is empty, contains invalid characters, has a drive sp
ecification without an absolute path, or is too long
warning CS2008: No source files specified.
error CS1562: Outputs without source must have the /out option specified

@enricosada
Copy link
Contributor Author

@smoothdeveloper i check if file exists, but i forgot invalid path like empty. Good catch!! thx

d:\github\fsharp>Release\net40\bin\fsc.exe "@dd"
Microsoft (R) F# Compiler version (private)
Copyright (c) Microsoft Corporation. All Rights Reserved.

error FS3192: Response file '@dd' not found in 'd:\github\fsharp\dd'

@enricosada
Copy link
Contributor Author

ok, added error if empty or invalid response file name ( like @ )
ready to merge or review!

@KevinRansom
Copy link
Member

merged into vs2015

Thanks for this contribution.

@KevinRansom KevinRansom reopened this Jan 20, 2016
@KevinRansom KevinRansom merged commit 20f0552 into dotnet:master Jan 20, 2016
@enricosada
Copy link
Contributor Author

@KevinRansom can you merge it in coreclr branch too? it's really useful for dotnet cli
btw why not master? the vs2015 it's the long term branch? it's not a breaking change

@smoothdeveloper
Copy link
Contributor

@enricosada it was pulled in master too I see.

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

Successfully merging this pull request may close these issues.

9 participants