-
-
Notifications
You must be signed in to change notification settings - Fork 54
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
fix jemalloc linking in CI #394
Commits on May 24, 2024
-
only link to one jemalloc build
Without setting JEMALLOC_OVERRIDE, we end up linking to two different jemalloc builds. Once dynamically, as a transitive dependency through rocksdb, and a second time to the static jemalloc that tikv-jemalloc-sys builds.
Configuration menu - View commit details
-
Copy full SHA for bec507d - Browse repository at this point
Copy the full SHA bec507dView commit details -
do default-feature unification in nix
Some of the features affect nix dependencies, so we need to have a full feature list available when constructing the nix derivation. This incidentally fixes the bug where we weren't enabling jemalloc on rocksdb in CI/devshells, because jemalloc is now a default feature. It does not fix the more general class of that issue, where CI is performing an `--all-features` build in a nix devshell built for default-features. I am now passing `--no-default-features` to cargo, and having it use our unified feature list rather than duplicating the unification inside cargo.
Configuration menu - View commit details
-
Copy full SHA for 857ac42 - Browse repository at this point
Copy the full SHA 857ac42View commit details -
This doesn't seem to be necessary to build, and the derivation is broken in pkgsStatic.
Configuration menu - View commit details
-
Copy full SHA for 7138eeb - Browse repository at this point
Copy the full SHA 7138eebView commit details -
factor devshell out into a helper function
We're planning to add a second devshell with `all-features` for CI.
Configuration menu - View commit details
-
Copy full SHA for 5479ed4 - Browse repository at this point
Copy the full SHA 5479ed4View commit details -
switch default devshell to static linking
Dynamically-linked jemalloc doesn't work due to link-order issues, and we want CI to be testing a static binary anyway since that's what we're publishing in releases.
Configuration menu - View commit details
-
Copy full SHA for cc71f64 - Browse repository at this point
Copy the full SHA cc71f64View commit details -
enable all-features in nix for CI builds
CI is running `cargo build --all-features`, so we should be passing all the features to nix as well. The only thing this currently affects is the jemalloc_prof feature, but if we add any non-default features that affect nix in the future they should also be handled correctly now.
Configuration menu - View commit details
-
Copy full SHA for 1e7be34 - Browse repository at this point
Copy the full SHA 1e7be34View commit details -
Configuration menu - View commit details
-
Copy full SHA for cf91db4 - Browse repository at this point
Copy the full SHA cf91db4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6e6f67a - Browse repository at this point
Copy the full SHA 6e6f67aView commit details -
don't use prefixed jemalloc with rocksdb
This is causing build failures on Mac: > In file included from /tmp/nix-build-rocksdb-static-aarch64-apple-darwin-9.1.1.drv-0/source/memory/memory_allocator.cc:8: > In file included from /tmp/nix-build-rocksdb-static-aarch64-apple-darwin-9.1.1.drv-0/source/memory/jemalloc_nodump_allocator.h:11: > /tmp/nix-build-rocksdb-static-aarch64-apple-darwin-9.1.1.drv-0/source/port/jemalloc_helper.h:63:36: warning: unknown attribute '_rjem_malloc' ignored [-Wunknown-attributes] > mallocx(size_t, int) JEMALLOC_ATTR(malloc) JEMALLOC_ALLOC_SIZE(1) > ^~~~~~ > /nix/store/3bix0kzy670dyhhizri3dwb1qfj3sdpa-jemalloc-static-aarch64-apple-darwin-5.3.0/include/jemalloc/jemalloc.h:412:18: note: expanded from macro 'malloc' > # define malloc je_malloc > ^~~~~~~~~ > /nix/store/3bix0kzy670dyhhizri3dwb1qfj3sdpa-jemalloc-static-aarch64-apple-darwin-5.3.0/include/jemalloc/jemalloc.h:75:21: note: expanded from macro 'je_malloc' > # define je_malloc _rjem_malloc > ^~~~~~~~~~~~ > /nix/store/3bix0kzy670dyhhizri3dwb1qfj3sdpa-jemalloc-static-aarch64-apple-darwin-5.3.0/include/jemalloc/jemalloc.h:183:43: note: expanded from macro 'JEMALLOC_ATTR' > # define JEMALLOC_ATTR(s) __attribute__((s)) Full build log at <https://girlboss.ceo/~strawberry/pb/ygJ3>. This is likely fixable with patches to rocksdb, but not worth it since darwin is only a dev platform.
Configuration menu - View commit details
-
Copy full SHA for 1224e19 - Browse repository at this point
Copy the full SHA 1224e19View commit details -
Configuration menu - View commit details
-
Copy full SHA for eec0a0a - Browse repository at this point
Copy the full SHA eec0a0aView commit details -
Configuration menu - View commit details
-
Copy full SHA for b4c1c0d - Browse repository at this point
Copy the full SHA b4c1c0dView commit details -
add a dynamically-linked devshell
This is broken on linux, but can be used by darwin users for development, since static/jemalloc/darwin is broken.
Configuration menu - View commit details
-
Copy full SHA for 6a1cbe7 - Browse repository at this point
Copy the full SHA 6a1cbe7View commit details -
use a statically-linked binary for complement
Dynamically-linked jemalloc is broken.
Configuration menu - View commit details
-
Copy full SHA for 9e9ff64 - Browse repository at this point
Copy the full SHA 9e9ff64View commit details -
set C/LDFLAGS for complement dependencies directly
Previously we were relying on NIX_CFLAGS_COMPILE, but this is not being set in static devshells. A cleaner solution for complement would likely be to build the tests in their own nix derivation instead of building them in the devshell, but this change unblocks CI for now.
Configuration menu - View commit details
-
Copy full SHA for 5c4cc43 - Browse repository at this point
Copy the full SHA 5c4cc43View commit details