Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • May 09 22:22
    LeeTibbert commented #2258
  • May 09 22:02
    LeeTibbert commented #2258
  • May 09 21:39
    LeeTibbert edited #2258
  • May 09 21:23
    LeeTibbert synchronize #2258
  • May 07 10:19
    WojciechMazur commented #2288
  • May 06 18:16
    ekrich commented #2288
  • May 06 17:34
    WojciechMazur edited #2288
  • May 06 17:34
    WojciechMazur opened #2288
  • May 06 13:42
    WojciechMazur milestoned #1984
  • May 06 13:41
    WojciechMazur milestoned #2207
  • May 06 13:41
    WojciechMazur milestoned #2168
  • May 06 13:41
    WojciechMazur milestoned #2147
  • May 06 13:41
    WojciechMazur milestoned #2141
  • May 06 13:41
    WojciechMazur milestoned #2133
  • May 06 13:39

    WojciechMazur on master

    Support for POSIX signal (#1362… (compare)

  • May 06 13:39
    WojciechMazur closed #1362
  • May 06 12:51
    WojciechMazur opened #2287
  • May 05 17:51
    LeeTibbert opened #2286
  • May 05 17:41
    LeeTibbert synchronize #2285
  • May 05 15:16
    ekrich commented #2242
zetashift
@zetashift
How fast are the compile times for Scala Native? Looking to make a small roguelike game with SDL2 and was wondering if Scala Native might be a good fit.
Lorenzo Gabriele
@lolgab
In debug mode it compiles pretty fast. Not fast as with JVM but in the order of seconds.
zetashift
@zetashift
alright I'll play around with it a bit!
LeeTibbert
@LeeTibbert
@WojciechMazur Today's (Monday April 26) Bintray brownout ( 13:00 to 21:00 UTC. Learn more at: status.bintray.com/
Shows that the entire SN build is going to start failing hard in 5 days (May 1). It is down now for another 6 hours.
Took me a few hours to figure this out; slow learner. I was thrashing seeing if the just released sbt 1.5.1 magically fixed the SN build breaking when changing build.sbt. No rest for the wicked...
How are other Scala Center projects handling this? (See the latest log file for my PR #2259, the "build image" step, for details of SN build failure I am reporting.
Oliver Schrenk
@oschrenk

I'm trying to build a project with Scala 2.13, Scala Native 0.4 and parboiled2. Parboiled2 just released 2.3.0 with Scala native (\0.4) support.

But when I try to build the example code from the README I get

[error] Found 14 missing definitions while linking
[error] Not found Top(org.parboiled2.RuleTrace$Sequence$)
...
[error] Not found Top(org.parboiled2.RuleTrace$Capture$)
...
[error] Undefined definitions found in reachability phase

With build.sbt

// sbt 1.5.1
enablePlugins(ScalaNativePlugin)

name := "scala-native-demo"

ThisBuild / scalaVersion := "2.13.5"

lazy val root = (project in file("."))
  .settings(
    libraryDependencies ++= Seq(
       "org.parboiled" %% "parboiled" % "2.3.0"
      )
  )

Am I missing some configuration/setting on my end?

Sébastien Doeraene
@sjrd
Probably %%% instead of %%.
Oliver Schrenk
@oschrenk
Yes. That was it. Such an easy thing to overlook.
Eric K Richardson
@ekrich
@WojciechMazur On that PR, if you are wanting to get it in now for your window support branch that is cool. Do you plan to add a scala-native.properties file and a marker like artifact=org.scala-native:posixlib and then process that file to filter for now? We could then move the optional to javalib and the GC to its own project and then maybe switch on the project as a first step. I actually think the filter being able add to the Config is very cool like the GC does. Right now this applied to the whole Scala Native lib but it would be eventually just for GC.
Wojciech Mazur
@WojciechMazur
@ekrich For now I've decided to take some other, simpler yet not perfect approach, by filtering unwanted code by the usage of pre-processor conditions. The idea with filtering at the level of the sbt plugin might work nicely, but it also comes with some issues that might be easier to solve using pre-processor, eg. detection of the compiler used, eg. Cygwin would basically need UNIX sources instead of native windows libraries. For now, I don't think we need to take care of that, but we should remember about that.
Eric K Richardson
@ekrich
@WojciechMazur We initially thought that would be too hard, that is why we thought up all these other approaches. I have an idea that we could use a build plugin approach for each project that could do the filtering for each project similar to how compiler plugins work. We could do that instead for the optional and for the GC include/delete. Then we could move GC to it's own project and optional to the javalib. Sound good?
Wojciech Mazur
@WojciechMazur
Yes, sounds nice! Right know I'd like to push forward merging current Windows progress, even thought it might not be flawless. At least some enthusiast will be able to use it and test it. That's why I've used preprocessor approach
Eric K Richardson
@ekrich
@WojciechMazur What you have is super great - the C preprocessor is what makes C portable as no platform can do the same thing or follow the specs perfectly. I think it is super great to open up the platform. The hard part as you know is adding things in pieces and parts - it requires allot of knowledge. The stuff you did with GCs and libunwind is great. I thought we would just say Windows support with Boehm.
Eric K Richardson
@ekrich
LeeTibbert
@LeeTibbert
I have only a few stolen moments for a quick analysis on CI failures after today's (Monday) merges (thank you @WojciechMazur ) . All of the failures appear to have nothing to do with the contents of the merge. Two of the failures appear to be CI Infrastrucure failures. The other failure appears to be a valid detection of a flaw in FilesTest. We have
seen that intermittent before. I fixed it in one place (by removing some dead wrong code). Looks like same underlying
rounding or race defect being reported by another assertion. The whole point of the failing method is that the
two times should be the same, not off by a second. The code should be fixed, if I ever get time. Changing the test to have an epsilon to account for the rounding is wrong.
LeeTibbert
@LeeTibbert
@bjornregnell Congrats & thank you for the doc PR which just got merged.
João Costa
@jd557:matrix.org
[m]

Hey everyone, I'm trying to get scala-native to run on a WSL2 setup, but I get a "No such file or directory" exception during nativeLink at https://github.com/scala-native/scala-native/blob/master/tools/src/main/scala/scala/scalanative/codegen/CodeGen.scala#L109

Any ideas on what might be causing this?

(I have 0.ll to 11.ll files on the target folder)
but I don't have any -body.ll file...
LeeTibbert
@LeeTibbert

First: condolences, I have been there and these issues certainly throw one of their feed.

As always, which SN version are you working with?

I think there are two "-v" for verbose options that can be specified in the build.sbt. If memory serves, there is one for the compile and one for the link.

If I had to bet on red or black, my WAG without data would be that something did not compile, probably one of the .c or cpp files. The error you seek may be in the compile step or earlier.

I am operating on stolen cycles, so I may not be consistently available. Post what you have after the -v options and either I or others can try to carry the baton.

João Costa
@jd557:matrix.org
[m]
I'm on 0.4.0. I'll see if I can use the verbose flags
LeeTibbert
@LeeTibbert
They are documented in the ReadTheDocs. I believe for both "latest" and "0.4.0" (and back to the egg). Sorry that my
memory is not better.
João Costa
@jd557:matrix.org
[m]
I don't think it helped much, maybe I'm using the flag wrong, but I didn't get anything much mote than the stack trace
nativeCheck also didn't help :(
LeeTibbert
@LeeTibbert
Rats! You should have seen more stuff. Can you post or make a gist of, say, the first 20 lines of the stack trace?
IMHO, there should be a special place in Hell for Exception messages which KNOW the failing name yet do not give it.
João Costa
@jd557:matrix.org
[m]

There you go: https://gist.github.com/JD557/a4c197e05aa25efc7739c744e18430a4

If you can't think of anything, I'll take a deeper look tomorrow.

LeeTibbert
@LeeTibbert
Thank you for the gist. I am looking at it now.
welcome to sbt 1.5.1. Thrashing. Have you tried sbt 1.4.9 (not .8)? I have had some trouble (some in sbt, some in SN)
getting SN to build itself using sbt 1.5.mumble. Not to slag sbt, but to probe around.
Back to the gist.
Eric K Richardson
@ekrich
I would suggest you create your application inside the WSL2 container like /home/user/ rather than in a windows area. You can start sbt with -d option and then run “run” to run your app. Ubuntu 18.04 or 20.04? or something else?
LeeTibbert
@LeeTibbert

@jd557:matrix.org Looking at the gist & traceback. Not to suck up your time, but would you be able to create a minimal reproducer project which just has a HelloWorld main()? (say from the Test.scala of the sandbox project in the SN repository, with a slight change to the output text, say "from WSL" or "from Brazil (?)".

Meanwhile, if my day job does not issue a priority interrupt, I will look at the the implementation of

 [error]        at sun.nio.ch.FileDispatcherImpl.size0(Native Method)
[error]         at sun.nio.ch.FileDispatcherImpl.size(FileDispatcherImpl.java:88)

The "Native Method" part looks like it bears investigation... I am trying to not jump to hypothesize (but have
the nagging suspicion about either a buried stub or some syscall just not working on WSL). Innocent until
proven guilty.

Eric K Richardson
@ekrich
I think running on the mounted D drive is the problem.
LeeTibbert
@LeeTibbert
As far as I can tell (Duh!) there is no FileDispatcherImpl.* in Scala Native, so this is SBT running in WSL JVMland.
Of course, Codegen.scala runs in JVM! Double Duh!.
If @ekrich's solution does not lead towards a solution and nobody else has a better solution, let me describe the way that I would take a run at this.
It would take futzing around, but I would create a private SN 0.4.1-SNAPSHOT build and put some debugging writes giving the failing file name in: /util/src/main/scala/scala/scalanative/io/VirtualDirectory.scala
// Line 118 from stack trace
 override def merge(sources: Seq[Path], target: Path): Unit = {
      val output = FileChannel.open(resolve(target),
                                    StandardOpenOption.CREATE,
                                    StandardOpenOption.WRITE,
                                    StandardOpenOption.APPEND)
      try {
        sources.foreach { path =>
          val input = FileChannel.open(resolve(path),
                                       StandardOpenOption.READ,
                                       StandardOpenOption.DELETE_ON_CLOSE)
          try {
            input.transferTo(0, input.size(), output)
          } finally input.close()
        }
      } finally output.close()
    }
  }
That should get you the name of the file which provokes the error. At best, from the name of the file it will be dead obvious what is wrong.
LeeTibbert
@LeeTibbert
@ekrich is almost certainly less work and worth trying first. Once solved, creating an Issue or two makes sense, at least to me. In particular, the code about would be more helpful if it has a catch block which at least gave the file name provoking the Exception.
João Costa
@jd557:matrix.org
[m]
ok, moving it to the home "kind of worked", thanks
(I'm having some errors, but they seem to be related to my GCC instalation)
actually, disregard what I said, everything is working fine now, thanks a bunch 👍️
kind of sucks that using a symlink also doesn't work... I wanted to have my projects accessible on both windows and WSL... oh well
LeeTibbert
@LeeTibbert
Good to see you found out what is wrong. Is there anything which can be gained from this experience to makes it harder for someone else to fall into this pain? Documentation does not solve everything, but sometimes helps. If one person has done it, somebody else will probably try the same or similar enough thing.
João Costa
@jd557:matrix.org
[m]
I guess there could be a note in the documentation to not use the windows drives in WSL, although in hindsight the fact that sbt also doesn't work well on that drive should have foreshadowed that other things could fail
Eric K Richardson
@ekrich
@jd557:matrix.org If you use VSCode you can work on you project directly inside the WSL machine. This is what I do and just check code in and out from there. The location is available to the windows file system as well via \\wsl$. Windows native support is coming but it may take a bit more time - no timeline as of yet but it is in the works hopefully for the next release.
João Costa
@jd557:matrix.org
[m]

Thanks for the suggestion (my problem is not the editor, though).

Accessing the filesystem through \wsl$ should fix my problems, however. 😊

Eric K Richardson
@ekrich
Cool 😎