代码拉取完成,页面将自动刷新
#! /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
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。