Skip to content

Commit

Permalink
Try to fix nix c++20
Browse files Browse the repository at this point in the history
  • Loading branch information
tvorogme committed Dec 15, 2024
1 parent 0b66fc1 commit 25517d4
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ton-x86_64-linux-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
matrix:
python: [39, 310, 311]
runs-on: [self-hosted, arc-runner-set, X64]
runs-on: arc-runner-set
steps:
- uses: actions/checkout@v4
with:
Expand Down
6 changes: 3 additions & 3 deletions assembly/nix/linux-arm64-static.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

{ pkgs ? import <nixpkgs> { system = builtins.currentSystem; }
, lib ? pkgs.lib
, stdenv ? pkgs.stdenv
, system ? builtins.currentSystem
, src ? ./.
}:
let
stdenv = pkgs.overrideCC pkgs.stdenv pkgs.gcc13;
microhttpdmy = (import ./microhttpd.nix) { inherit pkgs; };
staticLibs = import ./static-libs.nix { inherit pkgs; };
in
Expand Down Expand Up @@ -44,10 +44,10 @@ stdenv.mkDerivation {
"-DMHD_INCLUDE_DIR=${microhttpdmy}/usr/local/include"
"-DMHD_LIBRARY=${microhttpdmy}/usr/local/lib/libmicrohttpd.a"
"-DCMAKE_CTEST_ARGUMENTS=--timeout;1800"
"-DCMAKE_CXX_FLAGS=-w"
"-DCMAKE_CXX_FLAGS=-std=c++20 -Wno-deprecated-declarations -Wno-unused-but-set-variable"
"-DCMAKE_C_FLAGS=-w"
"-DCMAKE_CXX_STANDARD=20"
"-DCMAKE_CXX_FLAGS=-Wno-deprecated-declarations -Wno-unused-but-set-variable"
"-DCMAKE_CXX_FLAGS=-std=c++20 -Wno-deprecated-declarations -Wno-unused-but-set-variable"
];

LDFLAGS = [
Expand Down
5 changes: 2 additions & 3 deletions assembly/nix/linux-arm64-tonlib.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
{
pkgs ? import <nixpkgs> { inherit system; }
, lib ? pkgs.lib
, stdenv ? pkgs.stdenv
, system ? builtins.currentSystem
, src ? ./.
}:
let
stdenv = pkgs.overrideCC pkgs.stdenv pkgs.gcc13;
microhttpdmy = (import ./microhttpd.nix) { inherit pkgs; };
staticLibs = import ./static-libs.nix { inherit pkgs; };
in
Expand Down Expand Up @@ -46,10 +46,9 @@ pkgs.llvmPackages_16.stdenv.mkDerivation {
"-DMHD_FOUND=1"
"-DMHD_INCLUDE_DIR=${microhttpdmy}/usr/local/include"
"-DMHD_LIBRARY=${microhttpdmy}/usr/local/lib/libmicrohttpd.a"
"-DCMAKE_CXX_FLAGS=-w"
"-DCMAKE_C_FLAGS=-w"
"-DCMAKE_CXX_STANDARD=20"
"-DCMAKE_CXX_FLAGS=-Wno-deprecated-declarations -Wno-unused-but-set-variable"
"-DCMAKE_CXX_FLAGS=-std=c++20 -Wno-deprecated-declarations -Wno-unused-but-set-variable"
];

LDFLAGS = [
Expand Down
5 changes: 2 additions & 3 deletions assembly/nix/linux-x86-64-static.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

{ pkgs ? import <nixpkgs> { inherit system; }
, lib ? pkgs.lib
, stdenv ? pkgs.stdenv
, system ? builtins.currentSystem
, src ? ./.
}:
let
stdenv = pkgs.overrideCC pkgs.stdenv pkgs.gcc13;
microhttpdmy = (import ./microhttpd.nix) { inherit pkgs; };
staticLibs = import ./static-libs.nix { inherit pkgs; };
in
Expand Down Expand Up @@ -44,10 +44,9 @@ stdenv.mkDerivation {
"-DMHD_INCLUDE_DIR=${microhttpdmy}/usr/local/include"
"-DMHD_LIBRARY=${microhttpdmy}/usr/local/lib/libmicrohttpd.a"
"-DCMAKE_CTEST_ARGUMENTS=--timeout;1800"
"-DCMAKE_CXX_FLAGS=-w"
"-DCMAKE_CXX_FLAGS=-std=c++20 -Wno-deprecated-declarations -Wno-unused-but-set-variable"
"-DCMAKE_C_FLAGS=-w"
"-DCMAKE_CXX_STANDARD=20"
"-DCMAKE_CXX_FLAGS=-Wno-deprecated-declarations -Wno-unused-but-set-variable"
];

NIX_CFLAGS_COMPILE = [
Expand Down
28 changes: 14 additions & 14 deletions assembly/nix/linux-x86-64-tonlib.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,19 @@
, src ? ./.
}:
let
nixos1909 = (import (builtins.fetchTarball {
url = "https://channels.nixos.org/nixos-19.09/nixexprs.tar.xz";
sha256 = "1vp1h2gkkrckp8dzkqnpcc6xx5lph5d2z46sg2cwzccpr8ay58zy";
}) { inherit system; });
glibc227 = nixos1909.glibc // { pname = "glibc"; };
stdenv227 = let
cc = pkgs.wrapCCWith {
cc = nixos1909.buildPackages.gcc-unwrapped;
libc = glibc227;
bintools = pkgs.binutils.override { libc = glibc227; };
};
in (pkgs.overrideCC pkgs.stdenv cc);
stdenv = pkgs.overrideCC pkgs.stdenv pkgs.gcc13;
nixos1909 = (import (builtins.fetchTarball {
url = "https://channels.nixos.org/nixos-19.09/nixexprs.tar.xz";
sha256 = "1vp1h2gkkrckp8dzkqnpcc6xx5lph5d2z46sg2cwzccpr8ay58zy";
}) { inherit system; });
glibc227 = nixos1909.glibc // { pname = "glibc"; };
stdenv227 = let
cc = pkgs.wrapCCWith {
cc = nixos1909.buildPackages.gcc-unwrapped;
libc = glibc227;
bintools = pkgs.binutils.override { libc = glibc227; };
};
in (pkgs.overrideCC pkgs.stdenv cc);
staticLibs = import ./static-libs.nix { inherit pkgs; };
in
stdenv227.mkDerivation {
Expand Down Expand Up @@ -53,10 +54,9 @@ stdenv227.mkDerivation {
cmakeFlags = [
"-DTON_USE_ABSEIL=ON"
"-DNIX=ON"
"-DCMAKE_CXX_FLAGS=-w"
"-DCMAKE_CXX_FLAGS=-std=c++20 -Wno-deprecated-declarations -Wno-unused-but-set-variable"
"-DCMAKE_C_FLAGS=-w"
"-DCMAKE_CXX_STANDARD=20"
"-DCMAKE_CXX_FLAGS=-Wno-deprecated-declarations -Wno-unused-but-set-variable"
];

LDFLAGS = [
Expand Down
2 changes: 1 addition & 1 deletion assembly/nix/macos-static.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

{ pkgs ? import <nixpkgs> { inherit system; }
, lib ? pkgs.lib
, stdenv ? pkgs.stdenv
, system ? builtins.currentSystem
, src ? ./.
}:
let
stdenv = pkgs.overrideCC pkgs.stdenv pkgs.gcc13;
staticLibs = import ./static-libs.nix { inherit pkgs; };
in
pkgs.llvmPackages_14.stdenv.mkDerivation {
Expand Down
5 changes: 2 additions & 3 deletions assembly/nix/macos-tonlib.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@

{ pkgs ? import <nixpkgs> { inherit system; }
, lib ? pkgs.lib
, stdenv ? pkgs.stdenv
, system ? builtins.currentSystem
, src ? ./.
}:
let
# Import custom static packages
stdenv = pkgs.overrideCC pkgs.stdenv pkgs.gcc13;
staticLibs = import ./static-libs.nix { inherit pkgs; };
in
pkgs.llvmPackages_14.stdenv.mkDerivation {
Expand Down Expand Up @@ -42,7 +41,7 @@ pkgs.llvmPackages_14.stdenv.mkDerivation {
"-DNIX=ON"
"-DCMAKE_CXX_FLAGS=-stdlib=libc++"
"-DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=11.3"
"-DCMAKE_CXX_FLAGS=-w"
"-DCMAKE_CXX_FLAGS=-std=c++20 -Wno-deprecated-declarations -Wno-unused-but-set-variable"
"-DCMAKE_C_FLAGS=-w"
"-DCMAKE_CXX_STANDARD=20"
];
Expand Down

0 comments on commit 25517d4

Please sign in to comment.