diff --git a/Cargo.lock b/Cargo.lock index 8bb019ef..a4656778 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -49,6 +49,18 @@ dependencies = [ "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]] name = "aho-corasick" version = "0.7.19" @@ -1109,9 +1121,9 @@ dependencies = [ [[package]] name = "crossterm" -version = "0.23.2" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2102ea4f781910f8a5b98dd061f4c2023f479ce7bb1236330099ceb5a93cf17" +checksum = "e64e6c0fbe2c17357405f7c758c1ef960fce08bdfb2c03d88d2a18d7e09c4b67" dependencies = [ "bitflags", "crossterm_winapi", @@ -1186,9 +1198,9 @@ checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35" [[package]] name = "cursive" -version = "0.18.0" +version = "0.20.0" dependencies = [ - "ahash", + "ahash 0.8.1", "async-std", "cfg-if 1.0.0", "crossbeam-channel", @@ -1231,9 +1243,9 @@ dependencies = [ [[package]] name = "cursive_core" -version = "0.3.2" +version = "0.3.5" dependencies = [ - "ahash", + "ahash 0.8.1", "async-std", "crossbeam-channel", "enum-map", @@ -2048,12 +2060,12 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" dependencies = [ - "ahash", + "ahash 0.7.6", ] [[package]] name = "hashlink" -version = "0.8.0" +version = "0.8.1" dependencies = [ "hashbrown", "serde", @@ -4065,7 +4077,7 @@ dependencies = [ "bitflags", "fallible-iterator", "fallible-streaming-iterator", - "hashlink 0.8.1", + "hashlink 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", "libsqlite3-sys", "smallvec", ] @@ -5419,7 +5431,7 @@ dependencies = [ "generic-array", "getrandom 0.2.8", "hashbrown", - "hashlink 0.8.0", + "hashlink 0.8.1", "hex", "ifstructs", "igd", diff --git a/Earthfile b/Earthfile index 8ce1a7bd..e8f17b66 100644 --- a/Earthfile +++ b/Earthfile @@ -7,7 +7,7 @@ FROM --platform amd64 ubuntu:16.04 # Install build prerequisites deps-base: 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 deps-capnp: @@ -15,9 +15,15 @@ deps-capnp: COPY scripts/earthly/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 deps-rust: - FROM +deps-capnp + FROM +deps-protoc ENV RUSTUP_HOME=/usr/local/rustup ENV CARGO_HOME=/usr/local/cargo 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 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 apt-get clean -# Clean up the apt cache to save space -deps: - FROM +deps-android +# Just linux build not android +deps-linux: + FROM +deps-cross RUN apt-get clean -code: - FROM +deps +# Code + Linux 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 WORKDIR /veilid # Clippy only clippy: - FROM +code + FROM +code-linux RUN cargo clippy # Build build-linux-amd64: - FROM +code + FROM +code-linux 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 build-linux-arm64: - FROM +code + FROM +code-linux RUN cargo build --target aarch64-unknown-linux-gnu --release SAVE ARTIFACT ./target/aarch64-unknown-linux-gnu AS LOCAL ./target/artifacts/aarch64-unknown-linux-gnu build-android: - FROM +code + FROM +code-android WORKDIR /veilid/veilid-core ENV PATH=$PATH:/Android/Sdk/ndk/22.0.7026061/toolchains/llvm/prebuilt/linux-x86_64/bin/ RUN cargo build --target aarch64-linux-android --release @@ -92,11 +106,11 @@ build-android: # Unit tests unit-tests-linux-amd64: - FROM +code + FROM +code-linux RUN cargo test --target x86_64-unknown-linux-gnu --release unit-tests-linux-arm64: - FROM +code + FROM +code-linux RUN cargo test --target aarch64-unknown-linux-gnu --release # Package diff --git a/external/cursive b/external/cursive index fea04c2f..f1504cf3 160000 --- a/external/cursive +++ b/external/cursive @@ -1 +1 @@ -Subproject commit fea04c2f9bb8c4c9551ca6eb4f2cb1268551120f +Subproject commit f1504cf37a7021454020cda5cfba815755399794 diff --git a/external/hashlink b/external/hashlink index c8da3a58..a089b448 160000 --- a/external/hashlink +++ b/external/hashlink @@ -1 +1 @@ -Subproject commit c8da3a58485c850f4029a58de99b1af83112ba8a +Subproject commit a089b448071ef36633947693b90023c67dc8485f diff --git a/scripts/earthly/install_protoc.sh b/scripts/earthly/install_protoc.sh new file mode 100755 index 00000000..7ba2171a --- /dev/null +++ b/scripts/earthly/install_protoc.sh @@ -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 diff --git a/setup_linux.sh b/setup_linux.sh index 00e4e647..87118146 100755 --- a/setup_linux.sh +++ b/setup_linux.sh @@ -77,7 +77,9 @@ rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-andro cargo install wasm-bindgen-cli wasm-pack # 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 $SCRIPTDIR/scripts/earthly/install_capnproto.sh +# Install protoc using the same mechanism as our earthly build +$SCRIPTDIR/scripts/earthly/install_protoc.sh