[MacPorts] #39793: Allow custom Java options to launch sbt
#39793: Allow custom Java options to launch sbt -----------------------------+-------------------------------- Reporter: luc_j_bourhis@… | Owner: macports-tickets@… Type: request | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.3 Keywords: | Port: sbt -----------------------------+-------------------------------- The default Java options in /opt/local/share/sbt/sbt may not suit every user. For example, I like to reduce the memory footprint for some projects by using -XX:+UseCompressedOops -XX:+UseConcMarkSweepGC and then by tuning -Xms and -Xmx. Thus I propose the attached patch that lets user define their custom option in ~/.sbtconfig -- Ticket URL: <https://trac.macports.org/ticket/39793> MacPorts <http://www.macports.org/> Ports system for OS X
#39793: Allow custom Java options to launch sbt ------------------------------+---------------------- Reporter: luc_j_bourhis@… | Owner: blair@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: ports | Version: Resolution: | Keywords: haspatch Port: sbt | ------------------------------+---------------------- Changes (by macsforever2000@…): * keywords: => haspatch * owner: macports-tickets@… => blair@… * version: 2.1.3 => * type: request => enhancement Comment: In the future, please Cc the port maintainer(s). -- Ticket URL: <https://trac.macports.org/ticket/39793#comment:1> MacPorts <http://www.macports.org/> Ports system for OS X
#39793: Allow custom Java options to launch sbt ------------------------------+---------------------- Reporter: luc_j_bourhis@… | Owner: blair@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: ports | Version: Resolution: | Keywords: haspatch Port: sbt | ------------------------------+---------------------- Comment (by luc_j_bourhis@…): Better patch (sbt2.diff) that is more compatible with current behaviour. -- Ticket URL: <https://trac.macports.org/ticket/39793#comment:2> MacPorts <http://www.macports.org/> Ports system for OS X
#39793: Allow custom Java options to launch sbt ------------------------------+---------------------- Reporter: luc_j_bourhis@… | Owner: blair@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: ports | Version: Resolution: | Keywords: haspatch Port: sbt | ------------------------------+---------------------- Comment (by blair@…): Here's my new proposed patch which doesn't assume that ~/.sbtconfig sets SBT_JAVA_OPTS. Let me know if this works for you. {{{ Index: sbt.sh =================================================================== --- sbt.sh (revision 108610) +++ sbt.sh (working copy) @@ -17,9 +17,15 @@ # Is the location of the SBT launcher JAR file. LAUNCHJAR="__SBT_LAUNCHER_PATH__" -# Ensure enough heap space is created for sbt. These settings are the -# default settings from Typesafe's sbt wrapper. +# Customization: this may define a variable SBT_JAVA_OPTS +SBTCONF=~/.sbtconfig +if [ -f "$SBTCONF" ]; then + . $SBTCONF + JAVA_OPTS="$SBT_JAVA_OPTS" +fi if [ -z "$JAVA_OPTS" ]; then + # Ensure enough heap space is created for sbt. These settings are + # the default settings from Typesafe's sbt wrapper. JAVA_OPTS="-XX:+CMSClassUnloadingEnabled -Xms1536m -Xmx1536m -XX:MaxPermSize=384m -XX:ReservedCodeCacheSize=192m -Dfile.encoding=UTF8" fi }}} -- Ticket URL: <https://trac.macports.org/ticket/39793#comment:4> MacPorts <http://www.macports.org/> Ports system for OS X
#39793: Allow custom Java options to launch sbt ------------------------------+---------------------- Reporter: luc_j_bourhis@… | Owner: blair@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: ports | Version: Resolution: | Keywords: haspatch Port: sbt | ------------------------------+---------------------- Comment (by luc_j_bourhis@…): Replying to [comment:4 blair@…]:
Here's my new proposed patch which doesn't assume that ~/.sbtconfig sets SBT_JAVA_OPTS. Let me know if this works for you.
It works. But written in this way, shall we set JAVA_OPTS instead of SBT_JAVA_OPTS in ~/.sbtconfig then? This would make it more obvious, wouldn't it? -- Ticket URL: <https://trac.macports.org/ticket/39793#comment:5> MacPorts <http://www.macports.org/> Ports system for OS X
#39793: Allow custom Java options to launch sbt ------------------------------+---------------------- Reporter: luc_j_bourhis@… | Owner: blair@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: ports | Version: Resolution: | Keywords: haspatch Port: sbt | ------------------------------+---------------------- Comment (by blair@…): Sure, we can do this: {{{ Index: files/sbt.sh =================================================================== --- files/sbt.sh (revision 108610) +++ files/sbt.sh (working copy) @@ -17,9 +17,14 @@ # Is the location of the SBT launcher JAR file. LAUNCHJAR="__SBT_LAUNCHER_PATH__" -# Ensure enough heap space is created for sbt. These settings are the -# default settings from Typesafe's sbt wrapper. +# Customization: this may define JAVA_OPTS. +SBTCONF=~/.sbtconfig +if [ -f "$SBTCONF" ]; then + . $SBTCONF +fi if [ -z "$JAVA_OPTS" ]; then + # Ensure enough heap space is created for sbt. These settings are + # the default settings from Typesafe's sbt wrapper. JAVA_OPTS="-XX:+CMSClassUnloadingEnabled -Xms1536m -Xmx1536m -XX:MaxPermSize=384m -XX:ReservedCodeCacheSize=192m -Dfile.encoding=UTF8" fi }}} -- Ticket URL: <https://trac.macports.org/ticket/39793#comment:6> MacPorts <http://www.macports.org/> Ports system for OS X
#39793: Allow custom Java options to launch sbt ------------------------------+---------------------- Reporter: luc_j_bourhis@… | Owner: blair@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: ports | Version: Resolution: | Keywords: haspatch Port: sbt | ------------------------------+---------------------- Comment (by luc_j_bourhis@…): Yes, exactly, I think that's the better version. -- Ticket URL: <https://trac.macports.org/ticket/39793#comment:7> MacPorts <http://www.macports.org/> Ports system for OS X
#39793: Allow custom Java options to launch sbt ------------------------------+---------------------- Reporter: luc_j_bourhis@… | Owner: blair@… Type: enhancement | Status: closed Priority: Normal | Milestone: Component: ports | Version: Resolution: fixed | Keywords: haspatch Port: sbt | ------------------------------+---------------------- Changes (by blair@…): * status: new => closed * resolution: => fixed Comment: Fixed in r108615. I changed ~ to $HOME also in the final commit. -- Ticket URL: <https://trac.macports.org/ticket/39793#comment:8> MacPorts <http://www.macports.org/> Ports system for OS X
#39793: Allow custom Java options to launch sbt ------------------------------+---------------------- Reporter: luc_j_bourhis@… | Owner: blair@… Type: enhancement | Status: closed Priority: Normal | Milestone: Component: ports | Version: Resolution: fixed | Keywords: haspatch Port: sbt | ------------------------------+---------------------- Comment (by luc_j_bourhis@…): thanks a bunch -- Ticket URL: <https://trac.macports.org/ticket/39793#comment:9> MacPorts <http://www.macports.org/> Ports system for OS X
participants (1)
-
MacPorts