Update location and name of cscope (#246)

* Update location and name of cscope

* Update README and add quick test script

* Add architecture check and disable full test for now

* Remove test script. Enable libpng integration test

---------

Co-authored-by: Michael D Brown <michael.brown@trailofbits.com>
This commit is contained in:
Evan Downing
2025-08-14 21:44:22 -04:00
committed by GitHub
parent 120c8a21cb
commit b1a558da0f
10 changed files with 40 additions and 15 deletions
+17 -1
View File
@@ -306,8 +306,24 @@ jobs:
uv pip install --isolated pytest-html>=4.1.1 pytest-cov>=6.0.0
working-directory: ${{ matrix.component }}
- name: Run program-model libpng integration test
if: matrix.component == 'program-model' && steps.should_test.outputs.test != 'false'
run: |
uv run --frozen pytest -svv --runintegration tests/c/test_libpng.py \
--junit-xml=integration-test-results.xml \
--html=integration-test-report.html \
--self-contained-html \
--cov=${{ matrix.coverage_module }} \
--cov-report=xml:integration-coverage.xml \
--cov-report=html:integration-htmlcov \
--cov-report=term
env:
PYTHON_WASM_BUILD_PATH: "python-3.12.0.wasm"
working-directory: ${{ matrix.component }}
timeout-minutes: 30
- name: Run integration tests on ${{ matrix.component }}
if: steps.should_test.outputs.test != 'false'
if: matrix.component != 'program-model' && steps.should_test.outputs.test != 'false'
run: |
uv run --frozen pytest -svv --runintegration \
--junit-xml=integration-test-results.xml \
+3 -3
View File
@@ -1,3 +1,3 @@
[submodule "external/aixcc-cscope"]
path = external/aixcc-cscope
url = https://github.com/trailofbits/aixcc-cscope.git
[submodule "external/buttercup-cscope"]
path = external/buttercup-cscope
url = https://github.com/trail-of-forks/buttercup-cscope
+4 -4
View File
@@ -51,7 +51,7 @@ validate:
# Deployment targets
deploy:
@echo "Deploying to current environment..."
@if [ ! -f external/aixcc-cscope/configure.ac ]; then \
@if [ ! -f external/buttercup-cscope/configure.ac ]; then \
echo "Error: The git submodules have not been initialized. Run 'git submodule update --init --recursive' first."; \
exit 1; \
fi
@@ -102,7 +102,7 @@ deploy-local:
echo "Error: Configuration file not found. Run 'make setup-local' first."; \
exit 1; \
fi
@if [ ! -f external/aixcc-cscope/configure.ac ]; then \
@if [ ! -f external/buttercup-cscope/configure.ac ]; then \
echo "Error: The git submodules have not been initialized. Run 'git submodule update --init --recursive' first."; \
exit 1; \
fi
@@ -116,7 +116,7 @@ deploy-azure:
echo "Error: Configuration file not found. Run 'make setup-azure' first."; \
exit 1; \
fi
@if [ ! -f external/aixcc-cscope/configure.ac ]; then \
@if [ ! -f external/buttercup-cscope/configure.ac ]; then \
echo "Error: The git submodules have not been initialized. Run 'git submodule update --init --recursive' first."; \
exit 1; \
fi
@@ -212,7 +212,7 @@ clean-local:
# Additional targets migrated from justfile
install-cscope:
cd external/aixcc-cscope/ && autoreconf -i -s && ./configure && make && sudo make install
cd external/buttercup-cscope/ && autoreconf -i -s && ./configure && make && sudo make install
signoz-ui:
@echo "Opening SigNoz UI..."
Submodule external/aixcc-cscope deleted from d814aabe85
Vendored Submodule
+1
+1 -1
View File
@@ -49,7 +49,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \
FROM runtime-base AS cscope-builder
RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y autoconf gcc make bison flex libncurses-dev
COPY external/aixcc-cscope /cscope
COPY external/buttercup-cscope /cscope
RUN cd /cscope && autoreconf -i -s && ./configure && make && make install
FROM runtime-base AS runtime
+1 -1
View File
@@ -33,7 +33,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \
FROM base AS cscope-builder
RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y autoconf gcc make bison flex libncurses-dev
COPY external/aixcc-cscope /cscope
COPY external/buttercup-cscope /cscope
RUN cd /cscope && autoreconf -i -s && ./configure && make && make install
FROM base AS runtime
+1 -1
View File
@@ -34,4 +34,4 @@ test:
# PYTEST_DEBUG_TEMPROOT="/crs_scratch/" uv run pytest -svv --runintegration
# To run tests
uv run pytest -svv --runintegration
uv run pytest -svv --runintegration tests/c/test_libpng.py
+11 -2
View File
@@ -2,12 +2,21 @@
Indexes a program's source code to be queried by `seed-gen` and `patcher`.
## Setup
## Dependencies
* [CodeQuery](https://ruben2020.github.io/codequery/)
* <https://github.com/trail-of-forks/buttercup-cscope>
* [Tree-sitter](https://tree-sitter.github.io/tree-sitter/)
## Quick Test
```shell
uv run pytest -svv
```
## Development
Sync, reformat, lint, and test before committing changes to this directory.
Before committing changes to this directory: reformat, lint, and ensure all tests pass.
```shell
make all
+1 -1
View File
@@ -43,7 +43,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \
FROM runtime-base AS cscope-builder
RUN DEBIAN_FRONTEND=noninteractive apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y autoconf gcc make bison flex libncurses-dev
COPY external/aixcc-cscope /cscope
COPY external/buttercup-cscope /cscope
RUN cd /cscope && autoreconf -i -s && ./configure && make && make install
FROM runtime-base AS runtime