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

iterm2: fix build #58517

Merged
merged 1 commit into from Mar 31, 2019
Merged

iterm2: fix build #58517

merged 1 commit into from Mar 31, 2019

Conversation

strager
Copy link
Contributor

@strager strager commented Mar 29, 2019

Motivation for this change

During iterm2's build, xcodebuild invokes $LD and passes it options such as -isysroot. These options are intended for the linker driver (clang), not for the linker directly. ld64 ($LD) does not recognize these options, causing iterm2's build to fail.

Set $LD to $CC (clang) as intended, making iterm2's build succeed. This fixes issue #35412.

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.

I tested installing iTerm 2 by running nix-env -iA iterm2 ~/Projects/nixpkgs/ on a MacBook Pro with the following software configuration:

  • macOS 10.12.6
  • Xcode 8.3.3
    • MacOSX10.12.sdk
    • Apple LLVM version 8.1.0 (clang-802.0.42)
    • x86_64-apple-darwin16.7.0
    • ld64-278.4

During iterm2's build, xcodebuild invokes $LD and passes it options such
as -isysroot. These options are intended for the linker driver (clang),
not for the linker directly. ld64 ($LD) does not recognize these
options, causing iterm2's build to fail.

Set $LD to $CC (clang) as intended, making iterm2's build succeed.
@infinisil
Copy link
Member

@GrahamcOfBorg build iterm2

@infinisil
Copy link
Member

Could this build be fixed on hydra/ofborg (which don't have xcode) by making it use xcbuild?

@strager
Copy link
Contributor Author

strager commented Mar 30, 2019

Could this build be fixed on hydra/ofborg (which don't have xcode) by making it use xcbuild?

Good question! I didn't know Nixpkgs had support for this.

It looks like building with xcbuild requires using Foundation headers for macOS 10.10 [1]. iTerm 2 fails to build with these headers because iTerm 2 depends on some features in Foundation introduced in macOS 10.11 or 10.12:

In file included from /Users/strager/tmp/Projects/iTerm2/image_decoder/image_decoder.m:11:
/Users/strager/tmp/Projects/iTerm2/image_decoder/iTermSerializableImage.h:15:22: error: type arguments cannot be applied to non-parameterized class 'NSMutableArray'
@property(nonatomic) NSMutableArray<NSNumber *> *delays;
                     ^             ~~~~~~~~~~~~

I started building with xcbuild atop #56744. (It'll probably take an entire day to build the whole world on my poor MacBook...) I think my PR should not be blocked on that PR though.

[1]

@strager
Copy link
Contributor Author

strager commented Mar 31, 2019

It looks like iTerm 2's build requires ibtool. I think there is no open source implementation of ibtool we can use for Xcode-less environments. So even if we switch to xcbuild, Xcode's proprietary toolchain is still required.

@infinisil infinisil merged commit 4f25405 into NixOS:master Mar 31, 2019
@infinisil
Copy link
Member

Ah that's too bad, oh well, glad you got the build working with xcode at least

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

3 participants