mirror of
https://github.com/NixOS/nix
synced 2025-07-06 21:41:48 +02:00
Progress on Wine CI support, MinGW dev shell with Meson (#10975)
* Only build perl subproject on Linux * Fix various Windows regressions * Don't put the emulator hook in test builds We run the tests in a separate derivation. Only need it for the dev shell. * Fix native dev shells * Fix cross dev shells we don't know how to emulate Co-authored-by: PoweredByPie <poweredbypie@users.noreply.github.com> Co-authored-by: Joachim Schiele <js@lastlog.de> Co-authored-by: John Ericson <John.Ericson@Obsidian.Systems>
This commit is contained in:
parent
56757e15cf
commit
0ec5e3a1bc
9 changed files with 49 additions and 29 deletions
|
@ -14,10 +14,10 @@
|
|||
#include "nix_api_util.h"
|
||||
#include "nix_api_util_internal.h"
|
||||
|
||||
#ifdef HAVE_BOEHMGC
|
||||
#include <mutex>
|
||||
#define GC_INCLUDE_NEW 1
|
||||
#include "gc_cpp.h"
|
||||
#if HAVE_BOEHMGC
|
||||
# include <mutex>
|
||||
# define GC_INCLUDE_NEW 1
|
||||
# include "gc_cpp.h"
|
||||
#endif
|
||||
|
||||
nix_err nix_libexpr_init(nix_c_context * context)
|
||||
|
@ -131,7 +131,7 @@ void nix_state_free(EvalState * state)
|
|||
delete state;
|
||||
}
|
||||
|
||||
#ifdef HAVE_BOEHMGC
|
||||
#if HAVE_BOEHMGC
|
||||
std::unordered_map<
|
||||
const void *,
|
||||
unsigned int,
|
||||
|
@ -207,7 +207,7 @@ nix_err nix_value_decref(nix_c_context * context, nix_value *x)
|
|||
|
||||
void nix_gc_register_finalizer(void * obj, void * cd, void (*finalizer)(void * obj, void * cd))
|
||||
{
|
||||
#ifdef HAVE_BOEHMGC
|
||||
#if HAVE_BOEHMGC
|
||||
GC_REGISTER_FINALIZER(obj, finalizer, cd, 0, 0);
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
#ifdef HAVE_BOEHMGC
|
||||
#if HAVE_BOEHMGC
|
||||
# include "gc/gc.h"
|
||||
# define GC_INCLUDE_NEW 1
|
||||
# include "gc_cpp.h"
|
||||
|
@ -174,7 +174,7 @@ ExternalValue * nix_create_external_value(nix_c_context * context, NixCExternalV
|
|||
context->last_err_code = NIX_OK;
|
||||
try {
|
||||
auto ret = new
|
||||
#ifdef HAVE_BOEHMGC
|
||||
#if HAVE_BOEHMGC
|
||||
(GC)
|
||||
#endif
|
||||
NixCExternalValue(*desc, v);
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
#include "nix_api_value.h"
|
||||
#include "value/context.hh"
|
||||
|
||||
#ifdef HAVE_BOEHMGC
|
||||
#if HAVE_BOEHMGC
|
||||
# include "gc/gc.h"
|
||||
# define GC_INCLUDE_NEW 1
|
||||
# include "gc_cpp.h"
|
||||
|
@ -131,7 +131,7 @@ PrimOp * nix_alloc_primop(
|
|||
try {
|
||||
using namespace std::placeholders;
|
||||
auto p = new
|
||||
#ifdef HAVE_BOEHMGC
|
||||
#if HAVE_BOEHMGC
|
||||
(GC)
|
||||
#endif
|
||||
nix::PrimOp{
|
||||
|
|
|
@ -62,7 +62,7 @@ Goal::Co DrvOutputSubstitutionGoal::init()
|
|||
#ifndef _WIN32
|
||||
outPipe->readSide.get()
|
||||
#else
|
||||
&outPipe
|
||||
&*outPipe
|
||||
#endif
|
||||
}, true, false);
|
||||
|
||||
|
|
|
@ -416,7 +416,11 @@ void deletePath(const fs::path & path)
|
|||
|
||||
void createDir(const Path & path, mode_t mode)
|
||||
{
|
||||
if (mkdir(path.c_str(), mode) == -1)
|
||||
if (mkdir(path.c_str()
|
||||
#ifndef _WIN32
|
||||
, mode
|
||||
#endif
|
||||
) == -1)
|
||||
throw SysError("creating directory '%1%'", path);
|
||||
}
|
||||
|
||||
|
|
|
@ -97,7 +97,7 @@ void RestoreSink::createRegularFile(const CanonPath & path, std::function<void(C
|
|||
RestoreRegularFile crf;
|
||||
crf.fd =
|
||||
#ifdef _WIN32
|
||||
CreateFileW(path.c_str(), GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)
|
||||
CreateFileW(p.c_str(), GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)
|
||||
#else
|
||||
open(p.c_str(), O_CREAT | O_EXCL | O_WRONLY | O_CLOEXEC, 0666)
|
||||
#endif
|
||||
|
@ -145,7 +145,7 @@ void RestoreRegularFile::operator () (std::string_view data)
|
|||
void RestoreSink::createSymlink(const CanonPath & path, const std::string & target)
|
||||
{
|
||||
auto p = append(dstPath, path);
|
||||
nix::createSymlink(target, p);
|
||||
nix::createSymlink(target, p.string());
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -88,12 +88,17 @@ nix_sources = files(
|
|||
'store-info.cc',
|
||||
'store-repair.cc',
|
||||
'store.cc',
|
||||
'unix/daemon.cc',
|
||||
'upgrade-nix.cc',
|
||||
'verify.cc',
|
||||
'why-depends.cc',
|
||||
)
|
||||
|
||||
if host_machine.system() != 'windows'
|
||||
nix_sources += files(
|
||||
'unix/daemon.cc',
|
||||
)
|
||||
endif
|
||||
|
||||
nix_sources += [
|
||||
gen_header.process('doc/manual/generate-manpage.nix'),
|
||||
gen_header.process('doc/manual/generate-settings.nix'),
|
||||
|
@ -104,12 +109,6 @@ nix_sources += [
|
|||
gen_header.process('help-stores.md'),
|
||||
]
|
||||
|
||||
if host_machine.system() != 'windows'
|
||||
nix_sources += files(
|
||||
'unix/daemon.cc',
|
||||
)
|
||||
endif
|
||||
|
||||
# The rest of the subdirectories aren't separate components,
|
||||
# just source files in another directory, so we process them here.
|
||||
|
||||
|
@ -146,9 +145,7 @@ nix_store_sources = files(
|
|||
# Hurray for Meson list flattening!
|
||||
sources = [
|
||||
nix_sources,
|
||||
build_remote_sources,
|
||||
nix_build_sources,
|
||||
nix_channel_sources,
|
||||
unpack_channel_gen,
|
||||
nix_collect_garbage_sources,
|
||||
nix_copy_closure_sources,
|
||||
|
@ -158,6 +155,13 @@ sources = [
|
|||
nix_store_sources,
|
||||
]
|
||||
|
||||
if host_machine.system() != 'windows'
|
||||
sources += [
|
||||
build_remote_sources,
|
||||
nix_channel_sources,
|
||||
]
|
||||
endif
|
||||
|
||||
include_dirs = [include_directories('.')]
|
||||
|
||||
this_exe = executable(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue