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

Fake fails with unhelpful error if %temp% does not exist #1707

Closed
0x53A opened this issue Oct 10, 2017 · 5 comments · Fixed by matthid/Yaaf.FSharp.Scripting#9
Closed

Fake fails with unhelpful error if %temp% does not exist #1707

0x53A opened this issue Oct 10, 2017 · 5 comments · Fixed by matthid/Yaaf.FSharp.Scripting#9

Comments

@0x53A
Copy link
Contributor

0x53A commented Oct 10, 2017

Repro:

set TMP=c:\doesnotexist
set TEMP=c:\doesnotexist
fake.exe ...

Actual:

Build failed.
Error:
The directory name is invalid.

-------------------
 FAKE usage
-------------------

    fake.exe [<scriptPath>] [<targetName>] [options]

    scriptPath: Optional.  Path to your FAKE build script.  If not specified, FAKE will use the first .fsx file in the working directory and fail if none exists.

    targetName: Optional.  Name of the target you wish to run.  This will override the target you specifed to run in the build script.
                           When targetName is equal --listTargets or -lt FAKE will list the targets with their dependencies.

    Options:

Expected:

Either it works, or it prints exactly what directory is invalid. (%temp% in this case).

I think this is a regression to some older version, but not 100% sure.

ToDo:

I propose to just Directory.Create it, and if that also fails to write a nice detailed error message.

This cost me about a day, because my build script failed when executed during the automated serverbuild (which redirects temp), but succeeded, when I just copy-pasted the exact invokation into a new cmd window.

@0x53A
Copy link
Contributor Author

0x53A commented Oct 10, 2017

image

 	mscorlib.dll!System.IO.__Error.WinIOError(int errorCode, string maybeFullPath)	Unknown	Symbols loaded.
 	mscorlib.dll!System.IO.__Error.WinIOError()	Unknown	Symbols loaded.
 	mscorlib.dll!System.IO.Path.InternalGetTempFileName(bool checkHost)	Unknown	Symbols loaded.
 	mscorlib.dll!System.IO.Path.GetTempFileName()	Unknown	Symbols loaded.
>	FakeLib.dll!Yaaf.FSharp.Scripting.CompilerServiceExtensions.FSharpAssemblyHelper.getCheckerArguments(string frameworkVersion, System.Collections.Generic.IEnumerable<string> defaultReferences, Microsoft.FSharp.Core.FSharpOption<string> fsCoreLib, System.Collections.Generic.IEnumerable<string> dllFiles, System.Collections.Generic.IEnumerable<string> libDirs, System.Collections.Generic.IEnumerable<string> otherFlags) Line 178	F#	Symbols loaded.
 	FakeLib.dll!Yaaf.FSharp.Scripting.CompilerServiceExtensions.FSharpAssemblyHelper.getProjectReferences(string frameworkVersion, Microsoft.FSharp.Core.FSharpOption<System.Collections.Generic.IEnumerable<string>> otherFlags, Microsoft.FSharp.Core.FSharpOption<System.Collections.Generic.IEnumerable<string>> libDirs, System.Collections.Generic.IEnumerable<string> dllFiles) Line 270	F#	Symbols loaded.
 	FakeLib.dll!Yaaf.FSharp.Scripting.CompilerServiceExtensions.FSharpAssemblyHelper.getProjectReferencesSimple(string frameworkVersion, System.Collections.Generic.IEnumerable<string> dllFiles) Line 303	F#	Symbols loaded.
 	FakeLib.dll!Yaaf.FSharp.Scripting.CompilerServiceExtensions.FSharpAssemblyHelper.getProjectReferenceFromFile(string frameworkVersion, string dllFile) Line 307	F#	Symbols loaded.
 	FakeLib.dll!Yaaf.FSharp.Scripting.CompilerServiceExtensions.FSharpAssembly.FromAssembly.Static(System.Reflection.Assembly assembly) Line 367	F#	Symbols loaded.
 	FakeLib.dll!Yaaf.FSharp.Scripting.CompilerServiceExtensions.TypeNameHelper.getFSharpTypeName(System.Type t) Line 385	F#	Symbols loaded.
 	FakeLib.dll!Yaaf.FSharp.Scripting.CompilerServiceExtensions.Type.get_FSharpName(System.Type value) Line 400	F#	Symbols loaded.
 	FakeLib.dll!Yaaf.FSharp.Scripting.CompilerServiceExtensions.Type.get_FSharpFullName(System.Type value) Line 402	F#	Symbols loaded.
 	FakeLib.dll!Yaaf.FSharp.Scripting.CompilerServiceExtensions.Type.get_FSharpFullNameWithTypeArgs(System.Type value) Line 427	F#	Symbols loaded.
 	FakeLib.dll!Yaaf.FSharp.Scripting.Extensions.IFsiSession.Let<object>(Yaaf.FSharp.Scripting.IFsiSession x, string varName, object obj) Line 719	F#	Symbols loaded.
 	FakeLib.dll!Yaaf.FSharp.Scripting.Helper.getSession(object fsi, Yaaf.FSharp.Scripting.FsiOptions options, bool reportGlobal, Microsoft.FSharp.Core.FSharpOption<System.IO.TextWriter> liveOut, Microsoft.FSharp.Core.FSharpOption<System.IO.TextWriter> liveOutFsi, Microsoft.FSharp.Core.FSharpOption<System.IO.TextWriter> liveErr, Microsoft.FSharp.Core.FSharpOption<System.IO.TextWriter> liveErrFsi, bool preventStdOut) Line 1345	F#	Symbols loaded.
 	FakeLib.dll!Yaaf.FSharp.Scripting.ScriptHost.Create(Yaaf.FSharp.Scripting.FsiOptions opts, Microsoft.FSharp.Core.FSharpOption<object> fsiObj, Microsoft.FSharp.Core.FSharpOption<bool> reportGlobal, Microsoft.FSharp.Core.FSharpOption<System.IO.TextWriter> outWriter, Microsoft.FSharp.Core.FSharpOption<System.IO.TextWriter> fsiOutWriter, Microsoft.FSharp.Core.FSharpOption<System.IO.TextWriter> errWriter, Microsoft.FSharp.Core.FSharpOption<System.IO.TextWriter> fsiErrWriter, Microsoft.FSharp.Core.FSharpOption<bool> preventStdOut) Line 1493	F#	Symbols loaded.
 	FakeLib.dll!Fake.FSIHelper.runScriptUncached(bool useCache, System.Collections.Generic.IEnumerable<string> fsiOptions, bool printDetails, Fake.FSIHelper.CacheInfo cacheInfo, System.IO.TextWriter out, System.IO.TextWriter err) Line 515	F#	Symbols loaded.
 	FakeLib.dll!Fake.FSIHelper.runFAKEScriptWithFsiArgsAndRedirectMessages(bool printDetails, Fake.FSIHelper.FsiArgs _arg1, System.Collections.Generic.IEnumerable<System.Tuple<string, string>> env, Microsoft.FSharp.Core.FSharpFunc<string, Microsoft.FSharp.Core.Unit> onErrMsg, Microsoft.FSharp.Core.FSharpFunc<string, Microsoft.FSharp.Core.Unit> onOutMsg, bool useCache) Line 608	F#	Symbols loaded.
 	FakeLib.dll!Fake.FSIHelper.runBuildScriptWithFsiArgsAt(bool printDetails, Fake.FSIHelper.FsiArgs _arg1, System.Collections.Generic.IEnumerable<System.Tuple<string, string>> env, bool useCache) Line 634	F#	Symbols loaded.
 	FAKE.exe!<StartupCode$FAKE>.$Program.main@() Line 122	F#	Symbols loaded.

@matthid
Copy link
Member

matthid commented Oct 10, 2017

Did you try with verbose mode?
Did you try with fake 5?

@0x53A
Copy link
Contributor Author

0x53A commented Oct 10, 2017

no and no by Fake5 you mean the new modular one? I've used the fake.nupkg from #1703 which has a version 5.0-betaX.

0x53A added a commit to 0x53A/Yaaf.FSharp.Scripting that referenced this issue Oct 10, 2017
create temp directory if it does not exists

fixes fsprojects/FAKE#1707
@matthid
Copy link
Member

matthid commented Oct 15, 2017

no and no by Fake5 you mean the new modular one?

Yes.

@matthid
Copy link
Member

matthid commented Apr 8, 2018

It seems like fake5 has no problems with this.
So it is an interesting corner case for fake 4 and will be tracked in matthid/Yaaf.FSharp.Scripting#9
But it probably not be hotfixed in fake 4.

@matthid matthid closed this as completed Apr 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants