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

Build failure: emacs29-macport #253502

Closed
sixtysecrun opened this issue Sep 5, 2023 · 9 comments · Fixed by #253892
Closed

Build failure: emacs29-macport #253502

sixtysecrun opened this issue Sep 5, 2023 · 9 comments · Fixed by #253892
Labels
0.kind: build failure A package fails to build

Comments

@sixtysecrun
Copy link

sixtysecrun commented Sep 5, 2023

Steps To Reproduce

Steps to reproduce the behavior:

  1. build emacs29-macport

Build log

error: builder for '/nix/store/cawm1bdc0gb9gz2ya20za9fy2niz6jla-emacs-mac-macport-with-packages-29.1.drv' failed with exit code 1;
       last 1 log lines:
       > cp: cannot stat '/nix/store/63b32jd27qy6kz3mf3114w2qss66w3xy-emacs-mac-macport-29.1/Applications/Emacs.app/Contents/Info.plist': No such file or directory
       For full logs, run 'nix log /nix/store/cawm1bdc0gb9gz2ya20za9fy2niz6jla-emacs-mac-macport-with-packages-29.1.drv'.

Additional context

The emacs is installed using home-manager on MacOS

{ config, pkgs, ... }:
let
  emacsPackage = pkgs.emacs29-macport;
in
{

  programs.emacs = {
    enable = true;
    package = emacsPackage;
    extraPackages = epkgs: [
      ...
    ];
  };
}

Reverting f6a6dc8 back to 2160abc fixes the problem.

{ config, pkgs, ... }:
let
  workingPkgs = import (pkgs.fetchFromGitHub {
    owner = "NixOS";
    repo = "nixpkgs";
    rev = "2160abc3eddbe826b08bcffdb3758763b093f254";
    sha256 = "sha256-65gZ8Fa4EIMGOu5k0+dNiRi/9v2x+M9zDgly7fvDVa4=";
  }) {
    system = "x86_64-darwin";
  };
  emacsPackage = workingPkgs.emacs29-macport;
in
{

  programs.emacs = {
    enable = true;
    package = emacsPackage;
    extraPackages = epkgs: [
      ...
    ];
  };
}

Notify maintainers

@AndersonTorres

Metadata

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-darwin"`
 - host os: `Darwin 22.6.0, macOS 10.16`
 - multi-user?: `yes`
 - sandbox: `no`
 - version: `nix-env (Nix) 2.17.0`
 - channels(user): `"darwin"`
 - channels(root): `"nixpkgs"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixpkgs`
@sixtysecrun sixtysecrun added the 0.kind: build failure A package fails to build label Sep 5, 2023
@sixtysecrun sixtysecrun changed the title Build failure: PACKAGENAME Build failure: emacs29-macport Sep 5, 2023
@AndersonTorres
Copy link
Member

Well, I don't have machine to test Darwin things.

But, is this a home-manager related thing? Have you tried to run a nix-shell?

@sixtysecrun
Copy link
Author

sixtysecrun commented Sep 6, 2023

is this a home-manager related thing?

I am not sure, but it surely stopped working after f6a6dc8 .
Please also take a look at this file listings below 👇

✅ Working Emacs.app

/nix/store/4i36ghfh9cwgrasx7923zx1s7lwf61mp-emacs-mac-macport-with-packages-29.1/
/nix/store/4i36ghfh9cwgrasx7923zx1s7lwf61mp-emacs-mac-macport-with-packages-29.1/bin
/nix/store/4i36ghfh9cwgrasx7923zx1s7lwf61mp-emacs-mac-macport-with-packages-29.1/bin/ctags
/nix/store/4i36ghfh9cwgrasx7923zx1s7lwf61mp-emacs-mac-macport-with-packages-29.1/bin/etags
/nix/store/4i36ghfh9cwgrasx7923zx1s7lwf61mp-emacs-mac-macport-with-packages-29.1/bin/ebrowse
/nix/store/4i36ghfh9cwgrasx7923zx1s7lwf61mp-emacs-mac-macport-with-packages-29.1/bin/emacs-29.1
/nix/store/4i36ghfh9cwgrasx7923zx1s7lwf61mp-emacs-mac-macport-with-packages-29.1/bin/emacs
/nix/store/4i36ghfh9cwgrasx7923zx1s7lwf61mp-emacs-mac-macport-with-packages-29.1/bin/emacsclient
/nix/store/4i36ghfh9cwgrasx7923zx1s7lwf61mp-emacs-mac-macport-with-packages-29.1/Applications
/nix/store/4i36ghfh9cwgrasx7923zx1s7lwf61mp-emacs-mac-macport-with-packages-29.1/Applications/Emacs.app
/nix/store/4i36ghfh9cwgrasx7923zx1s7lwf61mp-emacs-mac-macport-with-packages-29.1/Applications/Emacs.app/Contents
/nix/store/4i36ghfh9cwgrasx7923zx1s7lwf61mp-emacs-mac-macport-with-packages-29.1/Applications/Emacs.app/Contents/MacOS
/nix/store/4i36ghfh9cwgrasx7923zx1s7lwf61mp-emacs-mac-macport-with-packages-29.1/Applications/Emacs.app/Contents/MacOS/Emacs
/nix/store/4i36ghfh9cwgrasx7923zx1s7lwf61mp-emacs-mac-macport-with-packages-29.1/Applications/Emacs.app/Contents/Resources
/nix/store/4i36ghfh9cwgrasx7923zx1s7lwf61mp-emacs-mac-macport-with-packages-29.1/Applications/Emacs.app/Contents/Resources/he.lproj
/nix/store/4i36ghfh9cwgrasx7923zx1s7lwf61mp-emacs-mac-macport-with-packages-29.1/Applications/Emacs.app/Contents/Resources/en_AU.lproj
/nix/store/4i36ghfh9cwgrasx7923zx1s7lwf61mp-emacs-mac-macport-with-packages-29.1/Applications/Emacs.app/Contents/Resources/ar.lproj
/nix/store/4i36ghfh9cwgrasx7923zx1s7lwf61mp-emacs-mac-macport-with-packages-29.1/Applications/Emacs.app/Contents/Resources/el.lproj
/nix/store/4i36ghfh9cwgrasx7923zx1s7lwf61mp-emacs-mac-macport-with-packages-29.1/Applications/Emacs.app/Contents/Resources/uk.lproj
/nix/store/4i36ghfh9cwgrasx7923zx1s7lwf61mp-emacs-mac-macport-with-packages-29.1/Applications/Emacs.app/Contents/Resources/English.lproj
/nix/store/4i36ghfh9cwgrasx7923zx1s7lwf61mp-emacs-mac-macport-with-packages-29.1/Applications/Emacs.app/Contents/Resources/English.lproj/InfoPlist.strings
/nix/store/4i36ghfh9cwgrasx7923zx1s7lwf61mp-emacs-mac-macport-with-packages-29.1/Applications/Emacs.app/Contents/Resources/es_419.lproj
/nix/store/4i36ghfh9cwgrasx7923zx1s7lwf61mp-emacs-mac-macport-with-packages-29.1/Applications/Emacs.app/Contents/Resources/es_MX.lproj
/nix/store/4i36ghfh9cwgrasx7923zx1s7lwf61mp-emacs-mac-macport-with-packages-29.1/Applications/Emacs.app/Contents/Resources/zh_CN.lproj
/nix/store/4i36ghfh9cwgrasx7923zx1s7lwf61mp-emacs-mac-macport-with-packages-29.1/Applications/Emacs.app/Contents/Resources/Dutch.lproj
/nix/store/4i36ghfh9cwgrasx7923zx1s7lwf61mp-emacs-mac-macport-with-packages-29.1/Applications/Emacs.app/Contents/Resources/pt_BR.lproj
/nix/store/4i36ghfh9cwgrasx7923zx1s7lwf61mp-emacs-mac-macport-with-packages-29.1/Applications/Emacs.app/Contents/Resources/da.lproj
/nix/store/4i36ghfh9cwgrasx7923zx1s7lwf61mp-emacs-mac-macport-with-packages-29.1/Applications/Emacs.app/Contents/Resources/document.icns
/nix/store/4i36ghfh9cwgrasx7923zx1s7lwf61mp-emacs-mac-macport-with-packages-29.1/Applications/Emacs.app/Contents/Resources/sk.lproj
/nix/store/4i36ghfh9cwgrasx7923zx1s7lwf61mp-emacs-mac-macport-with-packages-29.1/Applications/Emacs.app/Contents/Resources/pt_PT.lproj
/nix/store/4i36ghfh9cwgrasx7923zx1s7lwf61mp-emacs-mac-macport-with-packages-29.1/Applications/Emacs.app/Contents/Resources/German.lproj
/nix/store/4i36ghfh9cwgrasx7923zx1s7lwf61mp-emacs-mac-macport-with-packages-29.1/Applications/Emacs.app/Contents/Resources/ms.lproj
/nix/store/4i36ghfh9cwgrasx7923zx1s7lwf61mp-emacs-mac-macport-with-packages-29.1/Applications/Emacs.app/Contents/Resources/sv.lproj
/nix/store/4i36ghfh9cwgrasx7923zx1s7lwf61mp-emacs-mac-macport-with-packages-29.1/Applications/Emacs.app/Contents/Resources/cs.lproj
/nix/store/4i36ghfh9cwgrasx7923zx1s7lwf61mp-emacs-mac-macport-with-packages-29.1/Applications/Emacs.app/Contents/Resources/ko.lproj
/nix/store/4i36ghfh9cwgrasx7923zx1s7lwf61mp-emacs-mac-macport-with-packages-29.1/Applications/Emacs.app/Contents/Resources/no.lproj
/nix/store/4i36ghfh9cwgrasx7923zx1s7lwf61mp-emacs-mac-macport-with-packages-29.1/Applications/Emacs.app/Contents/Resources/hu.lproj
/nix/store/4i36ghfh9cwgrasx7923zx1s7lwf61mp-emacs-mac-macport-with-packages-29.1/Applications/Emacs.app/Contents/Resources/zh_HK.lproj
/nix/store/4i36ghfh9cwgrasx7923zx1s7lwf61mp-emacs-mac-macport-with-packages-29.1/Applications/Emacs.app/Contents/Resources/Spanish.lproj
/nix/store/4i36ghfh9cwgrasx7923zx1s7lwf61mp-emacs-mac-macport-with-packages-29.1/Applications/Emacs.app/Contents/Resources/tr.lproj
/nix/store/4i36ghfh9cwgrasx7923zx1s7lwf61mp-emacs-mac-macport-with-packages-29.1/Applications/Emacs.app/Contents/Resources/pl.lproj
/nix/store/4i36ghfh9cwgrasx7923zx1s7lwf61mp-emacs-mac-macport-with-packages-29.1/Applications/Emacs.app/Contents/Resources/zh_TW.lproj
/nix/store/4i36ghfh9cwgrasx7923zx1s7lwf61mp-emacs-mac-macport-with-packages-29.1/Applications/Emacs.app/Contents/Resources/en_GB.lproj
/nix/store/4i36ghfh9cwgrasx7923zx1s7lwf61mp-emacs-mac-macport-with-packages-29.1/Applications/Emacs.app/Contents/Resources/French.lproj
/nix/store/4i36ghfh9cwgrasx7923zx1s7lwf61mp-emacs-mac-macport-with-packages-29.1/Applications/Emacs.app/Contents/Resources/vi.lproj
/nix/store/4i36ghfh9cwgrasx7923zx1s7lwf61mp-emacs-mac-macport-with-packages-29.1/Applications/Emacs.app/Contents/Resources/ru.lproj
/nix/store/4i36ghfh9cwgrasx7923zx1s7lwf61mp-emacs-mac-macport-with-packages-29.1/Applications/Emacs.app/Contents/Resources/fr_CA.lproj
/nix/store/4i36ghfh9cwgrasx7923zx1s7lwf61mp-emacs-mac-macport-with-packages-29.1/Applications/Emacs.app/Contents/Resources/fi.lproj
/nix/store/4i36ghfh9cwgrasx7923zx1s7lwf61mp-emacs-mac-macport-with-packages-29.1/Applications/Emacs.app/Contents/Resources/id.lproj
/nix/store/4i36ghfh9cwgrasx7923zx1s7lwf61mp-emacs-mac-macport-with-packages-29.1/Applications/Emacs.app/Contents/Resources/th.lproj
/nix/store/4i36ghfh9cwgrasx7923zx1s7lwf61mp-emacs-mac-macport-with-packages-29.1/Applications/Emacs.app/Contents/Resources/pt.lproj
/nix/store/4i36ghfh9cwgrasx7923zx1s7lwf61mp-emacs-mac-macport-with-packages-29.1/Applications/Emacs.app/Contents/Resources/ro.lproj
/nix/store/4i36ghfh9cwgrasx7923zx1s7lwf61mp-emacs-mac-macport-with-packages-29.1/Applications/Emacs.app/Contents/Resources/Japanese.lproj
/nix/store/4i36ghfh9cwgrasx7923zx1s7lwf61mp-emacs-mac-macport-with-packages-29.1/Applications/Emacs.app/Contents/Resources/Emacs.icns
/nix/store/4i36ghfh9cwgrasx7923zx1s7lwf61mp-emacs-mac-macport-with-packages-29.1/Applications/Emacs.app/Contents/Resources/hr.lproj
/nix/store/4i36ghfh9cwgrasx7923zx1s7lwf61mp-emacs-mac-macport-with-packages-29.1/Applications/Emacs.app/Contents/Resources/hi.lproj
/nix/store/4i36ghfh9cwgrasx7923zx1s7lwf61mp-emacs-mac-macport-with-packages-29.1/Applications/Emacs.app/Contents/Resources/Italian.lproj
/nix/store/4i36ghfh9cwgrasx7923zx1s7lwf61mp-emacs-mac-macport-with-packages-29.1/Applications/Emacs.app/Contents/Resources/ca.lproj
/nix/store/4i36ghfh9cwgrasx7923zx1s7lwf61mp-emacs-mac-macport-with-packages-29.1/Applications/Emacs.app/Contents/Info.plist
/nix/store/4i36ghfh9cwgrasx7923zx1s7lwf61mp-emacs-mac-macport-with-packages-29.1/Applications/Emacs.app/Contents/PkgInfo
/nix/store/4i36ghfh9cwgrasx7923zx1s7lwf61mp-emacs-mac-macport-with-packages-29.1/share
/nix/store/4i36ghfh9cwgrasx7923zx1s7lwf61mp-emacs-mac-macport-with-packages-29.1/share/man
/nix/store/4i36ghfh9cwgrasx7923zx1s7lwf61mp-emacs-mac-macport-with-packages-29.1/share/info
/nix/store/4i36ghfh9cwgrasx7923zx1s7lwf61mp-emacs-mac-macport-with-packages-29.1/share/icons
/nix/store/4i36ghfh9cwgrasx7923zx1s7lwf61mp-emacs-mac-macport-with-packages-29.1/share/applications

❌ Latest Emacs.app

nix build nixpkgs#emacs29-macport
> find result/Applications/Emacs.app/

result/Applications/Emacs.app/
result/Applications/Emacs.app/Contents
result/Applications/Emacs.app/Contents/MacOS
result/Applications/Emacs.app/Contents/MacOS/Emacs.sh
result/Applications/Emacs.app/Contents/Resources
result/Applications/Emacs.app/Contents/Resources/document.icns
result/Applications/Emacs.app/Contents/Resources/Emacs.icns
result/Applications/Emacs.app/Contents/native-lisp
result/Applications/Emacs.app/Contents/PkgInfo

It seems that there is fewer files now in the output for whatever reason?

@knl
Copy link
Contributor

knl commented Sep 6, 2023

I'm having the same issue on darwin with emacs28-macport

@knl
Copy link
Contributor

knl commented Sep 6, 2023

Running git bisect run sh -c 'nix-build -A emacs28-macport && fd . result/Applications/Emacs.app |rg Info.plist between the HEAD and ae4e2e8 yields this as the breaking commit:

running 'sh' '-c' 'nix-build -A emacs28-macport && fd . result/Applications/Emacs.app |rg Info.plist'
/nix/store/jkdbjl02k2k45gp4kkqjg3cgvalrbkrp-emacs-mac-macport-28.2
f607a7851619a6efda5f7c57f0345018a3ea403c is the first bad commit
commit f607a7851619a6efda5f7c57f0345018a3ea403c
Author: Andrew Pan <a@tny.town>
Date:   Tue Aug 29 12:52:53 2023 -0500

    emacs-macport: build on LLVM 14

    - Build on `apple_sdk_11_0` to support `aarch64-darwin`
    - Add frameworks required for building on newer SDKs
      - `Accelerate`, `UniformTypeIdentifiers`
    - Include header to work around `CF_NOESCAPE` issue circa LLVM 7.0

 pkgs/applications/editors/emacs/default.nix        |  6 ++---
 pkgs/applications/editors/emacs/generic.nix        | 13 +++++++--
 .../editors/emacs/macport_noescape_noop.h          | 31 ++++++++++++++++++++++
 pkgs/top-level/all-packages.nix                    |  2 +-
 4 files changed, 46 insertions(+), 6 deletions(-)
 create mode 100644 pkgs/applications/editors/emacs/macport_noescape_noop.h
bisect found first bad commit

@AndersonTorres
Copy link
Member

Invoking @tnytown

@tnytown
Copy link
Contributor

tnytown commented Sep 6, 2023

Info.plist is gated on $HAVE_MACGUI in configure.ac:

MAC_TEMPLATE_FILES=                                                
if test "$HAVE_MACGUI" = "yes"; then                              
    AC_CONFIG_FILES([mac/Emacs.app/Contents/Info.plist:mac/templates/Info.plist.in \
    mac/Emacs.app/Contents/Resources/English.lproj/InfoPlist.strings:mac/templates/InfoPlist.strings.in])
    MAC_TEMPLATE_FILES="mac/templates/Info.plist.in mac/templates/InfoPlist.strings.in"
fi                                                                      
AC_SUBST(MAC_TEMPLATE_FILES)

Which is set by checking for Carbon/Carbon.h:

HAVE_MACGUI=no
if test "${with_mac}" != no; then
  AC_CHECK_HEADER(Carbon/Carbon.h, HAVE_MACGUI=yes)

Which, according to config.log, fails because of more SDK issues:

configure:11303: checking for Carbon/Carbon.h
configure:11303: clang -c -g3 -O2    conftest.c >&5
In file included from conftest.c:93:
In file included from /nix/store/wzvxqp2nm0ivww8f74qbq4bjbf239and-apple-framework-Carbon-11.0.0/Library/Frameworks/Carbon.framework/Headers/Carbon.h:20:
In file included from /nix/store/6dkb6ss4adynkjplmvh7ipmnmpyabk1h-apple-framework-CoreServices-11.0.0/Library/Frameworks/CoreServices.framework/Headers/CoreS
ervices.h:19:
In file included from /nix/store/3wi5zjg8p8qmqlww2kqkdw9q2vyi18wa-apple-framework-CoreFoundation-11.0.0/Library/Frameworks/CoreFoundation.framework/Headers/C
oreFoundation.h:60:
In file included from /nix/store/3wi5zjg8p8qmqlww2kqkdw9q2vyi18wa-apple-framework-CoreFoundation-11.0.0/Library/Frameworks/CoreFoundation.framework/Headers/C
FPropertyList.h:17:
In file included from /nix/store/3wi5zjg8p8qmqlww2kqkdw9q2vyi18wa-apple-framework-CoreFoundation-11.0.0/Library/Frameworks/CoreFoundation.framework/Headers/C
FStream.h:16:
/nix/store/3wi5zjg8p8qmqlww2kqkdw9q2vyi18wa-apple-framework-CoreFoundation-11.0.0/Library/Frameworks/CoreFoundation.framework/Headers/CFURL.h:1189:83: error:
 expected ','
    kCFURLBookmarkCreationWithSecurityScope API_AVAILABLE(macos(10.7), macCatalyst(13.0))  API_UNAVAILABLE(ios, watchos, tvos) = ( 1UL << 11 ), // Mac OS X 1
0.7.3 and later, include information in the bookmark data which allows the same sandboxed process to access the resource after being relaunched
                                                                                  ^
/nix/store/3wi5zjg8p8qmqlww2kqkdw9q2vyi18wa-apple-framework-CoreFoundation-11.0.0/Library/Frameworks/CoreFoundation.framework/Headers/CFURL.h:1190:98: error:
 expected ','
    kCFURLBookmarkCreationSecurityScopeAllowOnlyReadAccess API_AVAILABLE(macos(10.7), macCatalyst(13.0)) API_UNAVAILABLE(ios, watchos, tvos) = ( 1UL << 12 ),
 // Mac OS X 10.7.3 and later, if used with kCFURLBookmarkCreationWithSecurityScope, at resolution time only read access to the resource will be granted
                                                                                                 ^
/nix/store/3wi5zjg8p8qmqlww2kqkdw9q2vyi18wa-apple-framework-CoreFoundation-11.0.0/Library/Frameworks/CoreFoundation.framework/Headers/CFURL.h:1200:85: error:
 expected ','
    kCFURLBookmarkResolutionWithSecurityScope API_AVAILABLE(macos(10.7), macCatalyst(13.0)) API_UNAVAILABLE(ios, watchos, tvos) = ( 1UL << 10 ), // Mac OS X 
10.7.3 and later, use the secure information included at creation time to provide the ability to access the resource in a sandboxed process.
                                                                                    ^
...

This is happening because Carbon/Carbon.h is still including an old Libsystem, this time from libgccjit:

$ nix why-depends --all .#legacyPackages.x86_64-darwin.emacs28-macport /nix/store/gyp86pwkkxa8p7kppb8n2bzvxni9ww61-Libsystem-1238.60.2/
/nix/store/l9r0j134gkzq31jknyfip4kfcjf3r9db-emacs-mac-macport-28.2
└───/nix/store/qb70bcixfgkjn2dkzl2phd8mylxxqwbq-libgccjit-12.3.0
    └───/nix/store/gyp86pwkkxa8p7kppb8n2bzvxni9ww61-Libsystem-1238.60.2

Looks like #252244 (comment) may have produced a non-failing build, but missed this usage of Libsystem.

@wegank

This comment was marked as outdated.

@wegank wegank closed this as completed Sep 6, 2023
@knl
Copy link
Contributor

knl commented Sep 7, 2023

@wegank I think the issue we're concerned about is still not fixed. Info.plist is missing and emacs{28,29}-macport is incorrectly built.

@wegank wegank reopened this Sep 7, 2023
@tnytown
Copy link
Contributor

tnytown commented Sep 7, 2023

This is happening because Carbon/Carbon.h is still including an old Libsystem, this time from libgccjit

I was wrong here. libgccjit doesn't propagate Libsystem, it only depends on it. The correct (and baffling) solution is to explicitly inherit llvmPackages_14 from darwin.apple_sdk_11_0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: build failure A package fails to build
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants