Skip to content

Commit 11bbd99

Browse files
committed
JBMC: Added java-models-library dependency
This commit adds a dependency to the java-models-library (https://github.com/diffblue/java-models-library). This repository contains models for number of classes derived from the java standard library. These models are needed to support concurrency. This means that the process of building JBMC has changed slightly as one first needs to download the java-models-library. I.E: make -C jbmc/src java-models-library-download make -C jbmc/src Due possible licensing issues, the ability to automatically embed the java core models into JBMC has been removed. Instead, one must explicitly use the '--classpath' option to load the models. Consequently, the '--no-core-models' option and related code was removed as it is no longer relevant. Commit also adds a new make target, 'make dist'. This target in addition to building jbmc will create a 'dist' directory with two sub-folders, bin and lib. Executables will be copied to the former, while 'core-models.jar' will copied to the latter. Note: src/org/cprover/CProver.java has also been removed as this has been superseded by the CProver.java in the java-models-library.
1 parent 8af658f commit 11bbd99

File tree

17 files changed

+59
-251
lines changed

17 files changed

+59
-251
lines changed

.gitignore

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ src/ansi-c/gcc_builtin_headers_mips.inc
4949
src/ansi-c/gcc_builtin_headers_power.inc
5050
src/ansi-c/gcc_builtin_headers_ubsan.inc
5151
src/ansi-c/windows_builtin_headers.inc
52-
jbmc/src/java_bytecode/java_core_models.inc
5352

5453
# regression/test files
5554
*.out
@@ -122,9 +121,13 @@ src/ansi-c/file_converter
122121
src/ansi-c/file_converter.exe
123122
src/ansi-c/library/converter
124123
src/ansi-c/library/converter.exe
125-
jbmc/src/java_bytecode/converter
126-
jbmc/src/java_bytecode/converter.exe
124+
jbmc/src/java_bytecode/library/converter.exe
125+
jbmc/src/java_bytecode/library/converter
126+
jbmc/src/java_bytecode/library/core-models.jar
127+
jbmc/src/java_bytecode/library/classes
128+
jbmc/src/java_bytecode/library/src
127129
build/
130+
dist/
128131

129132
*.pyc
130133

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ jobs:
233233
name: "diffblue/cbmc"
234234
description: "Travis build of ${TRAVIS_COMMIT}"
235235
notification_email: "[email protected]"
236+
build_command_prepend: "make -C jbmc/src java-models-library-download"
236237
build_command_prepend: "make -C src minisat2-download"
237238
build_command: "make -C src -j2; make -C jbmc/src -j2"
238239
branch_pattern: "develop"
@@ -259,6 +260,7 @@ jobs:
259260
install:
260261
- ccache -z
261262
- ccache --max-size=1G
263+
- make -C jbmc/src java-models-library-download
262264
- make -C src minisat2-download
263265
- make -C src/ansi-c library_check
264266
- make -C src "CXX=${COMPILER} ${EXTRA_CXXFLAGS}" -j3
@@ -286,4 +288,3 @@ notifications:
286288
on_start: never
287289
on_cancel: never
288290
on_error: always
289-

appveyor.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,17 @@ install:
4242
& 7z x minisat2_2.2.1.orig.tar.gz
4343
&7z x minisat2_2.2.1.orig.tar
4444
}
45+
if (!(Test-Path jml)) {
46+
& appveyor downloadfile https://github.com/diffblue/java-models-library/archive/master.zip -FileName jml.zip
47+
& 7z x jml.zip
48+
}
4549
cd ..
4650
4751
cache: deps
4852

4953
build_script:
5054
- cmd: |
55+
cp -r deps/java-models-library-master/src jbmc/src/java_bytecode/library
5156
cp -r deps/minisat2-2.2.1 minisat-2.2.1
5257
patch -d minisat-2.2.1 -p1 < scripts/minisat-2.2.1-patch
5358
call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x64

buildspec.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ phases:
1313
build:
1414
commands:
1515
- echo Build started on `date`
16+
- make -C jbmc/src java-models-library-download
1617
- (cd src ; make minisat2-download)
1718
- (cd src ; make CXX="ccache g++" -j2)
1819
- (cd regression ; make test)

jbmc/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,10 @@ Compilation
3030
To compile you need to run the command:
3131

3232
```bash
33+
make -C jbmc/src java-models-library-download
3334
make -C jbmc/src
3435
```
36+
3537
Output
3638
======
3739

jbmc/regression/jbmc-strings/java_append_char/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
test_append_char.class
3-
--refine-strings --string-max-length 1000 --no-core-models --function test_append_char.main
3+
--refine-strings --string-max-length 1000 --function test_append_char.main
44
^EXIT=10$
55
^SIGNAL=0$
66
^VERIFICATION FAILED$

jbmc/regression/jbmc/coreModels/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
test.class
3-
--show-symbol-table
3+
--show-symbol-table --cp ../../../src/java_bytecode/library/core-models.jar:.
44
^EXIT=0$
55
^SIGNAL=0$
66
^Symbol\s*\.*\: java\:\:org\.cprover\.CProver\.\<clinit\>\:\(\)V$

jbmc/src/Makefile

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
DIRS = janalyzer jbmc jdiff java_bytecode miniz
2+
ROOT = ../
23

34
include config.inc
45

@@ -40,11 +41,33 @@ generated_files: $(patsubst %, %_generated_files, $(DIRS))
4041
# cleaning
4142

4243
.PHONY: clean
43-
clean: $(patsubst %, %_clean, $(DIRS)) cprover_clean
44+
clean: $(patsubst %, %_clean, $(DIRS)) cprover_clean dist_clean
4445

4546
$(patsubst %, %_clean, $(DIRS)):
4647
$(MAKE) $(MAKEARGS) -C $(patsubst %_clean, %, $@) clean ; \
4748

4849
.PHONY: cprover_clean
4950
cprover_clean:
5051
$(MAKE) $(MAKEARGS) -C $(CPROVER_DIR)/src clean
52+
53+
.PHONY: dist_clean
54+
dist_clean:
55+
rm -rf $(ROOT)dist
56+
57+
# extended JBMC models download, for your convenience
58+
java-models-library-download:
59+
@echo "Downloading java models library"
60+
@curl -L https://github.com/diffblue/java-models-library/archive/master.zip > java-models-library.zip
61+
@unzip java-models-library.zip
62+
@rm java-models-library.zip
63+
@cp -r java-models-library-master/src java_bytecode/library
64+
@rm -r java-models-library-master
65+
66+
.PHONY: dist
67+
dist: java-models-library-download all
68+
@mkdir --p $(ROOT)dist/lib
69+
@cp java_bytecode/library/core-models.jar $(ROOT)dist/lib
70+
@mkdir --p $(ROOT)dist/bin
71+
@cp jbmc/jbmc $(ROOT)dist/bin
72+
@cp janalyzer/janalyzer $(ROOT)dist/bin
73+
@cp jdiff/jdiff $(ROOT)dist/bin

jbmc/src/java_bytecode/CMakeLists.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ add_library(java_bytecode ${sources} ${headers})
1010
# targets wishing to depend on the target 'java_bytecode' may want to use
1111
generic_includes(java_bytecode)
1212

13-
# target 'java-core-models-inc' is defined in library/
14-
add_dependencies(java_bytecode java-core-models-inc)
15-
1613
# if you link java_bytecode.a in, then you also need to link other .a libraries
1714
# in
1815
target_link_libraries(java_bytecode util goto-programs miniz json)

jbmc/src/java_bytecode/Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,18 @@ include ../$(CPROVER_DIR)/src/common
4949

5050
CLEANFILES = java_bytecode$(LIBEXT)
5151

52-
all: java_bytecode$(LIBEXT)
52+
all: library java_bytecode$(LIBEXT)
5353

5454
clean: clean_library
5555

5656
.PHONY: clean_library
5757
clean_library:
5858
$(MAKE) clean -C library
5959

60-
library/java_core_models.inc:
61-
$(MAKE) -C library java_core_models.inc
60+
.PHONY: library
61+
library:
62+
$(MAKE) -C library
6263

63-
java_class_loader$(OBJEXT): library/java_core_models.inc
6464
###############################################################################
6565

6666
java_bytecode$(LIBEXT): $(OBJ)

0 commit comments

Comments
 (0)