silk-framework / silk

Silk Linked Data Integration Framework
http://silkframework.org/
Other
239 stars 62 forks source link

Build fails due to renamed yarn package in Debian (yarnpkg) [including fix] #237

Closed freeclimbing closed 1 year ago

freeclimbing commented 5 years ago

In Debian, yarn is renamed to yarnpkg. Due to this, sbt "project workbench" run will not find the build tool.

This can easily be fixed by checking for the Debian yarnpkg in project/ReactBuildHelper.scala:

Change

  val yarnCommand: String = sys.props.get("os.name") match {
    case Some(os) if os.toLowerCase.contains("win") =>
      // On windows, we need to provide the path of the yarn script manually
      process("where.exe" :: "yarn.cmd" :: Nil).trim
    case _ =>
        "yarn"
  }

to

  val yarnCommand: String = sys.props.get("os.name") match {
    case Some(os) if os.toLowerCase.contains("win") =>
      // On windows, we need to provide the path of the yarn script manually
      process("where.exe" :: "yarn.cmd" :: Nil).trim
    case _ =>
      /*
       * Support Debian yarnpgk
       */
      if (Process("which yarnpkg").run(ProcessLogger(_ => ())).exitValue == 0) {                              
        "yarnpkg"
      } else {
        "yarn"
      }
  }
eliohb commented 5 years ago

hello i change the Debian yarnpkg in project/ReactBuildHelper.scala but the following errors appears info] Resolving key references (15321 settings) ... [info] Set current project to root (in build file:/C:/Users/Toshiba/Desktop/silk-develop/) [info] Set current project to Silk Workbench (in build file:/C:/Users/Toshiba/Desktop/silk-develop/) java.lang.Error: Executing external process 'where.exe yarn.cmd' in working directory C:\Users\Toshiba\Desktop\silk-develop failed with error code 1 and error output: INFO: Could not find files for the given pattern(s). at ReactBuildHelper$.process(ReactBuildHelper.scala:93) at ReactBuildHelper$.process(ReactBuildHelper.scala:105) at ReactBuildHelper$.(ReactBuildHelper.scala:20) at ReactBuildHelper$.(ReactBuildHelper.scala) at $2360fed2d2f4ed3e689c$$anonfun$reactComponents$1.apply$mcV$sp(build.sbt:204) at $2360fed2d2f4ed3e689c$$anonfun$reactComponents$1.apply(build.sbt:203) at $2360fed2d2f4ed3e689c$$anonfun$reactComponents$1.apply(build.sbt:203) at sbt.std.Transform$$anon$3$$anonfun$apply$2.apply(System.scala:44) at sbt.std.Transform$$anon$3$$anonfun$apply$2.apply(System.scala:44) at sbt.std.Transform$$anon$4.work(System.scala:63) at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:228) at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:228) at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17) at sbt.Execute.work(Execute.scala:237) at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228) at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228) at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159) at sbt.CompletionService$$anon$2.call(CompletionService.scala:28) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) [error] (reactComponents/*:checkJsBuildTools) java.lang.Error: Executing external process 'where.exe yarn.cmd' in working directory C:\Users\Toshiba\Desktop\silk-develop failed with error code 1 and error output: INFO: Could not find files for the given pattern(s). [error] Total time: 5 s, completed Feb 27, 2019 11:01:06 PM

freeclimbing commented 5 years ago

Maybe you are mixing up your operating system? From the path structure in your error message i assume you are using Windows (good luck with that) - that's far from Debian.

Please check the details on your error message again, maybe you do not have yarn installed!?

123rabida123 commented 5 years ago

Hello,

Please help me

I change this code

val yarnCommand: String = sys.props.get("os.name") match { case Some(os) if os.toLowerCase.contains("win") => // On windows, we need to provide the path of the yarn script manually process("where.exe" :: "yarn.cmd" :: Nil).trim case _ => "yarn" }

to this code

val yarnCommand: String = sys.props.get("os.name") match { case Some(os) if os.toLowerCase.contains("win") => // On windows, we need to provide the path of the yarn script manually process("where.exe" :: "yarn.cmd" :: Nil).trim case _ => /*

but it is same problem of error :

[error] (reactComponents/*:checkJsBuildTools) java.lang.Error: Executing external process 'where.exe yarn.cmd' in working directory C:\silk-develop failed with error code 1 and error output: INFO: Could not find files for the given pattern(s).

[error] (core/compile:compileIncremental) java.io.IOException: Cannot run program "javac" (in directory "C:\silk-develop"): CreateProcess error=2, The system cannot find the file specified

[error] Total time: 28 s, completed May 17, 2019 2:48:51 PM

Please help me :(

chile12 commented 5 years ago

I think your solution path is correct. For the next error I would point out: https://stackoverflow.com/questions/18455732/play-framework-cant-find-javac.

Yet I did not encounter this before, so I'm just guessing this is a setup problem.