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

Published version 3.4.0 does not work #40

Closed
kammoh opened this issue May 5, 2021 · 7 comments
Closed

Published version 3.4.0 does not work #40

kammoh opened this issue May 5, 2021 · 7 comments

Comments

@kammoh
Copy link

kammoh commented May 5, 2021

Running any of the examples (e.g. https://github.com/vagmcs/Optimus/blob/master/docs/mixed_integer.md) results in an exception:

Exception in thread "main" java.io.FileNotFoundException: /home/vagmcs/Usr/work/dev/Optimus/core/target/scala-2.13/scoverage-data/scoverage.measurements.1 (No such file or directory)
	at java.base/java.io.FileOutputStream.open0(Native Method)
	at java.base/java.io.FileOutputStream.open(FileOutputStream.java:298)
	at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:237)
	at java.base/java.io.FileWriter.<init>(FileWriter.java:113)
	at scoverage.Invoker$.$anonfun$invoked$1(Invoker.scala:55)
Invoker.scala:55
	at scala.collection.mutable.HashMap.getOrElseUpdate(HashMap.scala:454)
HashMap.scala:454
	at scoverage.Invoker$.invoked(Invoker.scala:55)
Invoker.scala:55
	at optimus.optimization.MPModel.<init>(MPModel.scala:36)
MPModel.scala:36

localPublished version with coverageEnabled := false works as expected.

Seems to be related to:
scoverage/sbt-scoverage#84 and scoverage/sbt-scoverage#306

@vagmcs
Copy link
Owner

vagmcs commented May 5, 2021

Hello @kammoh,

What version of Java and Scala do you use?

@kammoh
Copy link
Author

kammoh commented May 5, 2021

Scala 2.13.5, OpenJDK 11

@vagmcs
Copy link
Owner

vagmcs commented May 7, 2021

Hi @kammoh,

There is an import missing from the MIP example in the documentation. You have to add,

import optimus.optimization.model.MPIntVar

Apart from that it works fine for me. If this is not the problem in your case you have to provide me with more details. Maybe the code you are trying to run and the way you run it, e.g., from some IDE or SBT console.

@kammoh
Copy link
Author

kammoh commented May 7, 2021

Hi @vagmcs ,
Please have a look at the reported error message and the referenced sbt-coverage issues. This has nothing to do with the missing import!
You can see the error on Scastie:
https://scastie.scala-lang.org/hnymyJJ4SNqnrfpRT5Zy2Q

Upgrading sbt-coverage could be a thing to try, but as it seems not to be resolved upstream, you need to disable sbt-coverate during publish (coverageEnabled := false).

@kammoh
Copy link
Author

kammoh commented May 7, 2021

Maybe the reason you're not observing this issue on your local machine is that your build-time coverage file (/home/vagmcs/Usr/work/dev/Optimus/core/target/scala-2.13/scoverage-data/scoverage.measurements.4463) actually exists there?

@vagmcs
Copy link
Owner

vagmcs commented May 9, 2021

Hello @kammoh,

It seems there is indeed a problem with the coverage option. I released a patched version 3.4.1. Can you please try it out?

@kammoh
Copy link
Author

kammoh commented May 9, 2021

Yes, it solves the issue! Thank you for the quick fix!

@kammoh kammoh closed this as completed May 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants