Browse Source

Clean up Onion (#4759)

* Change the Makefile, so that Onion is cloned and built only once
* Enable the plaintext test - the code has been present for a while,
but it hasn't been exercised.
Anton Kirilov 6 years ago
parent
commit
1e3a2174c4

+ 5 - 17
frameworks/C/onion/Makefile

@@ -1,29 +1,17 @@
+.PHONY: all
 all: hello
 
 CFLAGS=-O2 -Ionion/src/
-LDFLAGS=-lonion -ljson -lmysqlclient -lpthread -L/usr/lib64/mysql/ -L.
-
-hello.o: onion hello.c 
 
 hello: hello.o libonion_static.a base_html.o fortunes_html.o
 	cc hello.o base_html.o fortunes_html.o libonion_static.a -o hello -lpthread `mysql_config --libs` `pkg-config json --libs` -lgnutls -lgcrypt -lrt
 
+.PHONY: clean
 clean:
-	rm -fr *.o hello base_html.c fortunes_html.c libonion_static.a onion
-
-
-libonion_static.a: onion
-	(cd onion && mkdir -p build && cd build && cmake .. -DCMAKE_C_FLAGS="-Werror" -DCMAKE_CXX_FLAGS="-Werror" && make VERBOSE=1)
-	cp onion/build/src/onion/libonion_static.a .
-
-onion:
-	git clone --depth 1 https://github.com/davidmoreno/onion.git
-
-otemplate:
-	(cd onion/build/tools/otemplate/)
+	rm -fr *.o hello base_html.c fortunes_html.c
 
-base_html.c: otemplate base.html 
+base_html.c: base.html
 	onion/build/tools/otemplate/otemplate base.html base_html.c
 
-fortunes_html.c: otemplate fortunes.html
+fortunes_html.c: fortunes.html
 	onion/build/tools/otemplate/otemplate fortunes.html fortunes_html.c

+ 1 - 0
frameworks/C/onion/benchmark_config.json

@@ -6,6 +6,7 @@
       "db_url": "/db",
       "query_url": "/queries?queries=",
       "fortune_url": "/fortune",
+      "plaintext_url": "/plaintext",
       "port": 8080,
       "approach": "Realistic",
       "classification": "Platform",

+ 2 - 7
frameworks/C/onion/onion.dockerfile

@@ -7,19 +7,14 @@ RUN apt update -yqq && apt install -yqq git cmake make libmysqlclient-dev libjso
 
 ENV ONION_LOG noinfo
 
-# Latest commit on master as of July 10 2014
-# This is post tag v0.7, but pre any later tags
-
 RUN git clone https://github.com/davidmoreno/onion.git && \
     cd onion && \
-    git checkout c460557bfc7d45fb6ba61cb6b7259480a67dde82 && \
+    git checkout f6b9d9e0689871226d671fb641698974e3f38762 && \
     mkdir -p build && \
     cd build && \
     cmake .. && \
     make
 
-RUN make clean && \
-    rm -f onion/build/CMakeCache.txt && \
-    make
+RUN ln -v onion/build/src/onion/libonion_static.a . && make
 
 CMD ["./hello"]