Skip to content

Commit d153d3c

Browse files
committed
use stable-mir-json from PATH in Makefile
1 parent b2681d0 commit d153d3c

File tree

1 file changed

+6
-18
lines changed

1 file changed

+6
-18
lines changed

Makefile

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,16 @@ test: test-unit test-integration smir-parse-tests
1616
##################################################
1717
# for integration tests: build stable-mir-json in-tree
1818

19-
stable-mir-json: CARGO_BUILD_OPTS =
20-
stable-mir-json:
21-
cd deps/stable-mir-json && cargo build ${CARGO_BUILD_OPTS}
22-
cd deps/stable-mir-json && cargo run --bin cargo_stable_mir_json -- ${TOP_DIR}/deps/stable-mir-json ${TOP_DIR}/deps
23-
${TOP_DIR}/deps/.stable-mir-json/release.sh --version || ${TOP_DIR}/deps/.stable-mir-json/debug.sh --version
24-
2519
# generate smir and parse given test files (from parameter or run-rs subdirectory)
2620
smir-parse-tests: TESTS = $(shell find $(PWD)/kmir/src/tests/integration/data/run-rs -type f -name "*.rs")
27-
smir-parse-tests: SMIR = cargo -q -Z unstable-options -C deps/stable-mir-json run --
2821
smir-parse-tests: # build # commented out for CI's sake
2922
errors=""; \
3023
report() { echo $$2; errors="$$errors $$1"; }; \
3124
for source in ${TESTS}; do \
3225
echo -n "$$source: "; \
3326
dir=$$(dirname $${source}); \
3427
target=$${dir}/$$(basename $${source%.rs}).smir.json; \
35-
${SMIR} -Z no-codegen --out-dir $${dir} $$source \
28+
stable_mir_json -Z no-codegen --out-dir $${dir} $$source \
3629
&& echo -n "smir-ed " \
3730
|| report "$$source" "SMIR ERROR!"; \
3831
if [ -s $${target} ]; then \
@@ -49,7 +42,7 @@ smir-parse-tests: # build # commented out for CI's sake
4942
test-unit:
5043
$(UV_RUN) pytest $(TOP_DIR)/kmir/src/tests/unit --maxfail=1 --verbose $(TEST_ARGS)
5144

52-
test-integration: stable-mir-json build
45+
test-integration: build
5346
$(UV_RUN) pytest $(TOP_DIR)/kmir/src/tests/integration --maxfail=1 --verbose \
5447
--durations=0 --numprocesses=$(PARALLEL) --dist=worksteal $(TEST_ARGS)
5548

@@ -102,13 +95,9 @@ cov-integration: test-integration
10295
##################################################
10396
# Utilities
10497

105-
.PHONY: clean stable-mir-json-clean
106-
107-
stable-mir-json-clean:
108-
cd deps/stable-mir-json && cargo clean
109-
rm -rf deps/.stable-mir-json
98+
.PHONY: clean
11099

111-
clean: stable-mir-json-clean
100+
clean:
112101
rm -rf kmir/dist kmir/.coverage kmir/cov-* kmir/.mypy_cache kmir/.pytest_cache
113102
find kmir/ -type d -name __pycache__ -prune -exec rm -rf {} \;
114103

@@ -126,13 +115,12 @@ update-exec-smir:
126115
# file paths for spans in the the updated smir are truncated to known infixes
127116
.PHONY: update-smir-json
128117
update-smir-json: TARGETS = $(shell git ls-files | grep -e ".*\.smir\.json$$" | grep -v -e pinocchio)
129-
update-smir-json: SMIR = cargo -q -Z unstable-options -C deps/stable-mir-json run --
130-
update-smir-json: stable-mir-json
118+
update-smir-json:
131119
for file in ${TARGETS}; do \
132120
dir=$$(realpath $$(dirname $$file)); \
133121
rust=$$dir/$$(basename $${file%.smir.json}.rs); \
134122
[ -f "$$rust" ] || (echo "Source file $$rust missing."; exit 1); \
135-
${SMIR} -Zno-codegen --out-dir $$dir $$rust; \
123+
stable_mir_json -Zno-codegen --out-dir $$dir $$rust; \
136124
jq '.spans[].[1].[0] |= sub("/.*lib/rustlib"; "rustlib") | .spans[].[1].[0] |= sub("/.*/integration/data"; "data")' $$file > $$file.tmp; \
137125
mv $$file.tmp $$file; \
138126
done

0 commit comments

Comments
 (0)