Skip to content

Commit

Permalink
Set up version number for deb and rpm (#9122)
Browse files Browse the repository at this point in the history
Summary:
See hhvm/packaging#311 for version schema

Pull Request resolved: #9122

Test Plan:
 ---
Check "Show the rpm package's information" "Show the deb package's information" steps in GitHub Actions output. The version number should be like `4.165.0~dev20220714183154`

Reviewed By: alexeyt

Differential Revision: D37871984

Pulled By: Atry

fbshipit-source-id: 24b147eec8a9f882890ac89539d81591cf2730f6
  • Loading branch information
Atry authored and facebook-github-bot committed Jul 21, 2022
1 parent 516d018 commit 303bb4b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 4 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@
--input-type dir \
--output-type ${outputType} \
--name ${pkgs.lib.strings.escapeShellArg pkg.pname} \
--version ${pkgs.lib.strings.escapeShellArg pkg.version} \
--version ${
pkgs.lib.strings.escapeShellArg
(builtins.replaceStrings ["-"] ["~"] pkg.version)
} \
--description ${pkgs.lib.strings.escapeShellArg pkg.meta.description} \
--url ${pkgs.lib.strings.escapeShellArg pkg.meta.homepage} \
--maintainer ${pkgs.lib.strings.escapeShellArg (pkgs.lib.strings.concatStringsSep ", " (map ({name, email, ...}: "\"${name}\" <${email}>") pkg.meta.maintainers))} \
Expand Down
6 changes: 2 additions & 4 deletions hhvm.nix
Original file line number Diff line number Diff line change
Expand Up @@ -80,18 +80,16 @@ let
.*
''
(builtins.readFile ./hphp/runtime/version.h);
makePName = major: minor: patch: suffix:
if suffix == "-dev" then "hhvm_nightly" else "hhvm";
makeVersion = major: minor: patch: suffix:
if suffix == "-dev" then "${major}.${minor}.${patch}-${lastModifiedDate}" else "${major}.${minor}.${patch}";
if suffix == "-dev" then "${major}.${minor}.${patch}-dev${lastModifiedDate}" else "${major}.${minor}.${patch}";
rustNightly = rustChannelOf {
sha256 = "TpJKRroEs7V2BTo2GFPJlEScYVArFY2MnGpYTxbnSo8=";
date = "2022-02-24";
channel = "nightly";
};
in
stdenv.mkDerivation rec {
pname = builtins.foldl' lib.trivial.id makePName versionParts;
pname = "hhvm";
version = builtins.foldl' lib.trivial.id makeVersion versionParts;
src = ./.;
nativeBuildInputs =
Expand Down

0 comments on commit 303bb4b

Please sign in to comment.