Compare commits
28 Commits
nix-2.22
...
queued-job
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3e24c2eaf7 | ||
|
|
250668a19f | ||
|
|
efadb6a26c | ||
|
|
3b16941b14 | ||
|
|
9de9cb0ad8 | ||
|
|
e75a4cbda8 | ||
|
|
6456c1d7d6 | ||
|
|
182a48c9fb | ||
|
|
f974891c76 | ||
|
|
8515cb183e | ||
|
|
d3966d3e4c | ||
|
|
f442d74f6e | ||
|
|
a9a5b14331 | ||
|
|
e6b9f0dec7 | ||
|
|
72899596df | ||
|
|
bdeec354c3 | ||
|
|
1222ba03a6 | ||
|
|
8a54924d2a | ||
|
|
2a7b070da0 | ||
|
|
c69e30122b | ||
|
|
750275d6e8 | ||
|
|
ceb8b48cce | ||
|
|
95003f2eb5 | ||
|
|
012cbd43f5 | ||
|
|
9a75361781 | ||
|
|
029116422d | ||
|
|
0231453cc5 | ||
|
|
ae787e5799 |
42
.gitignore
vendored
42
.gitignore
vendored
@@ -1,48 +1,8 @@
|
|||||||
/.pls_cache
|
|
||||||
*.o
|
|
||||||
*~
|
*~
|
||||||
Makefile
|
.test_info.*
|
||||||
Makefile.in
|
|
||||||
.deps
|
|
||||||
.hydra-data
|
|
||||||
/config.guess
|
|
||||||
/config.log
|
|
||||||
/config.status
|
|
||||||
/config.sub
|
|
||||||
/configure
|
|
||||||
/depcomp
|
|
||||||
/libtool
|
|
||||||
/ltmain.sh
|
|
||||||
/autom4te.cache
|
|
||||||
/aclocal.m4
|
|
||||||
/missing
|
|
||||||
/install-sh
|
|
||||||
/src/sql/hydra-postgresql.sql
|
/src/sql/hydra-postgresql.sql
|
||||||
/src/sql/hydra-sqlite.sql
|
/src/sql/hydra-sqlite.sql
|
||||||
/src/sql/tmp.sqlite
|
/src/sql/tmp.sqlite
|
||||||
/src/hydra-eval-jobs/hydra-eval-jobs
|
|
||||||
/src/root/static/bootstrap
|
|
||||||
/src/root/static/js/flot
|
|
||||||
/tests
|
|
||||||
/doc/manual/images
|
|
||||||
/doc/manual/manual.html
|
|
||||||
/doc/manual/manual.pdf
|
|
||||||
/t/.bzr*
|
|
||||||
/t/.git*
|
|
||||||
/t/.hg*
|
|
||||||
/t/nix
|
|
||||||
/t/data
|
|
||||||
/t/jobs/config.nix
|
|
||||||
t/jobs/declarative/project.json
|
|
||||||
/inst
|
|
||||||
hydra-config.h
|
|
||||||
hydra-config.h.in
|
|
||||||
result
|
result
|
||||||
result-*
|
result-*
|
||||||
outputs
|
outputs
|
||||||
config
|
|
||||||
stamp-h1
|
|
||||||
src/hydra-evaluator/hydra-evaluator
|
|
||||||
src/hydra-queue-runner/hydra-queue-runner
|
|
||||||
src/root/static/fontawesome/
|
|
||||||
src/root/static/bootstrap*/
|
|
||||||
|
|||||||
12
Makefile.am
12
Makefile.am
@@ -1,12 +0,0 @@
|
|||||||
SUBDIRS = src doc
|
|
||||||
if CAN_DO_CHECK
|
|
||||||
SUBDIRS += t
|
|
||||||
endif
|
|
||||||
|
|
||||||
BOOTCLEAN_SUBDIRS = $(SUBDIRS)
|
|
||||||
DIST_SUBDIRS = $(SUBDIRS)
|
|
||||||
EXTRA_DIST = nixos-modules/hydra.nix
|
|
||||||
|
|
||||||
install-data-local: nixos-modules/hydra.nix
|
|
||||||
$(INSTALL) -d $(DESTDIR)$(datadir)/nix
|
|
||||||
$(INSTALL_DATA) nixos-modules/hydra.nix $(DESTDIR)$(datadir)/nix/hydra-module.nix
|
|
||||||
@@ -39,16 +39,16 @@ In order to evaluate and build anything you need to create _projects_ that conta
|
|||||||
#### Creating A Project
|
#### Creating A Project
|
||||||
Log in as administrator, click "_Admin_" and select "_Create project_". Fill the form as follows:
|
Log in as administrator, click "_Admin_" and select "_Create project_". Fill the form as follows:
|
||||||
|
|
||||||
- **Identifier**: `hello`
|
- **Identifier**: `hello-project`
|
||||||
- **Display name**: `hello`
|
- **Display name**: `hello`
|
||||||
- **Description**: `hello project`
|
- **Description**: `hello project`
|
||||||
|
|
||||||
Click "_Create project_".
|
Click "_Create project_".
|
||||||
|
|
||||||
#### Creating A Jobset
|
#### Creating A Jobset
|
||||||
After creating a project you are forwarded to the project page. Click "_Actions_" and choose "_Create jobset_". Fill the form with the following values:
|
After creating a project you are forwarded to the project page. Click "_Actions_" and choose "_Create jobset_". Change **Type** to Legacy for the example below. Fill the form with the following values:
|
||||||
|
|
||||||
- **Identifier**: `hello`
|
- **Identifier**: `hello-project`
|
||||||
- **Nix expression**: `examples/hello.nix` in `hydra`
|
- **Nix expression**: `examples/hello.nix` in `hydra`
|
||||||
- **Check interval**: 60
|
- **Check interval**: 60
|
||||||
- **Scheduling shares**: 1
|
- **Scheduling shares**: 1
|
||||||
@@ -57,7 +57,7 @@ We have to add two inputs for this jobset. One for _nixpkgs_ and one for _hydra_
|
|||||||
|
|
||||||
- **Input name**: `nixpkgs`
|
- **Input name**: `nixpkgs`
|
||||||
- **Type**: `Git checkout`
|
- **Type**: `Git checkout`
|
||||||
- **Value**: `https://github.com/nixos/nixpkgs-channels nixos-20.03`
|
- **Value**: `https://github.com/NixOS/nixpkgs nixos-24.05`
|
||||||
|
|
||||||
- **Input name**: `hydra`
|
- **Input name**: `hydra`
|
||||||
- **Type**: `Git checkout`
|
- **Type**: `Git checkout`
|
||||||
|
|||||||
91
configure.ac
91
configure.ac
@@ -1,91 +0,0 @@
|
|||||||
AC_INIT([Hydra], [m4_esyscmd([echo -n $(cat ./version.txt)$VERSION_SUFFIX])])
|
|
||||||
AC_CONFIG_AUX_DIR(config)
|
|
||||||
AM_INIT_AUTOMAKE([foreign serial-tests])
|
|
||||||
|
|
||||||
AC_LANG([C++])
|
|
||||||
|
|
||||||
AC_PROG_CC
|
|
||||||
AC_PROG_INSTALL
|
|
||||||
AC_PROG_LN_S
|
|
||||||
AC_PROG_LIBTOOL
|
|
||||||
AC_PROG_CXX
|
|
||||||
|
|
||||||
AC_PATH_PROG([XSLTPROC], [xsltproc])
|
|
||||||
|
|
||||||
AC_ARG_WITH([docbook-xsl],
|
|
||||||
[AS_HELP_STRING([--with-docbook-xsl=PATH],
|
|
||||||
[path of the DocBook XSL stylesheets])],
|
|
||||||
[docbookxsl="$withval"],
|
|
||||||
[docbookxsl="/docbook-xsl-missing"])
|
|
||||||
AC_SUBST([docbookxsl])
|
|
||||||
|
|
||||||
|
|
||||||
AC_DEFUN([NEED_PROG],
|
|
||||||
[
|
|
||||||
AC_PATH_PROG($1, $2)
|
|
||||||
if test -z "$$1"; then
|
|
||||||
AC_MSG_ERROR([$2 is required])
|
|
||||||
fi
|
|
||||||
])
|
|
||||||
|
|
||||||
NEED_PROG(perl, perl)
|
|
||||||
|
|
||||||
NEED_PROG([NIX_STORE_PROGRAM], [nix-store])
|
|
||||||
|
|
||||||
AC_MSG_CHECKING([whether $NIX_STORE_PROGRAM is recent enough])
|
|
||||||
if test -n "$NIX_STORE" -a -n "$TMPDIR"
|
|
||||||
then
|
|
||||||
# This may be executed from within a build chroot, so pacify
|
|
||||||
# `nix-store' instead of letting it choke while trying to mkdir
|
|
||||||
# /nix/var.
|
|
||||||
NIX_STATE_DIR="$TMPDIR"
|
|
||||||
export NIX_STATE_DIR
|
|
||||||
fi
|
|
||||||
if NIX_REMOTE=daemon PAGER=cat "$NIX_STORE_PROGRAM" --timeout 123 -q; then
|
|
||||||
AC_MSG_RESULT([yes])
|
|
||||||
else
|
|
||||||
AC_MSG_RESULT([no])
|
|
||||||
AC_MSG_ERROR([`$NIX_STORE_PROGRAM' doesn't support `--timeout'; please use a newer version.])
|
|
||||||
fi
|
|
||||||
|
|
||||||
PKG_CHECK_MODULES([NIX], [nix-main nix-expr nix-store])
|
|
||||||
|
|
||||||
testPath="$(dirname $(type -p expr))"
|
|
||||||
AC_SUBST(testPath)
|
|
||||||
|
|
||||||
CXXFLAGS+=" -include nix/config.h"
|
|
||||||
|
|
||||||
AC_CONFIG_FILES([
|
|
||||||
Makefile
|
|
||||||
doc/Makefile
|
|
||||||
doc/manual/Makefile
|
|
||||||
src/Makefile
|
|
||||||
src/hydra-evaluator/Makefile
|
|
||||||
src/hydra-eval-jobs/Makefile
|
|
||||||
src/hydra-queue-runner/Makefile
|
|
||||||
src/sql/Makefile
|
|
||||||
src/ttf/Makefile
|
|
||||||
src/lib/Makefile
|
|
||||||
src/root/Makefile
|
|
||||||
src/script/Makefile
|
|
||||||
])
|
|
||||||
|
|
||||||
# Tests might be filtered out
|
|
||||||
AM_CONDITIONAL([CAN_DO_CHECK], [test -f "$srcdir/t/api-test.t"])
|
|
||||||
AM_COND_IF(
|
|
||||||
[CAN_DO_CHECK],
|
|
||||||
[
|
|
||||||
jobsPath="$(realpath ./t/jobs)"
|
|
||||||
AC_SUBST(jobsPath)
|
|
||||||
AC_CONFIG_FILES([
|
|
||||||
t/Makefile
|
|
||||||
t/jobs/config.nix
|
|
||||||
t/jobs/declarative/project.json
|
|
||||||
])
|
|
||||||
])
|
|
||||||
|
|
||||||
AC_CONFIG_COMMANDS([executable-scripts], [])
|
|
||||||
|
|
||||||
AC_CONFIG_HEADER([hydra-config.h])
|
|
||||||
|
|
||||||
AC_OUTPUT
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
SUBDIRS = manual
|
|
||||||
BOOTCLEAN_SUBDIRS = $(SUBDIRS)
|
|
||||||
DIST_SUBDIRS = $(SUBDIRS)
|
|
||||||
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
MD_FILES = src/*.md
|
|
||||||
|
|
||||||
EXTRA_DIST = $(MD_FILES)
|
|
||||||
|
|
||||||
install: $(MD_FILES)
|
|
||||||
mdbook build . -d $(docdir)
|
|
||||||
36
doc/manual/meson.build
Normal file
36
doc/manual/meson.build
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
srcs = files(
|
||||||
|
'src/SUMMARY.md',
|
||||||
|
'src/about.md',
|
||||||
|
'src/api.md',
|
||||||
|
'src/configuration.md',
|
||||||
|
'src/hacking.md',
|
||||||
|
'src/installation.md',
|
||||||
|
'src/introduction.md',
|
||||||
|
'src/jobs.md',
|
||||||
|
'src/monitoring/README.md',
|
||||||
|
'src/notifications.md',
|
||||||
|
'src/plugins/README.md',
|
||||||
|
'src/plugins/RunCommand.md',
|
||||||
|
'src/plugins/declarative-projects.md',
|
||||||
|
'src/projects.md',
|
||||||
|
'src/webhooks.md',
|
||||||
|
)
|
||||||
|
|
||||||
|
manual = custom_target(
|
||||||
|
'manual',
|
||||||
|
command: [
|
||||||
|
mdbook,
|
||||||
|
'build',
|
||||||
|
'@SOURCE_ROOT@/doc/manual',
|
||||||
|
'-d', meson.current_build_dir() / 'html'
|
||||||
|
],
|
||||||
|
depend_files: srcs,
|
||||||
|
output: ['html'],
|
||||||
|
build_by_default: true,
|
||||||
|
)
|
||||||
|
|
||||||
|
install_subdir(
|
||||||
|
manual.full_path(),
|
||||||
|
install_dir: get_option('datadir') / 'doc/hydra',
|
||||||
|
strip_directory: true,
|
||||||
|
)
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# jobset example file. This file canbe referenced as Nix expression
|
# jobset example file. This file can be referenced as Nix expression
|
||||||
# in a jobset configuration along with inputs for nixpkgs and the
|
# in a jobset configuration along with inputs for nixpkgs and the
|
||||||
# repository containing this file.
|
# repository containing this file.
|
||||||
#
|
#
|
||||||
|
|||||||
137
flake.lock
generated
137
flake.lock
generated
@@ -1,165 +1,70 @@
|
|||||||
{
|
{
|
||||||
"nodes": {
|
"nodes": {
|
||||||
"flake-compat": {
|
|
||||||
"flake": false,
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1673956053,
|
|
||||||
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
|
|
||||||
"owner": "edolstra",
|
|
||||||
"repo": "flake-compat",
|
|
||||||
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "edolstra",
|
|
||||||
"repo": "flake-compat",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"flake-parts": {
|
|
||||||
"inputs": {
|
|
||||||
"nixpkgs-lib": [
|
|
||||||
"nix",
|
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1712014858,
|
|
||||||
"narHash": "sha256-sB4SWl2lX95bExY2gMFG5HIzvva5AVMJd4Igm+GpZNw=",
|
|
||||||
"owner": "hercules-ci",
|
|
||||||
"repo": "flake-parts",
|
|
||||||
"rev": "9126214d0a59633752a136528f5f3b9aa8565b7d",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "hercules-ci",
|
|
||||||
"repo": "flake-parts",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"flake-utils": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1667395993,
|
|
||||||
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "flake-utils",
|
|
||||||
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "flake-utils",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"libgit2": {
|
"libgit2": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1697646580,
|
"lastModified": 1715853528,
|
||||||
"narHash": "sha256-oX4Z3S9WtJlwvj0uH9HlYcWv+x1hqp8mhXl7HsLu2f0=",
|
"narHash": "sha256-J2rCxTecyLbbDdsyBWn9w7r3pbKRMkI9E7RvRgAqBdY=",
|
||||||
"owner": "libgit2",
|
"owner": "libgit2",
|
||||||
"repo": "libgit2",
|
"repo": "libgit2",
|
||||||
"rev": "45fd9ed7ae1a9b74b957ef4f337bc3c8b3df01b5",
|
"rev": "36f7e21ad757a3dacc58cf7944329da6bc1d6e96",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "libgit2",
|
"owner": "libgit2",
|
||||||
|
"ref": "v1.8.1",
|
||||||
"repo": "libgit2",
|
"repo": "libgit2",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nix": {
|
"nix": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-compat": "flake-compat",
|
"flake-compat": [],
|
||||||
"flake-parts": "flake-parts",
|
"flake-parts": [],
|
||||||
"libgit2": "libgit2",
|
"git-hooks-nix": [],
|
||||||
|
"libgit2": [
|
||||||
|
"libgit2"
|
||||||
|
],
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
],
|
],
|
||||||
"nixpkgs-regression": "nixpkgs-regression",
|
"nixpkgs-23-11": [],
|
||||||
"pre-commit-hooks": "pre-commit-hooks"
|
"nixpkgs-regression": []
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1713874370,
|
"lastModified": 1726787955,
|
||||||
"narHash": "sha256-gW1mO/CvsQQ5gvgiwzxsGhPFI/tx30NING+qgF5Do0s=",
|
"narHash": "sha256-XFznzb8L4SdUm9u+w3DPpMWJhffuv+/6+aiVl00slns=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nix",
|
"repo": "nix",
|
||||||
"rev": "1c8150ac312b5f9ba1b3f6768ff43b09867e5883",
|
"rev": "a7fdef6858dd45b9d7bda7c92324c63faee7f509",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"ref": "2.22-maintenance",
|
"ref": "2.24-maintenance",
|
||||||
"repo": "nix",
|
"repo": "nix",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1712848736,
|
"lastModified": 1726688310,
|
||||||
"narHash": "sha256-CzZwhqyLlebljv1zFS2KWVH/3byHND0LfaO1jKsGuVo=",
|
"narHash": "sha256-Xc9lEtentPCEtxc/F1e6jIZsd4MPDYv4Kugl9WtXlz0=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "1d6a23f11e44d0fb64b3237569b87658a9eb5643",
|
"rev": "dbebdd67a6006bb145d98c8debf9140ac7e651d0",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"ref": "nixos-23.11-small",
|
"ref": "nixos-24.05-small",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs-regression": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1643052045,
|
|
||||||
"narHash": "sha256-uGJ0VXIhWKGXxkeNnq4TvV3CIOkUJ3PAoLZ3HMzNVMw=",
|
|
||||||
"owner": "NixOS",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "NixOS",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"pre-commit-hooks": {
|
|
||||||
"inputs": {
|
|
||||||
"flake-compat": [
|
|
||||||
"nix"
|
|
||||||
],
|
|
||||||
"flake-utils": "flake-utils",
|
|
||||||
"gitignore": [
|
|
||||||
"nix"
|
|
||||||
],
|
|
||||||
"nixpkgs": [
|
|
||||||
"nix",
|
|
||||||
"nixpkgs"
|
|
||||||
],
|
|
||||||
"nixpkgs-stable": [
|
|
||||||
"nix",
|
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1712897695,
|
|
||||||
"narHash": "sha256-nMirxrGteNAl9sWiOhoN5tIHyjBbVi5e2tgZUgZlK3Y=",
|
|
||||||
"owner": "cachix",
|
|
||||||
"repo": "pre-commit-hooks.nix",
|
|
||||||
"rev": "40e6053ecb65fcbf12863338a6dcefb3f55f1bf8",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "cachix",
|
|
||||||
"repo": "pre-commit-hooks.nix",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
|
"libgit2": "libgit2",
|
||||||
"nix": "nix",
|
"nix": "nix",
|
||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": "nixpkgs"
|
||||||
}
|
}
|
||||||
|
|||||||
52
flake.nix
52
flake.nix
@@ -1,22 +1,24 @@
|
|||||||
{
|
{
|
||||||
description = "A Nix-based continuous build system";
|
description = "A Nix-based continuous build system";
|
||||||
|
|
||||||
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11-small";
|
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05-small";
|
||||||
inputs.nix.url = "github:NixOS/nix/2.22-maintenance";
|
|
||||||
inputs.nix.inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
|
|
||||||
outputs = { self, nixpkgs, nix }:
|
inputs.libgit2 = { url = "github:libgit2/libgit2/v1.8.1"; flake = false; };
|
||||||
|
inputs.nix.url = "github:NixOS/nix/2.24-maintenance";
|
||||||
|
inputs.nix.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
inputs.nix.inputs.libgit2.follows = "libgit2";
|
||||||
|
|
||||||
|
# hide nix dev tooling from our lock file
|
||||||
|
inputs.nix.inputs.flake-parts.follows = "";
|
||||||
|
inputs.nix.inputs.git-hooks-nix.follows = "";
|
||||||
|
inputs.nix.inputs.nixpkgs-regression.follows = "";
|
||||||
|
inputs.nix.inputs.nixpkgs-23-11.follows = "";
|
||||||
|
inputs.nix.inputs.flake-compat.follows = "";
|
||||||
|
|
||||||
|
outputs = { self, nixpkgs, nix, ... }:
|
||||||
let
|
let
|
||||||
systems = [ "x86_64-linux" "aarch64-linux" ];
|
systems = [ "x86_64-linux" "aarch64-linux" ];
|
||||||
forEachSystem = nixpkgs.lib.genAttrs systems;
|
forEachSystem = nixpkgs.lib.genAttrs systems;
|
||||||
|
|
||||||
overlayList = [ self.overlays.default nix.overlays.default ];
|
|
||||||
|
|
||||||
pkgsBySystem = forEachSystem (system: import nixpkgs {
|
|
||||||
inherit system;
|
|
||||||
overlays = overlayList;
|
|
||||||
});
|
|
||||||
|
|
||||||
in
|
in
|
||||||
rec {
|
rec {
|
||||||
|
|
||||||
@@ -25,11 +27,11 @@
|
|||||||
hydra = final.callPackage ./package.nix {
|
hydra = final.callPackage ./package.nix {
|
||||||
inherit (nixpkgs.lib) fileset;
|
inherit (nixpkgs.lib) fileset;
|
||||||
rawSrc = self;
|
rawSrc = self;
|
||||||
|
nix-perl-bindings = final.nixComponents.nix-perl-bindings;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
hydraJobs = {
|
hydraJobs = {
|
||||||
|
|
||||||
build = forEachSystem (system: packages.${system}.hydra);
|
build = forEachSystem (system: packages.${system}.hydra);
|
||||||
|
|
||||||
buildNoTests = forEachSystem (system:
|
buildNoTests = forEachSystem (system:
|
||||||
@@ -38,19 +40,21 @@
|
|||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
manual = forEachSystem (system:
|
manual = forEachSystem (system: let
|
||||||
let pkgs = pkgsBySystem.${system}; in
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
pkgs.runCommand "hydra-manual-${pkgs.hydra.version}" { }
|
hydra = self.packages.${pkgs.hostPlatform.system}.hydra;
|
||||||
|
in
|
||||||
|
pkgs.runCommand "hydra-manual-${hydra.version}" { }
|
||||||
''
|
''
|
||||||
mkdir -p $out/share
|
mkdir -p $out/share
|
||||||
cp -prvd ${pkgs.hydra}/share/doc $out/share/
|
cp -prvd ${hydra.doc}/share/doc $out/share/
|
||||||
|
|
||||||
mkdir $out/nix-support
|
mkdir $out/nix-support
|
||||||
echo "doc manual $out/share/doc/hydra" >> $out/nix-support/hydra-build-products
|
echo "doc manual $out/share/doc/hydra" >> $out/nix-support/hydra-build-products
|
||||||
'');
|
'');
|
||||||
|
|
||||||
tests = import ./nixos-tests.nix {
|
tests = import ./nixos-tests.nix {
|
||||||
inherit forEachSystem nixpkgs pkgsBySystem nixosModules;
|
inherit forEachSystem nixpkgs nixosModules;
|
||||||
};
|
};
|
||||||
|
|
||||||
container = nixosConfigurations.container.config.system.build.toplevel;
|
container = nixosConfigurations.container.config.system.build.toplevel;
|
||||||
@@ -63,12 +67,17 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
packages = forEachSystem (system: {
|
packages = forEachSystem (system: {
|
||||||
hydra = pkgsBySystem.${system}.hydra;
|
hydra = nixpkgs.legacyPackages.${system}.callPackage ./package.nix {
|
||||||
default = pkgsBySystem.${system}.hydra;
|
inherit (nixpkgs.lib) fileset;
|
||||||
|
rawSrc = self;
|
||||||
|
nix = nix.packages.${system}.nix;
|
||||||
|
nix-perl-bindings = nix.hydraJobs.perlBindings.${system};
|
||||||
|
};
|
||||||
|
default = self.packages.${system}.hydra;
|
||||||
});
|
});
|
||||||
|
|
||||||
nixosModules = import ./nixos-modules {
|
nixosModules = import ./nixos-modules {
|
||||||
overlays = overlayList;
|
inherit self;
|
||||||
};
|
};
|
||||||
|
|
||||||
nixosConfigurations.container = nixpkgs.lib.nixosSystem {
|
nixosConfigurations.container = nixpkgs.lib.nixosSystem {
|
||||||
@@ -76,7 +85,6 @@
|
|||||||
modules =
|
modules =
|
||||||
[
|
[
|
||||||
self.nixosModules.hydra
|
self.nixosModules.hydra
|
||||||
self.nixosModules.overlayNixpkgsForThisHydra
|
|
||||||
self.nixosModules.hydraTest
|
self.nixosModules.hydraTest
|
||||||
self.nixosModules.hydraProxy
|
self.nixosModules.hydraProxy
|
||||||
{
|
{
|
||||||
|
|||||||
40
meson.build
Normal file
40
meson.build
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
project('hydra', 'cpp',
|
||||||
|
version: files('version.txt'),
|
||||||
|
license: 'GPL-3.0',
|
||||||
|
default_options: [
|
||||||
|
'debug=true',
|
||||||
|
'optimization=2',
|
||||||
|
'cpp_std=c++20',
|
||||||
|
],
|
||||||
|
)
|
||||||
|
|
||||||
|
nix_store_dep = dependency('nix-store', required: true)
|
||||||
|
nix_main_dep = dependency('nix-main', required: true)
|
||||||
|
nix_expr_dep = dependency('nix-expr', required: true)
|
||||||
|
nix_flake_dep = dependency('nix-flake', required: true)
|
||||||
|
nix_cmd_dep = dependency('nix-cmd', required: true)
|
||||||
|
|
||||||
|
# Nix need extra flags not provided in its pkg-config files.
|
||||||
|
nix_dep = declare_dependency(
|
||||||
|
dependencies: [
|
||||||
|
nix_store_dep,
|
||||||
|
nix_main_dep,
|
||||||
|
nix_expr_dep,
|
||||||
|
nix_flake_dep,
|
||||||
|
nix_cmd_dep,
|
||||||
|
],
|
||||||
|
compile_args: ['-include', 'nix/config.h'],
|
||||||
|
)
|
||||||
|
|
||||||
|
pqxx_dep = dependency('libpqxx', required: true)
|
||||||
|
|
||||||
|
prom_cpp_core_dep = dependency('prometheus-cpp-core', required: true)
|
||||||
|
prom_cpp_pull_dep = dependency('prometheus-cpp-pull', required: true)
|
||||||
|
|
||||||
|
mdbook = find_program('mdbook', native: true)
|
||||||
|
perl = find_program('perl', native: true)
|
||||||
|
|
||||||
|
subdir('doc/manual')
|
||||||
|
subdir('nixos-modules')
|
||||||
|
subdir('src')
|
||||||
|
subdir('t')
|
||||||
@@ -1,11 +1,10 @@
|
|||||||
{ overlays }:
|
{ self }:
|
||||||
|
|
||||||
{
|
{
|
||||||
hydra = import ./hydra.nix;
|
hydra = { pkgs, lib,... }: {
|
||||||
|
_file = ./default.nix;
|
||||||
overlayNixpkgsForThisHydra = { pkgs, ... }: {
|
imports = [ ./hydra.nix ];
|
||||||
nixpkgs = { inherit overlays; };
|
services.hydra-dev.package = lib.mkDefault self.packages.${pkgs.hostPlatform.system}.hydra;
|
||||||
services.hydra.package = pkgs.hydra;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
hydraTest = { pkgs, ... }: {
|
hydraTest = { pkgs, ... }: {
|
||||||
|
|||||||
@@ -68,8 +68,6 @@ in
|
|||||||
|
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
type = types.path;
|
type = types.path;
|
||||||
default = pkgs.hydra_unstable;
|
|
||||||
defaultText = literalExpression "pkgs.hydra";
|
|
||||||
description = "The Hydra package.";
|
description = "The Hydra package.";
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -340,6 +338,7 @@ in
|
|||||||
systemd.services.hydra-queue-runner =
|
systemd.services.hydra-queue-runner =
|
||||||
{ wantedBy = [ "multi-user.target" ];
|
{ wantedBy = [ "multi-user.target" ];
|
||||||
requires = [ "hydra-init.service" ];
|
requires = [ "hydra-init.service" ];
|
||||||
|
wants = [ "network-online.target" ];
|
||||||
after = [ "hydra-init.service" "network.target" "network-online.target" ];
|
after = [ "hydra-init.service" "network.target" "network-online.target" ];
|
||||||
path = [ cfg.package pkgs.nettools pkgs.openssh pkgs.bzip2 config.nix.package ];
|
path = [ cfg.package pkgs.nettools pkgs.openssh pkgs.bzip2 config.nix.package ];
|
||||||
restartTriggers = [ hydraConf ];
|
restartTriggers = [ hydraConf ];
|
||||||
|
|||||||
4
nixos-modules/meson.build
Normal file
4
nixos-modules/meson.build
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
install_data('hydra.nix',
|
||||||
|
install_dir: get_option('datadir') / 'nix',
|
||||||
|
rename: ['hydra-module.nix'],
|
||||||
|
)
|
||||||
@@ -1,13 +1,12 @@
|
|||||||
{ forEachSystem, nixpkgs, pkgsBySystem, nixosModules }:
|
{ forEachSystem, nixpkgs, nixosModules }:
|
||||||
|
|
||||||
let
|
let
|
||||||
# NixOS configuration used for VM tests.
|
# NixOS configuration used for VM tests.
|
||||||
hydraServer =
|
hydraServer =
|
||||||
{ config, pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
nixosModules.hydra
|
nixosModules.hydra
|
||||||
nixosModules.overlayNixpkgsForThisHydra
|
|
||||||
nixosModules.hydraTest
|
nixosModules.hydraTest
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -44,11 +43,10 @@ in
|
|||||||
});
|
});
|
||||||
|
|
||||||
notifications = forEachSystem (system:
|
notifications = forEachSystem (system:
|
||||||
let pkgs = pkgsBySystem.${system}; in
|
|
||||||
with import (nixpkgs + "/nixos/lib/testing-python.nix") { inherit system; };
|
with import (nixpkgs + "/nixos/lib/testing-python.nix") { inherit system; };
|
||||||
simpleTest {
|
simpleTest {
|
||||||
name = "hydra-notifications";
|
name = "hydra-notifications";
|
||||||
nodes.machine = { pkgs, ... }: {
|
nodes.machine = {
|
||||||
imports = [ hydraServer ];
|
imports = [ hydraServer ];
|
||||||
services.hydra-dev.extraConfig = ''
|
services.hydra-dev.extraConfig = ''
|
||||||
<influxdb>
|
<influxdb>
|
||||||
@@ -89,7 +87,7 @@ in
|
|||||||
|
|
||||||
# Setup the project and jobset
|
# Setup the project and jobset
|
||||||
machine.succeed(
|
machine.succeed(
|
||||||
"su - hydra -c 'perl -I ${pkgs.hydra.perlDeps}/lib/perl5/site_perl ${./t/setup-notifications-jobset.pl}' >&2"
|
"su - hydra -c 'perl -I ${config.services.hydra-dev.package.perlDeps}/lib/perl5/site_perl ${./t/setup-notifications-jobset.pl}' >&2"
|
||||||
)
|
)
|
||||||
|
|
||||||
# Wait until hydra has build the job and
|
# Wait until hydra has build the job and
|
||||||
@@ -103,7 +101,7 @@ in
|
|||||||
});
|
});
|
||||||
|
|
||||||
gitea = forEachSystem (system:
|
gitea = forEachSystem (system:
|
||||||
let pkgs = pkgsBySystem.${system}; in
|
let pkgs = nixpkgs.legacyPackages.${system}; in
|
||||||
with import (nixpkgs + "/nixos/lib/testing-python.nix") { inherit system; };
|
with import (nixpkgs + "/nixos/lib/testing-python.nix") { inherit system; };
|
||||||
makeTest {
|
makeTest {
|
||||||
name = "hydra-gitea";
|
name = "hydra-gitea";
|
||||||
@@ -298,7 +296,7 @@ in
|
|||||||
});
|
});
|
||||||
|
|
||||||
validate-openapi = forEachSystem (system:
|
validate-openapi = forEachSystem (system:
|
||||||
let pkgs = pkgsBySystem.${system}; in
|
let pkgs = nixpkgs.legacyPackages.${system}; in
|
||||||
pkgs.runCommand "validate-openapi"
|
pkgs.runCommand "validate-openapi"
|
||||||
{ buildInputs = [ pkgs.openapi-generator-cli ]; }
|
{ buildInputs = [ pkgs.openapi-generator-cli ]; }
|
||||||
''
|
''
|
||||||
|
|||||||
40
package.nix
40
package.nix
@@ -9,10 +9,12 @@
|
|||||||
, perlPackages
|
, perlPackages
|
||||||
|
|
||||||
, nix
|
, nix
|
||||||
|
, nix-perl-bindings
|
||||||
, git
|
, git
|
||||||
|
|
||||||
, makeWrapper
|
, makeWrapper
|
||||||
, autoreconfHook
|
, meson
|
||||||
|
, ninja
|
||||||
, nukeReferences
|
, nukeReferences
|
||||||
, pkg-config
|
, pkg-config
|
||||||
, mdbook
|
, mdbook
|
||||||
@@ -59,7 +61,7 @@ let
|
|||||||
name = "hydra-perl-deps";
|
name = "hydra-perl-deps";
|
||||||
paths = lib.closePropagation
|
paths = lib.closePropagation
|
||||||
([
|
([
|
||||||
nix.perl-bindings
|
nix-perl-bindings
|
||||||
git
|
git
|
||||||
] ++ (with perlPackages; [
|
] ++ (with perlPackages; [
|
||||||
AuthenSASL
|
AuthenSASL
|
||||||
@@ -90,6 +92,7 @@ let
|
|||||||
DigestSHA1
|
DigestSHA1
|
||||||
EmailMIME
|
EmailMIME
|
||||||
EmailSender
|
EmailSender
|
||||||
|
FileCopyRecursive
|
||||||
FileLibMagic
|
FileLibMagic
|
||||||
FileSlurper
|
FileSlurper
|
||||||
FileWhich
|
FileWhich
|
||||||
@@ -137,28 +140,24 @@ stdenv.mkDerivation (finalAttrs: {
|
|||||||
src = fileset.toSource {
|
src = fileset.toSource {
|
||||||
root = ./.;
|
root = ./.;
|
||||||
fileset = fileset.unions ([
|
fileset = fileset.unions ([
|
||||||
./version.txt
|
|
||||||
./configure.ac
|
|
||||||
./Makefile.am
|
|
||||||
./src
|
|
||||||
./doc
|
./doc
|
||||||
./nixos-modules/hydra.nix
|
./meson.build
|
||||||
# These are always needed to appease Automake
|
./nixos-modules
|
||||||
./t/Makefile.am
|
./src
|
||||||
./t/jobs/config.nix.in
|
|
||||||
./t/jobs/declarative/project.json.in
|
|
||||||
] ++ lib.optionals finalAttrs.doCheck [
|
|
||||||
./t
|
./t
|
||||||
|
./version.txt
|
||||||
./.perlcriticrc
|
./.perlcriticrc
|
||||||
./.yath.rc
|
|
||||||
]);
|
]);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
outputs = [ "out" "doc" ];
|
||||||
|
|
||||||
strictDeps = true;
|
strictDeps = true;
|
||||||
|
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
makeWrapper
|
makeWrapper
|
||||||
autoreconfHook
|
meson
|
||||||
|
ninja
|
||||||
nukeReferences
|
nukeReferences
|
||||||
pkg-config
|
pkg-config
|
||||||
mdbook
|
mdbook
|
||||||
@@ -224,6 +223,12 @@ stdenv.mkDerivation (finalAttrs: {
|
|||||||
|
|
||||||
OPENLDAP_ROOT = openldap;
|
OPENLDAP_ROOT = openldap;
|
||||||
|
|
||||||
|
mesonBuildType = "release";
|
||||||
|
|
||||||
|
postPatch = ''
|
||||||
|
patchShebangs .
|
||||||
|
'';
|
||||||
|
|
||||||
shellHook = ''
|
shellHook = ''
|
||||||
pushd $(git rev-parse --show-toplevel) >/dev/null
|
pushd $(git rev-parse --show-toplevel) >/dev/null
|
||||||
|
|
||||||
@@ -237,14 +242,11 @@ stdenv.mkDerivation (finalAttrs: {
|
|||||||
popd >/dev/null
|
popd >/dev/null
|
||||||
'';
|
'';
|
||||||
|
|
||||||
NIX_LDFLAGS = [ "-lpthread" ];
|
|
||||||
|
|
||||||
enableParallelBuilding = true;
|
|
||||||
|
|
||||||
doCheck = true;
|
doCheck = true;
|
||||||
|
|
||||||
|
mesonCheckFlags = [ "--verbose" ];
|
||||||
|
|
||||||
preCheck = ''
|
preCheck = ''
|
||||||
patchShebangs .
|
|
||||||
export LOGNAME=''${LOGNAME:-foo}
|
export LOGNAME=''${LOGNAME:-foo}
|
||||||
# set $HOME for bzr so it can create its trace file
|
# set $HOME for bzr so it can create its trace file
|
||||||
export HOME=$(mktemp -d)
|
export HOME=$(mktemp -d)
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
SUBDIRS = hydra-evaluator hydra-eval-jobs hydra-queue-runner sql script lib root ttf
|
|
||||||
BOOTCLEAN_SUBDIRS = $(SUBDIRS)
|
|
||||||
DIST_SUBDIRS = $(SUBDIRS)
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
bin_PROGRAMS = hydra-eval-jobs
|
|
||||||
|
|
||||||
hydra_eval_jobs_SOURCES = hydra-eval-jobs.cc
|
|
||||||
hydra_eval_jobs_LDADD = $(NIX_LIBS) -lnixcmd
|
|
||||||
hydra_eval_jobs_CXXFLAGS = $(NIX_CFLAGS) -I ../libhydra
|
|
||||||
@@ -6,6 +6,7 @@
|
|||||||
#include "shared.hh"
|
#include "shared.hh"
|
||||||
#include "store-api.hh"
|
#include "store-api.hh"
|
||||||
#include "eval.hh"
|
#include "eval.hh"
|
||||||
|
#include "eval-gc.hh"
|
||||||
#include "eval-inline.hh"
|
#include "eval-inline.hh"
|
||||||
#include "eval-settings.hh"
|
#include "eval-settings.hh"
|
||||||
#include "signals.hh"
|
#include "signals.hh"
|
||||||
@@ -125,11 +126,14 @@ static void worker(
|
|||||||
if (myArgs.flake) {
|
if (myArgs.flake) {
|
||||||
using namespace flake;
|
using namespace flake;
|
||||||
|
|
||||||
auto flakeRef = parseFlakeRef(myArgs.releaseExpr);
|
auto [flakeRef, fragment, outputSpec] = parseFlakeRefWithFragmentAndExtendedOutputsSpec(fetchSettings, myArgs.releaseExpr, absPath("."));
|
||||||
|
|
||||||
auto vFlake = state.allocValue();
|
auto vFlake = state.allocValue();
|
||||||
|
|
||||||
auto lockedFlake = lockFlake(state, flakeRef,
|
auto lockedFlake = lockFlake(
|
||||||
|
flakeSettings,
|
||||||
|
state,
|
||||||
|
flakeRef,
|
||||||
LockFlags {
|
LockFlags {
|
||||||
.updateLockFile = false,
|
.updateLockFile = false,
|
||||||
.useRegistries = false,
|
.useRegistries = false,
|
||||||
@@ -368,7 +372,11 @@ int main(int argc, char * * argv)
|
|||||||
]()
|
]()
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
EvalState state(myArgs.lookupPath, openStore());
|
auto evalStore = myArgs.evalStoreUrl
|
||||||
|
? openStore(*myArgs.evalStoreUrl)
|
||||||
|
: openStore();
|
||||||
|
EvalState state(myArgs.lookupPath,
|
||||||
|
evalStore, fetchSettings, evalSettings);
|
||||||
Bindings & autoArgs = *myArgs.getAutoArgs(state);
|
Bindings & autoArgs = *myArgs.getAutoArgs(state);
|
||||||
worker(state, autoArgs, *to, *from);
|
worker(state, autoArgs, *to, *from);
|
||||||
} catch (Error & e) {
|
} catch (Error & e) {
|
||||||
|
|||||||
8
src/hydra-eval-jobs/meson.build
Normal file
8
src/hydra-eval-jobs/meson.build
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
hydra_eval_jobs = executable('hydra-eval-jobs',
|
||||||
|
'hydra-eval-jobs.cc',
|
||||||
|
dependencies: [
|
||||||
|
libhydra_dep,
|
||||||
|
nix_dep,
|
||||||
|
],
|
||||||
|
install: true,
|
||||||
|
)
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
bin_PROGRAMS = hydra-evaluator
|
|
||||||
|
|
||||||
hydra_evaluator_SOURCES = hydra-evaluator.cc
|
|
||||||
hydra_evaluator_LDADD = $(NIX_LIBS) -lpqxx
|
|
||||||
hydra_evaluator_CXXFLAGS = $(NIX_CFLAGS) -Wall -I ../libhydra -Wno-deprecated-declarations
|
|
||||||
9
src/hydra-evaluator/meson.build
Normal file
9
src/hydra-evaluator/meson.build
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
hydra_evaluator = executable('hydra-evaluator',
|
||||||
|
'hydra-evaluator.cc',
|
||||||
|
dependencies: [
|
||||||
|
libhydra_dep,
|
||||||
|
nix_dep,
|
||||||
|
pqxx_dep,
|
||||||
|
],
|
||||||
|
install: true,
|
||||||
|
)
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
bin_PROGRAMS = hydra-queue-runner
|
|
||||||
|
|
||||||
hydra_queue_runner_SOURCES = hydra-queue-runner.cc queue-monitor.cc dispatcher.cc \
|
|
||||||
builder.cc build-result.cc build-remote.cc \
|
|
||||||
hydra-build-result.hh counter.hh state.hh db.hh \
|
|
||||||
nar-extractor.cc nar-extractor.hh
|
|
||||||
hydra_queue_runner_LDADD = $(NIX_LIBS) -lpqxx -lprometheus-cpp-pull -lprometheus-cpp-core
|
|
||||||
hydra_queue_runner_CXXFLAGS = $(NIX_CFLAGS) -Wall -I ../libhydra -Wno-deprecated-declarations
|
|
||||||
@@ -2,6 +2,7 @@
|
|||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
#include <unordered_set>
|
||||||
|
|
||||||
#include "state.hh"
|
#include "state.hh"
|
||||||
|
|
||||||
|
|||||||
22
src/hydra-queue-runner/meson.build
Normal file
22
src/hydra-queue-runner/meson.build
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
srcs = files(
|
||||||
|
'builder.cc',
|
||||||
|
'build-remote.cc',
|
||||||
|
'build-result.cc',
|
||||||
|
'dispatcher.cc',
|
||||||
|
'hydra-queue-runner.cc',
|
||||||
|
'nar-extractor.cc',
|
||||||
|
'queue-monitor.cc',
|
||||||
|
)
|
||||||
|
|
||||||
|
hydra_queue_runner = executable('hydra-queue-runner',
|
||||||
|
'hydra-queue-runner.cc',
|
||||||
|
srcs,
|
||||||
|
dependencies: [
|
||||||
|
libhydra_dep,
|
||||||
|
nix_dep,
|
||||||
|
pqxx_dep,
|
||||||
|
prom_cpp_core_dep,
|
||||||
|
prom_cpp_pull_dep,
|
||||||
|
],
|
||||||
|
install: true,
|
||||||
|
)
|
||||||
@@ -54,32 +54,40 @@ struct Extractor : FileSystemObjectSink
|
|||||||
};
|
};
|
||||||
|
|
||||||
NarMemberDatas & members;
|
NarMemberDatas & members;
|
||||||
Path prefix;
|
std::filesystem::path prefix;
|
||||||
|
|
||||||
|
Path toKey(const CanonPath & path)
|
||||||
|
{
|
||||||
|
std::filesystem::path p = prefix;
|
||||||
|
// Conditional to avoid trailing slash
|
||||||
|
if (!path.isRoot()) p /= path.rel();
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
|
||||||
Extractor(NarMemberDatas & members, const Path & prefix)
|
Extractor(NarMemberDatas & members, const Path & prefix)
|
||||||
: members(members), prefix(prefix)
|
: members(members), prefix(prefix)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
void createDirectory(const Path & path) override
|
void createDirectory(const CanonPath & path) override
|
||||||
{
|
{
|
||||||
members.insert_or_assign(prefix + path, NarMemberData { .type = SourceAccessor::Type::tDirectory });
|
members.insert_or_assign(toKey(path), NarMemberData { .type = SourceAccessor::Type::tDirectory });
|
||||||
}
|
}
|
||||||
|
|
||||||
void createRegularFile(const Path & path, std::function<void(CreateRegularFileSink &)> func) override
|
void createRegularFile(const CanonPath & path, std::function<void(CreateRegularFileSink &)> func) override
|
||||||
{
|
{
|
||||||
NarMemberConstructor nmc {
|
NarMemberConstructor nmc {
|
||||||
members.insert_or_assign(prefix + path, NarMemberData {
|
members.insert_or_assign(toKey(path), NarMemberData {
|
||||||
.type = SourceAccessor::Type::tRegular,
|
.type = SourceAccessor::Type::tRegular,
|
||||||
.fileSize = 0,
|
.fileSize = 0,
|
||||||
.contents = filesToKeep.count(path) ? std::optional("") : std::nullopt,
|
.contents = filesToKeep.count(path.abs()) ? std::optional("") : std::nullopt,
|
||||||
}).first->second,
|
}).first->second,
|
||||||
};
|
};
|
||||||
func(nmc);
|
func(nmc);
|
||||||
}
|
}
|
||||||
|
|
||||||
void createSymlink(const Path & path, const std::string & target) override
|
void createSymlink(const CanonPath & path, const std::string & target) override
|
||||||
{
|
{
|
||||||
members.insert_or_assign(prefix + path, NarMemberData { .type = SourceAccessor::Type::tSymlink });
|
members.insert_or_assign(toKey(path), NarMemberData { .type = SourceAccessor::Type::tSymlink });
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
#include "nar-extractor.hh"
|
#include "nar-extractor.hh"
|
||||||
#include "serve-protocol.hh"
|
#include "serve-protocol.hh"
|
||||||
#include "serve-protocol-impl.hh"
|
#include "serve-protocol-impl.hh"
|
||||||
|
#include "serve-protocol-connection.hh"
|
||||||
#include "machines.hh"
|
#include "machines.hh"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ use Nix::Config;
|
|||||||
use Nix::Store;
|
use Nix::Store;
|
||||||
use Hydra::Model::DB;
|
use Hydra::Model::DB;
|
||||||
use Hydra::Helper::CatalystUtils;
|
use Hydra::Helper::CatalystUtils;
|
||||||
|
use Hydra::Helper::Nix;
|
||||||
|
|
||||||
sub isEnabled {
|
sub isEnabled {
|
||||||
my ($self) = @_;
|
my ($self) = @_;
|
||||||
|
|||||||
@@ -1,22 +0,0 @@
|
|||||||
PERL_MODULES = \
|
|
||||||
$(wildcard *.pm) \
|
|
||||||
$(wildcard Hydra/*.pm) \
|
|
||||||
$(wildcard Hydra/Helper/*.pm) \
|
|
||||||
$(wildcard Hydra/Model/*.pm) \
|
|
||||||
$(wildcard Hydra/View/*.pm) \
|
|
||||||
$(wildcard Hydra/Schema/*.pm) \
|
|
||||||
$(wildcard Hydra/Schema/Result/*.pm) \
|
|
||||||
$(wildcard Hydra/Schema/ResultSet/*.pm) \
|
|
||||||
$(wildcard Hydra/Controller/*.pm) \
|
|
||||||
$(wildcard Hydra/Base/*.pm) \
|
|
||||||
$(wildcard Hydra/Base/Controller/*.pm) \
|
|
||||||
$(wildcard Hydra/Script/*.pm) \
|
|
||||||
$(wildcard Hydra/Component/*.pm) \
|
|
||||||
$(wildcard Hydra/Event/*.pm) \
|
|
||||||
$(wildcard Hydra/Plugin/*.pm)
|
|
||||||
|
|
||||||
EXTRA_DIST = \
|
|
||||||
$(PERL_MODULES)
|
|
||||||
|
|
||||||
hydradir = $(libexecdir)/hydra/lib
|
|
||||||
nobase_hydra_DATA = $(PERL_MODULES)
|
|
||||||
5
src/libhydra/meson.build
Normal file
5
src/libhydra/meson.build
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
libhydra_inc = include_directories('.')
|
||||||
|
|
||||||
|
libhydra_dep = declare_dependency(
|
||||||
|
include_directories: [libhydra_inc],
|
||||||
|
)
|
||||||
86
src/meson.build
Normal file
86
src/meson.build
Normal file
@@ -0,0 +1,86 @@
|
|||||||
|
# Native code
|
||||||
|
subdir('libhydra')
|
||||||
|
subdir('hydra-eval-jobs')
|
||||||
|
subdir('hydra-evaluator')
|
||||||
|
subdir('hydra-queue-runner')
|
||||||
|
|
||||||
|
hydra_libexecdir = get_option('libexecdir') / 'hydra'
|
||||||
|
|
||||||
|
# Data and interpreted
|
||||||
|
foreach dir : ['lib', 'root']
|
||||||
|
install_subdir(dir,
|
||||||
|
install_dir: hydra_libexecdir,
|
||||||
|
)
|
||||||
|
endforeach
|
||||||
|
subdir('sql')
|
||||||
|
subdir('ttf')
|
||||||
|
|
||||||
|
# Static files for website
|
||||||
|
|
||||||
|
hydra_libexecdir_static = hydra_libexecdir / 'root' / 'static'
|
||||||
|
|
||||||
|
## Bootstrap
|
||||||
|
|
||||||
|
bootstrap_name = 'bootstrap-4.3.1-dist'
|
||||||
|
bootstrap = custom_target(
|
||||||
|
'extract-bootstrap',
|
||||||
|
input: 'root' / (bootstrap_name + '.zip'),
|
||||||
|
output: bootstrap_name,
|
||||||
|
command: ['unzip', '-u', '-d', '@OUTDIR@', '@INPUT@'],
|
||||||
|
)
|
||||||
|
custom_target(
|
||||||
|
'name-bootstrap',
|
||||||
|
input: bootstrap,
|
||||||
|
output: 'bootstrap',
|
||||||
|
command: ['cp', '-r', '@INPUT@' , '@OUTPUT@'],
|
||||||
|
install: true,
|
||||||
|
install_dir: hydra_libexecdir_static,
|
||||||
|
)
|
||||||
|
|
||||||
|
## Flot
|
||||||
|
|
||||||
|
custom_target(
|
||||||
|
'extract-flot',
|
||||||
|
input: 'root' / 'flot-0.8.3.zip',
|
||||||
|
output: 'flot',
|
||||||
|
command: ['unzip', '-u', '-d', '@OUTDIR@', '@INPUT@'],
|
||||||
|
install: true,
|
||||||
|
install_dir: hydra_libexecdir_static / 'js',
|
||||||
|
)
|
||||||
|
|
||||||
|
## Fontawesome
|
||||||
|
|
||||||
|
fontawesome_name = 'fontawesome-free-5.10.2-web'
|
||||||
|
fontawesome = custom_target(
|
||||||
|
'extract-fontawesome',
|
||||||
|
input: 'root' / (fontawesome_name + '.zip'),
|
||||||
|
output: fontawesome_name,
|
||||||
|
command: ['unzip', '-u', '-d', '@OUTDIR@', '@INPUT@'],
|
||||||
|
)
|
||||||
|
custom_target(
|
||||||
|
'name-fontawesome-css',
|
||||||
|
input: fontawesome,
|
||||||
|
output: 'css',
|
||||||
|
command: ['cp', '-r', '@INPUT@/css', '@OUTPUT@'],
|
||||||
|
install: true,
|
||||||
|
install_dir: hydra_libexecdir_static / 'fontawesome',
|
||||||
|
)
|
||||||
|
custom_target(
|
||||||
|
'name-fontawesome-webfonts',
|
||||||
|
input: fontawesome,
|
||||||
|
output: 'webfonts',
|
||||||
|
command: ['cp', '-r', '@INPUT@/webfonts', '@OUTPUT@'],
|
||||||
|
install: true,
|
||||||
|
install_dir: hydra_libexecdir_static / 'fontawesome',
|
||||||
|
)
|
||||||
|
|
||||||
|
# Scripts
|
||||||
|
|
||||||
|
install_subdir('script',
|
||||||
|
install_dir: get_option('bindir'),
|
||||||
|
exclude_files: [
|
||||||
|
'hydra-dev-server',
|
||||||
|
],
|
||||||
|
install_mode: 'rwxr-xr-x',
|
||||||
|
strip_directory: true,
|
||||||
|
)
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
TEMPLATES = $(wildcard *.tt)
|
|
||||||
STATIC = \
|
|
||||||
$(wildcard static/images/*) \
|
|
||||||
$(wildcard static/css/*) \
|
|
||||||
static/js/bootbox.min.js \
|
|
||||||
static/js/popper.min.js \
|
|
||||||
static/js/common.js \
|
|
||||||
static/js/jquery/jquery-3.4.1.min.js \
|
|
||||||
static/js/jquery/jquery-ui-1.10.4.min.js
|
|
||||||
|
|
||||||
FLOT = flot-0.8.3.zip
|
|
||||||
BOOTSTRAP = bootstrap-4.3.1-dist.zip
|
|
||||||
FONTAWESOME = fontawesome-free-5.10.2-web.zip
|
|
||||||
|
|
||||||
ZIPS = $(FLOT) $(BOOTSTRAP) $(FONTAWESOME)
|
|
||||||
|
|
||||||
EXTRA_DIST = $(TEMPLATES) $(STATIC) $(ZIPS)
|
|
||||||
|
|
||||||
hydradir = $(libexecdir)/hydra/root
|
|
||||||
nobase_hydra_DATA = $(EXTRA_DIST)
|
|
||||||
|
|
||||||
all:
|
|
||||||
mkdir -p $(srcdir)/static/js
|
|
||||||
unzip -u -d $(srcdir)/static $(BOOTSTRAP)
|
|
||||||
rm -rf $(srcdir)/static/bootstrap
|
|
||||||
mv $(srcdir)/static/$(basename $(BOOTSTRAP)) $(srcdir)/static/bootstrap
|
|
||||||
unzip -u -d $(srcdir)/static/js $(FLOT)
|
|
||||||
unzip -u -d $(srcdir)/static $(FONTAWESOME)
|
|
||||||
rm -rf $(srcdir)/static/fontawesome
|
|
||||||
mv $(srcdir)/static/$(basename $(FONTAWESOME)) $(srcdir)/static/fontawesome
|
|
||||||
|
|
||||||
install-data-local: $(ZIPS)
|
|
||||||
mkdir -p $(hydradir)/static/js
|
|
||||||
cp -prvd $(srcdir)/static/js/* $(hydradir)/static/js
|
|
||||||
mkdir -p $(hydradir)/static/bootstrap
|
|
||||||
cp -prvd $(srcdir)/static/bootstrap/* $(hydradir)/static/bootstrap
|
|
||||||
mkdir -p $(hydradir)/static/fontawesome/{css,webfonts}
|
|
||||||
cp -prvd $(srcdir)/static/fontawesome/css/* $(hydradir)/static/fontawesome/css
|
|
||||||
cp -prvd $(srcdir)/static/fontawesome/webfonts/* $(hydradir)/static/fontawesome/webfonts
|
|
||||||
@@ -27,15 +27,15 @@ removed or had an evaluation error.</div>
|
|||||||
<div id="generic-tabs" class="tab-content">
|
<div id="generic-tabs" class="tab-content">
|
||||||
|
|
||||||
<div id="tabs-status" class="tab-pane active">
|
<div id="tabs-status" class="tab-pane active">
|
||||||
|
[% IF queuedBuilds.size != 0 %]
|
||||||
|
<h3>Queued builds</h3>
|
||||||
|
[% INCLUDE renderBuildList builds=queuedBuilds showSchedulingInfo=1 hideResultInfo=1 %]
|
||||||
|
[% END %]
|
||||||
[% IF lastBuilds.size != 0 %]
|
[% IF lastBuilds.size != 0 %]
|
||||||
<h3>Latest builds</h3>
|
<h3>Latest builds</h3>
|
||||||
[% INCLUDE renderBuildList builds=lastBuilds
|
[% INCLUDE renderBuildList builds=lastBuilds
|
||||||
linkToAll=c.uri_for('/job' project.name jobset.name job 'all') %]
|
linkToAll=c.uri_for('/job' project.name jobset.name job 'all') %]
|
||||||
[% END %]
|
[% END %]
|
||||||
[% IF queuedBuilds.size != 0 %]
|
|
||||||
<h3>Queued builds</h3>
|
|
||||||
[% INCLUDE renderBuildList builds=queuedBuilds showSchedulingInfo=1 hideResultInfo=1 %]
|
|
||||||
[% END %]
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
[% IF constituentJobs.size > 0 %]
|
[% IF constituentJobs.size > 0 %]
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ main() {
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
tmpDir=${TMPDIR:-/tmp}/build-[% build.id +%]
|
tmpDir=$(realpath "${TMPDIR:-/tmp}")/build-[% build.id +%]
|
||||||
declare -a args extraArgs
|
declare -a args extraArgs
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,19 +0,0 @@
|
|||||||
EXTRA_DIST = \
|
|
||||||
$(distributable_scripts)
|
|
||||||
|
|
||||||
distributable_scripts = \
|
|
||||||
hydra-backfill-ids \
|
|
||||||
hydra-init \
|
|
||||||
hydra-eval-jobset \
|
|
||||||
hydra-server \
|
|
||||||
hydra-update-gc-roots \
|
|
||||||
hydra-s3-backup-collect-garbage \
|
|
||||||
hydra-create-user \
|
|
||||||
hydra-notify \
|
|
||||||
hydra-send-stats \
|
|
||||||
nix-prefetch-git \
|
|
||||||
nix-prefetch-bzr \
|
|
||||||
nix-prefetch-hg
|
|
||||||
|
|
||||||
bin_SCRIPTS = \
|
|
||||||
$(distributable_scripts)
|
|
||||||
@@ -78,7 +78,7 @@ fi
|
|||||||
|
|
||||||
init_remote(){
|
init_remote(){
|
||||||
local url=$1;
|
local url=$1;
|
||||||
git init;
|
git init --initial-branch=trunk;
|
||||||
git remote add origin $url;
|
git remote add origin $url;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
sqldir = $(libexecdir)/hydra/sql
|
|
||||||
nobase_dist_sql_DATA = \
|
|
||||||
hydra.sql \
|
|
||||||
test.sql \
|
|
||||||
upgrade-*.sql \
|
|
||||||
update-dbix.pl
|
|
||||||
|
|
||||||
update-dbix: hydra.sql
|
|
||||||
./update-dbix-harness.sh
|
|
||||||
90
src/sql/meson.build
Normal file
90
src/sql/meson.build
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
sql_files = files(
|
||||||
|
'hydra.sql',
|
||||||
|
'test.sql',
|
||||||
|
'update-dbix.pl',
|
||||||
|
'upgrade-2.sql',
|
||||||
|
'upgrade-3.sql',
|
||||||
|
'upgrade-4.sql',
|
||||||
|
'upgrade-5.sql',
|
||||||
|
'upgrade-6.sql',
|
||||||
|
'upgrade-7.sql',
|
||||||
|
'upgrade-8.sql',
|
||||||
|
'upgrade-9.sql',
|
||||||
|
'upgrade-10.sql',
|
||||||
|
'upgrade-11.sql',
|
||||||
|
'upgrade-12.sql',
|
||||||
|
'upgrade-13.sql',
|
||||||
|
'upgrade-14.sql',
|
||||||
|
'upgrade-15.sql',
|
||||||
|
'upgrade-16.sql',
|
||||||
|
'upgrade-17.sql',
|
||||||
|
'upgrade-18.sql',
|
||||||
|
'upgrade-19.sql',
|
||||||
|
'upgrade-20.sql',
|
||||||
|
'upgrade-21.sql',
|
||||||
|
'upgrade-22.sql',
|
||||||
|
'upgrade-23.sql',
|
||||||
|
'upgrade-24.sql',
|
||||||
|
'upgrade-25.sql',
|
||||||
|
'upgrade-26.sql',
|
||||||
|
'upgrade-27.sql',
|
||||||
|
'upgrade-28.sql',
|
||||||
|
'upgrade-29.sql',
|
||||||
|
'upgrade-30.sql',
|
||||||
|
'upgrade-31.sql',
|
||||||
|
'upgrade-32.sql',
|
||||||
|
'upgrade-33.sql',
|
||||||
|
'upgrade-34.sql',
|
||||||
|
'upgrade-35.sql',
|
||||||
|
'upgrade-36.sql',
|
||||||
|
'upgrade-37.sql',
|
||||||
|
'upgrade-38.sql',
|
||||||
|
'upgrade-39.sql',
|
||||||
|
'upgrade-40.sql',
|
||||||
|
'upgrade-41.sql',
|
||||||
|
'upgrade-42.sql',
|
||||||
|
'upgrade-43.sql',
|
||||||
|
'upgrade-44.sql',
|
||||||
|
'upgrade-45.sql',
|
||||||
|
'upgrade-46.sql',
|
||||||
|
'upgrade-47.sql',
|
||||||
|
'upgrade-48.sql',
|
||||||
|
'upgrade-49.sql',
|
||||||
|
'upgrade-50.sql',
|
||||||
|
'upgrade-51.sql',
|
||||||
|
'upgrade-52.sql',
|
||||||
|
'upgrade-53.sql',
|
||||||
|
'upgrade-54.sql',
|
||||||
|
'upgrade-55.sql',
|
||||||
|
'upgrade-56.sql',
|
||||||
|
'upgrade-57.sql',
|
||||||
|
'upgrade-58.sql',
|
||||||
|
'upgrade-59.sql',
|
||||||
|
'upgrade-60.sql',
|
||||||
|
'upgrade-61.sql',
|
||||||
|
'upgrade-62.sql',
|
||||||
|
'upgrade-63.sql',
|
||||||
|
'upgrade-64.sql',
|
||||||
|
'upgrade-65.sql',
|
||||||
|
'upgrade-66.sql',
|
||||||
|
'upgrade-67.sql',
|
||||||
|
'upgrade-68.sql',
|
||||||
|
'upgrade-69.sql',
|
||||||
|
'upgrade-70.sql',
|
||||||
|
'upgrade-71.sql',
|
||||||
|
'upgrade-72.sql',
|
||||||
|
'upgrade-73.sql',
|
||||||
|
'upgrade-74.sql',
|
||||||
|
'upgrade-75.sql',
|
||||||
|
'upgrade-76.sql',
|
||||||
|
'upgrade-77.sql',
|
||||||
|
'upgrade-78.sql',
|
||||||
|
'upgrade-79.sql',
|
||||||
|
'upgrade-80.sql',
|
||||||
|
'upgrade-81.sql',
|
||||||
|
'upgrade-82.sql',
|
||||||
|
'upgrade-83.sql',
|
||||||
|
'upgrade-84.sql',
|
||||||
|
)
|
||||||
|
|
||||||
|
install_data(sql_files, install_dir: hydra_libexecdir / 'sql')
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
EXTRA_DIST = COPYING.LIB StayPuft.ttf
|
|
||||||
|
|
||||||
ttfdir = $(libexecdir)/hydra/ttf
|
|
||||||
nobase_ttf_DATA = $(EXTRA_DIST)
|
|
||||||
5
src/ttf/meson.build
Normal file
5
src/ttf/meson.build
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
data_files = files(
|
||||||
|
'StayPuft.ttf',
|
||||||
|
'COPYING.LIB',
|
||||||
|
)
|
||||||
|
install_data(data_files, install_dir: hydra_libexecdir / 'ttf')
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
TESTS_ENVIRONMENT = \
|
|
||||||
BZR_HOME="$(abs_builddir)/data" \
|
|
||||||
HYDRA_DBI="dbi:Pg:dbname=hydra-test-suite;port=6433" \
|
|
||||||
HYDRA_DATA="$(abs_builddir)/data" \
|
|
||||||
HYDRA_HOME="$(top_srcdir)/src" \
|
|
||||||
HYDRA_CONFIG= \
|
|
||||||
NIX_REMOTE= \
|
|
||||||
NIX_REMOTE_SYSTEMS= \
|
|
||||||
NIX_CONF_DIR="$(abs_builddir)/nix/etc/nix" \
|
|
||||||
NIX_STATE_DIR="$(abs_builddir)/nix/var/nix" \
|
|
||||||
NIX_STORE_DIR="$(abs_builddir)/nix/store" \
|
|
||||||
NIX_LOG_DIR="$(abs_builddir)/nix/var/log/nix" \
|
|
||||||
PGHOST=/tmp \
|
|
||||||
PERL5LIB="$(srcdir):$(abs_top_srcdir)/src/lib:$$PERL5LIB" \
|
|
||||||
PYTHONPATH= \
|
|
||||||
PATH=$(abs_top_srcdir)/src/hydra-evaluator:$(abs_top_srcdir)/src/script:$(abs_top_srcdir)/src/hydra-eval-jobs:$(abs_top_srcdir)/src/hydra-queue-runner:$$PATH \
|
|
||||||
perl -w
|
|
||||||
|
|
||||||
EXTRA_DIST = \
|
|
||||||
$(wildcard *.pm) \
|
|
||||||
$(wildcard jobs/*.nix) \
|
|
||||||
$(wildcard jobs/*.sh) \
|
|
||||||
$(TESTS)
|
|
||||||
|
|
||||||
TESTS = \
|
|
||||||
perlcritic.pl \
|
|
||||||
test.pl
|
|
||||||
|
|
||||||
check_SCRIPTS = repos
|
|
||||||
|
|
||||||
repos: dirs
|
|
||||||
|
|
||||||
dirs:
|
|
||||||
mkdir -p data
|
|
||||||
touch data/hydra.conf
|
|
||||||
mkdir -p nix
|
|
||||||
mkdir -p nix/etc/nix
|
|
||||||
mkdir -p nix/store
|
|
||||||
mkdir -p nix/var
|
|
||||||
@@ -4,6 +4,8 @@ use warnings;
|
|||||||
package HydraTestContext;
|
package HydraTestContext;
|
||||||
use File::Path qw(make_path);
|
use File::Path qw(make_path);
|
||||||
use File::Basename;
|
use File::Basename;
|
||||||
|
use File::Copy::Recursive qw(rcopy);
|
||||||
|
use File::Which qw(which);
|
||||||
use Cwd qw(abs_path getcwd);
|
use Cwd qw(abs_path getcwd);
|
||||||
use CliRunners;
|
use CliRunners;
|
||||||
use Hydra::Helper::Exec;
|
use Hydra::Helper::Exec;
|
||||||
@@ -77,6 +79,13 @@ sub new {
|
|||||||
);
|
);
|
||||||
$ENV{'HYDRA_DBI'} = $pgsql->dsn;
|
$ENV{'HYDRA_DBI'} = $pgsql->dsn;
|
||||||
|
|
||||||
|
my $jobsdir = "$dir/jobs";
|
||||||
|
rcopy(abs_path(dirname(__FILE__) . "/../jobs"), $jobsdir);
|
||||||
|
|
||||||
|
my $coreutils_path = dirname(which 'install');
|
||||||
|
replace_variable_in_file($jobsdir . "/config.nix", '@testPath@', $coreutils_path);
|
||||||
|
replace_variable_in_file($jobsdir . "/declarative/project.json", '@jobsPath@', $jobsdir);
|
||||||
|
|
||||||
my $self = bless {
|
my $self = bless {
|
||||||
_db => undef,
|
_db => undef,
|
||||||
db_handle => $pgsql,
|
db_handle => $pgsql,
|
||||||
@@ -84,7 +93,7 @@ sub new {
|
|||||||
nix_state_dir => $nix_state_dir,
|
nix_state_dir => $nix_state_dir,
|
||||||
nix_log_dir => $nix_log_dir,
|
nix_log_dir => $nix_log_dir,
|
||||||
testdir => abs_path(dirname(__FILE__) . "/.."),
|
testdir => abs_path(dirname(__FILE__) . "/.."),
|
||||||
jobsdir => abs_path(dirname(__FILE__) . "/../jobs"),
|
jobsdir => $jobsdir,
|
||||||
deststoredir => $deststoredir,
|
deststoredir => $deststoredir,
|
||||||
}, $class;
|
}, $class;
|
||||||
|
|
||||||
@@ -243,6 +252,18 @@ sub write_file {
|
|||||||
close $fh;
|
close $fh;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub replace_variable_in_file {
|
||||||
|
my ($fn, $var, $val) = @_;
|
||||||
|
|
||||||
|
open (my $input, '<', "$fn.in") or die $!;
|
||||||
|
open (my $output, '>', $fn) or die $!;
|
||||||
|
|
||||||
|
while (my $line = <$input>) {
|
||||||
|
$line =~ s/$var/$val/g;
|
||||||
|
print $output $line;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
sub rand_chars {
|
sub rand_chars {
|
||||||
return sprintf("t%08X", rand(0xFFFFFFFF));
|
return sprintf("t%08X", rand(0xFFFFFFFF));
|
||||||
}
|
}
|
||||||
|
|||||||
43
t/meson.build
Normal file
43
t/meson.build
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
fs = import('fs')
|
||||||
|
|
||||||
|
test('perlcritic',
|
||||||
|
perl,
|
||||||
|
args: ['-w', files('perlcritic.pl')],
|
||||||
|
workdir: meson.project_source_root(),
|
||||||
|
timeout: -1,
|
||||||
|
)
|
||||||
|
|
||||||
|
testenv = environment(
|
||||||
|
{
|
||||||
|
'BZR_HOME': meson.current_build_dir() / 'data',
|
||||||
|
'HYDRA_DBI': 'dbi:Pg:dbname=hydra-test-suite;port=6433',
|
||||||
|
'HYDRA_DATA': meson.current_build_dir() / 'data',
|
||||||
|
'HYDRA_HOME': meson.project_source_root() / 'src',
|
||||||
|
'PGHOST': '/tmp',
|
||||||
|
'PYTHONPATH': '',
|
||||||
|
|
||||||
|
# libpqxx seems to randomly crash with certain values of MALLOC_PERTURB_,
|
||||||
|
# set by default by Meson's test(). Very promising, high quality software.
|
||||||
|
'MALLOC_PERTURB_': '0',
|
||||||
|
},
|
||||||
|
)
|
||||||
|
testenv.prepend('PERL5LIB',
|
||||||
|
meson.current_source_dir(),
|
||||||
|
meson.project_source_root() / 'src/lib',
|
||||||
|
separator: ':'
|
||||||
|
)
|
||||||
|
testenv.prepend('PATH',
|
||||||
|
fs.parent(hydra_eval_jobs.full_path()),
|
||||||
|
fs.parent(hydra_evaluator.full_path()),
|
||||||
|
fs.parent(hydra_queue_runner.full_path()),
|
||||||
|
meson.project_source_root() / 'src/script',
|
||||||
|
separator: ':'
|
||||||
|
)
|
||||||
|
|
||||||
|
test('testsuite',
|
||||||
|
perl,
|
||||||
|
args: ['-I', meson.current_source_dir() / 'lib', '-w', files('test.pl')],
|
||||||
|
env: testenv,
|
||||||
|
workdir: meson.current_source_dir(),
|
||||||
|
timeout: -1,
|
||||||
|
)
|
||||||
Reference in New Issue
Block a user