Closed smoothdeveloper closed 7 years ago
AFAIK there's no way to fix this except through response files (and having the MSBuild task use the response file feaure)
@dsyme thanks for feedback.
Could someone who has this info handy point to the bits of C# msbuild target that deal with response file and where is the F# msbuild target in this repository?
Thanks
@smoothdeveloper i think it's https://github.com/Microsoft/visualfsharp/blob/master/src/fsharp/FSharp.Build/Fsc.fs
Yes, that's the MSBuild task. You'd need to change ExecuteTool to write a response file and just pass that @ argument and nothing else https://github.com/Microsoft/visualfsharp/blob/master/src/fsharp/FSharp.Build/Fsc.fs#L347
(and of course this will also require having response files implemented per #816)
@enricosada would it make sense to update FSharp.Build/Fsc.cs in your branch / PR #816?
I looked at it briefly and it seemed to me that instead of returning the string https://github.com/Microsoft/visualfsharp/blob/master/src/fsharp/FSharp.Build/Fsc.fs#L512_L513 we should generate the temp file with the contents of the string and return @filename instead.
This change seems minor but I haven't yet figured how to get fsc itself to work once built in debug (get fsharp.core binding issue) so I'm not in shape to be able to test it soon.
@smoothdeveloper Does running Debug\net40\bin\fsc.exe
from the command line work? If not, did you follow these steps here: https://github.com/Microsoft/visualfsharp/blob/master/DEVGUIDE.md#3-full-steps-before-running-tests?
Assuming it does then you should be able to change the path to the Microsoft.FSharp.targets file in your project file to point to ...\Debug\net40\bin\Microsoft.FSharp.targets
. After doing that I believe building the project will use the new toolchain, including the new FSharp.Build.dll and fsc.exe.
Best Don
@dsyme I actually followed the steps 1 and 2 till You can now use the updated F# compiler in debug\net40\bin\fsc.exe and F# Interactive in debug\net40\bin\fsi.exe to develop and test basic language and tool features.
in 2, at this point I get a binding error for FSharp.Core while calling fsc.exe.
Thanks for the details regarding the targets file, I'll report back the exact error message once I have a chance to check on the machine I was trying this out.
Strange, I thought those two steps were enough, since it would copy FSharp.Core.dll to the Debing\net40\bin
directory as well.
But yes, try running step 3 as well.
/cc @otawfik-ms @KevinRansom for help about build and test
@smoothdeveloper for build problems, i usually call appveyor-build.cmd
instead of run single msbuild/runtests, it's faster for me
It build in release, but i see it a the fastest working solution for me to test stuff.
It's a bit of contributor pain develop with multiple msbuild + update.cmd.
you see what it's going to do, for example appveyor-build.cmd net40,build_only
Build/Tests configuration:
DO_NET40=1
DO_PORTABLE47=0
DO_PORTABLE7=0
DO_PORTABLE78=0
DO_PORTABLE259=0
DO_VS=0
TEST_NET40=0
TEST_PORTABLE47=0
TEST_PORTABLE7=0
TEST_PORTABLE78=0
TEST_PORTABLE259=0
TEST_VS=0
TEST_CAMBRIDGE_SUITE=0
CONF_CAMBRIDGE_SUITE=
TEST_QA_SUITE=0
CONF_QA_SUITE=
some good:
appveyor-build.cmd all,build_only
just compile in release, no testsappvetor-build.cmd all,smoke_only
build and run smoke testsafter build you can always run RunTest.cmd
or run fsc/fsi in Release\net40\bin
@smoothdeveloper i'd like to not change my pr, it's already a long process to review/merge, it's ready and i need it for dotnet cli. msbuild can be another pr (yours maybe).
You can clone my pr, add msbuild support, and submit another pr.
If you push a pr or a personal branch, i can help you (monday or tuesday, out for weekend) about build problems or other stuff. It's easy to clone and test it.
After my pr is merged, you can rebase your pr so only your change are there ( i can help if you need git command line help )
Btw i use github/hub to clone pr, you can hub checkout https://github.com/Microsoft/visualfsharp/pull/831 msbuild_should_use_responsefile
that create a local branch msbuild_should_use_responsefile
from my pr. it's a really nice tool
@enricosada thanks for the help, will try it out and report if I'm able to run fsc.exe after that.
Yes I can have a look at this issue with the msbuild task to use response file in a separate branch that I'll base on your branch for now, and make a PR once it works and #816 is merged.
For my build issue, it is that I was not running the build from an admin prompt, which is explained at the bottom of DEVGUIDE.md.
@enricosada I made minimal change in a branch https://github.com/smoothdeveloper/visualfsharp/tree/use-response-files-in-msbuild
After looking into more details at ToolTask I think overriding GenerateResponseFileCommands is the correct approach, but I get weird message once proto compiler starts its work.
CoreCompile:
..\..\..\Proto\net40\bin\fsc-proto.exe -o:obj\Release\net40\FSharp.Core.dll -g --debug:pdbonly --noframework --baseaddress:0x05000000 --define:STRONG_NAME_AND_DELAY_SIGN_FSHARP_COMPILER_W
ITH_MSFT_KEY --define:RUNTIME --define:TRACE --define:OPEN_BUILD --define:FSHARP_CORE_4_5 --define:FX_ATLEAST_45 --define:FX_ATLEAST_40 --define:FX_ATLEAST_35 --define:BE_SECURITY_TRANSPA
RENT --define:QUERIES_IN_FSLIB --define:PUT_TYPE_PROVIDERS_IN_FSCORE --define:FX_ATLEAST_LINQ --doc:..\..\..\Release\net40\bin\FSharp.Core.xml --optimize+ --resource:obj\Release\net40\FSC
ore.resources -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\mscorlib.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NET
Framework\v4.5\System.Core.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsof
t\Framework\.NETFramework\v4.5\System.Numerics.dll" --target:library --nowarn:69,65,54,61,75,45,55,62,75,1204 --warn:3 --warnaserror --warnaserror:76 --fullpaths --flaterrors --subsystemv
ersion:6.00 --highentropyva+ --times --warnon:1182 --compiling-fslib --optimize --maxerrors:20 --extraoptimizationloops:1 --compiling-fslib-40 --version:4.4.1.9055 --delaysign+ --keyfil
e:"..\..\fsharp\msft.pubkey" prim-types-prelude.fsi prim-types-prelude.fs SR.fs prim-types.fsi prim-types.fs local.fsi local.fs array2.fsi array2.fs option.fsi option.fs collections.fsi c
ollections.fs seq.fsi seq.fs string.fsi string.fs list.fsi list.fs array.fsi array.fs array3.fsi array3.fs map.fsi map.fs set.fsi set.fs reflect.fsi reflect.fs event.fsi event.fs math\n.f
si math\n.fs math\z.fsi math\z.fs ..\..\utils\sformat.fsi ..\..\utils\sformat.fs printf.fsi printf.fs quotations.fsi quotations.fs nativeptr.fsi nativeptr.fs control.fsi control.fs Linq.f
si Linq.fs MutableTuple.fs QueryExtensions.fs Query.fsi Query.fs SI.fs fslib-extra-pervasives.fsi fslib-extra-pervasives.fs ..\..\assemblyinfo\assemblyinfo.FSharp.Core.dll.fs "C:\Users\ga
uthier\AppData\Local\Temp\.NETFramework,Version=v4.5.AssemblyAttributes.fs"
FSC : error FS0207: No inputs specified [C:\dev\src\projects\github.com\visualfsharp\src\fsharp\FSharp.Core\FSharp.Core.fsproj]
FSC : error FS1227: Filename 'obj\Release\net40\FSharp.Core.dll -g --debug:pdbonly --noframework --baseaddress:0x05000000 --define:STRONG_NAME_AND_DELAY_SIGN_FSHARP_COMPILER_WITH_MSFT_KEY - -define:RUNTIME --define:TRACE --define:OPEN_BUILD --define:FSHARP_CORE_4_5 --define:FX_ATLEAST_45 --define:FX_ATLEAST_40 --define:FX_ATLEAST_35 --define:BE_SECURITY_TRANSPARENT --define:QU ERIES_IN_FSLIB --define:PUT_TYPE_PROVIDERS_IN_FSCORE --define:FX_ATLEAST_LINQ --doc:..\..\..\Release\net40\bin\FSharp.Core.xml --optimize+ --resource:obj\Release\net40\FSCore.resources -r:" C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\mscorlib.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\Syste m.Core.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramew ork\v4.5\System.Numerics.dll" --target:library --nowarn:69,65,54,61,75,45,55,62,75,1204 --warn:3 --warnaserror --warnaserror:76 --fullpaths --flaterrors --subsystemversion:6.00 --highentrop yva+ --times --warnon:1182 --compiling-fslib --optimize --maxerrors:20 --extraoptimizationloops:1 --compiling-fslib-40 --version:4.4.1.9055 --delaysign+ --keyfile:"..\..\fsharp\msft.pubke y" prim-types-prelude.fsi prim-types-prelude.fs SR.fs prim-types.fsi prim-types.fs local.fsi local.fs array2.fsi array2.fs option.fsi option.fs collections.fsi collections.fs seq.fsi seq.fs string.fsi string.fs list.fsi list.fs array.fsi array.fs array3.fsi array3.fs map.fsi map.fs set.fsi set.fs reflect.fsi reflect.fs event.fsi event.fs math\n.fsi math\n.fs math\z.fsi math\z .fs ..\..\utils\sformat.fsi ..\..\utils\sformat.fs printf.fsi printf.fs quotations.fsi quotations.fs nativeptr.fsi nativeptr.fs control.fsi control.fs Linq.fsi Linq.fs MutableTuple.fs Query Extensions.fs Query.fsi Query.fs SI.fs fslib-extra-pervasives.fsi fslib-extra-pervasives.fs ..\..\assemblyinfo\assemblyinfo.FSharp.Core.dll.fs "C:\Users\gauthier\AppData\Local\Temp\.NETFram ework,Version=v4.5.AssemblyAttributes.fs"' contains invalid character '"' [C:\dev\src\projects\github.com\visualfsharp\src\fsharp\FSharp.Core\FSharp.Core.fsproj]
Done Building Project "C:\dev\src\projects\github.com\visualfsharp\src\fsharp\FSharp.Core\FSharp.Core.fsproj" (Build target(s)) -- FAILED.
Done Building Project "C:\dev\src\projects\github.com\visualfsharp\src\fsharp-library-build.proj" (default targets) -- FAILED.
Wouldn't mind if you could have a look and suggest what I can try to fix this in the branch.
@smoothdeveloper i'll checkl your branch, today or tomorrow. Btw now the responsefile is merged! so less problems :smile:
Can someone with knowledge about msbuild tasks let us know, assuming I had a fix for this, with the task compiled in an arbitrary assembly, how would I go and modify an arbitrary .fsproj (or the main fsharp .targets so all .fsproj would be affected) to leverage it?
I want to make sure that if someone comes with a fix, this would be possible to deploy with reasonable effort before or after another release of the compiler.
I'm concerned I might face the issue soon in one of my projects which has a growing list of assembly references and want to make sure I'll be ready to deploy a work around quick.
Thanks.
@smoothdeveloper you mean how to point your local targets file locally to use the arbitary assembly? (link) Are you trying to test the fix on a local project build? you can modify your .fsproj to use the modified target that uses your assembly.
@otawfik-ms thanks for pointer on loading arbitrary assembly / running arbitrary task from .proj file.
Are you trying to test the fix on a local project build?
I had issues after building proto, I might have done a mistake but I remember looking at decompiled msbuild task for C# (is it opensource now? link to it's source would be good for reference), with the possibility to call the task from a proj, I might have easier time just compiling the task and using it in a playground instead of dealing with the whole proto build etc.
I'll try to come back on this issue this weekend.
@smoothdeveloper here you are: https://github.com/dotnet/roslyn/tree/master/src/Compilers/Core/MSBuildTask
@KevinRansom I confirm the bug is fixed by #1412 !
Adding a long list of dependencies to a fsharp project makes the compiler/msbuild fail.
It's probably a case where #816 (response files) would help, from command line I can't paste more than about 8k in a single command.