Closed cpu closed 2 months ago
I think @Ralith has some Nix experience, maybe he can help review?
I don't have a lot of experience with flakes specifically, but this looks generally reasonable.
Thanks for taking a look :-)
I think we should have CI coverage for it.
I pushed a simple CI job :+1:
It should be possible to configure an Android emulator, and to run the unit tests within the emulator, without using Android studio or manually configuring an emulator.
I pushed one last revision to add an emulator image output. The PR description is updated with some quick usage instructions. This is sufficient for being able to build the project and run the Android tests in an emulator without doing any manual setup in Android studio.
Going to call this done for now and pick up on the NDK version pinning the next time I have a chance to fiddle with this.
CI / Clippy (-Zbuild-std) (pull_request) Failing after 14s cargo deny / audit (pull_request) Failing after 23s CI / Test (Android) (pull_request) Failing after 6m
Unrelated to this branch, resolving these in https://github.com/rustls/rustls-platform-verifier/pull/91
@complexspaces Are you thinking that you'd like to do some further reviewing/testing of this branch or could it be merged soon?
I've gotten slightly better (only slightly š) with Nix since I last looked at this, but AFAICT this looks fine. I'm looking forward to trying this out when time permits.
Awesome! I'm not particularly skilled myself so I'm sure there are some improvements we could make down the road. š
cpu force-pushed the cpu-start-nix-flake_dev branch from 25440f2 to 58a085c
Rebased on main to pick up the CI fixes. Will merge once this is all green.
The tooling required to work in this repo can be a little bit challenging to set up (largely as a side effect of supporting multiple platforms/languages, each with their own tooling requirements).
In an effort to make this easier and more reproducible this commit adds the start of a Nix flake.
Some starting points (assuming you've set up
nix
, which is outside of the scope of this PR):nix build .
- builds the platform verifier Rust library in a release configuration using stable Rust.nix build .#rustls-platform-verifier-dbg
- same as above, but with the "dbg", "base64", and "docsrs" Cargo features enabled.nix develop
- enter a development shell offering a nightly rust toolchain, Android studio, Android SDK/NDK, Java, and Maven tools for building the Android project and using the release tooling.nix develop .#stable
- same as above, but with the stable Rust toolchain.nix develop .#msrv
- same as above, but with the project MSRV Rust toolchain.There's also an
android-emu
output for creating an Android device emulator that can be used to run unit tests:Future work:
nix build
step somewhere to try and prevent bitrot.~ I added a CI task.