diff --git a/.github/workflows/Elkeid_rasp_release.yml b/.github/workflows/Elkeid_rasp_release.yml index cc887459e..dcddd69c0 100644 --- a/.github/workflows/Elkeid_rasp_release.yml +++ b/.github/workflows/Elkeid_rasp_release.yml @@ -15,8 +15,8 @@ jobs: - name: Build run: | - curl -fsSL https://lf3-static.bytednsdoc.com/obj/eden-cn/laahweh7uhwbps/php-headers.tar.gz | tar -xz -C /tmp - docker run --rm -v $(pwd):/Elkeid -v /tmp/cache/gradle:/root/.gradle -v /tmp/cache/php:/Elkeid/rasp/php/build -v /tmp/cache/librasp:/Elkeid/rasp/librasp/target -v /tmp/cache/rasp_server:/Elkeid/rasp/rasp_server/target -v /tmp/cache/plugin:/Elkeid/rasp/plugin/target -v /tmp/php-headers:/tmp/php-headers -e MAKEFLAGS="-j$(nproc)" hackerl/rasp-toolchain make -C /Elkeid/rasp build STATIC=TRUE PY_PREBUILT=TRUE CC=/opt/x86_64-linux-musl-1.2.2/bin/x86_64-linux-musl-gcc CXX=/opt/x86_64-linux-musl-1.2.2/bin/x86_64-linux-musl-g++ LD=/opt/x86_64-linux-musl-1.2.2/bin/x86_64-linux-musl-ld CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_LINKER=/opt/x86_64-linux-musl-1.2.2/bin/x86_64-linux-musl-ld GNU_CC=/opt/gcc-10.4.0/bin/gcc GNU_CXX=/opt/gcc-10.4.0/bin/g++ PHP_HEADERS=/tmp/php-headers PYTHON2_INCLUDE=/usr/local/include/python2.7 PYTHON3_INCLUDE=/usr/local/include/python3.6m VERSION=${GITHUB_REF#refs/*/rasp-v} + curl -fsSL https://lf3-static.bytednsdoc.com/obj/eden-cn/laahweh7uhwbps/php-headers.tar.gz | tar -xz -C rasp/php + docker run --rm -v $(pwd):/Elkeid -v /tmp/cache/gradle:/root/.gradle -v /tmp/cache/librasp:/Elkeid/rasp/librasp/target -v /tmp/cache/rasp_server:/Elkeid/rasp/rasp_server/target -v /tmp/cache/plugin:/Elkeid/rasp/plugin/target -e MAKEFLAGS="-j$(nproc)" hackerl/rasp-toolchain make -C /Elkeid/rasp build STATIC=TRUE PY_PREBUILT=TRUE CC=/opt/x86_64-linux-musl-1.2.2/bin/x86_64-linux-musl-gcc CXX=/opt/x86_64-linux-musl-1.2.2/bin/x86_64-linux-musl-g++ LD=/opt/x86_64-linux-musl-1.2.2/bin/x86_64-linux-musl-ld CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_LINKER=/opt/x86_64-linux-musl-1.2.2/bin/x86_64-linux-musl-ld GNU_CC=/opt/gcc-10.4.0/bin/gcc GNU_CXX=/opt/gcc-10.4.0/bin/g++ PHP_HEADERS=/Elkeid/rasp/php/php-headers PYTHON2_INCLUDE=/usr/local/include/python2.7 PYTHON3_INCLUDE=/usr/local/include/python3.6m VERSION=${GITHUB_REF#refs/*/rasp-v} - name: Release uses: softprops/action-gh-release@v1 diff --git a/rasp/Makefile b/rasp/Makefile index c0a4cdbda..49e8ea6a2 100644 --- a/rasp/Makefile +++ b/rasp/Makefile @@ -159,9 +159,9 @@ php_probe: ## build php probe @echo "build PHP probe" mkdir -p output/lib/php ifeq ($(STATIC), TRUE) - cd php && mkdir -p output build; for header in ${PHP_HEADERS}/*; do version=$$(basename $$header); mkdir -p build/$$version; CC=$(GNU_CC) CXX=$(GNU_CXX) cmake -B build/$$version -DSTATIC_BUILD=ON -DPHP_EXTENSIONS_INCLUDE_DIR=$$header && cmake --build build/$$version -j$$(nproc) && cp lib/libphp_probe.so output/libphp_probe-$$version.so; done + cd php && mkdir -p output build; for header in ${PHP_HEADERS}/*; do [ -d include ] && rm -rf include; cp -r $$header include; CC=$(GNU_CC) CXX=$(GNU_CXX) cmake -B build -DSTATIC_BUILD=ON -DPHP_EXTENSIONS_INCLUDE_DIR=$$(pwd)/include && cmake --build build -j$$(nproc) && cp lib/libphp_probe.so output/libphp_probe-$$(basename $$header).so; done else - cd php && mkdir -p output build; for header in ${PHP_HEADERS}/*; do version=$$(basename $$header); mkdir -p build/$$version; cmake -B build/$$version -DSTATIC_BUILD=ON -DPHP_EXTENSIONS_INCLUDE_DIR=$$header && cmake --build build/$$version -j$$(nproc) && cp lib/libphp_probe.so output/libphp_probe-$$version.so; done + cd php && mkdir -p output build; for header in ${PHP_HEADERS}/*; do [ -d include ] && rm -rf include; cp -r $$header include; cmake -B build -DSTATIC_BUILD=ON -DPHP_EXTENSIONS_INCLUDE_DIR=$$(pwd)/include && cmake --build build -j$$(nproc) && cp lib/libphp_probe.so output/libphp_probe-$$(basename $$header).so; done endif cp php/output/* output/lib/php @@ -195,8 +195,6 @@ build: update_version agent_plugin nsenter mounts process_injector java python g $(call split_debug, output/lib/golang/go_loader) $(call split_debug, output/lib/golang/go_probe) $(call split_debug, output/lib/python/python_loader) - $(call split_debug, output/lib/python/rasp/probe.so) - $(call split_debug, output/lib/python/rasp/probe.abi3.so) $(foreach file, $(wildcard output/lib/php/*), $(call split_debug, $(file));) tar -czvf debug.tar.gz debug