Skip to content
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ jobs:
uses: vmactions/freebsd-vm@v1
with:
prepare: |
pkg install -y cmake ninja bash capnproto
pkg install -y cmake ninja bash capnproto git
sync: 'rsync'
copyback: false

Expand Down Expand Up @@ -148,7 +148,7 @@ jobs:
strategy:
fail-fast: false
matrix:
config: [default, llvm, gnu32, sanitize, olddeps]
config: [default, llvm, gnu32, sanitize, olddeps, newdeps]

name: build • ${{ matrix.config }}

Expand Down
1 change: 1 addition & 0 deletions ci/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ CI_CONFIG=ci/configs/llvm.bash ci/scripts/run.sh
CI_CONFIG=ci/configs/gnu32.bash ci/scripts/run.sh
CI_CONFIG=ci/configs/sanitize.bash ci/scripts/run.sh
CI_CONFIG=ci/configs/olddeps.bash ci/scripts/run.sh
CI_CONFIG=ci/configs/newdeps.bash ci/scripts/run.sh
```

By default CI jobs will reuse their build directories. `CI_CLEAN=1` can be specified to delete them before running instead.
Expand Down
6 changes: 6 additions & 0 deletions ci/configs/newdeps.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
CI_DESC="CI job using newest Cap'n Proto and cmake versions"
CI_DIR=build-newdeps
export CXXFLAGS="-Werror -Wall -Wextra -Wpedantic -Wno-unused-parameter -Wno-error=array-bounds"
CAPNP_CHECKOUT=master

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
CAPNP_CHECKOUT=master
CAPNP_CHECKOUT=master # This is the v1.x release branch

The default branch is v2, maybe clarify what master means?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

re: #212 (comment)

The default branch is v2, maybe clarify what master means?

Good suggestion, have added in followup

NIX_ARGS=(--argstr capnprotoVersion "none" --argstr cmakeVersion "4.1.1")
BUILD_ARGS=(-k)
17 changes: 17 additions & 0 deletions ci/scripts/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,27 @@ cmake --version
cmake_ver=$(cmake --version | awk '/version/{print $3; exit}')
ver_ge() { [ "$(printf '%s\n' "$2" "$1" | sort -V | head -n1)" = "$2" ]; }

# If CAPNP_CHECKOUT was requested, clone and install requested Cap'n Proto branch or tag
capnp_prefix=
if [ -n "${CAPNP_CHECKOUT-}" ]; then
capnp_prefix="$PWD/capnp-install"
[ -e "capnp" ] || git clone -b "${CAPNP_CHECKOUT}" "https://github.com/capnproto/capnproto" capnp
mkdir -p capnp/build
(
cd capnp/build
git --no-pager log -1 || true
CXXFLAGS="-std=c++20" cmake .. "-DCMAKE_INSTALL_PREFIX=${capnp_prefix}" -DBUILD_TESTING=OFF -DWITH_OPENSSL=OFF -DWITH_ZLIB=OFF
cmake --build .
cmake --install .
)
export CMAKE_PREFIX_PATH="${capnp_prefix}:${CMAKE_PREFIX_PATH-}"
fi

src_dir=$PWD
mkdir -p "$CI_DIR"
cd "$CI_DIR"
export CMAKE_BUILD_PARALLEL_LEVEL="$(nproc)"
git --no-pager log -1 || true

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a ci config that does not have git? I can't see one and it seems easy enough to just require it, so that logs always have the commit embedded?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

re: #212 (comment)

is there a ci config that does not have git? I can't see one and it seems easy enough to just require it, so that logs always have the commit embedded?

Sounds like the request here is to remove || true?

I'd slightly prefer to keep it just because these CI scripts are useful for testing locally even outside context of a real CI system, and there are reasons it can be useful to copy files around and not have valid git checkouts during testing. But it is true that a drawback of || true is that it could allow someone to add a CI job that does not have print the commit hash here. So I'd be ok with a change dropping || true in my planned followup, just let me know.

cmake "$src_dir" "${CMAKE_ARGS[@]+"${CMAKE_ARGS[@]}"}"
if ver_ge "$cmake_ver" "3.15"; then
cmake --build . -t "${BUILD_TARGETS[@]}" -- "${BUILD_ARGS[@]+"${BUILD_ARGS[@]}"}"
Expand Down
7 changes: 6 additions & 1 deletion shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ let
clang-tools = llvm.clang-tools.override { inherit enableLibcxx; };
cmakeHashes = {
"3.12.4" = "sha256-UlVYS/0EPrcXViz/iULUcvHA5GecSUHYS6raqbKOMZQ=";
"4.1.1" = "sha256-sp9vGXM6oiS3djUHoQikJ+1Ixojh+vIrKcROHDBUkoI=";
};
gcc = if gccVersion == null then null else builtins.getAttr ("gcc" + gccVersion) pkgs;
cmakeBuild = if cmakeVersion == null then pkgs.cmake else (pkgs.cmake.overrideAttrs (old: {
Expand All @@ -66,11 +67,12 @@ let
patches = [];
})).override { isMinimalBuild = true; };
in crossPkgs.mkShell {
buildInputs = [
buildInputs = lib.optionals (capnprotoVersion != "none") [
capnproto
];
nativeBuildInputs = with pkgs; [
cmakeBuild
git
include-what-you-use
ninja
] ++ lib.optional (gcc != null) gcc ++ lib.optionals (!minimal) [
Expand All @@ -83,4 +85,7 @@ in crossPkgs.mkShell {

# Tell IWYU where its libc++ mapping lives
IWYU_MAPPING_FILE = if enableLibcxx then "${llvm.libcxx.dev}/include/c++/v1/libcxx.imp" else null;

# Avoid "SSL certificate problem: unable to get local issuer certificate" error during git clone in ci/scripts/ci.sh
NIX_SSL_CERT_FILE = "${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt";
}
Loading