1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-12-15 05:21:03 +01:00

Tagging release 2.28.0

-----BEGIN PGP SIGNATURE-----
 
 iQFHBAABCAAxFiEEtUHVUwEnDgvPFcpdgXC0cm1xmN4FAmfv9fITHGVkb2xzdHJh
 QGdtYWlsLmNvbQAKCRCBcLRybXGY3ohrCAC1Uw/JJr3yEPlJ/jLc9t9HqEKMY08W
 W6SEjpYJHYixMXmoonexkqojncNWBaiytRa+vBY7JQq0xTOOBwj42TM2ZzMF4GXi
 vO4Ox0hEsRa/v7tSmK6GFz1sNEKEUOHDNbilg4kzkkBHPEGPUGMwdWkT0akO576Q
 SQ6ERwPPLsHDI2YtAeAD8R4p07CraiyA34ljDPz3rChTAXRPVKWxJUt1enwEWYTr
 cKk45RcR4S8rP1BVwf3wsNsrHjqjbaY45kPAo8GD79hFH0zkyJarS3Kgv8qsWLra
 9ph0DVVG0wiArlET7Y3uchqtAC0Z5LOnutAmOFYFw6DKfWp9yGfl/SVW
 =XRda
 -----END PGP SIGNATURE-----

Merge tag '2.28.0' into sync-2.28.0

Tagging release 2.28.0
This commit is contained in:
Eelco Dolstra 2025-04-04 17:49:15 +02:00
commit 852075ec9d
697 changed files with 4531 additions and 3970 deletions

View file

@ -0,0 +1,71 @@
#include <regex>
#include <rapidcheck.h>
#include "nix/store/tests/derived-path.hh"
namespace rc {
using namespace nix;
Gen<SingleDerivedPath::Opaque> Arbitrary<SingleDerivedPath::Opaque>::arbitrary()
{
return gen::map(gen::arbitrary<StorePath>(), [](StorePath path) {
return DerivedPath::Opaque{
.path = path,
};
});
}
Gen<SingleDerivedPath::Built> Arbitrary<SingleDerivedPath::Built>::arbitrary()
{
return gen::mapcat(gen::arbitrary<SingleDerivedPath>(), [](SingleDerivedPath drvPath) {
return gen::map(gen::arbitrary<StorePathName>(), [drvPath](StorePathName outputPath) {
return SingleDerivedPath::Built{
.drvPath = make_ref<SingleDerivedPath>(drvPath),
.output = outputPath.name,
};
});
});
}
Gen<DerivedPath::Built> Arbitrary<DerivedPath::Built>::arbitrary()
{
return gen::mapcat(gen::arbitrary<SingleDerivedPath>(), [](SingleDerivedPath drvPath) {
return gen::map(gen::arbitrary<OutputsSpec>(), [drvPath](OutputsSpec outputs) {
return DerivedPath::Built{
.drvPath = make_ref<SingleDerivedPath>(drvPath),
.outputs = outputs,
};
});
});
}
Gen<SingleDerivedPath> Arbitrary<SingleDerivedPath>::arbitrary()
{
return gen::mapcat(gen::inRange<uint8_t>(0, std::variant_size_v<SingleDerivedPath::Raw>), [](uint8_t n) {
switch (n) {
case 0:
return gen::map(gen::arbitrary<SingleDerivedPath::Opaque>(), [](SingleDerivedPath a) { return a; });
case 1:
return gen::map(gen::arbitrary<SingleDerivedPath::Built>(), [](SingleDerivedPath a) { return a; });
default:
assert(false);
}
});
}
Gen<DerivedPath> Arbitrary<DerivedPath>::arbitrary()
{
return gen::mapcat(gen::inRange<uint8_t>(0, std::variant_size_v<DerivedPath::Raw>), [](uint8_t n) {
switch (n) {
case 0:
return gen::map(gen::arbitrary<DerivedPath::Opaque>(), [](DerivedPath a) { return a; });
case 1:
return gen::map(gen::arbitrary<DerivedPath::Built>(), [](DerivedPath a) { return a; });
default:
assert(false);
}
});
}
}

View file

@ -3,10 +3,10 @@
#include <rapidcheck/gen/Arbitrary.h>
#include <derived-path.hh>
#include "nix/store/derived-path.hh"
#include "tests/path.hh"
#include "tests/outputs-spec.hh"
#include "nix/store/tests/path.hh"
#include "nix/store/tests/outputs-spec.hh"
namespace rc {
using namespace nix;

View file

@ -4,7 +4,7 @@
#include <gtest/gtest.h>
#include <gmock/gmock.h>
#include "store-api.hh"
#include "nix/store/store-api.hh"
namespace nix {

View file

@ -0,0 +1,12 @@
# Public headers directory
include_dirs = [include_directories('../../..')]
headers = files(
'derived-path.hh',
'libstore.hh',
'nix_api_store.hh',
'outputs-spec.hh',
'path.hh',
'protocol.hh',
)

View file

@ -1,8 +1,8 @@
#pragma once
///@file
#include "tests/nix_api_util.hh"
#include "nix/util/tests/nix_api_util.hh"
#include "file-system.hh"
#include "nix/util/file-system.hh"
#include <filesystem>
#include "nix_api_store.h"

View file

@ -3,9 +3,9 @@
#include <rapidcheck/gen/Arbitrary.h>
#include <outputs-spec.hh>
#include "nix/store/outputs-spec.hh"
#include "tests/path.hh"
#include "nix/store/tests/path.hh"
namespace rc {
using namespace nix;

View file

@ -3,7 +3,7 @@
#include <rapidcheck/gen/Arbitrary.h>
#include <path.hh>
#include "nix/store/path.hh"
namespace nix {

View file

@ -4,8 +4,8 @@
#include <nlohmann/json.hpp>
#include <gtest/gtest.h>
#include "tests/libstore.hh"
#include "tests/characterization.hh"
#include "nix/store/tests/libstore.hh"
#include "nix/util/tests/characterization.hh"
namespace nix {

View file

@ -27,32 +27,15 @@ subdir('nix-meson-build-support/subprojects')
rapidcheck = dependency('rapidcheck')
deps_public += rapidcheck
add_project_arguments(
# TODO(Qyriad): Yes this is how the autoconf+Make system did it.
# It would be nice for our headers to be idempotent instead.
'-include', 'config-util.hh',
'-include', 'config-store.hh',
language : 'cpp',
)
subdir('nix-meson-build-support/common')
sources = files(
'tests/derived-path.cc',
'tests/outputs-spec.cc',
'tests/path.cc',
'derived-path.cc',
'outputs-spec.cc',
'path.cc',
)
include_dirs = [include_directories('.')]
headers = files(
'tests/derived-path.hh',
'tests/libstore.hh',
'tests/nix_api_store.hh',
'tests/outputs-spec.hh',
'tests/path.hh',
'tests/protocol.hh',
)
subdir('include/nix/store/tests')
subdir('nix-meson-build-support/export-all-symbols')
subdir('nix-meson-build-support/windows-version')
@ -69,7 +52,7 @@ this_library = library(
install : true,
)
install_headers(headers, subdir : 'nix', preserve_path : true)
install_headers(headers, subdir : 'nix/store/tests', preserve_path : true)
libraries_private = []

View file

@ -0,0 +1,26 @@
#include "nix/store/tests/outputs-spec.hh"
#include <rapidcheck.h>
namespace rc {
using namespace nix;
Gen<OutputsSpec> Arbitrary<OutputsSpec>::arbitrary()
{
return gen::mapcat(
gen::inRange<uint8_t>(0, std::variant_size_v<OutputsSpec::Raw>), [](uint8_t n) -> Gen<OutputsSpec> {
switch (n) {
case 0:
return gen::just((OutputsSpec) OutputsSpec::All{});
case 1:
return gen::map(
gen::nonEmpty(gen::container<StringSet>(
gen::map(gen::arbitrary<StorePathName>(), [](StorePathName n) { return n.name; }))),
[](StringSet names) { return (OutputsSpec) OutputsSpec::Names{names}; });
default:
assert(false);
}
});
}
}

View file

@ -29,6 +29,7 @@ mkMesonLibrary (finalAttrs: {
./.version
./meson.build
# ./meson.options
./include/nix/store/tests/meson.build
(fileset.fileFilter (file: file.hasExt "cc") ./.)
(fileset.fileFilter (file: file.hasExt "hh") ./.)
];

View file

@ -3,11 +3,11 @@
#include <rapidcheck.h>
#include "path-regex.hh"
#include "store-api.hh"
#include "nix/store/path-regex.hh"
#include "nix/store/store-api.hh"
#include "tests/hash.hh"
#include "tests/path.hh"
#include "nix/util/tests/hash.hh"
#include "nix/store/tests/path.hh"
namespace nix {

View file

@ -1,57 +0,0 @@
#include <regex>
#include <rapidcheck.h>
#include "tests/derived-path.hh"
namespace rc {
using namespace nix;
Gen<SingleDerivedPath::Opaque> Arbitrary<SingleDerivedPath::Opaque>::arbitrary()
{
return gen::just(DerivedPath::Opaque {
.path = *gen::arbitrary<StorePath>(),
});
}
Gen<SingleDerivedPath::Built> Arbitrary<SingleDerivedPath::Built>::arbitrary()
{
return gen::just(SingleDerivedPath::Built {
.drvPath = make_ref<SingleDerivedPath>(*gen::arbitrary<SingleDerivedPath>()),
.output = (*gen::arbitrary<StorePathName>()).name,
});
}
Gen<DerivedPath::Built> Arbitrary<DerivedPath::Built>::arbitrary()
{
return gen::just(DerivedPath::Built {
.drvPath = make_ref<SingleDerivedPath>(*gen::arbitrary<SingleDerivedPath>()),
.outputs = *gen::arbitrary<OutputsSpec>(),
});
}
Gen<SingleDerivedPath> Arbitrary<SingleDerivedPath>::arbitrary()
{
switch (*gen::inRange<uint8_t>(0, std::variant_size_v<SingleDerivedPath::Raw>)) {
case 0:
return gen::just<SingleDerivedPath>(*gen::arbitrary<SingleDerivedPath::Opaque>());
case 1:
return gen::just<SingleDerivedPath>(*gen::arbitrary<SingleDerivedPath::Built>());
default:
assert(false);
}
}
Gen<DerivedPath> Arbitrary<DerivedPath>::arbitrary()
{
switch (*gen::inRange<uint8_t>(0, std::variant_size_v<DerivedPath::Raw>)) {
case 0:
return gen::just<DerivedPath>(*gen::arbitrary<DerivedPath::Opaque>());
case 1:
return gen::just<DerivedPath>(*gen::arbitrary<DerivedPath::Built>());
default:
assert(false);
}
}
}

View file

@ -1,24 +0,0 @@
#include "tests/outputs-spec.hh"
#include <rapidcheck.h>
namespace rc {
using namespace nix;
Gen<OutputsSpec> Arbitrary<OutputsSpec>::arbitrary()
{
switch (*gen::inRange<uint8_t>(0, std::variant_size_v<OutputsSpec::Raw>)) {
case 0:
return gen::just((OutputsSpec) OutputsSpec::All { });
case 1:
return gen::just((OutputsSpec) OutputsSpec::Names {
*gen::nonEmpty(gen::container<StringSet>(gen::map(
gen::arbitrary<StorePathName>(),
[](StorePathName n) { return n.name; }))),
});
default:
assert(false);
}
}
}