Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ZEPPELIN-1407] Fix Scala 2.11 build #1400

Closed
wants to merge 1 commit into from

Conversation

lresende
Copy link
Member

@lresende lresende commented Sep 3, 2016

What is this PR for?

Avoid activating the Scala 2.10 profile when building for Scala 2.11

What type of PR is it?

[Bug Fix]

What is the Jira issue?

How should this be tested?

Perform Scala 2.10 and 2.11 builds starting from a maven repository that does not have org.apache.zeppelin artifacts.

@lresende
Copy link
Member Author

lresende commented Sep 3, 2016

@bzz @Leemoonsoo Please review, this is more like a hotfix for the build.

@lresende
Copy link
Member Author

lresende commented Sep 3, 2016

This should go for both master and 0.6x release.

@felixcheung
Copy link
Member

build failed I think because of

[ERROR] Failed to execute goal on project zeppelin-spark-dependencies_2.10: Could not resolve dependencies for project org.apache.zeppelin:zeppelin-spark-dependencies_2.10:jar:0.7.0-SNAPSHOT: The following artifacts could not be resolved: org.apache.spark:spark-core_2.11:jar:1.1.1, org.apache.spark:spark-repl_2.11:jar:1.1.1, org.apache.spark:spark-sql_2.11:jar:1.1.1, org.apache.spark:spark-hive_2.11:jar:1.1.1, org.apache.spark:spark-streaming_2.11:jar:1.1.1, org.apache.spark:spark-catalyst_2.11:jar:1.1.1, org.spark-project.akka:akka-actor_2.11:jar:2.2.3-shaded-protobuf, org.spark-project.akka:akka-remote_2.11:jar:2.2.3-shaded-protobuf, org.spark-project.akka:akka-slf4j_2.11:jar:2.2.3-shaded-protobuf, org.spark-project.akka:akka-testkit_2.11:jar:2.2.3-shaded-protobuf, org.spark-project.akka:akka-zeromq_2.11:jar:2.2.3-shaded-protobuf: Could not find artifact org.apache.spark:spark-core_2.11:jar:1.1.1 in central (http://repo.maven.apache.org/maven2) -> [Help 1]

@lresende lresende force-pushed the scala-profile branch 3 times, most recently from f136021 to 2c56423 Compare September 3, 2016 19:13
@lresende
Copy link
Member Author

lresende commented Sep 3, 2016

@bzz Sorry, I had put the profiles activation as if scala 2.11 was the default, have fixed it now.
three builds still failing with timeout, I will try to force new builds

@lresende
Copy link
Member Author

lresende commented Sep 5, 2016

@bzz the build errors are related to RAT issues

No output has been received in the last 10 minutes, this potentially indicates a stalled build or something wrong with the build itself.

The build has been terminated

Avoid activating the Scala 2.10 profile when
building for Scala 2.11
@felixcheung
Copy link
Member

CI green, any more comments?

@lresende
Copy link
Member Author

lresende commented Sep 8, 2016

@felixcheung @Leemoonsoo @bzz Any more comments here ? Should we merge this to 0.6 branch and master, as it's kind blocking to 2.11

@asfgit asfgit closed this in 724ef6f Sep 8, 2016
asfgit pushed a commit that referenced this pull request Sep 8, 2016
### What is this PR for?
Avoid activating the Scala 2.10 profile when building for Scala 2.11

### What type of PR is it?
[Bug Fix]

### What is the Jira issue?
* (https://issues.apache.org/jira/browse/ZEPPELIN-1407)[https://issues.apache.org/jira/browse/ZEPPELIN-1407]

### How should this be tested?
Perform Scala 2.10 and 2.11 builds starting from a maven repository that does not have org.apache.zeppelin artifacts.

Author: Luciano Resende <lresende@apache.org>

Closes #1400 from lresende/scala-profile and squashes the following commits:

3fa489b [Luciano Resende] [ZEPPELIN-1407] Fix Scala 2.11 build

(cherry picked from commit 724ef6f)
Signed-off-by: Felix Cheung <felixcheung@apache.org>
@felixcheung
Copy link
Member

Done. master and branch-0.6 - thanks!

@Leemoonsoo
Copy link
Member

I'm sorry my comment is bit late. code is already been merged.

But let my write it for the records

Because of all our documents and scripts uses -Pscala-2.xx instead of -Dscala-2.xx. And with -Pscala-2.xx we don't have any problem.

Build instruction
https://github.com/apache/zeppelin#-pscala-version-optional

travis ci script
https://github.com/apache/zeppelin/blob/master/.travis.yml#L43

release script
https://github.com/apache/zeppelin/blob/master/dev/create_release.sh#L106

If we want to use -D instead of -P to activate profile, that's different story.
I think using -D is actually more flexible than -P in maven, but while all other profiles are activated by -P, i'm not sure only activating scala profile by -D can be helpful and beneficial.

@lresende
Copy link
Member Author

lresende commented Sep 8, 2016

@Leemoonsoo The issue wasn't about -P versus -D, but that the Scala 2.10 was with activation true by default, so even when you did only -Pscala2.11 the Scala 2.10 profile was being activated.

@lresende lresende deleted the scala-profile branch September 8, 2016 20:30
@lresende
Copy link
Member Author

lresende commented Sep 8, 2016

BTW, the properties on the profile activation, only enables the "default" to be activated by default, so mvn clean install will not have properties defined, so will start Scala 2.10...

@Leemoonsoo
Copy link
Member

@lresende You can see followings from http://maven.apache.org/guides/introduction/introduction-to-profiles.html.

All profiles that are active by default are automatically deactivated when a profile in the POM is activated on the command line or through its activation config.

So once -Pscala-2.11 is defined, scala-2.10 should be automatically deactivated.

@lresende
Copy link
Member Author

lresende commented Sep 8, 2016

But unfortunately this wasn't what maven was enforcing, and Scala 2.11 build was failing when -PScala2.11 was being used, and when invoking dependency:tree with -Pscala2.11 there were few dependencies that were being resolved to _2.10 version of the dependency and thus causing the build failure. This approach seems to not rely on that maven feature and make the build work on both scenarios.

@Leemoonsoo
Copy link
Member

@lresende In the issue description, your build command used -Dscala-2.11 when you get those errors.

I could reproduce the error when i use -Dscala-2.11, but if i use -Pscala-2.11 i couldn't reproduce the problem.

@felixcheung
Copy link
Member

It looks like -D is in fact setting property and this change is adding such a check for the property?

@minahlee
Copy link
Member

As moon mentioned, if you use build instruction in https://github.com/apache/zeppelin#example it doesn't bring any issue.
One of the reason I changed activation rule in #1251 was that using -D won't be scalable for scala-2.12 support in the future.
@lresende if you are not strongly against to build with -P and if you can confirm that there is no issue to build using -Pscala-2.11 not -Dscala-2.11 in c88010f, I would like to revert this change.

@lresende
Copy link
Member Author

I have verified that with that by reverting my changes -PScala2.10/Scala2.11 have the proper behavior and my original issue was that indeed my build alias had -D for the profile activation. Sorry for the confusion, please go ahead and revert this change.

@minahlee
Copy link
Member

@lresende thank you for verification. I am reverting this PR then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants