Skip to content

Feature/nix support#2257

Open
Lederstrumpf wants to merge 34 commits into
qdrvm:masterfrom
Lederstrumpf:feature/nix-support
Open

Feature/nix support#2257
Lederstrumpf wants to merge 34 commits into
qdrvm:masterfrom
Lederstrumpf:feature/nix-support

Conversation

@Lederstrumpf

@Lederstrumpf Lederstrumpf commented Nov 1, 2024

Copy link
Copy Markdown
Contributor

Referenced issues

Description of the Change

Implementation of nix shell/flake to build with nix package manager / NixOS.
Tries to strike a balance between Nix conventions and Kagome's current build workflow to be minimally invasive.
To test on NixOS or with the Nix package manager available, call nix develop in the root dir to instantiate a shell.

Possible Drawbacks

Checklist Before Opening a PR

Before you open a Pull Request (PR), please make sure you've completed the following steps and confirm by answering 'Yes' to each item:

  1. Code is formatted: Have you run your code through clang-format to ensure it adheres to the project's coding standards? [Yes|No]
  2. Code is documented: Have you added comments and documentation to your code according to the guidelines in the project's contributing guidelines? [Yes|No]
  3. Self-review: Have you reviewed your own code to ensure it is free of typos, syntax errors, logical errors, and unresolved TODOs or FIXME without linking to an issue? [Yes|No]
  4. Zombienet Tests: Have you ensured that the zombienet tests are passing? Zombienet is a network simulation and testing tool used in this project. It's important to ensure that these tests pass to maintain the stability and reliability of the project. [Yes|No]

@Lederstrumpf

Copy link
Copy Markdown
Contributor Author

opening up for review since this now only requires the following cmake override:
https://github.com/qdrvm/kagome/pull/2257/files#diff-5751c8524018c8ba20b8f5103bc31e17914b309708616b6328ce867c82399313R34-R39

for this issue:

[ 29%] Building C object CMakeFiles/crypto.dir/crypto/asn1/a_type.c.o
[ 29%] Building C object CMakeFiles/crypto.dir/crypto/asn1/a_utctm.c.o
In file included from /nix/store/m3cz66vv8phy8ywkc7m99vjf0gdx5yyc-glibc-2.39-52-dev/include/string.h:548,
                 from /home/lederstrumpf/.hunter/_Base/f2d79db/4d672ab/b98f023/Build/BoringSSL/Source/crypto/asn1/a_bitstr.c:60:
In function ‘memcpy’,
    inlined from ‘OPENSSL_memcpy’ at /home/lederstrumpf/.hunter/_Base/f2d79db/4d672ab/b98f023/Build/BoringSSL/Source/crypto/asn1/../internal.h:1045:10,
    inlined from ‘i2c_ASN1_BIT_STRING’ at /home/lederstrumpf/.hunter/_Base/f2d79db/4d672ab/b98f023/Build/BoringSSL/Source/crypto/asn1/a_bitstr.c:130:3:
/nix/store/m3cz66vv8phy8ywkc7m99vjf0gdx5yyc-glibc-2.39-52-dev/include/bits/string_fortified.h:29:10: error: ‘__builtin_memcpy’ specified bound between 18446744071562067968 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Werror=stringop-overflow=]
   29 |   return __builtin___memcpy_chk (__dest, __src, __len,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   30 |                                  __glibc_objsize0 (__dest));
      |                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~
[ 30%] Building C object CMakeFiles/crypto.dir/crypto/asn1/asn1_lib.c.o
cc1: all warnings being treated as errors

if the related fix (https://github.com/qdrvm/boringssl/tree/fix/remove-werror) is merged into https://github.com/qdrvm/boringssl/tree/master, then I can also remove this override.

They should be set on Ubuntu, but not Nix: for Nix, .cargo and .rustup
should be within project repo to not pollute system.
1. else, the venv belongs to sudo user
2. FLAKE_INITIATED flag is unset in root's environment (unless direnv or
`nix develop` invoked via sudo user)
@Lederstrumpf Lederstrumpf force-pushed the feature/nix-support branch from dc657e0 to 8a71806 Compare May 20, 2025 09:34
@Lederstrumpf Lederstrumpf force-pushed the feature/nix-support branch from 05e907a to 32109f7 Compare May 20, 2025 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant