File tree 1 file changed +19
-7
lines changed
1 file changed +19
-7
lines changed Original file line number Diff line number Diff line change @@ -16,23 +16,35 @@ install-rust-coverage:
16
16
cargo install rustfilt coverage-prepare
17
17
rustup component add llvm-tools-preview
18
18
19
+ .PHONY : install-pgo
20
+ rustup component add llvm-tools-preview
21
+
19
22
.PHONY : build-dev
20
23
build-dev :
21
24
@rm -f python/pydantic_core/* .so
22
- cargo build --features extension-module
23
- @rm -f target/debug/lib_pydantic_core.d
24
- @rm -f target/debug/lib_pydantic_core.rlib
25
- @mv target/debug/lib_pydantic_core.* python/pydantic_core/_pydantic_core.so
25
+ pip install -v -e . --config-settings=build-args=' --profile dev'
26
26
27
27
.PHONY : build-prod
28
28
build-prod :
29
29
@rm -f python/pydantic_core/* .so
30
- maturin develop --release
30
+ pip install -v -e .
31
31
32
32
.PHONY : build-coverage
33
33
build-coverage :
34
- rm -f python/pydantic_core/* .so
35
- maturin develop -- -C instrument-coverage
34
+ @rm -f python/pydantic_core/* .so
35
+ RUSTFLAGS=' -C instrument-coverage' pip install -v -e .
36
+
37
+ .PHONY : build-pgo
38
+ build-pgo :
39
+ @rm -f python/pydantic_core/* .so
40
+ $(eval PROFDATA := $(shell mktemp -d) )
41
+ RUSTFLAGS=' -Cprofile-generate=$(PROFDATA)' pip install -v -e .
42
+ pytest tests/benchmarks
43
+ $(eval LLVM_PROFDATA := $(shell rustup run stable bash -c 'echo $$RUSTUP_HOME/toolchains/$$RUSTUP_TOOLCHAIN/lib/rustlib/$$(rustc -Vv | grep host | cut -d " " -f 2 ) /bin/llvm-profdata') )
44
+ $(LLVM_PROFDATA ) merge -o $(PROFDATA ) /merged.profdata $(PROFDATA )
45
+ RUSTFLAGS=' -Cprofile-use=$(PROFDATA)/merged.profdata' pip install -v -e .
46
+ @rm -rf $(PROFDATA )
47
+
36
48
37
49
.PHONY : build-wasm
38
50
build-wasm :
You can’t perform that action at this time.
0 commit comments