From f76e5ab0cf0aa28e437a6b1c4aef4a85d2901b73 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Mon, 27 Jun 2016 21:29:12 +0000 Subject: travis: split build into matrix of 3 This adds a 3rd matrix to be built by Travis. The new matrix "checks" the NixPkgs evaluation so the other 2 can save their resources for building. Hopefully, this will lead to less "out of space" errors that seem to be happening with Travis. Also adds folding. --- maintainers/scripts/travis-nox-review-pr.sh | 109 ++++++++++++++++------------ 1 file changed, 61 insertions(+), 48 deletions(-) (limited to 'maintainers') diff --git a/maintainers/scripts/travis-nox-review-pr.sh b/maintainers/scripts/travis-nox-review-pr.sh index 092fc0cd9d07..025b27528e94 100755 --- a/maintainers/scripts/travis-nox-review-pr.sh +++ b/maintainers/scripts/travis-nox-review-pr.sh @@ -1,58 +1,71 @@ #! /usr/bin/env bash set -e +# This should make Curl silent +# but download-from-binary-cache doesn't respect export NIX_CURL_FLAGS=-sS -if [[ $1 == nix ]]; then - echo "=== Installing Nix..." - # Install Nix - bash <(curl -sS https://nixos.org/nix/install) +if [ -d $HOME/.nix-profile ]; then source $HOME/.nix-profile/etc/profile.d/nix.sh +fi - # Make sure we can use hydra's binary cache - sudo mkdir /etc/nix - sudo sh -c 'echo "build-max-jobs = 4" > /etc/nix/nix.conf' +while test -n "$1"; do - # Verify evaluation - echo "=== Verifying that nixpkgs evaluates..." - nix-env -f. -qa --json >/dev/null -elif [[ $1 == nox ]]; then - source $HOME/.nix-profile/etc/profile.d/nix.sh - echo "=== Installing nox..." - nix-build -A nox '' --show-trace -elif [[ $1 == build ]]; then - source $HOME/.nix-profile/etc/profile.d/nix.sh + # tell Travis to use folding + echo -en "travis_fold:start:$1\r" + + case $1 in + + install) + echo "=== Installing Nix..." - if [[ $TRAVIS_OS_NAME == "osx" ]]; then - echo "Skipping NixOS things on darwin" - else - # Nix builds in /tmp and we need exec support - sudo mount -o remount,exec /run - sudo mount -o remount,exec /run/user - sudo mount - - echo "=== Checking NixOS options" - nix-build nixos/release.nix -A options --show-trace - - echo "=== Checking tarball creation" - nix-build pkgs/top-level/release.nix -A tarball --show-trace - fi - - if [[ $TRAVIS_PULL_REQUEST == false ]]; then - echo "=== Not a pull request" - else - echo "=== Checking PR" - - if ! nix-shell -p nox --run "nox-review pr ${TRAVIS_PULL_REQUEST}"; then - if sudo dmesg | egrep 'Out of memory|Killed process' > /tmp/oom-log; then - echo "=== The build failed due to running out of memory:" - cat /tmp/oom-log - echo "=== Please disregard the result of this Travis build." + curl -sS https://nixos.org/nix/install | sh + + # Make sure we can use hydra's binary cache + sudo mkdir /etc/nix + echo "build-max-jobs = 4" | sudo tee /etc/nix/nix.conf > /dev/null + + # Make sure we can execute within /tmp in Linux + if [ "$TRAVIS_OS_NAME" == "linux" ]; then + sudo mount -o remount,exec /run + sudo mount -o remount,exec /run/user + sudo mount > /dev/null fi - exit 1 - fi - fi -else - echo "$0: Unknown option $1" >&2 - false -fi + ;; + + verify) + echo "=== Verifying that nixpkgs evaluates..." + + nix-env --file $TRAVIS_BUILD_DIR --query --available --json > /dev/null + ;; + + check) + echo "=== Checking NixOS options" + + nix-build $TRAVIS_BUILD_DIR/nixos/release.nix --attr options --show-trace + ;; + + tarball) + echo "=== Checking tarball creation" + + nix-build $TRAVIS_BUILD_DIR/pkgs/top-level/release.nix --attr tarball --show-trace + ;; + + pr) + if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then + echo "=== No pull request found" + else + echo "=== Building pull request #$TRAVIS_PULL_REQUEST" + + nix-shell --packages nox git --run "nox-review pr $TRAVIS_PULL_REQUEST" -I nixpkgs=$TRAVIS_BUILD_DIR + fi + ;; + + *) + echo "Skipping unknown option $1" + ;; + esac + + echo -en "travis_fold:end:$1\r" + shift +done -- cgit v1.2.3 From 95b28da35365c51ff1673baca9469b7f74a5bcf0 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Thu, 30 Jun 2016 21:23:55 +0000 Subject: travis: use community supported language Switch to the "community supported" Nix version of Travis. --- maintainers/scripts/travis-nox-review-pr.sh | 25 ------------------------- 1 file changed, 25 deletions(-) (limited to 'maintainers') diff --git a/maintainers/scripts/travis-nox-review-pr.sh b/maintainers/scripts/travis-nox-review-pr.sh index 025b27528e94..791a50b0ae80 100755 --- a/maintainers/scripts/travis-nox-review-pr.sh +++ b/maintainers/scripts/travis-nox-review-pr.sh @@ -1,14 +1,6 @@ #! /usr/bin/env bash set -e -# This should make Curl silent -# but download-from-binary-cache doesn't respect -export NIX_CURL_FLAGS=-sS - -if [ -d $HOME/.nix-profile ]; then - source $HOME/.nix-profile/etc/profile.d/nix.sh -fi - while test -n "$1"; do # tell Travis to use folding @@ -16,23 +8,6 @@ while test -n "$1"; do case $1 in - install) - echo "=== Installing Nix..." - - curl -sS https://nixos.org/nix/install | sh - - # Make sure we can use hydra's binary cache - sudo mkdir /etc/nix - echo "build-max-jobs = 4" | sudo tee /etc/nix/nix.conf > /dev/null - - # Make sure we can execute within /tmp in Linux - if [ "$TRAVIS_OS_NAME" == "linux" ]; then - sudo mount -o remount,exec /run - sudo mount -o remount,exec /run/user - sudo mount > /dev/null - fi - ;; - verify) echo "=== Verifying that nixpkgs evaluates..." -- cgit v1.2.3 From 2892bbd07a909feb928ed5f61d1705adff4f279a Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Mon, 4 Jul 2016 12:32:45 -0500 Subject: travis: support nox 0.0.4 arguments This adds the "slug" arguments and also the "token" argument. The slug argument provides the "owner_name/repo_name" format base repo to use for the pull request. The token argument provides the GitHub presonal access token to use for the requests to the GitHub API. --- maintainers/scripts/travis-nox-review-pr.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'maintainers') diff --git a/maintainers/scripts/travis-nox-review-pr.sh b/maintainers/scripts/travis-nox-review-pr.sh index 791a50b0ae80..a992311436c5 100755 --- a/maintainers/scripts/travis-nox-review-pr.sh +++ b/maintainers/scripts/travis-nox-review-pr.sh @@ -32,7 +32,12 @@ while test -n "$1"; do else echo "=== Building pull request #$TRAVIS_PULL_REQUEST" - nix-shell --packages nox git --run "nox-review pr $TRAVIS_PULL_REQUEST" -I nixpkgs=$TRAVIS_BUILD_DIR + token="" + if [ -n "$GITHUB_TOKEN" ]; then + token="--token $GITHUB_TOKEN" + fi + + nix-shell --packages nox git --run "nox-review pr --slug $TRAVIS_REPO_SLUG $token $TRAVIS_PULL_REQUEST" -I nixpkgs=$TRAVIS_BUILD_DIR fi ;; -- cgit v1.2.3 From 5282a336a4cda925f1e1d213702c3c31e2b3bcee Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Thu, 7 Jul 2016 19:18:42 +0000 Subject: travis: build manuals to verify that they work fixes #15109 --- maintainers/scripts/travis-nox-review-pr.sh | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'maintainers') diff --git a/maintainers/scripts/travis-nox-review-pr.sh b/maintainers/scripts/travis-nox-review-pr.sh index a992311436c5..35ac3d443048 100755 --- a/maintainers/scripts/travis-nox-review-pr.sh +++ b/maintainers/scripts/travis-nox-review-pr.sh @@ -8,20 +8,32 @@ while test -n "$1"; do case $1 in - verify) + nixpkgs-verify) echo "=== Verifying that nixpkgs evaluates..." nix-env --file $TRAVIS_BUILD_DIR --query --available --json > /dev/null ;; - check) + nixos-options) echo "=== Checking NixOS options" nix-build $TRAVIS_BUILD_DIR/nixos/release.nix --attr options --show-trace ;; - tarball) - echo "=== Checking tarball creation" + nixos-manual) + echo "=== Checking NixOS manuals" + + nix-build $TRAVIS_BUILD_DIR/nixos/release.nix --attr manual --show-trace + ;; + + nixpkgs-manual) + echo "=== Checking nixpkgs manuals" + + nix-build $TRAVIS_BUILD_DIR/pkgs/top-level/release.nix --attr manpages --show-trace + ;; + + nixpkgs-tarball) + echo "=== Checking nixpkgs tarball creation" nix-build $TRAVIS_BUILD_DIR/pkgs/top-level/release.nix --attr tarball --show-trace ;; -- cgit v1.2.3 From 7c37ac0edd999b2eb34fc91c2f91050e390ccaa2 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Thu, 7 Jul 2016 20:07:01 +0000 Subject: travis: run nixpkgs-lint in build script This will run nixpkgs-lint for each travis build. We'll disable "nixpkgs-lint" for now, it was a little too verbose: https://travis-ci.org/NixOS/nixpkgs/jobs/144290920 --- maintainers/scripts/travis-nox-review-pr.sh | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'maintainers') diff --git a/maintainers/scripts/travis-nox-review-pr.sh b/maintainers/scripts/travis-nox-review-pr.sh index 35ac3d443048..386868301a25 100755 --- a/maintainers/scripts/travis-nox-review-pr.sh +++ b/maintainers/scripts/travis-nox-review-pr.sh @@ -38,6 +38,12 @@ while test -n "$1"; do nix-build $TRAVIS_BUILD_DIR/pkgs/top-level/release.nix --attr tarball --show-trace ;; + nixpkgs-lint) + echo "=== Checking nixpkgs lint" + + nix-shell --packages nixpkgs-lint --run "nixpkgs-lint -f $TRAVIS_BUILD_DIR" + ;; + pr) if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo "=== No pull request found" -- cgit v1.2.3