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

folly: 2019.11.11.00 -> 2020.09.28.00, fix build #99133

Merged
merged 3 commits into from
Dec 21, 2020
Merged
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
43 changes: 35 additions & 8 deletions pkgs/development/libraries/folly/default.nix
Original file line number Diff line number Diff line change
@@ -1,18 +1,37 @@
{ stdenv, fetchFromGitHub, cmake, boost, libevent, double-conversion, glog
, gflags, libiberty, openssl }:
{ stdenv
, fetchFromGitHub
, cmake
, boost
, libevent
, double-conversion
, glog
, gflags
, libiberty
, lz4
, lzma
, zlib
, jemalloc
, openssl
, pkg-config
, libunwind
, fmt
}:

stdenv.mkDerivation rec {
stdenv.mkDerivation (rec {
pname = "folly";
version = "2019.11.11.00";
version = "2020.09.28.00";

src = fetchFromGitHub {
owner = "facebook";
repo = "folly";
rev = "v${version}";
sha256 = "1sgv7sdalbs7zhz3zcc95gn2h8j2xjf7hkw2c618zc3pdn6aa58w";
sha256 = "1ry2nqfavcbz0jvsqw71105gbxm5hpmdi2k1w155m957jrv3n5vg";
};

nativeBuildInputs = [ cmake ];
nativeBuildInputs = [
cmake
pkg-config
];

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would you mind adding the following to fix the darwin build?

cmakeFlags = stdenv.lib.optionals stdenv.cc.isClang [ "-DCOMPILER_HAS_F_ALIGNED_NEW=OFF" ];

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, now I'm getting this:

  /private/var/folders/78/nbjn_b991sd60rhqbs_0xwd8x2nf6n/T/nix-build-folly-2020.09.28.00.drv-0/source/folly/concurrency/UnboundedQueue.h:561:21: note: if you supply your own aligned allocation functions, use -faligned-allocation to silence this diagnostic
  /private/var/folders/78/nbjn_b991sd60rhqbs_0xwd8x2nf6n/T/nix-build-folly-2020.09.28.00.drv-0/source/folly/concurrency/UnboundedQueue.h:565:7: error: aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' is only available on macOS 10.13 or newer
        delete next;
        ^
  /private/var/folders/78/nbjn_b991sd60rhqbs_0xwd8x2nf6n/T/nix-build-folly-2020.09.28.00.drv-0/source/folly/concurrency/UnboundedQueue.h:565:7: note: if you supply your own aligned allocation functions, use -faligned-allocation to silence this diagnostic
  12 warnings and 18 errors generated.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cannot test on OSX, so I cannot help here. If someone finds a fix I'm happy to push that.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this does require the 10.13 SDK, then this will break on macos until the sdk used by nixpkgs gets bumped, which could potentially be a while. So I would think that we'd either need to block this update until that happens, or keep the old 2019.11.11.00 around for use on macs.
However I'm very new to nixpkgs so don't take this as the gospel truth. I've noticed a couple other packages failing on hydra due to requiring the 10.13 sdk so maybe this isn't a blocker.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was the 2019.11.11.00 build working on Mac (it wasn't for Linux)?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On current nixpkgs master the old version builds for darwin.

# See CMake/folly-deps.cmake in the Folly source tree.
buildInputs = [
Expand All @@ -23,9 +42,15 @@ stdenv.mkDerivation rec {
libevent
libiberty
openssl
lz4
lzma
zlib
jemalloc
libunwind
fmt
];

enableParallelBuilding = true;
cmakeFlags = [ "-DBUILD_SHARED_LIBS=ON" ];

meta = with stdenv.lib; {
description = "An open-source C++ library developed and used at Facebook";
Expand All @@ -35,4 +60,6 @@ stdenv.mkDerivation rec {
platforms = [ "x86_64-linux" "x86_64-darwin" ];
maintainers = with maintainers; [ abbradar pierreis ];
};
}
} // stdenv.lib.optionalAttrs stdenv.isDarwin {
LDFLAGS = "-ljemalloc";
})