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

Coverage binaries prevent usage of shacles #224

Open
tonicebrian opened this issue Dec 9, 2019 · 10 comments
Open

Coverage binaries prevent usage of shacles #224

tonicebrian opened this issue Dec 9, 2019 · 10 comments

Comments

@tonicebrian
Copy link
Contributor

tonicebrian commented Dec 9, 2019

When trying to run shaclex from command line I get errors about coverage files not present in my path. Just cloning a master and running it we get:

$ sbt run
[info] Loading settings for project global-plugins from plugins.sbt ...
[info] Loading global plugins from /Users/cebriant/.sbt/1.0/plugins
[info] Loading settings for project shaclex-build from plugins.sbt ...
[info] Loading project definition from /Users/cebriant/GIT/shaclex/project
[info] Loading settings for project shaclex from version.sbt,build.sbt ...
[info] Set current project to shaclex (in build file:/Users/cebriant/GIT/shaclex/)
[info] running (fork) es.weso.shaclex.Main
[error] Exception in thread "main" java.lang.ExceptionInInitializerError
[error]         at es.weso.schema.ShaclexSchema$.empty(ShaclexSchema.scala:180)
[error]         at es.weso.schema.Schemas$.shaclex$lzycompute(Schemas.scala:15)
[error]         at es.weso.schema.Schemas$.shaclex(Schemas.scala:15)
[error]         at es.weso.schema.Schemas$.<init>(Schemas.scala:18)
[error]         at es.weso.schema.Schemas$.<clinit>(Schemas.scala)
[error]         at es.weso.shaclex.MainOpts.schemaFormats$lzycompute(MainOpts.scala:16)
[error]         at es.weso.shaclex.MainOpts.schemaFormats(MainOpts.scala:16)
[error]         at es.weso.shaclex.MainOpts.<init>(MainOpts.scala:43)
[error]         at es.weso.shaclex.Main$.run(Main.scala:67)
[error]         at cats.effect.IOApp.$anonfun$main$3(IOApp.scala:67)
[error]         at cats.effect.internals.IOAppPlatform$.mainFiber(IOAppPlatform.scala:37)
[error]         at cats.effect.internals.IOAppPlatform$.main(IOAppPlatform.scala:24)
[error]         at cats.effect.IOApp.main(IOApp.scala:67)
[error]         at cats.effect.IOApp.main$(IOApp.scala:66)
[error]         at es.weso.shaclex.Main$.main(Main.scala:25)
[error]         at es.weso.shaclex.Main.main(Main.scala)
[error] Caused by: java.io.FileNotFoundException: /home/labra/src/shapes/shacl-s/modules/shacl/target/scala-2.12/scoverage-data/scoverage.measurements.1 (No such file or directory)
[error]         at java.base/java.io.FileOutputStream.open0(Native Method)
[error]         at java.base/java.io.FileOutputStream.open(FileOutputStream.java:292)
[error]         at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:235)
[error]         at java.base/java.io.FileWriter.<init>(FileWriter.java:113)
[error]         at scoverage.Invoker$.$anonfun$invoked$1(Invoker.scala:55)
[error]         at scala.collection.mutable.HashMap.getOrElseUpdate(HashMap.scala:86)
[error]         at scoverage.Invoker$.invoked(Invoker.scala:55)
[error]         at es.weso.shacl.Schema$.<init>(Schema.scala:116)
[error]         at es.weso.shacl.Schema$.<clinit>(Schema.scala)
[error]         ... 16 more
[error] Nonzero exit code returned from runner: 1
[error] (Compile / run) Nonzero exit code returned from runner: 1
[error] Total time: 2 s, completed Dec 9, 2019, 9:17:52 AM
@labra
Copy link
Member

labra commented Dec 9, 2019

It's strange...I have just cloned it into a new folder and sbt run works.

When did you clone it? because I had detected that issue about the coverage code and I had tried to repair it...

@tonicebrian
Copy link
Contributor Author

I've just cloned it right now and still see the problem:

$ rm -rf shaclex/
✔ cebriant@C02YM3Z3LVCG:~/GIT
$ git clone https://github.com/weso/shaclex
Cloning into 'shaclex'...
remote: Enumerating objects: 114, done.
remote: Counting objects: 100% (114/114), done.
remote: Compressing objects: 100% (67/67), done.
remote: Total 27756 (delta 31), reused 81 (delta 18), pack-reused 27642
Receiving objects: 100% (27756/27756), 8.94 MiB | 1.92 MiB/s, done.
Resolving deltas: 100% (13307/13307), done.
✔ cebriant@C02YM3Z3LVCG:~/GIT
$ cd shaclex/
✔ cebriant@C02YM3Z3LVCG:~/GIT/shaclex [master]
$ sbt run
[info] Loading settings for project global-plugins from plugins.sbt ...
[info] Loading global plugins from /Users/cebriant/.sbt/1.0/plugins
[info] Loading settings for project shaclex-build from plugins.sbt ...
[info] Loading project definition from /Users/cebriant/GIT/shaclex/project
[warn] There may be incompatibilities among your library dependencies; run 'evicted' to see detailed eviction warnings.
[info] Loading settings for project shaclex from version.sbt,build.sbt ...
[info] Set current project to shaclex (in build file:/Users/cebriant/GIT/shaclex/)
[warn] There may be incompatibilities among your library dependencies; run 'evicted' to see detailed eviction warnings.
[warn] There may be incompatibilities among your library dependencies; run 'evicted' to see detailed eviction warnings.
[warn] There may be incompatibilities among your library dependencies; run 'evicted' to see detailed eviction warnings.
[info] Compiling 14 Scala sources to /Users/cebriant/GIT/shaclex/modules/slang/target/scala-2.12/classes ...
[info] Compiling 5 Scala sources to /Users/cebriant/GIT/shaclex/modules/sgraph/target/scala-2.12/classes ...
[info] Compiling 5 Scala sources to /Users/cebriant/GIT/shaclex/modules/converter/target/scala-2.12/classes ...
[info] Compiling 10 Scala sources to /Users/cebriant/GIT/shaclex/modules/schema/target/scala-2.12/classes ...
[info] Compiling 12 Scala sources to /Users/cebriant/GIT/shaclex/modules/schemaInfer/target/scala-2.12/classes ...
[info] Compiling 3 Scala sources to /Users/cebriant/GIT/shaclex/target/scala-2.12/classes ...
[info] running (fork) es.weso.shaclex.Main
[error] Exception in thread "main" java.lang.ExceptionInInitializerError
[error]         at es.weso.schema.ShaclexSchema$.empty(ShaclexSchema.scala:180)
[error]         at es.weso.schema.Schemas$.shaclex$lzycompute(Schemas.scala:15)
[error]         at es.weso.schema.Schemas$.shaclex(Schemas.scala:15)
[error]         at es.weso.schema.Schemas$.<init>(Schemas.scala:18)
[error]         at es.weso.schema.Schemas$.<clinit>(Schemas.scala)
[error]         at es.weso.shaclex.MainOpts.schemaFormats$lzycompute(MainOpts.scala:16)
[error]         at es.weso.shaclex.MainOpts.schemaFormats(MainOpts.scala:16)
[error]         at es.weso.shaclex.MainOpts.<init>(MainOpts.scala:43)
[error]         at es.weso.shaclex.Main$.run(Main.scala:67)
[error]         at cats.effect.IOApp.$anonfun$main$3(IOApp.scala:67)
[error]         at cats.effect.internals.IOAppPlatform$.mainFiber(IOAppPlatform.scala:37)
[error]         at cats.effect.internals.IOAppPlatform$.main(IOAppPlatform.scala:24)
[error]         at cats.effect.IOApp.main(IOApp.scala:67)
[error]         at cats.effect.IOApp.main$(IOApp.scala:66)
[error]         at es.weso.shaclex.Main$.main(Main.scala:25)
[error]         at es.weso.shaclex.Main.main(Main.scala)
[error] Caused by: java.io.FileNotFoundException: /home/labra/src/shapes/shacl-s/modules/shacl/target/scala-2.12/scoverage-data/scoverage.measurements.1 (No such file or directory)
[error]         at java.base/java.io.FileOutputStream.open0(Native Method)
[error]         at java.base/java.io.FileOutputStream.open(FileOutputStream.java:292)
[error]         at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:235)
[error]         at java.base/java.io.FileWriter.<init>(FileWriter.java:113)
[error]         at scoverage.Invoker$.$anonfun$invoked$1(Invoker.scala:55)
[error]         at scala.collection.mutable.HashMap.getOrElseUpdate(HashMap.scala:86)
[error]         at scoverage.Invoker$.invoked(Invoker.scala:55)
[error]         at es.weso.shacl.Schema$.<init>(Schema.scala:116)
[error]         at es.weso.shacl.Schema$.<clinit>(Schema.scala)
[error]         ... 16 more
[error] Nonzero exit code returned from runner: 1
[error] (Compile / run) Nonzero exit code returned from runner: 1
[error] Total time: 16 s, completed Dec 9, 2019, 10:22:48 AM
✘ cebriant@C02YM3Z3LVCG:~/GIT/shaclex [master]
$

@tonicebrian
Copy link
Contributor Author

Could it be that it works in your case because you effectively have the file in /home/labra/src/shapes/shacl-s/modules/shacl/target/scala-2.12/scoverage-data/scoverage.measurements.1 or you're able to write there?

@labra
Copy link
Member

labra commented Dec 9, 2019

You were right!, I think it has been solved in the new commit updating the shacl-s version.

Thanks for spotting the problem, and the solution!

@labra
Copy link
Member

labra commented Dec 9, 2019

Ummm...I stil think it is failing. I tried to change .travis.yml to use also scala 2.12.10 and now it fails.

My guess is that the coverage code has been included in the scala 2.12 binaries for some reason. But I don't know why.

In order to publish, the command we run is:

$ sbt clean coverageOff +publish

@tonicebrian
Copy link
Contributor Author

tonicebrian commented Dec 9, 2019

Yep, it doesn't work locally neither. I guess one of your published dependencies still has that coverage. I you only need to do the coverageOff when doing an interactive session. Starting sbt from the console and doing sbt clean +publish should be enough.

I think you best option is to publish artefacts only from Travis and bump versions in all libraries. Then you'll have your reproducible environment.

@tonicebrian
Copy link
Contributor Author

Also make sure that your repo forbids overwriting artefacts, the moment something is published remains forever. I say so because I'm using the exact same version of shex in my own project and it works, so maybe on this library (or other) the binary got overwritten.

@tholiebig
Copy link

Is this solved now? I still get the exception from above.

@labra
Copy link
Member

labra commented Mar 26, 2020

We thought it was solved...but maybe it isn't. We will try to check which of the published libraries is generating the problem.

If you know a way to detect the library, it would be great...the problem is that the only way we found was to go one by one library re-publishing it without the coverage code.

@tholiebig
Copy link

Sorry, I have no idea how to identify the respective library.

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

3 participants