Fix build of legacy packages and add CI tests

This commit is contained in:
oxalica 2022-06-22 10:08:22 +08:00
parent 8159585609
commit b6190a6b1a
2 changed files with 9 additions and 3 deletions

View File

@ -105,6 +105,12 @@ jobs:
exclude:
- os: macos-latest
nixpkgs-channel: nixos-21.11
include:
# The legacy package, used by compatible functions.
- os: ubuntu-latest
rust-channel: stable
profile: rust
nixpkgs-channel: nixpkgs-unstable
runs-on: ${{ matrix.os }}
env:
NIX_SHELL_CMD: nix-shell --pure --argstr channel ${{ matrix.rust-channel }} --argstr profile ${{ matrix.profile }}
@ -135,13 +141,13 @@ jobs:
[[ "$(< out)" == *"Hello, world!"* ]]
- name: Test cargo fmt
if: matrix.profile == 'default'
if: matrix.profile == 'default' || matrix.profile == 'rust'
run: |
cd examples/hello-world
$NIX_SHELL_CMD --command "cargo fmt -- --check"
- name: Test cargo clippy
if: matrix.profile == 'default'
if: matrix.profile == 'default' || matrix.profile == 'rust'
run: |
cd examples/hello-world
set -o pipefail

View File

@ -36,7 +36,7 @@ let
optional (hostPlatform.isDarwin && linksToRustc) bintools;
buildInputs =
optional (elem pname [ "rustc" "cargo" "llvm-tools-preview" ]) zlib ++
optional (elem pname [ "rustc" "cargo" "llvm-tools-preview" "rust" ]) zlib ++
optional linksToRustc self.rustc;
# Nightly `rustc` since 2022-02-17 links to `libstdc++.so.6` on Linux.