Skip to content

emacsMacport: build fails on aarch64-darwin #127902

@shaunsingh

Description

@shaunsingh

Issue description

If you install emacsMacport on an aarch64-darwin machine (running nix natively) the build fails. Note that on homebrew, the emacsMacport formula (railway cat) builds fine on aarch64 and includes a prebuilt release (cask). The only arm-specific change they have is this: https://github.com/railwaycat/homebrew-emacsmacport/blob/master/patches/mac-arm-fix.diff, which patches the codesigning process.

Steps to reproduce

Install nix
Modify /etc/nix/nix.conf to include the aarch64 architecture
Rebuild nix
run 'nix-env -iA nixpkgs.emacsMacport` to install emacs

Build fails with the following output:

[  6%] Building CXX object lib/sanitizer_common/CMakeFiles/RTSanitizerCommonNoHooks.osx.dir/sanitizer_persistent_allocator.cc.o
[  7%] Building CXX object lib/sanitizer_common/CMakeFiles/RTSanitizerCommonNoHooks.osx.dir/sanitizer_platform_limits_linux.cc.o
[  7%] Building CXX object lib/sanitizer_common/CMakeFiles/RTSanitizerCommonNoHooks.osx.dir/sanitizer_platform_limits_netbsd.cc.o
[  7%] Building CXX object lib/sanitizer_common/CMakeFiles/RTSanitizerCommonNoHooks.osx.dir/sanitizer_platform_limits_posix.cc.o
/tmp/nix-build-compiler-rt-6.0.1.drv-0/compiler-rt-6.0.1.src/lib/sanitizer_common/sanitizer_platform_limits_posix.cc:202:31: error: invalid application of 'sizeof' to an incomplete type 'struct stat64'
  unsigned struct_stat64_sz = sizeof(struct stat64);
                              ^     ~~~~~~~~~~~~~~~
/tmp/nix-build-compiler-rt-6.0.1.drv-0/compiler-rt-6.0.1.src/lib/sanitizer_common/sanitizer_platform_limits_posix.cc:202:45: note: forward declaration of '__sanitizer::stat64'
  unsigned struct_stat64_sz = sizeof(struct stat64);
                                            ^
/tmp/nix-build-compiler-rt-6.0.1.drv-0/compiler-rt-6.0.1.src/lib/sanitizer_common/sanitizer_platform_limits_posix.cc:227:33: error: invalid application of 'sizeof' to an incomplete type 'struct statfs64'
  unsigned struct_statfs64_sz = sizeof(struct statfs64);
                                ^     ~~~~~~~~~~~~~~~~~
/tmp/nix-build-compiler-rt-6.0.1.drv-0/compiler-rt-6.0.1.src/lib/sanitizer_common/sanitizer_platform_limits_posix.cc:227:47: note: forward declaration of '__sanitizer::statfs64'
  unsigned struct_statfs64_sz = sizeof(struct statfs64);
                                              ^
2 errors generated.
make[2]: *** [lib/sanitizer_common/CMakeFiles/RTSanitizerCommonNoHooks.osx.dir/build.make:303: lib/sanitizer_common/CMakeFiles/RTSanitizerCommonNoHooks.osx.dir/sanitizer_platform_limits_posix.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:764: lib/sanitizer_common/CMakeFiles/RTSanitizerCommonNoHooks.osx.dir/all] Error 2
make: *** [Makefile:149: all] Error 2
builder for '/nix/store/b11kjv1kkh489zr3hi0iscq62faa45bw-compiler-rt-6.0.1.drv' failed with exit code 2
building '/nix/store/s6r151m6wsm7xs0y777vfqhdf1fa122f-apple-framework-Quartz-11.0.0.drv'...
cannot build derivation '/nix/store/gq19zfgabj5b53frj43vlk69lprdi9db-clang-wrapper-6.0.1.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/axmp969633hzkbl4733xl4w44sq6n034-stdenv-darwin.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/sxjawx6ls6n1s5c2lnm1vblynpc9mfl6-emacs-mac-27.2-8.2.drv': 1 dependencies couldn't be built
error: build of '/nix/store/sxjawx6ls6n1s5c2lnm1vblynpc9mfl6-emacs-mac-27.2-8.2.drv' failed
```zsh

## Technical details

Please run `nix-shell -p nix-info --run "nix-info -m"` and paste the result.
```zsh
 - system: `"aarch64-darwin"`
 - host os: `Darwin 21.0.0, macOS 12.0`
 - multi-user?: `no`
 - sandbox: `no`
 - version: `nix-env (Nix) 2.3.12`
 - channels(shauryasingh): `"nixpkgs-21.11pre297243.b27eaa18b47, unstable-21.11pre297243.b27eaa18b47"`
 - nixpkgs: `/Users/shauryasingh/.nix-defexpr/channels/nixpkgs`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions