Skip to content

Commit

Permalink
Fixes from review
Browse files Browse the repository at this point in the history
  • Loading branch information
tomuben committed Aug 12, 2024
1 parent b9860ac commit fd1f1d1
Show file tree
Hide file tree
Showing 11 changed files with 45 additions and 91 deletions.
2 changes: 1 addition & 1 deletion exaudfclient/.bazelrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
build --copt='-std=c++17' --force_pic --action_env=PROTOBUF_BIN --action_env=PROTOBUF_LIBRARY_PREFIX --action_env=PROTOBUF_INCLUDE_PREFIX
build --lockfile_mode=off --copt='-std=c++17' --force_pic --action_env=PROTOBUF_BIN --action_env=PROTOBUF_LIBRARY_PREFIX --action_env=PROTOBUF_INCLUDE_PREFIX
# TODO add environment variables for R libraries
build:benchmark --define benchmark=true
build:java --define java=true --action_env=JAVA_PREFIX
Expand Down
2 changes: 1 addition & 1 deletion exaudfclient/base/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ cc_library(


# Using cc_binary to build a shared library as output target is a workaround, because
# Bazel's cc_library are only intermediate stages and can be used as output target.
# Bazel's cc_library are only intermediate stages and can't be used as output target.
# It is necessary to include //base/exaudflib:exaudflib into deps and srcs, because
# otherwise dlmopen won't find the symbols of exaudflib and its dependencies. The target //base/exaudflib:exaudflib-deps
# won't work either, because it only contains the libraries as dependencies.
Expand Down
117 changes: 35 additions & 82 deletions exaudfclient/base/javacontainer/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -9,32 +9,32 @@ genrule(
cd build_exascript_java_tmp_cc
swig -v -O -DEXTERNAL_PROCESS -Wall -c++ -java -addextern -module exascript_java -package com.exasol.swig -outdir "../java_src/com/exasol/swig" -o "../exascript_java_tmp.cc" exaudflib/exascript.i
cd ..
cp java_src/com/exasol/swig/ConnectionInformationWrapper.java $(location orig/com/exasol/swig/ConnectionInformationWrapper.java)
cp java_src/com/exasol/swig/exascript_java.java $(location orig/com/exasol/swig/exascript_java.java)
cp java_src/com/exasol/swig/exascript_javaJNI.java $(location orig/com/exasol/swig/exascript_javaJNI.java)
cp java_src/com/exasol/swig/ExportSpecificationWrapper.java $(location orig/com/exasol/swig/ExportSpecificationWrapper.java)
cp java_src/com/exasol/swig/ImportSpecificationWrapper.java $(location orig/com/exasol/swig/ImportSpecificationWrapper.java)
cp java_src/com/exasol/swig/Metadata.java $(location orig/com/exasol/swig/Metadata.java)
cp java_src/com/exasol/swig/ResultHandler.java $(location orig/com/exasol/swig/ResultHandler.java)
cp java_src/com/exasol/swig/SWIGTYPE_p_ExecutionGraph__ExportSpecification.java $(location orig/com/exasol/swig/SWIGTYPE_p_ExecutionGraph__ExportSpecification.java)
cp java_src/com/exasol/swig/SWIGTYPE_p_ExecutionGraph__ImportSpecification.java $(location orig/com/exasol/swig/SWIGTYPE_p_ExecutionGraph__ImportSpecification.java)
cp java_src/com/exasol/swig/SWIGVM_datatype_e.java $(location orig/com/exasol/swig/SWIGVM_datatype_e.java)
cp java_src/com/exasol/swig/SWIGVM_itertype_e.java $(location orig/com/exasol/swig/SWIGVM_itertype_e.java)
cp java_src/com/exasol/swig/TableIterator.java $(location orig/com/exasol/swig/TableIterator.java)
cp java_src/com/exasol/swig/ConnectionInformationWrapper.java $(location ConnectionInformationWrapper.java)
cp java_src/com/exasol/swig/exascript_java.java $(location exascript_java.java)
cp java_src/com/exasol/swig/exascript_javaJNI.java $(location raw/exascript_javaJNI.java)
cp java_src/com/exasol/swig/ExportSpecificationWrapper.java $(location ExportSpecificationWrapper.java)
cp java_src/com/exasol/swig/ImportSpecificationWrapper.java $(location ImportSpecificationWrapper.java)
cp java_src/com/exasol/swig/Metadata.java $(location Metadata.java)
cp java_src/com/exasol/swig/ResultHandler.java $(location raw/ResultHandler.java)
cp java_src/com/exasol/swig/SWIGTYPE_p_ExecutionGraph__ExportSpecification.java $(location SWIGTYPE_p_ExecutionGraph__ExportSpecification.java)
cp java_src/com/exasol/swig/SWIGTYPE_p_ExecutionGraph__ImportSpecification.java $(location SWIGTYPE_p_ExecutionGraph__ImportSpecification.java)
cp java_src/com/exasol/swig/SWIGVM_datatype_e.java $(location SWIGVM_datatype_e.java)
cp java_src/com/exasol/swig/SWIGVM_itertype_e.java $(location SWIGVM_itertype_e.java)
cp java_src/com/exasol/swig/TableIterator.java $(location raw/TableIterator.java)
cp exascript_java_tmp.cc $(location exascript_java_tmp.cc)
""",
outs = ["orig/com/exasol/swig/ConnectionInformationWrapper.java",
"orig/com/exasol/swig/exascript_java.java",
"orig/com/exasol/swig/exascript_javaJNI.java",
"orig/com/exasol/swig/ExportSpecificationWrapper.java",
"orig/com/exasol/swig/ImportSpecificationWrapper.java",
"orig/com/exasol/swig/Metadata.java",
"orig/com/exasol/swig/ResultHandler.java",
"orig/com/exasol/swig/SWIGTYPE_p_ExecutionGraph__ExportSpecification.java",
"orig/com/exasol/swig/SWIGTYPE_p_ExecutionGraph__ImportSpecification.java",
"orig/com/exasol/swig/SWIGVM_datatype_e.java",
"orig/com/exasol/swig/SWIGVM_itertype_e.java",
"orig/com/exasol/swig/TableIterator.java",
outs = ["ConnectionInformationWrapper.java",
"exascript_java.java",
"ExportSpecificationWrapper.java",
"ImportSpecificationWrapper.java",
"Metadata.java",
"SWIGTYPE_p_ExecutionGraph__ExportSpecification.java",
"SWIGTYPE_p_ExecutionGraph__ImportSpecification.java",
"SWIGVM_datatype_e.java",
"SWIGVM_itertype_e.java",
"raw/exascript_javaJNI.java",
"raw/ResultHandler.java",
"raw/TableIterator.java",
"exascript_java_tmp.cc"
],
srcs = ["//base/exaudflib:exascript.i","//base/exaudflib:swig/script_data_transfer_objects_wrapper.h"]
Expand Down Expand Up @@ -67,75 +67,28 @@ genrule(
cmd = """
TMPDIR=`mktemp -d`
mkdir -p "$$TMPDIR"/java_src/com/exasol/swig
cp $(location :orig/com/exasol/swig/TableIterator.java) "$$TMPDIR"/java_src/com/exasol/swig/
cp $(location :orig/com/exasol/swig/ResultHandler.java) "$$TMPDIR"/java_src/com/exasol/swig/
cp $(location :orig/com/exasol/swig/exascript_javaJNI.java) "$$TMPDIR"/java_src/com/exasol/swig/
cp $(location :raw/TableIterator.java) "$$TMPDIR"/java_src/com/exasol/swig/
cp $(location :raw/ResultHandler.java) "$$TMPDIR"/java_src/com/exasol/swig/
cp $(location :raw/exascript_javaJNI.java) "$$TMPDIR"/java_src/com/exasol/swig/
find "$$TMPDIR"/java_src/com/exasol/swig/ -name *.java -type f -exec chmod 644 {} \\;
cp -r -L $(location //base:filter_swig_code.py) $(location :exascript_java_tmp.cc) "$$TMPDIR"
(cd "$$TMPDIR"
python3 filter_swig_code.py "exascript_java.cc" "exascript_java_tmp.cc")
cp "$$TMPDIR"/exascript_java.cc $(location :exascript_java.cc)
cp "$$TMPDIR"/java_src/com/exasol/swig/TableIterator.java $(location :filtered/com/exasol/swig/TableIterator.java)
cp "$$TMPDIR"/java_src/com/exasol/swig/ResultHandler.java $(location :filtered/com/exasol/swig/ResultHandler.java)
cp "$$TMPDIR"/java_src/com/exasol/swig/exascript_javaJNI.java $(location :filtered/com/exasol/swig/exascript_javaJNI.java)
cp "$$TMPDIR"/java_src/com/exasol/swig/TableIterator.java $(location TableIterator.java)
cp "$$TMPDIR"/java_src/com/exasol/swig/ResultHandler.java $(location ResultHandler.java)
cp "$$TMPDIR"/java_src/com/exasol/swig/exascript_javaJNI.java $(location exascript_javaJNI.java)
rm -rf "$$TMPDIR"
""",
outs = [
"exascript_java.cc",
"filtered/com/exasol/swig/TableIterator.java",
"filtered/com/exasol/swig/ResultHandler.java",
"filtered/com/exasol/swig/exascript_javaJNI.java"
],
srcs = [":exascript_java_tmp.cc", ":orig/com/exasol/swig/TableIterator.java",
":orig/com/exasol/swig/ResultHandler.java", ":orig/com/exasol/swig/exascript_javaJNI.java"],
tools = ["//base:filter_swig_code.py"]
)


genrule(
name = "finish_java_package",
cmd = """
cp $(location filtered/com/exasol/swig/TableIterator.java) $(location TableIterator.java)
cp $(location filtered/com/exasol/swig/ResultHandler.java) $(location ResultHandler.java)
cp $(location filtered/com/exasol/swig/exascript_javaJNI.java) $(location exascript_javaJNI.java)
cp $(location orig/com/exasol/swig/ConnectionInformationWrapper.java) $(location ConnectionInformationWrapper.java)
cp $(location orig/com/exasol/swig/exascript_java.java) $(location exascript_java.java)
cp $(location orig/com/exasol/swig/ExportSpecificationWrapper.java) $(location ExportSpecificationWrapper.java)
cp $(location orig/com/exasol/swig/ImportSpecificationWrapper.java) $(location ImportSpecificationWrapper.java)
cp $(location orig/com/exasol/swig/Metadata.java) $(location Metadata.java)
cp $(location orig/com/exasol/swig/SWIGTYPE_p_ExecutionGraph__ExportSpecification.java) $(location SWIGTYPE_p_ExecutionGraph__ExportSpecification.java)
cp $(location orig/com/exasol/swig/SWIGTYPE_p_ExecutionGraph__ImportSpecification.java) $(location SWIGTYPE_p_ExecutionGraph__ImportSpecification.java)
cp $(location orig/com/exasol/swig/SWIGVM_datatype_e.java) $(location SWIGVM_datatype_e.java)
cp $(location orig/com/exasol/swig/SWIGVM_itertype_e.java) $(location SWIGVM_itertype_e.java)
""",
outs = [
"ConnectionInformationWrapper.java",
"exascript_java.java",
"exascript_javaJNI.java",
"ExportSpecificationWrapper.java",
"ImportSpecificationWrapper.java",
"Metadata.java",
"ResultHandler.java",
"SWIGTYPE_p_ExecutionGraph__ExportSpecification.java",
"SWIGTYPE_p_ExecutionGraph__ImportSpecification.java",
"SWIGVM_datatype_e.java",
"SWIGVM_itertype_e.java",
"TableIterator.java",
"ResultHandler.java",
"exascript_javaJNI.java"
],
srcs = [
"filtered/com/exasol/swig/TableIterator.java",
"filtered/com/exasol/swig/ResultHandler.java",
"filtered/com/exasol/swig/exascript_javaJNI.java",
"orig/com/exasol/swig/ConnectionInformationWrapper.java",
"orig/com/exasol/swig/exascript_java.java",
"orig/com/exasol/swig/ExportSpecificationWrapper.java",
"orig/com/exasol/swig/ImportSpecificationWrapper.java",
"orig/com/exasol/swig/Metadata.java",
"orig/com/exasol/swig/SWIGTYPE_p_ExecutionGraph__ExportSpecification.java",
"orig/com/exasol/swig/SWIGTYPE_p_ExecutionGraph__ImportSpecification.java",
"orig/com/exasol/swig/SWIGVM_datatype_e.java",
"orig/com/exasol/swig/SWIGVM_itertype_e.java",
]
srcs = [":exascript_java_tmp.cc", ":raw/TableIterator.java",
":raw/ResultHandler.java", ":raw/exascript_javaJNI.java"],
tools = ["//base:filter_swig_code.py"]
)

cc_library(
Expand Down
2 changes: 1 addition & 1 deletion exaudfclient/build_local_all.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash

bash build_local.sh "$@" --lockfile_mode=off --config no-tty --config python --config java --config slow-wrapper-py3
bash build_local.sh "$@" --config no-tty --config python --config java --config slow-wrapper-py3
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ WORKDIR /exaudfclient/
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MAMBA_ROOT_PREFIX/lib/
ENV CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:$MAMBA_ROOT_PREFIX/include/
ENV C_INCLUDE_PATH=$C_INCLUDE_PATH:$MAMBA_ROOT_PREFIX/include/
RUN ./build.sh --lockfile_mode=off --config no-tty -c dbg --config python --config test-binaries-py3
RUN ./build.sh --config no-tty -c dbg --config python --config test-binaries-py3
RUN cp -r -L bazel-bin/* /exaudf

WORKDIR /exaudfclient/base
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ bazel|7.2.1
gxx_linux-64|12.4.0
gcc_linux-64|12.4.0
make|4.3
chrpath|0.16
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ WORKDIR /exaudfclient/
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MAMBA_ROOT_PREFIX/lib/
ENV CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:$MAMBA_ROOT_PREFIX/include/
ENV C_INCLUDE_PATH=$C_INCLUDE_PATH:$MAMBA_ROOT_PREFIX/include/
RUN ./build.sh --lockfile_mode=off --config no-tty --config optimize --config python --config fast-binary-py3
RUN ./build.sh --config no-tty --config optimize --config python --config fast-binary-py3
RUN cp -r -L bazel-bin/* /exaudf

WORKDIR /exaudfclient/base
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MAMBA_ROOT_PREFIX/lib/
ENV CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:$MAMBA_ROOT_PREFIX/include/
ENV C_INCLUDE_PATH=$C_INCLUDE_PATH:$MAMBA_ROOT_PREFIX/include/
# We need to build with optimize here, because the debug build fails to run with a runtime linking error regarding protobuf
RUN ./build.sh --lockfile_mode=off --config no-tty -c dbg --config python --config test-binaries-py3
RUN ./build.sh --config no-tty -c dbg --config python --config test-binaries-py3
RUN cp -r -L bazel-bin/* /exaudf

WORKDIR /exaudfclient/base
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ WORKDIR /exaudfclient/
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MAMBA_ROOT_PREFIX/lib/
ENV CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:$MAMBA_ROOT_PREFIX/include/
ENV C_INCLUDE_PATH=$C_INCLUDE_PATH:$MAMBA_ROOT_PREFIX/include/
RUN ./build.sh --lockfile_mode=off --config no-tty --config optimize --config python --config fast-binary-py3
RUN ./build.sh --config no-tty --config optimize --config python --config fast-binary-py3
RUN cp -r -L bazel-bin/* /exaudf

WORKDIR /exaudfclient/base
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ RUN mkdir /exaudfclient /exaudf
COPY /exaudfclient/ /exaudfclient/

WORKDIR /exaudfclient/
RUN ["/bin/bash", "-c", "source /env && bash build.sh --lockfile_mode=off --config no-tty -c dbg --config python --config test-binaries-py3"]
RUN ["/bin/bash", "-c", "source /env && bash build.sh --config no-tty -c dbg --config python --config test-binaries-py3"]
RUN cp -r -L bazel-bin/* /exaudf

WORKDIR /exaudfclient/base
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ RUN mkdir /exaudfclient /exaudf
COPY exaudfclient/ /exaudfclient/

WORKDIR /exaudfclient/
RUN ["/bin/bash", "-c", "source /env && bash build.sh --lockfile_mode=off --config no-tty --config optimize --config python --config fast-binary-py3"]
RUN ["/bin/bash", "-c", "source /env && bash build.sh --config no-tty --config optimize --config python --config fast-binary-py3"]
RUN cp -r -L bazel-bin/* /exaudf

WORKDIR /exaudfclient/base
Expand Down

0 comments on commit fd1f1d1

Please sign in to comment.