标签: fsc

如何关闭Scala快速编译服务器(FSC)超时?

我正在使用Scala编译服务器.这可能与我的IDE IntelliJ IDEA无关,但我只是通知您,我通过该IDE中的特殊运行配置启动Scala编译服务器.

经过一段时间没有编译任何东西,编译服务器终止,没有任何消息.通常,当我尝试编译某些内容并且编译失败时,我只会注意到这一点.然后,我需要再次启动编译服务器,当然下一次编译需要很长时间,因为它是自启动编译服务器以来的第一次编译.

如何关闭超时?我查看了scalac的联机帮助页,似乎没有选项.我可以为该运行配置添加VM选项.

scala intellij-idea scalac fsc

13
推荐指数
2
解决办法
1624
查看次数

F#编译器抛出OutOfMemoryException

我使用的项目包含很多从单个基类继承的类.在单元测试中,我需要按类型和数据比较接收结果.

当条件列表包含足够多的不同条件时,我按类型使用匹配比较时编译器抛出OutOfMemoryException.

例如,在编译期间跟随F#代码引发System.OutOfMemoryException(参数错误FS0193)(并且在抛出异常之前编译大约需要30秒)

type IBaseClass() = class end

type IChildClass1 () = inherit IBaseClass () 

type IChildClass2 () = inherit IBaseClass () 

type IChildClass3 () = inherit IBaseClass () 

type IChildClass4 () = inherit IBaseClass () 

type IChildClass5 () = inherit IBaseClass () 

type IChildClass6 () = inherit IBaseClass () 

type IChildClass7 () = inherit IBaseClass () 

type IChildClass8 () = inherit IBaseClass () 

type IChildClass9 () = inherit IBaseClass () 

type IChildClass10 () = inherit …
Run Code Online (Sandbox Code Playgroud)

f# compiler-errors out-of-memory fsc

12
推荐指数
1
解决办法
357
查看次数

Maven不正当地启动fsc?

我正在尝试使用fsc(快速scala编译器)和我的maven项目.我pom.xml有:

...
 <execution>
   <id>cc</id>
   <goals>
     <goal>cc</goal>
   </goals>
   <phase>compile</phase>
   <configuration>
     <useFsc>true</useFsc>
     <once>true</once>
   </configuration>
 </execution>
...
Run Code Online (Sandbox Code Playgroud)

正如在使用maven编译Scala文件的最快方法中所讨论的那样

当我输入时mvn scala:cc,它会挂起:

[INFO] wait for files to compile...
Run Code Online (Sandbox Code Playgroud)

运行 mvn scala:cc -DdisplayCmd=true -Dverbose=true

 [INFO] cmd:  /bin/sh -c .../java -classpath [redacted] scala.tools.nsc.MainGenericRunner scala.tools.nsc.CompileServer >MainGenericRunner.out 2>MainGenericRunner.err
Run Code Online (Sandbox Code Playgroud)

这似乎很奇怪(不应该不包括scala.tools.nsc.MainGenericRunner?)我注意到MainGenericRunner.out包含

no such file: scala.tools.nsc.CompileServer
Run Code Online (Sandbox Code Playgroud)

这似乎证实了我的怀疑.

有没有人遇到这个,或者有解决方法?我真的很想用fsc来加速我的构建.我在Google群组中找到了一个具有类似输出的用户,但没有跟进.

在OSX上运行scala 2.8.1和maven 3.0.3

scala maven fsc scala-maven-plugin

8
推荐指数
1
解决办法
301
查看次数

如何运行Fast Scala Compiler远程服务器?

我想设置一个在盒子上运行的fsc进程,然后我可以远程访问它.

我知道我需要共享一个临时目录.

但是,我很难在笔记本电脑上使用它.

我尝试着:

fsc -Djava.io.tmpdir=/tempscala -server 127.0.0.1:8080
Run Code Online (Sandbox Code Playgroud)

但它只是给了我使用选项......

救命?

java scala scalac fsc

5
推荐指数
1
解决办法
1106
查看次数

快速scala编译器:无法建立与编译守护程序的连接

我在OpenVZ虚拟化下有一台ubuntu机器.当我运行fsc test.scala时,我得到:

Unable to establish connection to compilation daemon

然后ps aux向我展示了许多看起来像这样的过程

ren      17482  0.0  0.0   4908  1400 pts/0    S    00:29   0:00 /bin/bash --posix /usr/bin/scala -Djava.net.preferIPv4Stack=true scala.tools
ren      17490  0.2  0.5 1246676 24268 pts/0   Sl   00:29   0:00 java -Djava.net.preferIPv4Stack=true -Djava.net.preferIPv4Stack=true -Xbootc
Run Code Online (Sandbox Code Playgroud)

我已经没有想法如何让它工作,版本是Scala code runner version 2.9.2 -- Copyright 2002-2011, LAMP/EPFL.有任何想法吗?

编辑:

找到了 这个,所以:

  • 没有安装selinux
  • 出口| grep SCALA不会返回任何内容,但是scalac和scala编译/运行正常,所以我假设这一步没问题
  • ping localhost - 工作
  • fsc -reset - 同样的错误
  • fsc -verbose >> logfile.log 2>&1产生:
Fast Scala compiler version 2.9.2 -- …
Run Code Online (Sandbox Code Playgroud)

scala fsc

5
推荐指数
1
解决办法
857
查看次数

带有AssemblyInfo.fs文件的MSBuild F#项目.使用fsc.exe在CoreCompile中出错

我有问题通过MSBuild构建我的解决方案.

在我的解决方案中,我有F#项目,我已经添加了AssemblyInfo.fs文件,这样的文件如下所示:

namespace namespaceName

open System.Reflection
open System.Runtime.CompilerServices
open System.Runtime.InteropServices

// General Information about an assembly is controlled through the following 
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[<assembly: AssemblyTitle("assemblyName")>]
[<assembly: AssemblyDescription("")>]
[<assembly: AssemblyConfiguration("")>]
[<assembly: AssemblyCompany("")>]
[<assembly: AssemblyProduct("assemblyName")>]
[<assembly: AssemblyCopyright("Copyright ©  2013")>]
[<assembly: AssemblyTrademark("")>]
[<assembly: AssemblyCulture("")>]

// Setting ComVisible to false makes the types in this assembly not visible 
// to COM components.  If you need to access a type …
Run Code Online (Sandbox Code Playgroud)

msbuild f# assemblyinfo fsc visual-studio-2012

5
推荐指数
0
解决办法
1179
查看次数

更改Visual Studio 2010使用的F#工具

我用很少的语法添加重建了F#.我能够告诉VS2010将它们用于F#Interactive和构建,但代码编辑器仍然声称我犯了错误(即使项目构建得很好).

甚至可以改变这个吗?如果是 - 怎么样?

intellisense f# visual-studio-2010 visual-studio fsc

5
推荐指数
1
解决办法
250
查看次数

如何在 .NET Core 上直接调用 F# 编译器?

更新:

我想直接从 .NET Core SDK 调用 F# 编译器(即 fsc)。

我知道 dotnet build & co,但是当我只需要编译一个简单的问题时,我不想涉及它们,即在 fsc file.fs 就足够的情况下。

我尝试在 .NET Core SDK 中搜索(在我的 Mac 上,它在 /usr/local/share/dotnet/sdk/2.2.102/FSharp 中)并在那里找到了一个 fsc.exe 文件。不幸的是,当我尝试使用 dotnet /usr/local/share/dotnet/sdk/2.2.102/FSharp/fsc.exe 启动它时,它给了我一个错误:

error FS0193: Could not load file or assembly 'Microsoft.Build.Tasks.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
Run Code Online (Sandbox Code Playgroud)

环境:macOS,.NET Core 2.2

.net f# fsc .net-core

5
推荐指数
1
解决办法
899
查看次数

FSC编译警告:程序集"SMDiagnostics"被过度引用,无法自动解决程序集

在编译我的项目时(它是一个实现Windows服务的控制台应用程序),间歇性地发布了上述警告.

(这里有完整的警告文字)

Warning 1   Assembly 'SMDiagnostics' was referenced transitively and the assembly could not be resolved automatically. 
Static linking will assume this DLL has no dependencies on the F# library or other statically linked DLLs. Consider adding an explicit reference to this DLL.   
FSC 1   1   myService (Applications\myService\myService)
Run Code Online (Sandbox Code Playgroud)

这个错误意味着什么,可能导致什么?

compiler-construction f# compiler-warnings fsc

4
推荐指数
1
解决办法
531
查看次数

如何使用fsc.exe(F#)或csc.exe(C#)包含app.config文件?

我有一个使用app.config文件的控制台应用程序但是我无法弄清楚如何在命令行参数中包含它,以便当我使用fsc.exe以编程方式编译时,输出将创建Program.exe.config.现在我的解决方法是将app.config重命名为Program.exe.config并将其复制到与Program.exe相同的输出位置.我需要的是fsc.exe命令行参数来执行此操作,但是我怀疑csc.exe将具有与fsc.exe相同或非常接近的内容,因此如果你知道它在csc.exe中是什么我会试试看.

短发

compiler-construction f# csc fsc

2
推荐指数
1
解决办法
1180
查看次数