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

Exract classpathOptions in sbt-bloop #110

Merged
merged 4 commits into from
Mar 27, 2018
Merged

Conversation

Duhemm
Copy link
Collaborator

@Duhemm Duhemm commented Dec 1, 2017

No description provided.

@Duhemm
Copy link
Collaborator Author

Duhemm commented Dec 1, 2017

That's a genuine failure, but I can't reproduce it on my machine...

@Duhemm Duhemm force-pushed the topic/extract-classpathoptions branch from 23561dc to 84ffca7 Compare December 5, 2017 10:33
@jvican jvican added this to the Bloop 0.1 milestone Dec 12, 2017
@Duhemm Duhemm force-pushed the topic/extract-classpathoptions branch from 84ffca7 to 2a210dd Compare January 19, 2018 16:34
@Duhemm
Copy link
Collaborator Author

Duhemm commented Jan 19, 2018

I couldn't reproduce the failure on my machine then, and I still can't. Hopefully it'll work now!

@jvican
Copy link
Contributor

jvican commented Jan 22, 2018

@Duhemm Did you eventually print classpaths here to see how classpathOptions is making a difference?

@Duhemm
Copy link
Collaborator Author

Duhemm commented Jan 22, 2018

It's on today's list :)

@jvican
Copy link
Contributor

jvican commented Jan 30, 2018

Has the mistery been solved? We may want to find a sorcerer to help us find out what's happening.

@Duhemm Duhemm force-pushed the topic/extract-classpathoptions branch from 2a210dd to e45babb Compare February 6, 2018 15:19
@Duhemm
Copy link
Collaborator Author

Duhemm commented Feb 8, 2018

Debug info shows that this is extremely likely to be caused by our integration tests setup: several entries of the classpath and boot classpath do no exists when we do the compilation, because they're downloaded in scripted when we do the setup.

Let's see if sharing the same ivy home for scripted and normal sbt solves the issue.

@Duhemm Duhemm force-pushed the topic/extract-classpathoptions branch 2 times, most recently from c6968fe to 6aee219 Compare February 8, 2018 09:24
@jvican jvican force-pushed the master branch 2 times, most recently from 3883387 to 21a8dc9 Compare February 9, 2018 15:08
@Duhemm Duhemm force-pushed the topic/extract-classpathoptions branch from 6aee219 to 2042b53 Compare February 10, 2018 19:39
@Duhemm Duhemm force-pushed the topic/extract-classpathoptions branch 2 times, most recently from fca0537 to 88bb1ef Compare February 19, 2018 16:22
@Duhemm
Copy link
Collaborator Author

Duhemm commented Feb 19, 2018

I'm pretty sure it didn't run the community build

@jvican Do you know why?

@Duhemm
Copy link
Collaborator Author

Duhemm commented Feb 20, 2018

Nevermind, I had forgotten about your PR that fixes it :)

@Duhemm
Copy link
Collaborator Author

Duhemm commented Feb 26, 2018

test performance please

@bloopoid
Copy link
Collaborator

performance test scheduled: 1 job(s) in queue, 0 running.

@bloopoid
Copy link
Collaborator

Performance test finished successfully.

Benchmarks is based on merging with master

@jvican
Copy link
Contributor

jvican commented Feb 27, 2018

Any news on this? 😄

@Duhemm
Copy link
Collaborator Author

Duhemm commented Feb 27, 2018

Yes, it works. It crashed because it had the wrong configurations (hence the NPEs).

@Duhemm Duhemm force-pushed the topic/extract-classpathoptions branch 2 times, most recently from 4c64091 to 402596d Compare March 8, 2018 08:55
@Duhemm Duhemm force-pushed the topic/extract-classpathoptions branch from 402596d to c28c757 Compare March 8, 2018 09:01
Copy link
Contributor

@jvican jvican left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, I'd like to run the benchmarks on this before merging. I've left three comments I think are important addressing before merging.

@@ -70,7 +73,11 @@ class IntegrationTestSuite(testDirectory: Path) {
(state, rootProject)
}

val reachable = Dag.dfs(state.build.getDagFor(projectToCompile)).filter(_ != projectToCompile)
val reachable =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this necessary?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I renamed state to initialState, and state is now the state after cleaning. We need to clean because the project may have already been compiled by a previous test.

@@ -35,6 +37,21 @@
@Parameter(property = "bloop.executionFork", defaultValue = "false")
private boolean bloopExecutionFork;

@Parameter(property = "bloop.classpathOptions.bootLibrary", defaultValue = "true")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you looked if the maven integration already supports all these?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've been through the plugin but I haven't found how this could be configured, so I assumed it didn't.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you double-check?

@@ -96,6 +99,12 @@ object Project {
ScalaInstance(scalaOrganization, scalaName, scalaVersion, allScalaJars, logger)
val classpath = toPaths(properties.getProperty("classpath"))
val classesDir = toPath(properties.getProperty("classesDir"))
val classpathOptions = {
val values = properties.getProperty("classpathOptions").split(",")
val Array(bootLibrary, compiler, extra, autoBoot, filterLibrary) =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error reporting if this fails is poor here.

exit 0
else
echo "The community build will not run for this pull request."
exit 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this mean that Drone will fail altogether?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, the problem was actually in .drone.yml

@@ -15,13 +15,14 @@ class CompilerCache(componentProvider: ComponentProvider,
logger: Logger,
userResolvers: List[Resolver]) {

private val cache = new ConcurrentHashMap[ScalaInstance, Compilers]()
private type CompilerID = (ScalaInstance, ClasspathOptions)
private val cache = new ConcurrentHashMap[CompilerID, Compilers]()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this necessary? It's not clear to me why classpath options is part of the compiler key, this is not nice performance wise because every time the classpath options change we need to instantiate a new compiler. Can we avoid this change?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The classpathOptions are part of the parameters that we give Zinc to get a Compilers instance. I'll try to work around that...

.drone.yml Outdated
*[DOCS]*) echo "Skipping tests for commit that only changes docs." ;;
*) ${SBT_RUN}; ./bin/ci-clean-cache.sh ;;
esac
- if [[ "$DRONE_COMMIT_MESSAGE" == *[DOCS]* ]]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fails in sh, that's why it's implemented via case

@Duhemm Duhemm force-pushed the topic/extract-classpathoptions branch from 881009b to 4fe1988 Compare March 9, 2018 08:09
@jvican
Copy link
Contributor

jvican commented Mar 9, 2018

If you want to regenerate the configuration files, you need to update the version number of the configuratino file in our build, you can drop 4fe1988

@jvican jvican added the bug A defect or misbehaviour. label Mar 14, 2018
@Duhemm Duhemm force-pushed the topic/extract-classpathoptions branch from 4fe1988 to 3ece4db Compare March 16, 2018 12:58
@Duhemm Duhemm force-pushed the topic/extract-classpathoptions branch 2 times, most recently from 35841c2 to 6ea16fa Compare March 27, 2018 13:55
@jvican jvican force-pushed the topic/extract-classpathoptions branch from 6ea16fa to 8b7e16d Compare March 27, 2018 14:35
@jvican jvican force-pushed the topic/extract-classpathoptions branch from 8b7e16d to aa87faf Compare March 27, 2018 15:09
@jvican jvican added the configuration format Assigned to any ticket or pull request that will change the configuration file format. label Mar 27, 2018
@jvican jvican merged commit 0def412 into master Mar 27, 2018
@tgodzik tgodzik deleted the topic/extract-classpathoptions branch September 7, 2021 16:19
tgodzik pushed a commit to tgodzik/bloop that referenced this pull request Jul 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A defect or misbehaviour. configuration format Assigned to any ticket or pull request that will change the configuration file format.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants