Skip to content

Commit

Permalink
initial integration of jq. (#4980)
Browse files Browse the repository at this point in the history
Initial integration of jq. jq is a lightweight and flexible command-line
JSON processor. It's a widely used command-line for handling json
processing, and has more than 25K stars on Github. In essence am not
sure which corporations use it as such (but I would assume many), but I
use it frequently and would place it in some form of position similar to
Binutils from a user perspective. It is, in essence, the `sed` command
in the JSON world.
  • Loading branch information
DavidKorczynski authored Jul 11, 2023
1 parent 0094d30 commit 330cc0c
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 0 deletions.
23 changes: 23 additions & 0 deletions projects/jq/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
################################################################################

FROM gcr.io/oss-fuzz-base/base-builder
RUN apt-get update && apt-get install -y \
make flex bison libtool automake autoconf

RUN git clone --depth 1 https://github.com/jqlang/jq
WORKDIR $SRC/jq
COPY build.sh $SRC/
29 changes: 29 additions & 0 deletions projects/jq/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash -eu
#
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
################################################################################

git submodule init
git submodule update
autoreconf -fi
./configure --with-oniguruma=builtin
make -j$(nproc)

$CC $CFLAGS -c tests/jq_fuzz_parse.c \
-I./src -o ./jq_fuzz_parse.o
$CXX $CXXFLAGS $LIB_FUZZING_ENGINE ./jq_fuzz_parse.o \
./.libs/libjq.a ./modules/oniguruma/src/.libs/libonig.a \
-o $OUT/jq_fuzz_parse -I./src
8 changes: 8 additions & 0 deletions projects/jq/project.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
homepage: "https://jqlang.github.io/jq"
main_repo: "https://github.com/jqlang/jq"
language: c
primary_contact: "[email protected]"
auto_ccs :
- "[email protected]"
- "[email protected]"
- "[email protected]"

0 comments on commit 330cc0c

Please sign in to comment.