Skip to content

Commit 096a1ab

Browse files
stilschersim642
authored andcommitted
update files from goblint-http-server repository
1 parent 2fe0d1b commit 096a1ab

File tree

8 files changed

+68
-9
lines changed

8 files changed

+68
-9
lines changed

goblint-http-server/.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# executable
2+
goblint-http
13

24
# Created by https://www.toptal.com/developers/gitignore/api/ocaml,emacs,vim,visualstudiocode,linux,macos,windows
35
# Edit at https://www.toptal.com/developers/gitignore?templates=ocaml,emacs,vim,visualstudiocode,linux,macos,windows
@@ -74,7 +76,8 @@ flycheck_*.el
7476
.LSOverride
7577

7678
# Icon must end with two \r
77-
Icon
79+
Icon
80+
7881

7982
# Thumbnails
8083
._*

goblint-http-server/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
native :
2+
3+
% :
4+
@./make.sh $@

goblint-http-server/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Http-Server for GobView
2+
3+
## Building
4+
1. Install [opam](https://opam.ocaml.org/doc/Install.html).
5+
2. Run `make setup` to install OCaml and dependencies via opam.
6+
4. Run `make` to build the Goblint-Http-Server itself.
7+
8+
## Running
9+
To use the Goblint Http-Server run e.g.:
10+
`./goblint-http -with-goblint ../analyzer/goblint -goblint --set save_run run --set files[+] "../analyzer/tests/regression/00-sanity/01-assert.c"`
11+
For more information on the usage of `goblint-http` run:
12+
`./goblint-http -help`

goblint-http-server/dune-project

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
(maintainers "Kerem Çakırer <[email protected]>")
1212

1313
(source
14-
(github keremc/goblint-http-server))
14+
(github goblint/goblint-http-server))
1515

1616
(generate_opam_files true)
1717

goblint-http-server/goblint-http-server.opam

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ synopsis: "Goblint HTTP server"
55
maintainer: ["Kerem Çakırer <[email protected]>"]
66
authors: ["Kerem Çakırer <[email protected]>"]
77
license: "ISC"
8-
homepage: "https://github.com/keremc/goblint-http-server"
9-
bug-reports: "https://github.com/keremc/goblint-http-server/issues"
8+
homepage: "https://github.com/goblint/goblint-http-server"
9+
bug-reports: "https://github.com/goblint/goblint-http-server/issues"
1010
depends: [
1111
"dune" {>= "2.9"}
1212
"batteries"
@@ -38,4 +38,4 @@ build: [
3838
]
3939
["dune" "install" "-p" name "--create-install-files" name]
4040
]
41-
dev-repo: "git+https://github.com/keremc/goblint-http-server.git"
41+
dev-repo: "git+https://github.com/goblint/goblint-http-server.git"

goblint-http-server/goblint-http-server.opam.locked

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ synopsis: "Goblint HTTP server"
55
maintainer: "Kerem Çakırer <[email protected]>"
66
authors: "Kerem Çakırer <[email protected]>"
77
license: "ISC"
8-
homepage: "https://github.com/keremc/goblint-http-server"
9-
bug-reports: "https://github.com/keremc/goblint-http-server/issues"
8+
homepage: "https://github.com/goblint/goblint-http-server"
9+
bug-reports: "https://github.com/goblint/goblint-http-server/issues"
1010
depends: [
1111
"angstrom" {= "0.15.0"}
1212
"asn1-combinators" {= "0.2.6"}
@@ -122,4 +122,4 @@ build: [
122122
]
123123
["dune" "install" "-p" name "--create-install-files" name]
124124
]
125-
dev-repo: "git+https://github.com/keremc/goblint-http-server.git"
125+
dev-repo: "git+https://github.com/goblint/goblint-http-server.git"

goblint-http-server/make.sh

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/usr/bin/env bash
2+
set -e # exit immediately if a command fails
3+
set -o pipefail # or all $? in pipe instead of returning exit code of the last command only
4+
5+
#$TARGET=src/goblint_http
6+
7+
rule() {
8+
case $1 in
9+
# new rules using dune
10+
clean)
11+
git clean -X -f
12+
dune clean
13+
;; setup)
14+
# set -x
15+
# opam init -y -a --bare $SANDBOXING # sandboxing is disabled in travis and docker
16+
# opam update
17+
opam switch -y create . --deps-only ocaml-base-compiler.4.13.1 ocaml-options-vanilla --locked
18+
;; nat*)
19+
eval $(opam config env)
20+
dune build #$TARGET.exe &&
21+
rm -f goblint-http &&
22+
cp _build/install/default/bin/goblint-http goblint-http
23+
;; dev)
24+
eval $(opam env)
25+
echo "Installing opam packages for development..."
26+
opam install -y utop ocaml-lsp-server ocp-indent ocamlformat ounit2
27+
# ocaml-lsp-server is needed for https://github.com/ocamllabs/vscode-ocaml-platform
28+
echo "Be sure to adjust your vim/emacs config!"
29+
esac;
30+
}
31+
32+
if [ $# -eq 0 ]; then
33+
rule native
34+
else
35+
while [ $# -gt 0 ]; do
36+
rule $1;
37+
shift
38+
done
39+
fi

goblint-http-server/src/goblint.ml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ let with_lock goblint = Lwt_mutex.with_lock goblint.mutex
2424

2525
let assert_ok (resp: Jsonrpc.Response.t) s = match resp.result with
2626
| Ok _ -> ()
27-
| Error _ -> failwith s
27+
| Error e -> failwith (Format.sprintf "%s (%s)" s e.message)
2828

2929
let send goblint name params =
3030
let id = `Int goblint.counter in
@@ -33,6 +33,7 @@ let send goblint name params =
3333
Jsonrpc.Message.create ?params ~id ~method_:name ()
3434
|> Jsonrpc.Message.yojson_of_request
3535
|> Yojson.Safe.to_string in
36+
Printf.printf "send jsonrpc message:\n%s\n" req;
3637
let%lwt () = Lwt_io.fprintl goblint.output req in
3738
let%lwt resp =
3839
Lwt_io.read_line goblint.input

0 commit comments

Comments
 (0)