Skip to content

folly: support macOS#59846

Closed
strager wants to merge 2 commits intoNixOS:masterfrom
strager:folly-macos
Closed

folly: support macOS#59846
strager wants to merge 2 commits intoNixOS:masterfrom
strager:folly-macos

Conversation

@strager
Copy link
Copy Markdown
Contributor

@strager strager commented Apr 18, 2019

Motivation for this change

Enable building the folly library on macOS (Darwin).

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)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@GrahamcOfBorg GrahamcOfBorg added 6.topic: darwin Running or building packages on Darwin 8.has: package (new) This PR adds a new package labels Apr 18, 2019
@GrahamcOfBorg GrahamcOfBorg requested a review from abbradar April 18, 2019 16:48
@GrahamcOfBorg GrahamcOfBorg added 10.rebuild-darwin: 101-500 This PR causes between 101 and 500 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Apr 18, 2019
@strager strager marked this pull request as ready for review April 20, 2019 07:24
@veprbl
Copy link
Copy Markdown
Member

veprbl commented Apr 27, 2019

The patches to disable tests might require more work to maintain. Do you think we could do it cleaner with just substituteInPlace?

@strager
Copy link
Copy Markdown
Contributor Author

strager commented Apr 29, 2019

@veprbl, I uploaded a new version which uses substituteInPlace. I don't have experience maintaining packages to know which is better. Let me know what you think about the substituteInPlace version compared to the old version (strager@700f99d).

@strager strager mentioned this pull request Apr 29, 2019
10 tasks
@ofborg ofborg bot added the 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS label Apr 29, 2019
Copy link
Copy Markdown
Member

@veprbl veprbl left a comment

Choose a reason for hiding this comment

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

LGTM

@veprbl
Copy link
Copy Markdown
Member

veprbl commented May 2, 2019

@GrahamcOfBorg build folly

@veprbl
Copy link
Copy Markdown
Member

veprbl commented May 2, 2019

Fails to build

@strager
Copy link
Copy Markdown
Contributor Author

strager commented May 3, 2019

Yeah, f75c68c introduced problems. I'll rebase and fix them.

strager added 2 commits May 2, 2019 20:40
Make it easier to catch possible misconfiguration and regressions for the
folly package by running folly's test suite.
* operator new + align() is supported only since macOS 10.13. Disable
  uses of align() to support macOS 10.11 and 10.12. This affects
  performance but should not affect correctness.
* Clang 5 fails to emit typeinfo symbols for some folly::dynamic
  classes. Work around this bug by compiling folly with a newer version
  of Clang.
* Clang fails to compile some sketchy code in Boost.Atomic. Boost.Atomic
  is a dependency of folly. Backport the fix for this bug to Boost 1.67.
Copy link
Copy Markdown
Member

@veprbl veprbl left a comment

Choose a reason for hiding this comment

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

Since we just had a breakage due to the patches, perhaps we could remove some of them.

// Errors attempting to format the message should not throw
FB_LOGC(footest1234, ERR, "width overflow: %999999999999999999999d", 5);
ASSERT_EQ(1, messages.size());
+#if 0
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should we just disable PrintfTest?

@@ -50,10 +50,10 @@ TEST(Simple, Path) {
}

TEST(Simple, CanonicalizeParent) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Not sure if this is sandbox-safe. Should we just disable this test?

stdenv.mkDerivation rec {
let
disableTests = import ./disable-tests.nix { inherit (stdenv) lib; };
optionals = stdenv.lib.optionals;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
optionals = stdenv.lib.optionals;
inherit (stdenv.lib) optionals;

@@ -0,0 +1,88 @@
--- a/folly/IndexedMemPool.h
Copy link
Copy Markdown
Member

@veprbl veprbl May 7, 2019

Choose a reason for hiding this comment

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

I can build folly without this patch. Is this for uses in the code built with clang 5?

folly = callPackage ../development/libraries/folly { };
folly = callPackage ../development/libraries/folly {
# Clang 5 miscompiles folly. Build with a newer compiler on Darwin.
stdenv = if stdenv.isDarwin then llvmPackages_7.stdenv else stdenv;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Not needed anymore since ae1e940 has just landed on master #60491

@veprbl veprbl added the 2.status: merge conflict This PR has merge conflicts with the target branch label May 7, 2019
@veprbl
Copy link
Copy Markdown
Member

veprbl commented Jun 7, 2019

macOS support was merged as a part of #62330

@veprbl
Copy link
Copy Markdown
Member

veprbl commented Dec 27, 2019

@strager Are you still interested in contributing the tests?

@strager
Copy link
Copy Markdown
Contributor Author

strager commented Dec 31, 2019

@strager Are you still interested in contributing the tests?

I have no plans to work on this PR or on folly. You can take over my work if you want.

@stale
Copy link
Copy Markdown

stale bot commented Jun 28, 2020

Thank you for your contributions.

This has been automatically marked as stale because it has had no activity for 180 days.

If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.

Here are suggestions that might help resolve this more quickly:

  1. Search for maintainers and people that previously touched the related code and @ mention them in a comment.
  2. Ask on the NixOS Discourse.
  3. Ask on the #nixos channel on irc.freenode.net.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 28, 2020
@ryantm ryantm added 2.status: merge conflict This PR has merge conflicts with the target branch and removed 2.status: merge conflict This PR has merge conflicts with the target branch labels Oct 3, 2020
@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Oct 3, 2020
@SuperSandro2000
Copy link
Copy Markdown
Member

@strager please resolve the merge conflicts.

@prusnak
Copy link
Copy Markdown
Member

prusnak commented Nov 28, 2020

Closing. macOS support was added #62330 and @Stragger expressed he does not want to work on the tests: #59846 (comment)

@prusnak prusnak closed this Nov 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2.status: merge conflict This PR has merge conflicts with the target branch 6.topic: darwin Running or building packages on Darwin 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 101-500 This PR causes between 101 and 500 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants