Merge Go frontend (apiserver + xcecli) into meson build

This commit is contained in:
Rongsong Shen 2026-04-14 11:20:17 +08:00
parent 43dc12a36c
commit c9dc8c4676
205 changed files with 30793 additions and 328 deletions

View file

@ -14,8 +14,12 @@ let
withDebug = true;
withAsan = true;
};
xcecli = pkgs.callPackage ./xcecli.nix {
inherit pkgs myCommitId;
};
in
{
xcecore = xcecore;
xcecore_debug = xcecore_debug;
xcecli = xcecli;
}

View file

@ -22,7 +22,10 @@ stdenv.mkDerivation {
pkg-config
cmake
go
delve
go-swag # swagger doc generation: swag init
gotools # goimports, godoc
gopls # Go language server
delve # Go debugger
(openssl.overrideAttrs (oldAttrs: {
separateDebugInfo = true;
}))
@ -57,6 +60,7 @@ stdenv.mkDerivation {
separateDebugInfo = true;
}))
packcc
cacert
] ++ (if withDebug then [
(librtti_debug.overrideAttrs (oldattrs: {
separateDebugInfo = true;
@ -76,6 +80,6 @@ stdenv.mkDerivation {
(lib.optional withDebug "--buildtype=debug")
(lib.optional withAsan "-Db_sanitize=address")
("-Dcommit_id=" + myCommitId)
# (lib.optional (!with_debug) "-Dbuildtype=release")
"-Dcomponent=xcecore"
];
}

32
src/nixSupport/xcecli.nix Normal file
View file

@ -0,0 +1,32 @@
{
lib,
stdenv,
pkgs,
myCommitId,
...
}:
stdenv.mkDerivation {
pname = "xcecli";
version = "0.0.1";
src = ./..;
nativeBuildInputs = with pkgs; [
meson
ninja
go
cacert
which
findutils
];
build-system = [ pkgs.meson ];
impureEnvVars = [ "HOME" ];
mesonFlags = [
"-Dcomponent=xcecli"
("-Dcommit_id=" + myCommitId)
];
}