jpmml / jpmml-sparkml

Java library and command-line application for converting Apache Spark ML pipelines to PMML
GNU Affero General Public License v3.0
267 stars 80 forks source link

Build error: com.google.common.io.MoreFiles.checkAllowsInsecure #67

Closed dlepzelter closed 5 years ago

dlepzelter commented 5 years ago

On trying to build via Maven on OS X, I get the following (for example; the same error occurs 29 other times, for different algorithms):

  <testcase name="evaluateDecisionTreeAudit" classname="org.jpmml.sparkml.ClassificationTest" time="8.536">
    <error message="/var/folders/my/csv46_zj4n519tcqvt8m2w08lsl7ch/T/DecisionTreeAudit9043072563902398363.zip: unable to guarantee security of recursive delete" type="com.google.common.io.InsecureRecursiveDeleteException">com.google.common.io.InsecureRecursiveDeleteException: /var/folders/my/csv46_zj4n519tcqvt8m2w08lsl7ch/T/DecisionTreeAudit9043072563902398363.zip: unable to guarantee security of recursive delete
        at com.google.common.io.MoreFiles.checkAllowsInsecure(MoreFiles.java:742)

The impression that I get from Google is that this is because the Maven install is trying to do something mildly naughty that could, in the wrong hands, delete more than it should be able to delete, and OS X doesn't prevent this. Is there any way this can be done in a way that OS X and Maven can agree on?

vruusmann commented 5 years ago

There are pre-built JPMML-SparkML executable applications available here: https://github.com/jpmml/jpmml-sparkml/releases

If you really need to build one yourself (eg. were tweaking the source code), then you can disable integration tests by specifying the -Dmaven.test.skip=true system property:

$ mvn -Dmaven.test.skip=true clean install

The build should complete in less than 10 seconds if integration tests are disabled.

This exceptions appears to be related to post-integration testing cleanup. Should probably add an extra exception handler, or move away from Guava's utility method (to something more reckless).

dlepzelter commented 5 years ago

Between the prebuilt option and the disabling integration tests, I'm satisfied for the moment. I would appreciate the less hacky fix whenever you get to it, though. (Even just the exception handler would be good; "Warning, clean these subdirectories up yourself because Guava won't.")