mirror of
https://github.com/NixOS/nix
synced 2025-07-07 14:21:48 +02:00
Merge remote-tracking branch 'origin/2.27-maintenance' into mergify/bp/2.27-maintenance/pr-12869
This commit is contained in:
commit
95cd6c1e48
5 changed files with 60 additions and 66 deletions
|
@ -170,7 +170,7 @@
|
||||||
{
|
{
|
||||||
otherSplices = final.generateSplicesForMkScope "nixDependencies";
|
otherSplices = final.generateSplicesForMkScope "nixDependencies";
|
||||||
f = import ./packaging/dependencies.nix {
|
f = import ./packaging/dependencies.nix {
|
||||||
inherit inputs stdenv;
|
inherit stdenv;
|
||||||
pkgs = final;
|
pkgs = final;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,33 +1,14 @@
|
||||||
# These overrides are applied to the dependencies of the Nix components.
|
# These overrides are applied to the dependencies of the Nix components.
|
||||||
|
|
||||||
{
|
{
|
||||||
# Flake inputs; used for sources
|
|
||||||
inputs,
|
|
||||||
|
|
||||||
# The raw Nixpkgs, not affected by this scope
|
# The raw Nixpkgs, not affected by this scope
|
||||||
pkgs,
|
pkgs,
|
||||||
|
|
||||||
stdenv,
|
stdenv,
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
|
||||||
prevStdenv = stdenv;
|
|
||||||
in
|
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (pkgs) lib;
|
inherit (pkgs) lib;
|
||||||
|
|
||||||
stdenv = if prevStdenv.isDarwin && prevStdenv.isx86_64 then darwinStdenv else prevStdenv;
|
|
||||||
|
|
||||||
# Fix the following error with the default x86_64-darwin SDK:
|
|
||||||
#
|
|
||||||
# error: aligned allocation function of type 'void *(std::size_t, std::align_val_t)' is only available on macOS 10.13 or newer
|
|
||||||
#
|
|
||||||
# Despite the use of the 10.13 deployment target here, the aligned
|
|
||||||
# allocation function Clang uses with this setting actually works
|
|
||||||
# all the way back to 10.6.
|
|
||||||
darwinStdenv = pkgs.overrideSDK prevStdenv { darwinMinVersion = "10.13"; };
|
|
||||||
|
|
||||||
in
|
in
|
||||||
scope: {
|
scope: {
|
||||||
inherit stdenv;
|
inherit stdenv;
|
||||||
|
@ -65,13 +46,12 @@ scope: {
|
||||||
installPhase = lib.replaceStrings [ "--without-python" ] [ "" ] old.installPhase;
|
installPhase = lib.replaceStrings [ "--without-python" ] [ "" ] old.installPhase;
|
||||||
});
|
});
|
||||||
|
|
||||||
libgit2 = pkgs.libgit2.overrideAttrs (
|
libgit2 =
|
||||||
attrs:
|
if lib.versionAtLeast pkgs.libgit2.version "1.9.0" then
|
||||||
{
|
pkgs.libgit2
|
||||||
cmakeFlags = attrs.cmakeFlags or [ ] ++ [ "-DUSE_SSH=exec" ];
|
else
|
||||||
}
|
pkgs.libgit2.overrideAttrs (attrs: {
|
||||||
# libgit2: Nixpkgs 24.11 has < 1.9.0, which needs our patches
|
# libgit2: Nixpkgs 24.11 has < 1.9.0, which needs our patches
|
||||||
// lib.optionalAttrs (!lib.versionAtLeast pkgs.libgit2.version "1.9.0") {
|
|
||||||
nativeBuildInputs =
|
nativeBuildInputs =
|
||||||
attrs.nativeBuildInputs or [ ]
|
attrs.nativeBuildInputs or [ ]
|
||||||
# gitMinimal does not build on Windows. See packbuilder patch.
|
# gitMinimal does not build on Windows. See packbuilder patch.
|
||||||
|
@ -98,6 +78,5 @@ scope: {
|
||||||
# binary patch; see `prePatch`
|
# binary patch; see `prePatch`
|
||||||
./patches/libgit2-packbuilder-callback-interruptible.patch
|
./patches/libgit2-packbuilder-callback-interruptible.patch
|
||||||
];
|
];
|
||||||
}
|
});
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -532,14 +532,20 @@ struct GitInputScheme : InputScheme
|
||||||
return *head;
|
return *head;
|
||||||
}
|
}
|
||||||
|
|
||||||
static MakeNotAllowedError makeNotAllowedError(std::string url)
|
static MakeNotAllowedError makeNotAllowedError(std::filesystem::path repoPath)
|
||||||
{
|
{
|
||||||
return [url{std::move(url)}](const CanonPath & path) -> RestrictedPathError
|
return [repoPath{std::move(repoPath)}](const CanonPath & path) -> RestrictedPathError {
|
||||||
{
|
if (nix::pathExists(repoPath / path.rel()))
|
||||||
if (nix::pathExists(path.abs()))
|
return RestrictedPathError(
|
||||||
return RestrictedPathError("access to path '%s' is forbidden because it is not under Git control; maybe you should 'git add' it to the repository '%s'?", path, url);
|
"Path '%1%' in the repository %2% is not tracked by Git.\n"
|
||||||
|
"\n"
|
||||||
|
"To make it visible to Nix, run:\n"
|
||||||
|
"\n"
|
||||||
|
"git -C %2% add \"%1%\"",
|
||||||
|
path.rel(),
|
||||||
|
repoPath);
|
||||||
else
|
else
|
||||||
return RestrictedPathError("path '%s' does not exist in Git repository '%s'", path, url);
|
return RestrictedPathError("Path '%s' does not exist in Git repository %s.", path.rel(), repoPath);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -747,7 +753,7 @@ struct GitInputScheme : InputScheme
|
||||||
ref<SourceAccessor> accessor =
|
ref<SourceAccessor> accessor =
|
||||||
repo->getAccessor(repoInfo.workdirInfo,
|
repo->getAccessor(repoInfo.workdirInfo,
|
||||||
exportIgnore,
|
exportIgnore,
|
||||||
makeNotAllowedError(repoInfo.locationToArg()));
|
makeNotAllowedError(repoPath));
|
||||||
|
|
||||||
/* If the repo has submodules, return a mounted input accessor
|
/* If the repo has submodules, return a mounted input accessor
|
||||||
consisting of the accessor for the top-level repo and the
|
consisting of the accessor for the top-level repo and the
|
||||||
|
|
|
@ -29,7 +29,17 @@
|
||||||
|
|
||||||
namespace nix {
|
namespace nix {
|
||||||
|
|
||||||
namespace fs { using namespace std::filesystem; }
|
namespace fs {
|
||||||
|
using namespace std::filesystem;
|
||||||
|
|
||||||
|
bool symlink_exists(const std::filesystem::path & path) {
|
||||||
|
try {
|
||||||
|
return std::filesystem::exists(std::filesystem::symlink_status(path));
|
||||||
|
} catch (const std::filesystem::filesystem_error & e) {
|
||||||
|
throw SysError("cannot check existence of %1%", path);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool isAbsolute(PathView path)
|
bool isAbsolute(PathView path)
|
||||||
{
|
{
|
||||||
|
|
|
@ -134,6 +134,7 @@ bool pathExists(const Path & path);
|
||||||
namespace fs {
|
namespace fs {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* TODO: we may actually want to use pathExists instead of this function
|
||||||
* ```
|
* ```
|
||||||
* symlink_exists(p) = std::filesystem::exists(std::filesystem::symlink_status(p))
|
* symlink_exists(p) = std::filesystem::exists(std::filesystem::symlink_status(p))
|
||||||
* ```
|
* ```
|
||||||
|
@ -142,9 +143,7 @@ namespace fs {
|
||||||
* std::filesystem::exists(p) = std::filesystem::exists(std::filesystem::status(p))
|
* std::filesystem::exists(p) = std::filesystem::exists(std::filesystem::status(p))
|
||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
inline bool symlink_exists(const std::filesystem::path & path) {
|
bool symlink_exists(const std::filesystem::path & path);
|
||||||
return std::filesystem::exists(std::filesystem::symlink_status(path));
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace fs
|
} // namespace fs
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue