Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into meson-functional-…
Browse files Browse the repository at this point in the history
…tests
  • Loading branch information
Ericson2314 committed Jul 24, 2024
2 parents a0ffaba + 874c1bd commit 3519e78
Show file tree
Hide file tree
Showing 69 changed files with 878 additions and 128 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -208,3 +208,23 @@ jobs:
# Only meson packages that don't have a tests.run derivation.
# Those that have it are already built and tested as part of nix flake check.
- run: nix build -L .#hydraJobs.build.{nix-cmd,nix-main}.$(nix-instantiate --eval --expr builtins.currentSystem | sed -e 's/"//g')

flake_regressions:
needs: vm_tests
runs-on: ubuntu-22.04
steps:
- name: Checkout nix
uses: actions/checkout@v4
- name: Checkout flake-regressions
uses: actions/checkout@v4
with:
repository: NixOS/flake-regressions
path: flake-regressions
- name: Checkout flake-regressions-data
uses: actions/checkout@v4
with:
repository: NixOS/flake-regressions-data
path: flake-regressions/tests
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- run: nix build --out-link ./new-nix && PATH=$(pwd)/new-nix/bin:$PATH scripts/flake-regressions.sh
7 changes: 0 additions & 7 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -340,13 +340,6 @@ AC_CHECK_HEADERS([aws/s3/S3Client.h],
AC_SUBST(ENABLE_S3, [$enable_s3])
AC_LANG_POP(C++)
if test -n "$enable_s3"; then
declare -a aws_version_tokens=($(printf '#include <aws/core/VersionConfig.h>\nAWS_SDK_VERSION_STRING' | $CPP $CPPFLAGS - | grep -v '^#.*' | sed 's/"//g' | tr '.' ' '))
AC_DEFINE_UNQUOTED([AWS_VERSION_MAJOR], ${aws_version_tokens@<:@0@:>@}, [Major version of aws-sdk-cpp.])
AC_DEFINE_UNQUOTED([AWS_VERSION_MINOR], ${aws_version_tokens@<:@1@:>@}, [Minor version of aws-sdk-cpp.])
AC_DEFINE_UNQUOTED([AWS_VERSION_PATCH], ${aws_version_tokens@<:@2@:>@}, [Patch version of aws-sdk-cpp.])
fi
# Whether to use the Boehm garbage collector.
AC_ARG_ENABLE(gc, AS_HELP_STRING([--enable-gc],[enable garbage collection in the Nix expression evaluator (requires Boehm GC) [default=yes]]),
Expand Down
83 changes: 34 additions & 49 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 7 additions & 9 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
{
description = "The purely functional package manager";

# TODO switch to nixos-23.11-small
# https://nixpk.gs/pr-tracker.html?pr=291954
inputs.nixpkgs.url = "github:NixOS/nixpkgs/release-24.05";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
inputs.nixpkgs-regression.url = "github:NixOS/nixpkgs/215d4d0fd80ca5163643b03a33fde804a29cc1e2";
inputs.nixpkgs-23-11.url = "github:NixOS/nixpkgs/a62e6edd6d5e1fa0329b8653c801147986f8d446";
inputs.flake-compat = { url = "github:edolstra/flake-compat"; flake = false; };
inputs.libgit2 = { url = "github:libgit2/libgit2"; flake = false; };
inputs.libgit2 = { url = "github:libgit2/libgit2/v1.8.1"; flake = false; };

# dev tooling
inputs.flake-parts.url = "github:hercules-ci/flake-parts";
inputs.pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix";
inputs.git-hooks-nix.url = "github:cachix/git-hooks.nix";
# work around https://github.com/NixOS/nix/issues/7730
inputs.flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs";
inputs.pre-commit-hooks.inputs.nixpkgs.follows = "nixpkgs";
inputs.pre-commit-hooks.inputs.nixpkgs-stable.follows = "nixpkgs";
inputs.git-hooks-nix.inputs.nixpkgs.follows = "nixpkgs";
inputs.git-hooks-nix.inputs.nixpkgs-stable.follows = "nixpkgs";
# work around 7730 and https://github.com/NixOS/nix/issues/7807
inputs.pre-commit-hooks.inputs.flake-compat.follows = "";
inputs.pre-commit-hooks.inputs.gitignore.follows = "";
inputs.git-hooks-nix.inputs.flake-compat.follows = "";
inputs.git-hooks-nix.inputs.gitignore.follows = "";

outputs = inputs@{ self, nixpkgs, nixpkgs-regression, libgit2, ... }:

Expand Down
2 changes: 1 addition & 1 deletion maintainers/flake-module.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{
imports = [
inputs.pre-commit-hooks.flakeModule
inputs.git-hooks-nix.flakeModule
];

perSystem = { config, pkgs, ... }: {
Expand Down
11 changes: 10 additions & 1 deletion packaging/dependencies.nix
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ let
workDir = null;
};

# Work around weird `--as-needed` linker behavior with BSD, see
# https://github.com/mesonbuild/meson/issues/3593
bsdNoLinkAsNeeded = finalAttrs: prevAttrs: lib.optionalAttrs stdenv.hostPlatform.isBSD {
mesonFlags = [ (lib.mesonBool "b_asneeded" false) ] ++ prevAttrs.mesonFlags or [];
};

in
scope: {
inherit stdenv versionSuffix;
Expand Down Expand Up @@ -130,5 +136,8 @@ scope: {

inherit resolvePath filesetToSource;

mkMesonDerivation = f: stdenv.mkDerivation (lib.extends localSourceLayer f);
mkMesonDerivation = f: stdenv.mkDerivation
(lib.extends
(lib.composeExtensions bsdNoLinkAsNeeded localSourceLayer)
f);
}
27 changes: 27 additions & 0 deletions scripts/flake-regressions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#! /usr/bin/env bash

set -e

echo "Nix version:"
nix --version

cd flake-regressions

status=0

flakes=$(find tests -mindepth 3 -maxdepth 3 -type d -not -path '*/.*' | sort | head -n25)

echo "Running flake tests..."

for flake in $flakes; do

if ! REGENERATE=0 ./eval-flake.sh "$flake"; then
status=1
echo "$flake"
else
echo "$flake"
fi

done

exit "$status"
2 changes: 2 additions & 0 deletions src/libcmd/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ deps_public_maybe_subproject = [
]
subdir('build-utils-meson/subprojects')

subdir('build-utils-meson/threads')

nlohmann_json = dependency('nlohmann_json', version : '>= 3.9')
deps_public += nlohmann_json

Expand Down
2 changes: 2 additions & 0 deletions src/libexpr-c/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ deps_public_maybe_subproject = [
]
subdir('build-utils-meson/subprojects')

subdir('build-utils-meson/threads')

# TODO rename, because it will conflict with downstream projects
configdata.set_quoted('PACKAGE_VERSION', meson.project_version())

Expand Down
8 changes: 8 additions & 0 deletions src/libexpr/eval-error.cc
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,14 @@ void EvalErrorBuilder<T>::debugThrow()
throw error;
}

template<class T>
void EvalErrorBuilder<T>::panic()
{
logError(error.info());
printError("This is a bug! An unexpected condition occurred, causing the Nix evaluator to have to stop. If you could share a reproducible example or a core dump, please open an issue at https://github.com/NixOS/nix/issues");
abort();
}

template class EvalErrorBuilder<EvalBaseError>;
template class EvalErrorBuilder<EvalError>;
template class EvalErrorBuilder<AssertionError>;
Expand Down
6 changes: 6 additions & 0 deletions src/libexpr/eval-error.hh
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,12 @@ public:
* Delete the `EvalErrorBuilder` and throw the underlying exception.
*/
[[gnu::noinline, gnu::noreturn]] void debugThrow();

/**
* A programming error or fatal condition occurred. Abort the process for core dump and debugging.
* This does not print a proper backtrace, because unwinding the stack is destructive.
*/
[[gnu::noinline, gnu::noreturn]] void panic();
};

}
Loading

0 comments on commit 3519e78

Please sign in to comment.