This commit is contained in:
John Smith 2022-11-02 20:42:07 -04:00
parent ee7ccd698d
commit 74dc92c657
6 changed files with 80 additions and 26 deletions

32
Cargo.lock generated
View File

@ -49,6 +49,18 @@ dependencies = [
"version_check", "version_check",
] ]
[[package]]
name = "ahash"
version = "0.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "464b3811b747f8f7ebc8849c9c728c39f6ac98a055edad93baf9eb330e3f8f9d"
dependencies = [
"cfg-if 1.0.0",
"getrandom 0.2.8",
"once_cell",
"version_check",
]
[[package]] [[package]]
name = "aho-corasick" name = "aho-corasick"
version = "0.7.19" version = "0.7.19"
@ -1109,9 +1121,9 @@ dependencies = [
[[package]] [[package]]
name = "crossterm" name = "crossterm"
version = "0.23.2" version = "0.25.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a2102ea4f781910f8a5b98dd061f4c2023f479ce7bb1236330099ceb5a93cf17" checksum = "e64e6c0fbe2c17357405f7c758c1ef960fce08bdfb2c03d88d2a18d7e09c4b67"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"crossterm_winapi", "crossterm_winapi",
@ -1186,9 +1198,9 @@ checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35"
[[package]] [[package]]
name = "cursive" name = "cursive"
version = "0.18.0" version = "0.20.0"
dependencies = [ dependencies = [
"ahash", "ahash 0.8.1",
"async-std", "async-std",
"cfg-if 1.0.0", "cfg-if 1.0.0",
"crossbeam-channel", "crossbeam-channel",
@ -1231,9 +1243,9 @@ dependencies = [
[[package]] [[package]]
name = "cursive_core" name = "cursive_core"
version = "0.3.2" version = "0.3.5"
dependencies = [ dependencies = [
"ahash", "ahash 0.8.1",
"async-std", "async-std",
"crossbeam-channel", "crossbeam-channel",
"enum-map", "enum-map",
@ -2048,12 +2060,12 @@ version = "0.12.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
dependencies = [ dependencies = [
"ahash", "ahash 0.7.6",
] ]
[[package]] [[package]]
name = "hashlink" name = "hashlink"
version = "0.8.0" version = "0.8.1"
dependencies = [ dependencies = [
"hashbrown", "hashbrown",
"serde", "serde",
@ -4065,7 +4077,7 @@ dependencies = [
"bitflags", "bitflags",
"fallible-iterator", "fallible-iterator",
"fallible-streaming-iterator", "fallible-streaming-iterator",
"hashlink 0.8.1", "hashlink 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)",
"libsqlite3-sys", "libsqlite3-sys",
"smallvec", "smallvec",
] ]
@ -5419,7 +5431,7 @@ dependencies = [
"generic-array", "generic-array",
"getrandom 0.2.8", "getrandom 0.2.8",
"hashbrown", "hashbrown",
"hashlink 0.8.0", "hashlink 0.8.1",
"hex", "hex",
"ifstructs", "ifstructs",
"igd", "igd",

View File

@ -7,7 +7,7 @@ FROM --platform amd64 ubuntu:16.04
# Install build prerequisites # Install build prerequisites
deps-base: deps-base:
RUN apt-get -y update RUN apt-get -y update
RUN apt-get install -y iproute2 curl build-essential cmake libssl-dev openssl file git pkg-config libdbus-1-dev libdbus-glib-1-dev libgirepository1.0-dev libcairo2-dev RUN apt-get install -y iproute2 curl build-essential cmake libssl-dev openssl file git pkg-config libdbus-1-dev libdbus-glib-1-dev libgirepository1.0-dev libcairo2-dev checkinstall unzip
# Install Cap'n Proto # Install Cap'n Proto
deps-capnp: deps-capnp:
@ -15,9 +15,15 @@ deps-capnp:
COPY scripts/earthly/install_capnproto.sh / COPY scripts/earthly/install_capnproto.sh /
RUN /bin/bash /install_capnproto.sh; rm /install_capnproto.sh RUN /bin/bash /install_capnproto.sh; rm /install_capnproto.sh
# Install protoc
deps-protoc:
FROM +deps-capnp
COPY scripts/earthly/install_protoc.sh /
RUN /bin/bash /install_protoc.sh; rm /install_protoc.sh
# Install Rust # Install Rust
deps-rust: deps-rust:
FROM +deps-capnp FROM +deps-protoc
ENV RUSTUP_HOME=/usr/local/rustup ENV RUSTUP_HOME=/usr/local/rustup
ENV CARGO_HOME=/usr/local/cargo ENV CARGO_HOME=/usr/local/cargo
ENV PATH=/usr/local/cargo/bin:$PATH ENV PATH=/usr/local/cargo/bin:$PATH
@ -49,35 +55,43 @@ deps-android:
RUN curl -o /Android/cmdline-tools.zip https://dl.google.com/android/repository/commandlinetools-linux-7583922_latest.zip RUN curl -o /Android/cmdline-tools.zip https://dl.google.com/android/repository/commandlinetools-linux-7583922_latest.zip
RUN cd /Android; unzip /Android/cmdline-tools.zip RUN cd /Android; unzip /Android/cmdline-tools.zip
RUN yes | /Android/cmdline-tools/bin/sdkmanager --sdk_root=/Android/Sdk build-tools\;30.0.3 ndk\;22.0.7026061 cmake\;3.18.1 platform-tools platforms\;android-30 RUN yes | /Android/cmdline-tools/bin/sdkmanager --sdk_root=/Android/Sdk build-tools\;30.0.3 ndk\;22.0.7026061 cmake\;3.18.1 platform-tools platforms\;android-30
RUN apt-get clean
# Clean up the apt cache to save space # Just linux build not android
deps: deps-linux:
FROM +deps-android FROM +deps-cross
RUN apt-get clean RUN apt-get clean
code: # Code + Linux deps
FROM +deps code-linux:
FROM +deps-linux
COPY --dir .cargo external files scripts veilid-cli veilid-core veilid-server veilid-flutter veilid-wasm Cargo.lock Cargo.toml /veilid
WORKDIR /veilid
# Code + Linux + Android deps
code-android:
FROM +deps-android
COPY --dir .cargo external files scripts veilid-cli veilid-core veilid-server veilid-flutter veilid-wasm Cargo.lock Cargo.toml /veilid COPY --dir .cargo external files scripts veilid-cli veilid-core veilid-server veilid-flutter veilid-wasm Cargo.lock Cargo.toml /veilid
WORKDIR /veilid WORKDIR /veilid
# Clippy only # Clippy only
clippy: clippy:
FROM +code FROM +code-linux
RUN cargo clippy RUN cargo clippy
# Build # Build
build-linux-amd64: build-linux-amd64:
FROM +code FROM +code-linux
RUN cargo build --target x86_64-unknown-linux-gnu --release RUN cargo build --target x86_64-unknown-linux-gnu --release
SAVE ARTIFACT ./target/x86_64-unknown-linux-gnu AS LOCAL ./target/artifacts/x86_64-unknown-linux-gnu SAVE ARTIFACT ./target/x86_64-unknown-linux-gnu AS LOCAL ./target/artifacts/x86_64-unknown-linux-gnu
build-linux-arm64: build-linux-arm64:
FROM +code FROM +code-linux
RUN cargo build --target aarch64-unknown-linux-gnu --release RUN cargo build --target aarch64-unknown-linux-gnu --release
SAVE ARTIFACT ./target/aarch64-unknown-linux-gnu AS LOCAL ./target/artifacts/aarch64-unknown-linux-gnu SAVE ARTIFACT ./target/aarch64-unknown-linux-gnu AS LOCAL ./target/artifacts/aarch64-unknown-linux-gnu
build-android: build-android:
FROM +code FROM +code-android
WORKDIR /veilid/veilid-core WORKDIR /veilid/veilid-core
ENV PATH=$PATH:/Android/Sdk/ndk/22.0.7026061/toolchains/llvm/prebuilt/linux-x86_64/bin/ ENV PATH=$PATH:/Android/Sdk/ndk/22.0.7026061/toolchains/llvm/prebuilt/linux-x86_64/bin/
RUN cargo build --target aarch64-linux-android --release RUN cargo build --target aarch64-linux-android --release
@ -92,11 +106,11 @@ build-android:
# Unit tests # Unit tests
unit-tests-linux-amd64: unit-tests-linux-amd64:
FROM +code FROM +code-linux
RUN cargo test --target x86_64-unknown-linux-gnu --release RUN cargo test --target x86_64-unknown-linux-gnu --release
unit-tests-linux-arm64: unit-tests-linux-arm64:
FROM +code FROM +code-linux
RUN cargo test --target aarch64-unknown-linux-gnu --release RUN cargo test --target aarch64-unknown-linux-gnu --release
# Package # Package

2
external/cursive vendored

@ -1 +1 @@
Subproject commit fea04c2f9bb8c4c9551ca6eb4f2cb1268551120f Subproject commit f1504cf37a7021454020cda5cfba815755399794

2
external/hashlink vendored

@ -1 +1 @@
Subproject commit c8da3a58485c850f4029a58de99b1af83112ba8a Subproject commit a089b448071ef36633947693b90023c67dc8485f

View File

@ -0,0 +1,26 @@
#!/bin/bash
VERSION=21.9
mkdir /tmp/protoc-install
pushd /tmp/protoc-install
curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v$VERSION/protoc-$VERSION-linux-x86_64.zip
unzip protoc-$VERSION-linux-x86_64.zip
if [ "$EUID" -ne 0 ]; then
if command -v checkinstall &> /dev/null; then
sudo checkinstall --pkgversion=$VERSION -y cp -r bin include /usr/local/
cp *.deb ~
else
sudo make install
fi
popd
sudo rm -rf /tmp/protoc-install
else
if command -v checkinstall &> /dev/null; then
checkinstall --pkgversion=$VERSION -y cp -r bin include /usr/local/
cp *.deb ~
else
make install
fi
popd
rm -rf /tmp/protoc-install
fi

View File

@ -77,7 +77,9 @@ rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-andro
cargo install wasm-bindgen-cli wasm-pack cargo install wasm-bindgen-cli wasm-pack
# Ensure packages are installed # Ensure packages are installed
sudo apt-get install libc6-dev-i386 libc6:i386 libncurses5:i386 libstdc++6:i386 lib32z1 libbz2-1.0:i386 openjdk-11-jdk llvm wabt protobuf-compiler checkinstall sudo apt-get install libc6-dev-i386 libc6:i386 libncurses5:i386 libstdc++6:i386 lib32z1 libbz2-1.0:i386 openjdk-11-jdk llvm wabt checkinstall
# Install capnproto using the same mechanism as our earthly build # Install capnproto using the same mechanism as our earthly build
$SCRIPTDIR/scripts/earthly/install_capnproto.sh $SCRIPTDIR/scripts/earthly/install_capnproto.sh
# Install protoc using the same mechanism as our earthly build
$SCRIPTDIR/scripts/earthly/install_protoc.sh