| 
									
										
										
										
											2023-03-25 10:07:47 -04:00
										 |  |  | SHELL := bash | 
					
						
							|  |  |  | .ONESHELL: | 
					
						
							|  |  |  | .SHELLFLAGS := -eu -o pipefail -c | 
					
						
							|  |  |  | .DELETE_ON_ERROR: | 
					
						
							|  |  |  | MAKEFLAGS += --warn-undefined-variables | 
					
						
							|  |  |  | MAKEFLAGS += --no-builtin-rules | 
					
						
							| 
									
										
										
										
											2023-04-19 16:35:26 -04:00
										 |  |  | TESTJOBS := 4 | 
					
						
							|  |  |  | OS:=$(shell uname -s) | 
					
						
							| 
									
										
										
										
											2023-04-20 22:53:17 -04:00
										 |  |  | RELEASEFLAGS := | 
					
						
							| 
									
										
										
										
											2023-04-19 16:35:26 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | ifeq ($(OS),Linux) | 
					
						
							|  |  |  |   TESTJOBS:=$(shell nproc) | 
					
						
							| 
									
										
										
										
											2023-04-20 22:53:17 -04:00
										 |  |  |   RELEASEFLAGS=--target x86_64-unknown-linux-musl | 
					
						
							|  |  |  | endif | 
					
						
							|  |  |  | ifeq ($(OS),FreeBSD) | 
					
						
							|  |  |  |   TESTJOBS:=$(shell sysctl -n hw.ncpu) | 
					
						
							| 
									
										
										
										
											2023-04-19 16:35:26 -04:00
										 |  |  | endif | 
					
						
							| 
									
										
										
										
											2023-03-25 10:07:47 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | ifeq ($(origin .RECIPEPREFIX), undefined) | 
					
						
							|  |  |  |   $(error This Make does not support .RECIPEPREFIX. Please use GNU Make 4.0 or later) | 
					
						
							|  |  |  | endif | 
					
						
							|  |  |  | .RECIPEPREFIX = > | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | .PHONY: build | 
					
						
							| 
									
										
										
										
											2023-03-25 14:10:22 -04:00
										 |  |  | build: | 
					
						
							|  |  |  | > cargo build | 
					
						
							| 
									
										
										
										
											2023-03-25 10:07:47 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-04-19 00:09:25 -04:00
										 |  |  | .PHONY: release | 
					
						
							|  |  |  | release: | 
					
						
							| 
									
										
										
										
											2023-04-20 22:53:17 -04:00
										 |  |  | > cargo build --release $(RELEASEFLAGS) | 
					
						
							| 
									
										
										
										
											2023-04-19 00:09:25 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-12-24 00:39:57 -05:00
										 |  |  | .PHONY: wasm | 
					
						
							|  |  |  | wasm: | 
					
						
							|  |  |  | > cargo build --target=wasm32-unknown-unknown --profile wasm --bin wasm --features wasm | 
					
						
							| 
									
										
										
										
											2023-12-24 01:35:21 -05:00
										 |  |  | > wasm-bindgen --target web --out-dir target/wasm32-unknown-unknown/js target/wasm32-unknown-unknown/wasm/wasm.wasm | 
					
						
							| 
									
										
										
										
											2023-12-24 00:39:57 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-12-25 12:03:59 -05:00
										 |  |  | .PHONY: run_wasm | 
					
						
							|  |  |  | run_wasm: | 
					
						
							| 
									
										
										
										
											2023-12-25 13:10:40 -05:00
										 |  |  | > cargo run --profile wasm --bin wasm_test --features wasm_test | jq | 
					
						
							| 
									
										
										
										
											2023-12-25 12:03:59 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-03-25 10:07:47 -04:00
										 |  |  | .PHONY: clean | 
					
						
							|  |  |  | clean: | 
					
						
							|  |  |  | > cargo clean | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-09-21 23:13:30 -04:00
										 |  |  | .PHONY: format | 
					
						
							|  |  |  | format: | 
					
						
							|  |  |  | > $(MAKE) -C docker/cargo_fmt run | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-10-16 19:38:45 -04:00
										 |  |  | .PHONY: dockerclippy | 
					
						
							|  |  |  | dockerclippy: | 
					
						
							|  |  |  | > $(MAKE) -C docker/organic_clippy run | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-10-16 16:16:37 -04:00
										 |  |  | .PHONY: clippy | 
					
						
							|  |  |  | clippy: | 
					
						
							|  |  |  | > cargo clippy --no-deps --all-targets --all-features -- -D warnings | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-03-25 14:10:22 -04:00
										 |  |  | .PHONY: test | 
					
						
							|  |  |  | test: | 
					
						
							| 
									
										
										
										
											2023-08-29 23:23:31 -04:00
										 |  |  | > cargo test --no-default-features --features compare --no-fail-fast --lib --test test_loader -- --test-threads $(TESTJOBS) | 
					
						
							| 
									
										
										
										
											2023-04-18 22:38:18 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-08-12 23:57:32 -04:00
										 |  |  | .PHONY: dockertest | 
					
						
							|  |  |  | dockertest: | 
					
						
							|  |  |  | > $(MAKE) -C docker/organic_test | 
					
						
							| 
									
										
										
										
											2023-08-31 21:23:51 -04:00
										 |  |  | > docker run --init --rm -i -t --read-only -v "$$(readlink -f ./):/source:ro" --mount type=tmpfs,destination=/tmp --mount source=cargo-cache,target=/usr/local/cargo/registry --mount source=rust-cache,target=/target --env CARGO_TARGET_DIR=/target -w /source organic-test --no-default-features --features compare --no-fail-fast --lib --test test_loader -- --test-threads $(TESTJOBS) | 
					
						
							| 
									
										
										
										
											2023-08-12 23:57:32 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-10-04 17:20:46 -04:00
										 |  |  | .PHONY: buildtest | 
					
						
							|  |  |  | buildtest: | 
					
						
							|  |  |  | > cargo build --no-default-features | 
					
						
							|  |  |  | > cargo build --no-default-features --features compare | 
					
						
							|  |  |  | > cargo build --no-default-features --features tracing | 
					
						
							|  |  |  | > cargo build --no-default-features --features compare,tracing | 
					
						
							| 
									
										
										
										
											2023-10-14 19:30:04 -04:00
										 |  |  | > cargo build --no-default-features --features compare,foreign_document_test | 
					
						
							| 
									
										
										
										
											2023-10-14 15:26:04 -04:00
										 |  |  | > cargo build --no-default-features --features compare,tracing,foreign_document_test | 
					
						
							| 
									
										
										
										
											2023-10-04 17:20:46 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-09-06 16:17:42 -04:00
										 |  |  | .PHONY: foreign_document_test | 
					
						
							|  |  |  | foreign_document_test: | 
					
						
							|  |  |  | > $(MAKE) -C docker/organic_test run_foreign_document_test | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-08-14 15:30:13 -04:00
										 |  |  | .PHONY: dockerclean | 
					
						
							|  |  |  | dockerclean: | 
					
						
							|  |  |  | # Delete volumes created for running the tests in docker. This does not touch anything related to the jaeger docker container.
 | 
					
						
							|  |  |  | > docker volume rm cargo-cache rust-cache | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-04-18 22:38:18 -04:00
										 |  |  | .PHONY: integrationtest | 
					
						
							|  |  |  | integrationtest: | 
					
						
							| 
									
										
										
										
											2023-08-29 23:23:31 -04:00
										 |  |  | > cargo test --no-default-features --features compare --no-fail-fast --test test_loader -- --test-threads $(TESTJOBS) | 
					
						
							| 
									
										
										
										
											2023-03-25 14:10:22 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-04-19 15:29:46 -04:00
										 |  |  | .PHONY: unittest | 
					
						
							|  |  |  | unittest: | 
					
						
							| 
									
										
										
										
											2023-08-29 23:23:31 -04:00
										 |  |  | > cargo test --no-default-features --lib -- --test-threads $(TESTJOBS) | 
					
						
							| 
									
										
										
										
											2023-04-19 15:29:46 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-03-25 10:07:47 -04:00
										 |  |  | .PHONY: jaeger | 
					
						
							|  |  |  | jaeger: | 
					
						
							| 
									
										
										
										
											2023-08-10 21:22:06 -04:00
										 |  |  | # 4317 for OTLP gRPC, 4318 for OTLP HTTP. We currently use gRPC but I forward both ports regardless.
 | 
					
						
							|  |  |  | #
 | 
					
						
							| 
									
										
										
										
											2023-08-14 16:54:40 -04:00
										 |  |  | # These flags didn't help even though they seem like they would: --collector.queue-size=20000 --collector.num-workers=100
 | 
					
						
							| 
									
										
										
										
											2023-08-31 21:23:51 -04:00
										 |  |  | > docker run -d --rm --name organicdocker --read-only -p 4317:4317 -p 4318:4318 -p 16686:16686 -e COLLECTOR_OTLP_ENABLED=true jaegertracing/all-in-one:1.47 --collector.grpc-server.max-message-size=20000000 --collector.otlp.grpc.max-message-size=20000000 | 
					
						
							| 
									
										
										
										
											2023-03-25 17:00:56 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | .PHONY: jaegerweb | 
					
						
							|  |  |  | jaegerweb: | 
					
						
							|  |  |  | > xdg-open 'http://localhost:16686' | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | .PHONY: jaegerstop | 
					
						
							|  |  |  | jaegerstop: | 
					
						
							| 
									
										
										
										
											2023-08-10 18:51:16 -04:00
										 |  |  | > docker stop organicdocker |