epfl-lara/smart

Strange permissions in archive release

cgrigis opened this issue · 1 comments

The archive for smart v0.3.1s has the following permissions:

$ zipinfo smart-scalac-standalone-0.3.1s-linux.zip 
Archive:  smart-scalac-standalone-0.3.1s-linux.zip
Zip file size: 77641408 bytes, number of entries: 5
-rw-r-----  3.0 unx 10705357 bx defN 19-Jul-10 17:15 lib/scalaz3-unix-64-2.12.jar
-rw-r--r--  3.0 unx 60483607 bx defN 19-Jul-10 17:15 lib/stainless-scalac-standalone-0.3.1s.jar
-rw-r--r--  3.0 unx     1096 tx defN 19-Jul-10 17:15 z3/LICENSE.txt
-rwxr-xr-x  3.0 unx 23741960 bx defN 19-Jul-10 17:15 z3/z3
-rwxr-xr-x  3.0 unx      291 tx defN 19-Jul-10 17:15 stainless
5 files, 94932311 bytes uncompressed, 77640550 bytes compressed:  18.2%

Notice the lack of r for "other" in lib/scalaz3-unix-64-2.12.jar.
This has the strange consequence of giving a cryptic error when running stainless with a user who does not happen to have enough rights (as I discovered by running it in a Docker with limited rights).

It is reproducible as follows:

$ unzip -d test smart-scalac-standalone-0.3.1s-linux.zip 
Archive:  smart-scalac-standalone-0.3.1s-linux.zip
  inflating: test/lib/scalaz3-unix-64-2.12.jar  
  inflating: test/lib/stainless-scalac-standalone-0.3.1s.jar  
  inflating: test/z3/LICENSE.txt     
  inflating: test/z3/z3              
  inflating: test/stainless          

$ find test/ -ls
 10226565      4 drwxr-xr-x   4 cgrigis  cgrigis      4096 Jul 16 16:50 test/
 10226572      4 -rwxr-xr-x   1 cgrigis  cgrigis       291 Jul 10 17:15 test/stainless
 10226569      4 drwxr-xr-x   2 cgrigis  cgrigis      4096 Jul 16 16:50 test/z3
 10226570      4 -rw-r--r--   1 cgrigis  cgrigis      1096 Jul 10 17:15 test/z3/LICENSE.txt
 10226571  23188 -rwxr-xr-x   1 cgrigis  cgrigis  23741960 Jul 10 17:15 test/z3/z3
 10226566      4 drwxr-xr-x   2 cgrigis  cgrigis      4096 Jul 16 16:50 test/lib
 10226567  10456 -rw-r-----   1 cgrigis  cgrigis  10705357 Jul 10 17:15 test/lib/scalaz3-unix-64-2.12.jar
 10226568  59068 -rw-r--r--   1 cgrigis  cgrigis  60483607 Jul 10 17:15 test/lib/stainless-scalac-standalone-0.3.1s.jar

$ ./test/stainless 
[  Info  ]  - Checking cache: 'cast correctness' VC for payableAddressToAddress @142:29...
[  Info  ] Cache hit: 'cast correctness' VC for payableAddressToAddress @142:29...
[  Info  ]   ┌───────────────────┐
[  Info  ] ╔═╡ stainless summary ╞══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╗
[  Info  ] ║ └───────────────────┘                                                                                                                                      ║
[  Info  ] ║ payableAddressToAddress  cast correctness  valid from cache     ../../../../../tmp/stainless_smartcontracts_package6653813212807447176.scala:142:29  1.893 ║
[  Info  ] ╟┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄╢
[  Info  ] ║ total: 1    valid: 1    (1 from cache) invalid: 0    unknown: 0    time:   1.893                                                                           ║
[  Info  ] ╚════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╝
[  Info  ] Shutting down executor service.

$ chmod ugo-r ./test/lib/scalaz3-unix-64-2.12.jar 

$ ./test/stainless 
[ Fatal  ] Run has failed with error: stainless.extraction.oo.Definitions$ClassLookupException: Lookup failed for class with symbol `stainless.smartcontracts.Msg$0`
[ Fatal  ] 
[ Fatal  ] stainless.extraction.oo.Definitions$AbstractSymbols$Lookup.$anonfun$apply$1(Definitions.scala:270)
[ Fatal  ] scala.Option.getOrElse(Option.scala:138)
[ Fatal  ] stainless.extraction.oo.Definitions$AbstractSymbols$Lookup.apply(Definitions.scala:270)
[ Fatal  ] stainless.extraction.smartcontracts.EnvironmentBuilder$TransformerContext.<init>(EnvironmentBuilder.scala:30)
(...)

I added the o+r permission before packaging the new release v0.3.2s, and added a sanity check that the jars are readable in the script (0cd0add). Please reopen if there's still an issue.