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

libtapi: build the 'tapi' executable #106348

Closed
wants to merge 1 commit into from

Conversation

midchildan
Copy link
Member

@midchildan midchildan commented Dec 8, 2020

Motivation for this change

This adds the tapi executable to the libtapi package. The tapi executable can be used to create TBD files, i.e. text-based stubs for macOS dynamic libraries.

The main use I have in mind for this is osxfuse (now macFUSE). The osxfuse library in nixpkgs is currently built from source, but this sadly isn't ideal because the library is closely tied to the osxfuse kernel extension which isn't packaged in nixpkgs. Replacing the current osxfuse library with a TBD would make FUSE packages work more reliably by making it link to the osxfuse library that matches its kernel counterpart.

I also did a quick check to see if I could use this copy of the tapi executable to generate darwin-stubs, but that unfortunately didn't seem to work out well. This version of tapi lacks support for "zippered" binaries (whatever that means), so it couldn't generate a TBD for libSystem.B.dylib.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • 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 nixpkgs-review --run "nixpkgs-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.
Package closure size
/nix/store/6k24c94hwqn6zfq018whzzq1k1rg0nca-libtapi-1000.10.8	  46.0M  # 21.03pre256644.b3193b24e44
/nix/store/p66pkx6syhjfd4gxqckv1n68lf8pzvgz-libtapi-1000.10.8	  71.2M  # this PR

@@ -19,6 +19,10 @@ stdenv.mkDerivation rec {
# not allowed for the stdenv.
buildInputs = [ ncurses ];

postPatch = ''
patch -p3 < ${./build-tapi-command.patch}
Copy link
Member

Choose a reason for hiding this comment

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

Could you open a PR at https://github.com/tpoechtrager/apple-libtapi with this change? This should help make sure this stays up to date.

Copy link
Member Author

Choose a reason for hiding this comment

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

I've opened a upstream PR in tpoechtrager/apple-libtapi#17

@midchildan
Copy link
Member Author

The problem with zippered binaries seems to have been resolved with the latest version of libtapi. I was successfully able to create TBD files from libsystem.B.dylib.

midchildan added a commit to midchildan/nixpkgs that referenced this pull request Dec 20, 2020
@midchildan midchildan mentioned this pull request Dec 20, 2020
10 tasks
@midchildan
Copy link
Member Author

I've created a new PR at #107262, which no longer requires patching.

@midchildan midchildan closed this Dec 20, 2020
f4814 pushed a commit to f4814/nixpkgs that referenced this pull request Apr 10, 2021
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