Skip to content

Commit

Permalink
Revert "Move build logic for the core hydra package into its own defa…
Browse files Browse the repository at this point in the history
…ult.nix."

This reverts commit 949e586. This
makes release.nix harder to read/maintain IMHO. There already is a Nix
expression for Hydra in Nixpkgs that can be used for this purpose.
  • Loading branch information
edolstra committed Apr 12, 2017
1 parent 949e586 commit 468b048
Show file tree
Hide file tree
Showing 2 changed files with 133 additions and 125 deletions.
111 changes: 0 additions & 111 deletions default.nix

This file was deleted.

147 changes: 133 additions & 14 deletions release.nix
Expand Up @@ -29,6 +29,8 @@ let
environment.systemPackages = [ pkgs.perlPackages.LWP pkgs.perlPackages.JSON ];
};

version = builtins.readFile ./version + "." + toString hydraSrc.revCount + "." + hydraSrc.rev;

in

rec {
Expand All @@ -45,24 +47,141 @@ rec {
customMemoryManagement = false;
};

stdenv6 = overrideCC stdenv gcc6;
/*
nix = overrideDerivation nixUnstable (attrs: {
src = fetchFromGitHub {
owner = "NixOS";
repo = "nix";
rev = "4be4f6de56f4de77f6a376f1a40ed75eb641bb89";
sha256 = "0icvbwpca1jh8qkdlayxspdxl5fb0qjjd1kn74x6gs6iy66kndq6";
};
buildInputs = attrs.buildInputs ++ [ autoreconfHook bison flex ];
nativeBuildInputs = attrs.nativeBuildInputs ++ [ aws-sdk-cpp' autoconf-archive ];
configureFlags = attrs.configureFlags + " --disable-doc-gen";
preConfigure = "./bootstrap.sh; mkdir -p $doc $man";
});
*/
nix = nixUnstable;

perlDeps = buildEnv {
name = "hydra-perl-deps";
paths = with perlPackages;
[ ModulePluggable
CatalystActionREST
CatalystAuthenticationStoreDBIxClass
CatalystDevel
CatalystDispatchTypeRegex
CatalystPluginAccessLog
CatalystPluginAuthorizationRoles
CatalystPluginCaptcha
CatalystPluginSessionStateCookie
CatalystPluginSessionStoreFastMmap
CatalystPluginStackTrace
CatalystPluginUnicodeEncoding
CatalystTraitForRequestProxyBase
CatalystViewDownload
CatalystViewJSON
CatalystViewTT
CatalystXScriptServerStarman
CryptRandPasswd
DBDPg
DBDSQLite
DataDump
DateTime
DigestSHA1
EmailMIME
EmailSender
FileSlurp
IOCompress
IPCRun
JSONXS
LWP
LWPProtocolHttps
NetAmazonS3
NetStatsd
PadWalker
Readonly
SQLSplitStatement
SetScalar
Starman
SysHostnameLong
TestMore
TextDiff
TextTable
XMLSimple
nix
nix.perl-bindings
git
boehmgc
aws-sdk-cpp'
];
};

in

callPackage ./. {
stdenv = stdenv6 // { mkDerivation = args: releaseTools.nixBuild (args // {
stdenv = stdenv6;
postUnpack = optionalString (!shell) ''
# Clean up when building from a working tree.
(cd $sourceRoot && (git ls-files -o --directory | xargs -r rm -rfv)) || true
'';
}); };
inherit (gitAndTools) topGit;
nix = nixUnstable;
aws-sdk-cpp = aws-sdk-cpp';
hydraSrc = if shell then null else hydraSrc;
releaseTools.nixBuild {
name = "hydra-${version}";

src = if shell then null else hydraSrc;

stdenv = overrideCC stdenv gcc6;

buildInputs =
[ makeWrapper autoconf automake libtool unzip nukeReferences pkgconfig sqlite libpqxx
gitAndTools.topGit mercurial darcs subversion bazaar openssl bzip2 libxslt
guile # optional, for Guile + Guix support
perlDeps perl nix
postgresql92 # for running the tests
];

hydraPath = lib.makeBinPath (
[ sqlite subversion openssh nix coreutils findutils pixz
gzip bzip2 lzma gnutar unzip git gitAndTools.topGit mercurial darcs gnused bazaar
] ++ lib.optionals stdenv.isLinux [ rpm dpkg cdrkit ] );

postUnpack = optionalString (!shell) ''
# Clean up when building from a working tree.
(cd $sourceRoot && (git ls-files -o --directory | xargs -r rm -rfv)) || true
'';

configureFlags = [ "--with-docbook-xsl=${docbook_xsl}/xml/xsl/docbook" ];

preHook = ''
PATH=$(pwd)/src/hydra-evaluator:$(pwd)/src/script:$(pwd)/src/hydra-eval-jobs:$(pwd)/src/hydra-queue-runner:$PATH
PERL5LIB=$(pwd)/src/lib:$PERL5LIB;
'';

preConfigure = "autoreconf -vfi";

enableParallelBuilding = true;

preCheck = ''
patchShebangs .
export LOGNAME=${LOGNAME:-foo}
'';

postInstall = ''
mkdir -p $out/nix-support
for i in $out/bin/*; do
read -n 4 chars < $i
if [[ $chars =~ ELF ]]; then continue; fi
wrapProgram $i \
--prefix PERL5LIB ':' $out/libexec/hydra/lib:$PERL5LIB \
--prefix PATH ':' $out/bin:$hydraPath \
--set HYDRA_RELEASE ${version} \
--set HYDRA_HOME $out/libexec/hydra \
--set NIX_RELEASE ${nix.name or "unknown"}
done
''; # */

dontStrip = true;

meta.description = "Build of Hydra on ${system}";
passthru.perlDeps = perlDeps;
});

manual = pkgs.runCommand "hydra-manual-${build.x86_64-linux.version}"
manual = pkgs.runCommand "hydra-manual-${version}"
{ build = build.x86_64-linux;
}
''
Expand Down

2 comments on commit 468b048

@shlevy
Copy link
Member

@shlevy shlevy commented on 468b048 Apr 19, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please let me know when you revert my work.

Is the expression in nixpkgs kept up to date?

@Ericson2314
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Certainly if this continuous release RFC is passed, as I hope it will, keeping nixpkgs's Nix up to date by hand will be basically impossible.

Please sign in to comment.