Debian Codegraph @

crt/s2n/codebuild/spec/buildspec_ktls.yml

raw symbols SCIP
1 ---
2 # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License"). You may not use
5 # this file except in compliance with the License. A copy of the License is
6 # located at
7 #
8 # http://aws.amazon.com/apache2.0/
9 #
10 # or in the "license" file accompanying this file. This file is distributed on an
11 # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
12 # implied. See the License for the specific language governing permissions and
13 # limitations under the License.
14
15 version: 0.2
16 # This is designed to work with CodeBuild's reserved instances fleet and
17 # curated Ec2 AMI for AL2023.
18 #
19 # Because the Ec2 reserved instance disks persist between runs,
20 # we need to do periodic clean up; The `nix store gc` command runs on Sunday to
21 # prevent the disk from filling up.
22 env:
23 shell: bash
24 variables:
25 NIX_CACHE_BUCKET: "s3://s2n-tls-nixcachebucket-x86-64?region=us-west-2"
26 NIX_INSTALLER: "https://nixos.org/nix/install"
27 S2N_KTLS_TESTING_EXPECTED: 1
28 phases:
29 install:
30 commands:
31 - yum update -y; yum upgrade -y
32 pre_build:
33 commands:
34 - id; groupadd nixbld||true
35 - useradd -m -g nixbld -G nixbld nix || true
36 - |
37 echo "Working around the faulty yaml parser..."
38 echo 'nix ALL=NOPASSWD: ALL' > /etc/sudoers.d/nix
39 # (Re)Install nix
40 - sh <(curl -L "$NIX_INSTALLER") --no-daemon
41 # Make sure nix exists in the PATH
42 - export PATH=$HOME/.nix-profile/bin:$PATH
43 # Turn on flakes
44 - mkdir -p ~/.config/nix; echo "experimental-features = nix-command flakes" >> ~/.config/nix/nix.conf
45 # Configure S3 bucket as a nix substituter
46 - echo "extra-substituters = $NIX_CACHE_BUCKET" >> ~/.config/nix/nix.conf
47 - echo "extra-trusted-substituters = $NIX_CACHE_BUCKET" >> ~/.config/nix/nix.conf
48 - echo "require-sigs = false" >> ~/.config/nix/nix.conf
49 - if [[ $(date +%u) -eq 0 ]]; then nix store gc;fi
50 # Load the TLS kernel module
51 - sudo modprobe tls
52 - echo "Checking that the TLS kernel mod loaded..."; test $(sudo lsmod|grep -c tls) = 1
53 build:
54 commands:
55 - nix develop .#awslc --command bash -c 'source ./nix/shell.sh && clean && configure && unit'
56 - S2N_CMAKE_OPTIONS="-DASAN=ON" nix develop .#awslc --command bash -c 'source ./nix/shell.sh && clean && configure && unit'
57 post_build:
58 commands:
59 - nix copy --to $NIX_CACHE_BUCKET .#cache-awslc
60