File tree Expand file tree Collapse file tree 3 files changed +50
-3
lines changed Expand file tree Collapse file tree 3 files changed +50
-3
lines changed Original file line number Diff line number Diff line change 1
1
/target
2
2
.direnv
3
+ result
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ if [ $# -ne 1 ]; then
4
+ echo Expected one argument for the commit hash
5
+ exit 1
6
+ fi
7
+
8
+ HASH=$1
9
+
10
+ # Set up the testing directory in tmpfs
11
+
12
+ CI_PATH=/dev/shm/" $HASH " -webring-ci
13
+
14
+ # Prevent other users from deleting/modifying our directory
15
+ mkdir $CI_PATH --mode=700
16
+
17
+ # Defer cleanup until after this script has finished
18
+ # SCRIPT_PID=$$
19
+ # bash -e "wait $SCRIPT_PID; rm -r $CI_PATH" &
20
+ # disown
21
+
22
+ # Checkout the commit into the testing directory
23
+ # Use `--work-tree` to copy the code into the testing directory instead of the deployment directory. This doesn't copy `.git`.
24
+ mkdir $CI_PATH /webring
25
+ git fetch --all || exit 1
26
+ git --work-tree $CI_PATH /webring checkout $HASH || exit 1
27
+
28
+ # Build the flake
29
+ AT=$( pwd)
30
+ cd $CI_PATH
31
+ nix build || exit 1
32
+
33
+ # Sandbox the webring and run it
34
+ # The webring will only see its own source code and have rw access to it
35
+ timeout -k 10s -s 9 bwrap -- \
36
+ --bind $CI_PATH / --unshare-user --uid 256 --gid 512 ./result/bin/ph-webring
37
+ STATUS=$?
38
+
39
+ cd $AT
40
+
41
+ if [ $STATUS -ne 137 ]; then
42
+ exit 0
43
+ fi
44
+ exit $STATUS
Original file line number Diff line number Diff line change 22
22
23
23
src = ./. ;
24
24
25
- nativeBuildInputs = [ pkgconfig , pkgs . openssl . dev ] ;
26
- cargoSha256 = "" ;
25
+ nativeBuildInputs = [ pkgs . pkg-config pkgs . openssl . dev ] ;
26
+ cargoHash = "sha256-oIm9GcOEgBvE8KahtNQwquX0Miir0uxr3Z5rMXKduTY= " ;
27
27
28
- meta = with stdenv . lib ; {
28
+ PKG_CONFIG_PATH = "${ pkgs . openssl . dev } /lib/pkgconfig" ;
29
+
30
+ meta = with pkgs . lib ; {
29
31
homepage = cargo . package . homepage ;
30
32
description = cargo . package . description ;
31
33
# TODO: Change
You can’t perform that action at this time.
0 commit comments