forked from lix-project/lix
Merge pull request #2914 from CSVdB/finegrainedEpochs
Made epochs more fine-grained
This commit is contained in:
commit
412684f9dc
|
@ -96,7 +96,7 @@ module.
|
||||||
|
|
||||||
# The epoch may be used in the future to determine how Nix
|
# The epoch may be used in the future to determine how Nix
|
||||||
# expressions inside this flake are to be parsed.
|
# expressions inside this flake are to be parsed.
|
||||||
epoch = 2018;
|
epoch = 201906;
|
||||||
|
|
||||||
# Some other metadata.
|
# Some other metadata.
|
||||||
description = "A filesystem that fetches DWARF debug info from the Internet on demand";
|
description = "A filesystem that fetches DWARF debug info from the Internet on demand";
|
||||||
|
@ -164,7 +164,7 @@ Similarly, a minimal `flake.nix` for Nixpkgs:
|
||||||
{
|
{
|
||||||
name = "nixpkgs";
|
name = "nixpkgs";
|
||||||
|
|
||||||
epoch = 2018;
|
epoch = 201906;
|
||||||
|
|
||||||
description = "A collection of packages for the Nix package manager";
|
description = "A collection of packages for the Nix package manager";
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
description = "The purely functional package manager";
|
description = "The purely functional package manager";
|
||||||
|
|
||||||
epoch = 2019;
|
epoch = 201906;
|
||||||
|
|
||||||
inputs = [ "nixpkgs" ];
|
inputs = [ "nixpkgs" ];
|
||||||
|
|
||||||
|
|
|
@ -312,7 +312,7 @@ Flake getFlake(EvalState & state, const FlakeRef & flakeRef, bool impureIsAllowe
|
||||||
|
|
||||||
if (auto epoch = vInfo.attrs->get(sEpoch)) {
|
if (auto epoch = vInfo.attrs->get(sEpoch)) {
|
||||||
flake.epoch = state.forceInt(*(**epoch).value, *(**epoch).pos);
|
flake.epoch = state.forceInt(*(**epoch).value, *(**epoch).pos);
|
||||||
if (flake.epoch > 2019)
|
if (flake.epoch > 201906)
|
||||||
throw Error("flake '%s' requires unsupported epoch %d; please upgrade Nix", flakeRef, flake.epoch);
|
throw Error("flake '%s' requires unsupported epoch %d; please upgrade Nix", flakeRef, flake.epoch);
|
||||||
} else
|
} else
|
||||||
throw Error("flake '%s' lacks attribute 'epoch'", flakeRef);
|
throw Error("flake '%s' lacks attribute 'epoch'", flakeRef);
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
description = "A flake for building Hello World";
|
description = "A flake for building Hello World";
|
||||||
|
|
||||||
epoch = 2019;
|
epoch = 201906;
|
||||||
|
|
||||||
requires = [ "nixpkgs" ];
|
requires = [ "nixpkgs" ];
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ cat > $flake1Dir/flake.nix <<EOF
|
||||||
{
|
{
|
||||||
name = "flake1";
|
name = "flake1";
|
||||||
|
|
||||||
epoch = 2019;
|
epoch = 201906;
|
||||||
|
|
||||||
description = "Bla bla";
|
description = "Bla bla";
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ cat > $flake2Dir/flake.nix <<EOF
|
||||||
{
|
{
|
||||||
name = "flake2";
|
name = "flake2";
|
||||||
|
|
||||||
epoch = 2019;
|
epoch = 201906;
|
||||||
|
|
||||||
inputs = [ "flake1" ];
|
inputs = [ "flake1" ];
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ cat > $flake3Dir/flake.nix <<EOF
|
||||||
{
|
{
|
||||||
name = "flake3";
|
name = "flake3";
|
||||||
|
|
||||||
epoch = 2019;
|
epoch = 201906;
|
||||||
|
|
||||||
inputs = [ "flake2" ];
|
inputs = [ "flake2" ];
|
||||||
|
|
||||||
|
@ -169,7 +169,7 @@ cat > $flake3Dir/flake.nix <<EOF
|
||||||
{
|
{
|
||||||
name = "flake3";
|
name = "flake3";
|
||||||
|
|
||||||
epoch = 2019;
|
epoch = 201906;
|
||||||
|
|
||||||
inputs = [ "flake1" "flake2" ];
|
inputs = [ "flake1" "flake2" ];
|
||||||
|
|
||||||
|
@ -192,7 +192,7 @@ nix build -o $TEST_ROOT/result --flake-registry $registry $flake3Dir:sth
|
||||||
[[ ! (-z $(git -C $flake3Dir diff master)) ]]
|
[[ ! (-z $(git -C $flake3Dir diff master)) ]]
|
||||||
|
|
||||||
# Unsupported epochs should be an error.
|
# Unsupported epochs should be an error.
|
||||||
sed -i $flake3Dir/flake.nix -e s/2019/2030/
|
sed -i $flake3Dir/flake.nix -e s/201906/201909/
|
||||||
nix build -o $TEST_ROOT/result --flake-registry $registry $flake3Dir:sth 2>&1 | grep 'unsupported epoch'
|
nix build -o $TEST_ROOT/result --flake-registry $registry $flake3Dir:sth 2>&1 | grep 'unsupported epoch'
|
||||||
|
|
||||||
# Test whether registry caching works.
|
# Test whether registry caching works.
|
||||||
|
@ -219,7 +219,7 @@ cat > $flake3Dir/flake.nix <<EOF
|
||||||
{
|
{
|
||||||
name = "flake3";
|
name = "flake3";
|
||||||
|
|
||||||
epoch = 2019;
|
epoch = 201906;
|
||||||
|
|
||||||
inputs = [ "flake1" "flake2" ];
|
inputs = [ "flake1" "flake2" ];
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue