Project

General

Profile

Actions

Architecture #11781

closed

sealerate should be scoped "provided"

Added by François ARMAND about 7 years ago. Updated about 7 years ago.

Status:
Released
Priority:
N/A
Category:
Architecture - Dependencies
Target version:
Effort required:
Name check:
Fix check:
Regression:

Description

I just tested with the following source:

object Main {

  def main(args: Array[String]): Unit = {

    println(s"Hello! Direction are: ${Direction.values.map(_.name).mkString(",")}")

  }

  sealed trait Direction { def name: String }
  object Direction {
    final case object East  extends Direction { val name = "Est" }
    final case object South extends Direction { val name = "Sud" }
    final case object West  extends Direction { val name = "Ouest" }
    final case object North extends Direction { val name = "Nord" }

    def values = ca.mrvisser.sealerate.values[Direction]
  }
}

And the runtime exec is the same, but with a BIG difference in package size:

% mvn package -q

% ls -lah target
...
-rw-r--r-- 1 fanf fanf 5.1M Nov 24 14:56 test-0.0.1-SNAPSHOT-jar-with-dependencies.jar

% java -jar target/test-0.0.1-SNAPSHOT-jar-with-dependencies.jar
Hello! Direction are: Est,Sud,Ouest,Nord

% sed -i -e "s/provided/compile/" pom.xml

% mvn clean package -q

% ls -lah target
...
-rw-r--r-- 1 fanf fanf  19M Nov 24 14:57 test-0.0.1-SNAPSHOT-jar-with-dependencies.jar

% java -jar target/test-0.0.1-SNAPSHOT-jar-with-dependencies.jar
Hello! Direction are: Est,Sud,Ouest,Nord

This is normal, as sealerate is just a compile time macro. But it hold a "compile" dependency toward scala-reflect/compiler, which accounts for ~12Mo.
We won't get the size reduction until all transitive dep toward scala-compiler are removed, but this one is a easy one to break.

Actions #1

Updated by François ARMAND about 7 years ago

  • Status changed from In progress to Pending technical review
  • Assignee changed from François ARMAND to Vincent MEMBRÉ
  • Pull Request set to https://github.com/Normation/rudder-parent-pom/pull/49
Actions #2

Updated by François ARMAND about 7 years ago

  • Status changed from Pending technical review to Pending release
Actions #3

Updated by Vincent MEMBRÉ about 7 years ago

  • Status changed from Pending release to Released

This bug has been fixed in Rudder 4.1.9 and 4.2.3 which were released today.

Actions

Also available in: Atom PDF