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

Fix build and pin Abseil branch #29

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions _heapprof/port.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,15 @@ inline void gettime(struct timespec *spec) {
// A note here: We need to achieve some portable operations which aren't yet
// available in the C++ standard, but the portable logic for them is
// depressingly long. So we include ABSL, which has extremely nice
// implementations of them. However, these are in the base/internal directory,
// because the ABSL team hasn't decided to make them formally part of the spec
// yet. At some point, these are definitely going to be moved out of internal,
// just Not Quite Yet. (Signed, the original author of endian.h and quite a bit
// of the other stuff in this directory; sigh. -- zunger@)
#include "absl/base/internal/bits.h"
// implementations of them.
#include "absl/numeric/bits.h"

// This file defines ghton[size] and gntoh[size].
// However, these are in the base/internal directory, because the ABSL team
// hasn't decided to make them formally part of the spec yet. At some point,
// these are definitely going to be moved out of internal, just Not Quite Yet.
// (Signed, the original author of endian.h and quite a bit of the other stuff
// in this directory; sigh. -- zunger@)
#include "absl/base/internal/endian.h"

// C++20 will have a standardized version of this. Until then, we use
Expand All @@ -72,7 +74,7 @@ inline void gettime(struct timespec *spec) {

// Return ceil(log2(x)).
inline int Log2RoundUp(uint64_t x) {
return x ? 64 - absl::base_internal::CountLeadingZeros64(x - 1) : 0;
return x ? 64 - absl::countl_zero(x - 1) : 0;
}

////////////////////////////////////////////////////////////////////////////////////////////
Expand Down
9 changes: 8 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,14 @@ class BuildExtWithABSL(_build_ext):
def run(self) -> None:
if not os.path.exists("build/absl"):
self.mkpath("build/absl")
self.spawn(["git", "clone", "https://github.com/abseil/abseil-cpp.git", "build/absl"])
self.spawn([
"git",
"clone",
"--branch",
"lts_2021_03_24",
"https://github.com/abseil/abseil-cpp.git",
"build/absl",
])

cmake = findCMake()

Expand Down