From 30cf61fd26894d397c3f24eed888e84acf9c9218 Mon Sep 17 00:00:00 2001 From: Jade Lovelace Date: Mon, 27 May 2024 18:23:13 -0600 Subject: [PATCH] fix: don't crash on startup on macOS This is caused, through several layers of absurdity, by runtime type information of Nix things being invisible due to -fvisibility=hidden inside n-e-j. We don't have any idea why n-e-j has -fvisibility=hidden, since blame says it's from the initial commit. It is plausible that it was some ill-advised optimization but it's not sound. The crash is caused by dynamic_cast(MyArgs *) failing, which is in turn caused by the RTTI being invisible. See: https://www.qt.io/blog/quality-assurance/one-way-dynamic_cast-across-library-boundaries-can-fail-and-how-to-fix-it Fixes: https://git.lix.systems/lix-project/nix-eval-jobs/issues/2 --- src/eval-args.hh | 2 +- src/meson.build | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/eval-args.hh b/src/eval-args.hh index 84f2ba1..b0932fb 100644 --- a/src/eval-args.hh +++ b/src/eval-args.hh @@ -12,7 +12,7 @@ class MyArgs : virtual public nix::MixEvalArgs, virtual public nix::MixCommonArgs, - virtual nix::RootArgs { + virtual public nix::RootArgs { public: std::string releaseExpr; nix::Path gcRootsDir; diff --git a/src/meson.build b/src/meson.build index dfbcd87..745e036 100644 --- a/src/meson.build +++ b/src/meson.build @@ -31,4 +31,4 @@ executable('nix-eval-jobs', src, threads_dep ], install: true, - cpp_args: ['-std=c++2a', '-fvisibility=hidden', '--include', 'autotools-config.h']) + cpp_args: ['-std=c++2a', '--include', 'autotools-config.h'])