Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

redis: Try to fix cross-compilation #67694

Merged
merged 1 commit into from Aug 29, 2019

Conversation

vikanezrimaya
Copy link
Member

Note: This makes redis use libc malloc when cross-compiling to ARM. This may or may not degrade performance.

The reason for this is vendored jemalloc with Redis' patches. The makefile for deps has hardcoded configure flags for jemalloc, and as a result, it is unable to cross-compile it.

This may be ugly, and may be rejected. There is an alternative, which is fixing the vendored jemalloc build and sending patches upstream, but I'm proposing this as a temporary fix.

The build for this is available at https://glovebox.fireburn.ru/job/nixos-armv7l/nixos-unstable/redis-libc-malloc, built against latest nixos-unstable channel.

Motivation for this change

Redis won't cross-compile, particularly for ARM. I'm trying to fix it here.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Notify maintainers

cc @globin @berdario

**Note**: This makes redis use libc malloc when cross-compiling to
ARM. This may or may not degrade performance.

The reason for this is vendored jemalloc with Redis' patches. The
makefile for deps has hardcoded configure flags for jemalloc, and as a
result, it is unable to cross-compile it.
@matthewbauer
Copy link
Member

@GrahamcOfBorg build pkgsCross.aarch64-multiplatform.redis

@vikanezrimaya
Copy link
Member Author

Glibc cannot be built. @matthewbauer can you restart?

@matthewbauer
Copy link
Member

Actually that's aarch64-linux -> aarch64-linux cross compilation. That's not as important as x86_64-linux -> aarch64-linux compilation, which looks like it works:

https://github.com/NixOS/nixpkgs/pull/67694/checks?check_run_id=207052152

@matthewbauer matthewbauer merged commit f86bbb2 into NixOS:master Aug 29, 2019
@vikanezrimaya vikanezrimaya deleted the redis-cross-compile-fixes branch August 29, 2019 18:05
@vikanezrimaya
Copy link
Member Author

By the way, a proper fix for this would be redis/redis#5670.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants