Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

releaseTools: no-op expression cleanup #83112

Merged
merged 1 commit into from
Apr 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 13 additions & 18 deletions pkgs/build-support/release/binary-tarball.nix
Original file line number Diff line number Diff line change
Expand Up @@ -51,29 +51,24 @@ stdenv.mkDerivation (
configureFlags="--prefix=$prefix $configureFlags"
dontAddPrefix=1
prefix=$TMPDIR/inst$prefix
''; # */

'';

doDist = true;

distPhase =
''
mkdir -p $out/tarballs
tar cvfj $out/tarballs/''${releaseName:-binary-dist}.tar.bz2 -C $TMPDIR/inst .
'';


finalPhase =
''
for i in $out/tarballs/*; do
echo "file binary-dist $i" >> $out/nix-support/hydra-build-products
done
distPhase = ''
mkdir -p $out/tarballs
tar cvfj $out/tarballs/''${releaseName:-binary-dist}.tar.bz2 -C $TMPDIR/inst .
'';

# Propagate the release name of the source tarball. This is
# to get nice package names in channels.
test -n "$releaseName" && (echo "$releaseName" >> $out/nix-support/hydra-release-name)
'';
finalPhase = ''
for i in $out/tarballs/*; do
echo "file binary-dist $i" >> $out/nix-support/hydra-build-products
done

# Propagate the release name of the source tarball. This is
# to get nice package names in channels.
test -n "$releaseName" && (echo "$releaseName" >> $out/nix-support/hydra-release-name)
'';

meta = (if args ? meta then args.meta else {}) // {
description = "Build of a generic binary distribution";
Expand Down
2 changes: 1 addition & 1 deletion pkgs/build-support/release/debian-build.nix
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ vmTools.runInLinuxImage (stdenv.mkDerivation (
done

eval "$postInstall"
''; # */
'';

meta = (if args ? meta then args.meta else {}) // {
description = "Deb package for ${diskImage.fullName}";
Expand Down
6 changes: 3 additions & 3 deletions pkgs/build-support/release/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{pkgs}:
{ pkgs }:

with pkgs;

Expand Down Expand Up @@ -77,7 +77,7 @@ rec {
its contituents. Channel jobs are a special type of jobs that are
listed in the channel tab of Hydra and that can be suscribed.
A tarball of the src attribute is distributed via the channel.

- constituents: a list of derivations on which the channel success depends.
- name: the channel name that will be used in the hydra interface.
- src: should point to the root folder of the nix-expressions used by the
Expand All @@ -88,7 +88,7 @@ rec {
name = "my-channel";
src = ./.;
};

*/
channel =
{ name, src, constituents ? [], meta ? {}, isNixOS ? true, ... }@args:
Expand Down
24 changes: 12 additions & 12 deletions pkgs/build-support/release/maven-build.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
, ...
} @ args :

let
let
mvnFlags = "-Dmaven.repo.local=$M2_REPO ${if doTest then "" else "-Dmaven.test.skip.exec=true"} ${extraMvnFlags}";
in

stdenv.mkDerivation ( {
inherit name src;
inherit name src;
phases = "setupPhase unpackPhase patchPhase mvnCompile ${if doTestCompile then "mvnTestCompile mvnTestJar" else ""} ${if doTest then "mvnTest" else ""} ${if doJavadoc then "mvnJavadoc" else ""} ${if doCheckstyle then "mvnCheckstyle" else ""} mvnJar mvnAssembly mvnRelease finalPhase";

setupPhase = ''
Expand All @@ -32,15 +32,15 @@ stdenv.mkDerivation ( {

mvnCompile = ''
mvn compile ${mvnFlags}
'';
'';

mvnTestCompile = ''
mvn test-compile ${mvnFlags}
'';
'';

mvnTestJar = ''
mvn jar:test-jar ${mvnFlags}
'';
'';

mvnTest = ''
mvn test ${mvnFlags}
Expand All @@ -53,21 +53,21 @@ stdenv.mkDerivation ( {
mvn surefire-report:report-only
echo "report coverage $out/site/surefire-report.html" >> $out/nix-support/hydra-build-products
fi
'';
'';

mvnJavadoc = ''
mvn javadoc:javadoc ${mvnFlags}
echo "report javadoc $out/site/apidocs" >> $out/nix-support/hydra-build-products
'';
'';

mvnCheckstyle = ''
mvn checkstyle:checkstyle ${mvnFlags}
echo "report checkstyle $out/site/checkstyle.html" >> $out/nix-support/hydra-build-products
'';
'';

mvnJar = ''
mvn jar:jar ${mvnFlags}
'';
'';

mvnAssembly = ''
mvn assembly:assembly -Dmaven.test.skip=true ${mvnFlags}
Expand All @@ -80,19 +80,19 @@ stdenv.mkDerivation ( {
releaseName=$(basename $zip .zip)
releaseName="$releaseName-r${toString src.rev or "0"}"
cp $zip $out/release/$releaseName.zip

echo "$releaseName" > $out/nix-support/hydra-release-name

${if doRelease then ''
echo "file zip $out/release/$releaseName.zip" >> $out/nix-support/hydra-build-products
'' else ""}
'';
'';

finalPhase = ''
if [ -d target/site ] ; then
cp -R target/site $out/
echo "report site $out/site" >> $out/nix-support/hydra-build-products
fi
'';
} // args
} // args
)
2 changes: 1 addition & 1 deletion pkgs/build-support/release/rpm-build.nix
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ vmTools.buildRPM (
for rpmdir in $extraRPMs ; do
echo "file rpm-extra $(ls $rpmdir/rpms/*/*.rpm | grep -v 'src\.rpm' | sort | head -1)" >> $out/nix-support/hydra-build-products
done
''; # */
'';

meta = (if args ? meta then args.meta else {}) // {
description = "RPM package for ${diskImage.fullName}";
Expand Down