Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: kTLS specific nix devShell #4886

Closed
wants to merge 15 commits into from
Closed
Show file tree
Hide file tree
Changes from 11 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
20 changes: 16 additions & 4 deletions codebuild/spec/buildspec_ktls.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
version: 0.2
env:
shell: bash
phases:
install:
commands:
Expand All @@ -8,17 +10,27 @@ phases:
- apt install -y qemu qemu-system-x86 wget cloud-image-utils
pre_build:
commands:
- mkdir ~/.ssh; echo -e "Host localhost\nUser codebuild\nPort 2222" > ~/.ssh/config
- aws s3 --quiet sync s3://s2n-ktls-testing ./qemu
- cd qemu; bash ./run.sh; cd ..
- rsync -avz --exclude=qemu --exclude=tests/fuzz -e 'ssh -p 2222' . codebuild@localhost:/home/codebuild/s2n-tls
build:
commands:
- codebuild-breakpoint
- |
ssh -p 2222 codebuild@localhost " \
ssh localhost " \
cd s2n-tls; sudo modprobe tls; \
export S2N_CMAKE_OPTIONS=${S2N_CMAKE_OPTIONS}; \
export S2N_KTLS_TESTING_EXPECTED=1; \
nix develop .#openssl111 --command bash -c \
'source ./nix/shell.sh && clean && configure && unit' \
nix develop .#ktls --command bash -c \
'source ./nix/shell.sh && clean && configure' \
"
post_build:
commands:
lrstewart marked this conversation as resolved.
Show resolved Hide resolved
- |
ssh localhost " \
cd s2n-tls; \
export S2N_CMAKE_OPTIONS=${S2N_CMAKE_OPTIONS}; \
export S2N_KTLS_TESTING_EXPECTED=1; \
nix develop .#ktls --command bash -c \
'source ./nix/shell.sh && unit' \
"
14 changes: 13 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,19 @@
source ${writeScript ./nix/shell.sh}
'';
});

devShells.ktls = pkgs.mkShell {
lrstewart marked this conversation as resolved.
Show resolved Hide resolved
# Intended for kTLS.
# This is not an over-ride like the other shells.
buildInputs = [ pkgs.cmake openssl_1_1_1 ];
S2N_LIBCRYPTO = "openssl-1.1.1";
OPENSSL_1_1_1_INSTALL_DIR = "${openssl_1_1_1}";
lrstewart marked this conversation as resolved.
Show resolved Hide resolved
shellHook = ''
echo Setting up $S2N_LIBCRYPTO environment from flake.nix...
export PATH=${openssl_1_1_1}/bin:$PATH
export PS1="[nix $S2N_LIBCRYPTO] $PS1"
source ${writeScript ./nix/shell.sh}
'';
};
# Used to backup the devShell to s3 for caching.
packages.devShell = devShells.default.inputDerivation;
packages.default = packages.s2n-tls;
Expand Down
Loading