More fixes

This commit is contained in:
John Ericson 2024-06-27 19:19:32 -04:00
parent 5ba9f6cec6
commit 479befa76d
30 changed files with 101 additions and 67 deletions

View file

@ -324,6 +324,7 @@
++ pkgs.nixComponents.nix-internal-api-docs.nativeBuildInputs
++ pkgs.nixComponents.nix-external-api-docs.nativeBuildInputs
++ [
pkgs.buildPackages.cmake
modular.pre-commit.settings.package
(pkgs.writeScriptBin "pre-commit-hooks-install"
modular.pre-commit.settings.installationScript)

View file

@ -13,8 +13,8 @@ subproject('libexpr')
subproject('libflake')
# Docs
#subproject('internal-api-docs')
#subproject('external-api-docs')
subproject('internal-api-docs')
subproject('external-api-docs')
# C wrappers
subproject('libutil-c')

View file

@ -62,9 +62,11 @@ mkDerivation (finalAttrs: {
];
preConfigure =
# "Inline" .version so it's not a symlink, and includes the suffix
# "Inline" .version so it's not a symlink, and includes the suffix.
# Do the meson utils, without modification.
''
echo ${version} > .version
cp -r ${../../build-utils-meson} build-utils-meson
'';
mesonFlags = [

View file

@ -64,9 +64,11 @@ mkDerivation (finalAttrs: {
];
preConfigure =
# "Inline" .version so it's not a symlink, and includes the suffix
# "Inline" .version so it's not a symlink, and includes the suffix.
# Do the meson utils, without modification.
''
echo ${version} > .version
cp -r ${../../build-utils-meson} build-utils-meson
'';
mesonFlags = [

View file

@ -17,18 +17,12 @@ cxx = meson.get_compiler('cpp')
subdir('build-utils-meson/deps-lists')
deps_private_maybe_subproject = [
]
deps_public_maybe_subproject = [
dependency('nix-util'),
dependency('nix-util-c'),
dependency('nix-util-test-support'),
dependency('nix-store'),
dependency('nix-store-c'),
dependency('nix-store-test-support'),
dependency('nix-expr'),
dependency('nix-expr-c'),
dependency('nix-expr-test-support'),
]
deps_public_maybe_subproject = [
]
subdir('build-utils-meson/subprojects')
subdir('build-utils-meson/export-all-symbols')

View file

@ -69,9 +69,11 @@ mkDerivation (finalAttrs: {
];
preConfigure =
# "Inline" .version so it's not a symlink, and includes the suffix
# "Inline" .version so it's not a symlink, and includes the suffix.
# Do the meson utils, without modification.
''
echo ${version} > .version
cp -r ${../../build-utils-meson} build-utils-meson
'';
mesonFlags = [

View file

@ -293,7 +293,7 @@ EvalState::EvalState(
)}
, callFlakeInternal{internalFS->addFile(
CanonPath("call-flake.nix"),
#include "flake/call-flake.nix.gen.hh"
#include "call-flake.nix.gen.hh"
)}
, store(store)
, buildStore(buildStore ? buildStore : store)

View file

@ -47,4 +47,4 @@ $(foreach i, $(wildcard src/libexpr/value/*.hh), \
$(d)/primops.cc: $(d)/imported-drv-to-derivation.nix.gen.hh
$(d)/eval.cc: $(d)/primops/derivation.nix.gen.hh $(d)/fetchurl.nix.gen.hh $(d)/flake/call-flake.nix.gen.hh
$(d)/eval.cc: $(d)/primops/derivation.nix.gen.hh $(d)/fetchurl.nix.gen.hh $(d)/call-flake.nix.gen.hh

View file

@ -55,6 +55,9 @@ if bdw_gc.found()
endif
configdata.set('HAVE_BOEHMGC', bdw_gc.found().to_int())
toml11 = dependency('toml11', version : '>=3.7.0', method : 'cmake')
deps_other += toml11
config_h = configure_file(
configuration : configdata,
output : 'config-expr.hh',
@ -117,8 +120,7 @@ generated_headers = []
foreach header : [
'imported-drv-to-derivation.nix',
'fetchurl.nix',
'flake/call-flake.nix',
'primops/derivation.nix',
'call-flake.nix',
]
generated_headers += custom_target(
command : [ 'bash', '-c', '{ echo \'R"__NIX_STR(\' && cat @INPUT@ && echo \')__NIX_STR"\'; } > "$1"', '_ignored_argv0', '@OUTPUT@' ],
@ -142,11 +144,6 @@ sources = files(
'nixexpr.cc',
'paths.cc',
'primops.cc',
'primops/context.cc',
'primops/fetchClosure.cc',
'primops/fetchMercurial.cc',
'primops/fetchTree.cc',
'primops/fromTOML.cc',
'print-ambiguous.cc',
'print.cc',
'search-path.cc',
@ -187,6 +184,8 @@ headers = [config_h] + files(
'value/context.hh',
)
subdir('primops')
this_library = library(
'nixexpr',
sources,

View file

@ -5,6 +5,9 @@
, meson
, ninja
, pkg-config
, bison
, flex
, cmake # for resolving toml11 dep
, nix-util
, nix-store
@ -12,6 +15,7 @@
, boost
, boehmgc
, nlohmann_json
, toml11
# Configuration Options
@ -57,8 +61,12 @@ mkDerivation (finalAttrs: {
fileset = fileset.unions [
./meson.build
./meson.options
./primops/meson.build
(fileset.fileFilter (file: file.hasExt "cc") ./.)
(fileset.fileFilter (file: file.hasExt "hh") ./.)
./lexer.l
./parser.y
(fileset.fileFilter (file: file.hasExt "nix") ./.)
];
};
@ -68,6 +76,13 @@ mkDerivation (finalAttrs: {
meson
ninja
pkg-config
bison
flex
cmake
];
buildInputs = [
toml11
];
propagatedBuildInputs = [
@ -79,9 +94,11 @@ mkDerivation (finalAttrs: {
] ++ lib.optional enableGC boehmgc;
preConfigure =
# "Inline" .version so it's not a symlink, and includes the suffix
# "Inline" .version so it's not a symlink, and includes the suffix.
# Do the meson utils, without modification.
''
echo ${version} > .version
cp -r ${../../build-utils-meson} build-utils-meson
'';
mesonFlags = [

View file

@ -0,0 +1,17 @@
foreach header : [
'derivation.nix',
]
generated_headers += custom_target(
command : [ 'bash', '-c', '{ echo \'R"__NIX_STR(\' && cat @INPUT@ && echo \')__NIX_STR"\'; } > "$1"', '_ignored_argv0', '@OUTPUT@' ],
input : header,
output : '@PLAINNAME@.gen.hh',
)
endforeach
sources += files(
'context.cc',
'fetchClosure.cc',
'fetchMercurial.cc',
'fetchTree.cc',
'fromTOML.cc',
)

View file

@ -17,16 +17,11 @@ cxx = meson.get_compiler('cpp')
subdir('build-utils-meson/deps-lists')
deps_private_maybe_subproject = [
]
deps_public_maybe_subproject = [
dependency('nix-util'),
dependency('nix-util-c'),
dependency('nix-util-test-support'),
dependency('nix-store'),
dependency('nix-store-c'),
dependency('nix-store-test-support'),
dependency('nix-fetchers'),
]
deps_public_maybe_subproject = [
]
subdir('build-utils-meson/subprojects')
subdir('build-utils-meson/export-all-symbols')
@ -43,8 +38,6 @@ add_project_arguments(
'-include', 'config-util.hh',
'-include', 'config-store.hh',
'-include', 'config-store.hh',
'-include', 'config-util.h',
'-include', 'config-store.h',
language : 'cpp',
)

View file

@ -67,9 +67,11 @@ mkDerivation (finalAttrs: {
];
preConfigure =
# "Inline" .version so it's not a symlink, and includes the suffix
# "Inline" .version so it's not a symlink, and includes the suffix.
# Do the meson utils, without modification.
''
echo ${version} > .version
cp -r ${../../build-utils-meson} build-utils-meson
'';
mesonFlags = [

View file

@ -30,7 +30,7 @@ nlohmann_json = dependency('nlohmann_json', version : '>= 3.9')
deps_public += nlohmann_json
libgit2 = dependency('libgit2')
deps_public += libgit2
deps_private += libgit2
add_project_arguments(
# TODO(Qyriad): Yes this is how the autoconf+Make system did it.

View file

@ -69,9 +69,11 @@ mkDerivation (finalAttrs: {
];
preConfigure =
# "Inline" .version so its not a symlink, and includes the suffix
# "Inline" .version so it's not a symlink, and includes the suffix.
# Do the meson utils, without modification.
''
echo ${version} > .version
cp -r ${../../build-utils-meson} build-utils-meson
'';
env = lib.optionalAttrs (stdenv.isLinux && !(stdenv.hostPlatform.isStatic && stdenv.system == "aarch64-linux")) {

View file

@ -17,19 +17,11 @@ cxx = meson.get_compiler('cpp')
subdir('build-utils-meson/deps-lists')
deps_private_maybe_subproject = [
]
deps_public_maybe_subproject = [
dependency('nix-util'),
dependency('nix-util-c'),
dependency('nix-util-test-support'),
dependency('nix-store'),
dependency('nix-store-c'),
dependency('nix-store-test-support'),
dependency('nix-expr'),
dependency('nix-expr-c'),
dependency('nix-expr-test-support'),
dependency('nix-flake'),
]
deps_public_maybe_subproject = [
]
subdir('build-utils-meson/subprojects')
subdir('build-utils-meson/export-all-symbols')
@ -46,9 +38,6 @@ add_project_arguments(
'-include', 'config-util.hh',
'-include', 'config-store.hh',
'-include', 'config-expr.hh',
'-include', 'config-util.h',
'-include', 'config-store.h',
'-include', 'config-expr.h',
language : 'cpp',
)

View file

@ -67,9 +67,11 @@ mkDerivation (finalAttrs: {
];
preConfigure =
# "Inline" .version so it's not a symlink, and includes the suffix
# "Inline" .version so it's not a symlink, and includes the suffix.
# Do the meson utils, without modification.
''
echo ${version} > .version
cp -r ${../../build-utils-meson} build-utils-meson
'';
mesonFlags = [

View file

@ -29,9 +29,6 @@ subdir('build-utils-meson/subprojects')
nlohmann_json = dependency('nlohmann_json', version : '>= 3.9')
deps_public += nlohmann_json
libgit2 = dependency('libgit2')
deps_public += libgit2
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.

View file

@ -69,9 +69,11 @@ mkDerivation (finalAttrs: {
];
preConfigure =
# "Inline" .version so its not a symlink, and includes the suffix
# "Inline" .version so it's not a symlink, and includes the suffix.
# Do the meson utils, without modification.
''
echo ${version} > .version
cp -r ${../../build-utils-meson} build-utils-meson
'';
env = lib.optionalAttrs (stdenv.isLinux && !(stdenv.hostPlatform.isStatic && stdenv.system == "aarch64-linux")) {

View file

@ -62,9 +62,11 @@ mkDerivation (finalAttrs: {
];
preConfigure =
# "Inline" .version so it's not a symlink, and includes the suffix
# "Inline" .version so it's not a symlink, and includes the suffix.
# Do the meson utils, without modification.
''
echo ${version} > .version
cp -r ${../../build-utils-meson} build-utils-meson
'';
mesonFlags = [

View file

@ -64,9 +64,11 @@ mkDerivation (finalAttrs: {
];
preConfigure =
# "Inline" .version so it's not a symlink, and includes the suffix
# "Inline" .version so it's not a symlink, and includes the suffix.
# Do the meson utils, without modification.
''
echo ${version} > .version
cp -r ${../../build-utils-meson} build-utils-meson
'';
mesonFlags = [

View file

@ -17,15 +17,12 @@ cxx = meson.get_compiler('cpp')
subdir('build-utils-meson/deps-lists')
deps_private_maybe_subproject = [
]
deps_public_maybe_subproject = [
dependency('nix-util'),
dependency('nix-util-c'),
dependency('nix-util-test-support'),
dependency('nix-store'),
dependency('nix-store-c'),
dependency('nix-store-test-support'),
]
deps_public_maybe_subproject = [
]
subdir('build-utils-meson/subprojects')
subdir('build-utils-meson/export-all-symbols')

View file

@ -69,9 +69,11 @@ mkDerivation (finalAttrs: {
];
preConfigure =
# "Inline" .version so it's not a symlink, and includes the suffix
# "Inline" .version so it's not a symlink, and includes the suffix.
# Do the meson utils, without modification.
''
echo ${version} > .version
cp -r ${../../build-utils-meson} build-utils-meson
'';
mesonFlags = [

View file

@ -87,9 +87,11 @@ mkDerivation (finalAttrs: {
];
preConfigure =
# "Inline" .version so it's not a symlink, and includes the suffix
# "Inline" .version so it's not a symlink, and includes the suffix.
# Do the meson utils, without modification.
''
echo ${version} > .version
cp -r ${../../build-utils-meson} build-utils-meson
'';
mesonFlags = [

View file

@ -60,9 +60,11 @@ mkDerivation (finalAttrs: {
];
preConfigure =
# "Inline" .version so it's not a symlink, and includes the suffix
# "Inline" .version so it's not a symlink, and includes the suffix.
# Do the meson utils, without modification.
''
echo ${version} > .version
cp -r ${../../build-utils-meson} build-utils-meson
'';
mesonFlags = [

View file

@ -62,9 +62,11 @@ mkDerivation (finalAttrs: {
];
preConfigure =
# "Inline" .version so it's not a symlink, and includes the suffix
# "Inline" .version so it's not a symlink, and includes the suffix.
# Do the meson utils, without modification.
''
echo ${version} > .version
cp -r ${../../build-utils-meson} build-utils-meson
'';
mesonFlags = [

View file

@ -17,12 +17,12 @@ cxx = meson.get_compiler('cpp')
subdir('build-utils-meson/deps-lists')
deps_private_maybe_subproject = [
]
deps_public_maybe_subproject = [
dependency('nix-util'),
dependency('nix-util-c'),
dependency('nix-util-test-support'),
]
deps_public_maybe_subproject = [
]
subdir('build-utils-meson/subprojects')
subdir('build-utils-meson/export-all-symbols')

View file

@ -69,9 +69,11 @@ mkDerivation (finalAttrs: {
];
preConfigure =
# "Inline" .version so it's not a symlink, and includes the suffix
# "Inline" .version so it's not a symlink, and includes the suffix.
# Do the meson utils, without modification.
''
echo ${version} > .version
cp -r ${../../build-utils-meson} build-utils-meson
'';
mesonFlags = [

View file

@ -79,9 +79,11 @@ mkMesonDerivation (finalAttrs: {
preConfigure =
# TODO: change release process to add `pre` in `.version`, remove it before tagging, and restore after.
# Do the meson utils, without modification.
''
chmod u+w ./.version
echo ${version} > ../../.version
cp -r ${../../build-utils-meson} build-utils-meson
'';
mesonFlags = [