Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions default.nix
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
lib,
stdenv,
boost182,
boost,
gtest,
lit,
llvmPackages,
meson,
ninja,
nix,
nixComponents,
pkg-config,
nlohmann_json,
python312,
Expand All @@ -31,9 +31,12 @@ stdenv.mkDerivation {
nativeCheckInputs = [ lit ];

buildInputs = [
nix
nixComponents.nix-main
nixComponents.nix-expr
nixComponents.nix-cmd
nixComponents.nix-flake
gtest
boost182
boost
llvmPackages.llvm
nlohmann_json
];
Expand Down
7 changes: 4 additions & 3 deletions flake.lock

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

13 changes: 6 additions & 7 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
inputs = {
# Temporary, until channel catchs up with Nix 2.28
nixpkgs.url = "github:NixOS/nixpkgs";
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";

flake-parts.url = "github:hercules-ci/flake-parts";

Expand Down Expand Up @@ -34,15 +33,15 @@
callPackage
stdenv
;
nix = nixVersions.nix_2_28;
nixComponents = nixVersions.nixComponents_2_30;
llvmPackages = llvmPackages_19;
nixf = callPackage ./libnixf { };
nixt = callPackage ./libnixt { inherit nix; };
nixt = callPackage ./libnixt { inherit nixComponents; };
nixd = callPackage ./nixd {
inherit nix nixf nixt;
inherit nixComponents nixf nixt;
inherit llvmPackages;
};
nixdMono = callPackage ./. { inherit nix llvmPackages; };
nixdMono = callPackage ./. { inherit nixComponents llvmPackages; };
nixdLLVM = nixdMono.override { stdenv = if stdenv.isDarwin then stdenv else llvmPackages.stdenv; };
regressionDeps = with pkgs; [
clang-tools
Expand All @@ -53,7 +52,7 @@
nativeBuildInputs = old.nativeBuildInputs ++ regressionDeps;
shellHook = ''
export PATH="${pkgs.clang-tools}/bin:$PATH"
export NIX_SRC=${nix.src}
export NIX_SRC=${nixComponents.src}
export NIX_PATH=nixpkgs=${nixpkgs}
'';
hardeningDisable = [ "fortify" ];
Expand Down
4 changes: 2 additions & 2 deletions libnixf/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
pkg-config,
lit,
gtest,
boost182,
boost,
nlohmann_json,
python312,
}:
Expand Down Expand Up @@ -40,7 +40,7 @@ stdenv.mkDerivation {

buildInputs = [
gtest
boost182
boost
nlohmann_json
];

Expand Down
11 changes: 7 additions & 4 deletions libnixt/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
meson,
ninja,
pkg-config,
nix,
gtest,
boost182,
boost,
nixComponents,
}:

stdenv.mkDerivation {
Expand All @@ -33,9 +33,12 @@ stdenv.mkDerivation {
];

buildInputs = [
nix
nixComponents.nix-main
nixComponents.nix-expr
nixComponents.nix-cmd
nixComponents.nix-flake
gtest
boost182
boost
];

meta = {
Expand Down
2 changes: 1 addition & 1 deletion libnixt/test/StateTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include <nix/cmd/common-eval-args.hh>
#include <nix/expr/eval.hh>
#include <nix/store/store-api.hh>
#include <nix/store/store-open.hh>

namespace nixt {

Expand Down
10 changes: 6 additions & 4 deletions nixd/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
meson,
ninja,
pkg-config,
nix,
nixComponents,
nixf,
nixt,
llvmPackages,
gtest,
boost182,
boost,
}:

let
Expand Down Expand Up @@ -39,12 +39,14 @@ stdenv.mkDerivation {
];

buildInputs = [
nix
nixComponents.nix-expr
nixComponents.nix-main
nixComponents.nix-cmd
nixf
nixt
llvmPackages.llvm
gtest
boost182
boost
];

meta = {
Expand Down
5 changes: 4 additions & 1 deletion nixd/include/nixd/Controller/Controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,10 @@ class Controller : public lspserver::LSPServer {
return TU ? getAST(*TU) : nullptr;
}

boost::asio::thread_pool Pool;
// Default constructor is broken in Boost 1.87:
// https://github.com/boostorg/asio/commit/30b5974ed34bfa321d268b3135ffaffcb261461a
boost::asio::thread_pool Pool{
static_cast<size_t>(boost::asio::detail::default_thread_pool_size())};

/// Action right after a document is added (including updates).
void actOnDocumentAdd(lspserver::PathRef File,
Expand Down
6 changes: 3 additions & 3 deletions nixd/lib/Eval/AttrSetProvider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <nix/cmd/common-eval-args.hh>
#include <nix/expr/attr-path.hh>
#include <nix/expr/nixexpr.hh>
#include <nix/store/store-api.hh>
#include <nix/store/store-open.hh>
#include <nixt/Value.h>

using namespace nixd;
Expand Down Expand Up @@ -101,7 +101,7 @@ void fillOptionDeclarationPositions(nix::EvalState &State, nix::Value &V,
State.forceValue(V, nix::noPos);
if (V.type() != nix::ValueType::nList)
return;
for (nix::Value *Item : V.listItems()) {
for (nix::Value *Item : V.listView()) {
// Each item should have "column", "line", "file" fields.
lspserver::Location Loc;
fillUnsafeGetAttrPosLocation(State, *Item, Loc);
Expand Down Expand Up @@ -195,7 +195,7 @@ std::optional<ValueDescription> describeValue(nix::EvalState &State,
.Args = PrimOp->args,
};
} else if (V.isLambda()) {
auto *Lambda = V.payload.lambda.fun;
auto *Lambda = V.lambda().fun;
assert(Lambda);
const auto DocComment = Lambda->docComment;

Expand Down
Loading