1 Star 3 Fork 0

个人收藏室/semgrep

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
install-alpine-semgrep-core 1.70 KB
一键复制 编辑 原始数据 按行查看 历史
#! /usr/bin/env bash
#
# Build the semgrep-core statically-linked against musl, on alpine linux,
# with opam pre-installed.
#
# This script assumes we're at the root of the checked-out semgrep repository.
#
set -eu
# This is useful to locate 'dune' and for any build command not called
# by opam.
eval $(opam env)
# Sanity check
if [[ ! -e /etc/alpine-release ]]; then
echo "Error: This doesn't look like an Alpine container." >&2
exit 1
fi
# Avoid distracting warning in sudo 1.8.31
# 'sudo: setrlimit(RLIMIT_CORE): Operation not permitted'
echo "Set disable_coredump false" | sudo tee -a /etc/sudo.conf 2>/dev/null
# Obtain the sources if they're not here already. This is for local testing
# purposes, i.e. outside of GitHub Actions or CircleCI.
#
if [[ "$(basename "$(pwd)")" != semgrep ]]; then
cd
echo "Obtain semgrep sources"
git clone https://github.com/returntocorp/semgrep.git
cd semgrep
fi
echo "Install missing packages"
sudo apk add --no-cache m4
echo "Install submodules"
git submodule update --init --recursive
echo "Install ocaml-tree-sitter"
./scripts/install-ocaml-tree-sitter
echo "Install spacegrep"
(
cd spacegrep
opam install --deps-only -y .
DUNE_PROFILE=static make
make install
)
echo "Install pfff dependencies"
(
cd semgrep-core/pfff
opam install --deps-only -y .
)
echo "Install semgrep-core"
(
cd semgrep-core
opam install --deps-only -y .
make all
make install
)
echo "Copy executables to artifacts archive"
rm -rf ocaml-build-artifacts
bin=ocaml-build-artifacts/bin
mkdir -p "$bin"
cp ./spacegrep/_build/install/default/bin/spacegrep "$bin"
cp ./semgrep-core/_build/install/default/bin/semgrep-core "$bin"
tar czf ocaml-build-artifacts.tgz ocaml-build-artifacts
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/software-reverse-engineering/semgrep.git
git@gitee.com:software-reverse-engineering/semgrep.git
software-reverse-engineering
semgrep
semgrep
EJ-2307-php-metavar

搜索帮助

371d5123 14472233 46e8bd33 14472233