You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by "Steve Lawrence (Jira)" <ji...@apache.org> on 2021/07/27 14:54:00 UTC

[jira] [Resolved] (DAFFODIL-2544) Running sbt in windows causes "Unrecognized option: -mem" failure

     [ https://issues.apache.org/jira/browse/DAFFODIL-2544?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Steve Lawrence resolved DAFFODIL-2544.
--------------------------------------
    Fix Version/s: 3.2.0
       Resolution: Fixed

Fixed in commit 032347dfcfce47573f81b3eaac3c782d0b3b7d9f

> Running sbt in windows causes "Unrecognized option: -mem" failure
> -----------------------------------------------------------------
>
>                 Key: DAFFODIL-2544
>                 URL: https://issues.apache.org/jira/browse/DAFFODIL-2544
>             Project: Daffodil
>          Issue Type: Bug
>          Components: Infrastructure, Windows
>            Reporter: Steve Lawrence
>            Assignee: Min Phyo Aung
>            Priority: Minor
>              Labels: beginner
>             Fix For: 3.2.0
>
>
> If you try to start sbt in a windows command shell, you get the error
> {quote}Unregcognized option: -mem
> {quote}
> And if fails to start.
> After some trial and error, it looks like sbt on windows does not actually parse the contents of the .sbtopts file, but instead just sends the contents directly to java. Our .sbtopts file uses the "-mem" option to increase memory given to Java needed for compiling/running tests. In linux, this works and sbt to parses the -mem option, converts it to the correct Java memory options (e.g. -Xms, -Xmx), and then passes those to java. But windows does not do that, so we get a failure.
> Note that things work fine in our Windows CI tests because our CI uses msys2, which is essentially a modified version of cygwin, so doesn't use the sbt .bat that has this problem, but instead uses the same sbt script that Linux uses.
> To get around this, we should modify our .sbtopts file so that it it provides the memory options that Java expects, so we do not rely on sbt to convert -mem to those options.
> For reference, Daffodil sets -mem to 4096, which is equivalent to this in the .sbtopts file
> {code}
> -J-Xms4096m
> -J-Xmx4096m
> -J-Xss4M
> -J-XX:ReservedCodeCacheSize=512m
> {code}
> So we should just replace -mem with those options in our .sbtopts file



--
This message was sent by Atlassian Jira
(v8.3.4#803005)