When building devel/spark on a system that sets /root to read-only (such as ports-mgmt/Synth or dragonfly poudriere), spark fails to build: [ERROR] Failed to execute goal net.alchim31.maven:scala-maven-plugin:3.2.2:compile (scala-compile-first) on project spark-test-tags_2.10: Execution scala-compile-first of goal net.alchim31.maven:scala-maven-plugin:3.2.2:compile failed: Could not create directory /root/.zinc/0.3.5/compiler-interface-2.10.5-51.0 -> [Help 1] Spark should not be writing at /root during the build, this is a file system violation. if I find a solution, I'll post it.
okay, I solved it. you need to pass "-Duser.home=${WRKDIR}" to maven (as seen in other maven ports) see example: --- Makefile.orig 2016-04-10 12:05:14 UTC +++ Makefile @@ -46,7 +46,11 @@ JAVA_ARCH = ${ARCH} do-build: ${MKDIR} ${WRKDIR}/snappy/org/xerial/snappy/native/${OPSYS}/${JAVA_ARCH} ${CP} ${LOCALBASE}/lib/libsnappyjava.so ${WRKDIR}/snappy/org/xerial/snappy/native/${OPSYS}/${JAVA_ARCH} - cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${LOCALBASE}/share/java/maven33/bin/mvn --offline -Dmaven.repo.local=${WRKDIR}/m2 clean package -Dhadoop.version=2.7.2 -Pyarn -Phadoop-2.6 -DskipTests + cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} \ + ${LOCALBASE}/share/java/maven33/bin/mvn --offline \ + -Dmaven.repo.local=${WRKDIR}/m2 clean package \ + -Dhadoop.version=2.7.2 -Pyarn -Phadoop-2.6 -DskipTests \ + -Duser.home=${WRKDIR} ${JAR} uvf ${WRKSRC}/assembly/target/scala*/*assembly*hadoop*.jar -C ${WRKDIR}/snappy org This patch also changed the *HUGE* line to respect 80 columns which is the convention (and nice for people that aren't on a virtual terminal)
Thank you very much for your investigation! Can you please commit it?
A commit references this bug: Author: marino Date: Sun Apr 10 13:39:47 UTC 2016 New revision: 412931 URL: https://svnweb.freebsd.org/changeset/ports/412931 Log: devel/spark: Avoid building in /root ($HOME) Following other maven ports, set user.home to $WRKDIR to prevent writing in /root or $HOME during the build, which is a file system violation. While here, change the do-install target to respect 80 columns. PR: 208666 Approved by: maintainer (demon@) (notice the 666 suffix?) Changes: head/devel/spark/Makefile
done, thanks!