mirror of
https://github.com/NixOS/nix.git
synced 2025-12-12 20:11:03 +01:00
Merge pull request #14731 from NixOS/fix-hydra-for-release
Fix failing hydra jobs for release
This commit is contained in:
commit
26bf932e41
3 changed files with 13 additions and 13 deletions
|
|
@ -63,7 +63,6 @@ let
|
||||||
"nix-cli"
|
"nix-cli"
|
||||||
"nix-functional-tests"
|
"nix-functional-tests"
|
||||||
"nix-json-schema-checks"
|
"nix-json-schema-checks"
|
||||||
"nix-kaitai-struct-checks"
|
|
||||||
]
|
]
|
||||||
++ lib.optionals enableBindings [
|
++ lib.optionals enableBindings [
|
||||||
"nix-perl-bindings"
|
"nix-perl-bindings"
|
||||||
|
|
@ -73,6 +72,7 @@ let
|
||||||
"nix-manual-manpages-only"
|
"nix-manual-manpages-only"
|
||||||
"nix-internal-api-docs"
|
"nix-internal-api-docs"
|
||||||
"nix-external-api-docs"
|
"nix-external-api-docs"
|
||||||
|
"nix-kaitai-struct-checks"
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
in
|
in
|
||||||
|
|
|
||||||
|
|
@ -232,22 +232,22 @@ TEST_F(nix_api_expr_test, nix_expr_realise_context)
|
||||||
nix_realised_string_free(r);
|
nix_realised_string_free(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * SAMPLE_USER_DATA = "whatever";
|
static const char SAMPLE_USER_DATA = 0;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
primop_square(void * user_data, nix_c_context * context, EvalState * state, nix_value ** args, nix_value * ret)
|
primop_square(void * user_data, nix_c_context * context, EvalState * state, nix_value ** args, nix_value * ret)
|
||||||
{
|
{
|
||||||
assert(context);
|
assert(context);
|
||||||
assert(state);
|
assert(state);
|
||||||
assert(user_data == SAMPLE_USER_DATA);
|
assert(user_data == &SAMPLE_USER_DATA);
|
||||||
auto i = nix_get_int(context, args[0]);
|
auto i = nix_get_int(context, args[0]);
|
||||||
nix_init_int(context, ret, i * i);
|
nix_init_int(context, ret, i * i);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(nix_api_expr_test, nix_expr_primop)
|
TEST_F(nix_api_expr_test, nix_expr_primop)
|
||||||
{
|
{
|
||||||
PrimOp * primop =
|
PrimOp * primop = nix_alloc_primop(
|
||||||
nix_alloc_primop(ctx, primop_square, 1, "square", nullptr, "square an integer", (void *) SAMPLE_USER_DATA);
|
ctx, primop_square, 1, "square", nullptr, "square an integer", const_cast<char *>(&SAMPLE_USER_DATA));
|
||||||
assert_ctx_ok();
|
assert_ctx_ok();
|
||||||
nix_value * primopValue = nix_alloc_value(ctx, state);
|
nix_value * primopValue = nix_alloc_value(ctx, state);
|
||||||
assert_ctx_ok();
|
assert_ctx_ok();
|
||||||
|
|
@ -273,7 +273,7 @@ primop_repeat(void * user_data, nix_c_context * context, EvalState * state, nix_
|
||||||
{
|
{
|
||||||
assert(context);
|
assert(context);
|
||||||
assert(state);
|
assert(state);
|
||||||
assert(user_data == SAMPLE_USER_DATA);
|
assert(user_data == &SAMPLE_USER_DATA);
|
||||||
|
|
||||||
// Get the string to repeat
|
// Get the string to repeat
|
||||||
std::string s;
|
std::string s;
|
||||||
|
|
@ -295,8 +295,8 @@ primop_repeat(void * user_data, nix_c_context * context, EvalState * state, nix_
|
||||||
|
|
||||||
TEST_F(nix_api_expr_test, nix_expr_primop_arity_2_multiple_calls)
|
TEST_F(nix_api_expr_test, nix_expr_primop_arity_2_multiple_calls)
|
||||||
{
|
{
|
||||||
PrimOp * primop =
|
PrimOp * primop = nix_alloc_primop(
|
||||||
nix_alloc_primop(ctx, primop_repeat, 2, "repeat", nullptr, "repeat a string", (void *) SAMPLE_USER_DATA);
|
ctx, primop_repeat, 2, "repeat", nullptr, "repeat a string", const_cast<char *>(&SAMPLE_USER_DATA));
|
||||||
assert_ctx_ok();
|
assert_ctx_ok();
|
||||||
nix_value * primopValue = nix_alloc_value(ctx, state);
|
nix_value * primopValue = nix_alloc_value(ctx, state);
|
||||||
assert_ctx_ok();
|
assert_ctx_ok();
|
||||||
|
|
@ -330,8 +330,8 @@ TEST_F(nix_api_expr_test, nix_expr_primop_arity_2_multiple_calls)
|
||||||
|
|
||||||
TEST_F(nix_api_expr_test, nix_expr_primop_arity_2_single_call)
|
TEST_F(nix_api_expr_test, nix_expr_primop_arity_2_single_call)
|
||||||
{
|
{
|
||||||
PrimOp * primop =
|
PrimOp * primop = nix_alloc_primop(
|
||||||
nix_alloc_primop(ctx, primop_repeat, 2, "repeat", nullptr, "repeat a string", (void *) SAMPLE_USER_DATA);
|
ctx, primop_repeat, 2, "repeat", nullptr, "repeat a string", const_cast<char *>(&SAMPLE_USER_DATA));
|
||||||
assert_ctx_ok();
|
assert_ctx_ok();
|
||||||
nix_value * primopValue = nix_alloc_value(ctx, state);
|
nix_value * primopValue = nix_alloc_value(ctx, state);
|
||||||
assert_ctx_ok();
|
assert_ctx_ok();
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,7 @@
|
||||||
{ nodes }: # python
|
{ nodes }: # python
|
||||||
''
|
''
|
||||||
import json
|
import json
|
||||||
|
import os
|
||||||
|
|
||||||
start_all()
|
start_all()
|
||||||
|
|
||||||
|
|
@ -118,9 +119,8 @@
|
||||||
|
|
||||||
# Get the NAR hash of the unpacked tarball in SRI format
|
# Get the NAR hash of the unpacked tarball in SRI format
|
||||||
path_info_json = substituter.succeed(f"nix path-info --json-format 2 --json {tarball_store_path}").strip()
|
path_info_json = substituter.succeed(f"nix path-info --json-format 2 --json {tarball_store_path}").strip()
|
||||||
path_info_dict = json.loads(path_info_json)
|
path_info_dict = json.loads(path_info_json)["info"]
|
||||||
# nix path-info returns a dict with store paths as keys
|
narHash_obj = path_info_dict[os.path.basename(tarball_store_path)]["narHash"]
|
||||||
narHash_obj = path_info_dict[tarball_store_path]["narHash"]
|
|
||||||
# Convert from structured format {"algorithm": "sha256", "format": "base16", "hash": "..."} to SRI string
|
# Convert from structured format {"algorithm": "sha256", "format": "base16", "hash": "..."} to SRI string
|
||||||
tarball_hash_sri = substituter.succeed(f"nix hash convert --to sri {narHash_obj['algorithm']}:{narHash_obj['hash']}").strip()
|
tarball_hash_sri = substituter.succeed(f"nix hash convert --to sri {narHash_obj['algorithm']}:{narHash_obj['hash']}").strip()
|
||||||
print(f"Tarball NAR hash (SRI): {tarball_hash_sri}")
|
print(f"Tarball NAR hash (SRI): {tarball_hash_sri}")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue