Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps: add support for vendor and use local vendor for deps #123

Merged
merged 3 commits into from
Dec 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
11 changes: 11 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Use vendor for everything
[source.crates-io]
replace-with = "vendored-sources"

[source."/~https://github.com/little-dude/netlink"]
git = "/~https://github.com/little-dude/netlink"
branch = "master"
replace-with = "vendored-sources"

[source.vendored-sources]
directory = "vendor"
10 changes: 10 additions & 0 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,15 @@ validate_task:
setup_script: *setup
main_script: *main

verify_vendor_task:
alias: "verify_vendor"
depends_on:
- "build"
cargo_cache: *ro_cargo_cache
targets_cache: *ro_targets_cache
bin_cache: *ro_bin_cache
setup_script: *setup
main_script: *main

unit_task:
alias: "unit"
Expand Down Expand Up @@ -144,6 +153,7 @@ success_task:
depends_on:
- "build"
- "validate"
- "verify_vendor"
- "unit"
- "integration"
- "meta"
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ bin/
targets/
*.swp
netavark.1
vendor/winapi*gnu*/lib/*.a
13 changes: 12 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ else
endif

.PHONY: all
all: build docs
all: vendor build

bin:
mkdir -p $@
Expand Down Expand Up @@ -89,6 +89,17 @@ validate: $(CARGO_TARGET_DIR)
cargo fmt --all -- --check
cargo clippy -p netavark -- -D warnings

.PHONY: vendor
vendor: ## vendor everything into vendor/
cargo vendor
$(MAKE) vendor-rm-windows ## remove windows library if possible

.PHONY: vendor-rm-windows
vendor-rm-windows:
if [ -d "vendor/winapi" ]; then \
rm -fr vendor/winapi*gnu*/lib/*.a; \
fi

.PHONY: help
help:
@echo "usage: make $(prog) [debug=1]"
7 changes: 7 additions & 0 deletions contrib/cirrus/runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ _run_validate() {
make validate
}

_run_verify_vendor() {
# N/B: current repo. dir. contents produced by _run_build() above.
if ! git diff --no-ext-diff --quiet --exit-code; then
die "Found uncommited and necessary changes to vendoring, please fix, commit, and re-submit."
fi
}

flouthoc marked this conversation as resolved.
Show resolved Hide resolved
_run_unit() {
make unit
}
Expand Down
1 change: 1 addition & 0 deletions vendor/aho-corasick/.cargo-checksum.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"files":{"COPYING":"01c266bced4a434da0051174d6bee16a4c82cf634e2679b6155d40d75012390f","Cargo.toml":"f61283fd900435313b9ba8c1b87a4b5b31d442f9b554222136ec8d1d3d1e39d8","DESIGN.md":"9065f33d818d1562244d36dc4781e2a351108030cee17f11c2ba512ca7b4c27e","LICENSE-MIT":"0f96a83840e146e43c0ec96a22ec1f392e0680e6c1226e6f3ba87e0740af850f","README.md":"741e7249c8d1d6a7ba9341d68253dbf4952477c5620ff37c5325f2e894b148b6","UNLICENSE":"7e12e5df4bae12cb21581ba157ced20e1986a0508dd10d0e8a4ab9a4cf94e85c","rustfmt.toml":"1ca600239a27401c4a43f363cf3f38183a212affc1f31bff3ae93234bbaec228","src/ahocorasick.rs":"6fcbe812eec7af44b104c6b8a27b0a2ea8d67c3d9aec73cb69d802b30be5f005","src/automaton.rs":"610b3e2c104c51bf4f51a6d07626c3972e9d1274ca276e987385a231b284cc8b","src/buffer.rs":"dae7ee7c1f846ca9cf115ba4949484000e1837b4fb7311f8d8c9a35011c9c26f","src/byte_frequencies.rs":"2fb85b381c038c1e44ce94294531cdcd339dca48b1e61f41455666e802cbbc9e","src/classes.rs":"99a53a2ed8eea8c13699def90e31dfdff9d0b90572b1db3cb534e3396e7a0ed0","src/dfa.rs":"25e4455b3e179a7e192108d05f3683993456b36e3ebed99f827558c52525b7e6","src/error.rs":"d34c2c9c815df5d9dedc46b4b3ce109cd2cee07825de643f0c574ec960367beb","src/lib.rs":"f0c48b0ee093dd8b3034d025d052c3667860c5d4a196cb178588012b719acea4","src/nfa.rs":"2f443951c78196126bfd237ed5770a69077e6190daeecd47131339c25e51a3d0","src/packed/api.rs":"ec58ff1b4375dd4ff88fb5859c7ede994fe08d31b7d3677720a086592aa0fe53","src/packed/mod.rs":"d7ee11d487a7f129f16dc8f1473442a7127905933f378504bae83df0f23c5e2a","src/packed/pattern.rs":"3abf3835d4c4f8a43753c52936a894d819f713f233fc046e19de5ef95200dcce","src/packed/rabinkarp.rs":"caf9563b7442c9b75c9cb520fa236c7a6da8173705889b8d79b69ede14a20767","src/packed/teddy/README.md":"5819f40d221af93288e705eadef5393a41d7a0900881b4d676e01fd65d5adf15","src/packed/teddy/compile.rs":"aad40b3f93d2c388b409b31fb2795d414a365237789d5b1a7510d97ceb8ce260","src/packed/teddy/mod.rs":"83b52bd80272970ad17234d0db293d17c1710ec582302bf516b203c8edec037e","src/packed/teddy/runtime.rs":"836146e90b320b14fa2c65fe4af7915a41f6fb04408aac5fac731c22ff46adae","src/packed/tests.rs":"b8dc4d3281ecd6d0fa2bf7ef16cf292a467dfdce64e470c7921e983bfa60fee2","src/packed/vector.rs":"ab3c0535fca5f09198d58cbfae44c292aeb3ce44bc92bca36d30dc72963639fc","src/prefilter.rs":"82a3eb6d5c0c3f10bc8d5f57d55d6d14cf4cf21c475bb5253e1921084063b8d7","src/state_id.rs":"519ec8c7bf3fa72103d4c561c193759759f535dca924c9853efe630f406d2029","src/tests.rs":"6522ed1b244513c01de5bbcf0fe35571454fdea2c2a9d8dfe13a04bf57b70eca"},"package":"1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f"}
3 changes: 3 additions & 0 deletions vendor/aho-corasick/COPYING
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This project is dual-licensed under the Unlicense and MIT licenses.

You may use this code under the terms of either license.
43 changes: 43 additions & 0 deletions vendor/aho-corasick/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
#
# When uploading crates to the registry Cargo will automatically
# "normalize" Cargo.toml files for maximal compatibility
# with all versions of Cargo and also rewrite `path` dependencies
# to registry (e.g., crates.io) dependencies
#
# If you believe there's an error in this file please file an
# issue against the rust-lang/cargo repository. If you're
# editing this file be aware that the upstream Cargo.toml
# will likely look very different (and much more reasonable)

[package]
edition = "2018"
name = "aho-corasick"
version = "0.7.18"
authors = ["Andrew Gallant <jamslam@gmail.com>"]
exclude = ["/aho-corasick-debug", "/ci/*", "/.travis.yml", "/appveyor.yml"]
autotests = false
description = "Fast multiple substring searching."
homepage = "/~https://github.com/BurntSushi/aho-corasick"
readme = "README.md"
keywords = ["string", "search", "text", "aho", "multi"]
categories = ["text-processing"]
license = "Unlicense/MIT"
repository = "/~https://github.com/BurntSushi/aho-corasick"
[profile.bench]
debug = true

[profile.release]
debug = true

[lib]
name = "aho_corasick"
[dependencies.memchr]
version = "2.4.0"
default-features = false

[dev-dependencies]

[features]
default = ["std"]
std = ["memchr/std"]
Loading