Skip to content

Fix build for centos and astra

Dmitry Rodionov requested to merge dkr/update-nix-v2 into master

Summary

The problem lies in nix package which references memfd_create libc symbol which doesnt exist in older libc versions available in centos and astra.

The solution is to patch nix to previous version to use raw syscall. The offending commit that broke nix for us is https://github.com/nix-rust/nix/commit/cf15c2bb5505231bc3128ef61522336e315e2169#diff-17f9119515eead05b2e65afe0b31095ec95425112c31fe3c529a02f46528b970R56

Another instance of the problem in the wild: https://github.com/lucab/libsystemd-rs/pull/144

The patch uses nix version 26.4 while the latest one is 27 because rustyline didnt update to 27 yet and keeping two patched versions doesnt make sense. If proposed patch is ok for us I'll propose it upstream. The patch is available here: https://github.com/LizardWizzard/nix/commit/92a95c75320be3e268ba320283526e1096ea2211 Upstream PR: https://github.com/nix-rust/nix/pull/2146

In the long run nix doesnt look like a stable option. There are no any libc version policy. And the way symbols are used makes them required even if we're not using them. The alternative, rustix uses weak symbols or falls back to raw syscalls: https://github.com/bytecodealliance/rustix/blob/b08519f046787b93121214622aac015b68733c8f/src/backend/libc/fs/syscalls.rs#L1631 I believe with this solution we wouldnt have had this problem in the first place. There is an open issue in rustyline with suggestion to use rustix instead of nix: https://github.com/kkawakam/rustyline/issues/733

Aside from that this patch adds distro package build to MR's. This was previously discussed and approved by @kdy. Current order of steps can be tweaked to run tests without waiting for base image to build. Do we even require base image to be built for tests/packpack? Maybe we can just remove this stage from MR pipelines.

Drive by transform "only" keyword in .gitlab-ci.yml to "rules" because "only" is deprecated

Close #...

Ensure that

  • New code is covered by tests
  • API is documented
  • Changelog is up to date
  • (if Lua API changed) Lua API version is bumped in luamod.rs
  • (if necessary) A follow-up doc issue is created in picodata/docs and linked here
Edited by Dmitry Rodionov

Merge request reports