GithubHelp home page GithubHelp logo

emacs's Introduction

Nightly custom Emacs builds for macOS Nix environments

CI badge BuiltWithNix badge Cachix badge Emacs badge

This repository provides nightly automated builds of Emacs from HEAD for macOS Nix environments with the following additions:

Recent Changes

The no-titlebar frame patch has been removed, as it can be implemented with pure Emacs Lisp by putting the following early on during initialization (e.g. in early-init.el):

(add-to-list 'default-frame-alist '(undecorated . t))

See d12frosted/homebrew-emacs-plus#433 (comment) for further background.

Usage

To use this flake on your system, add it to your configuration inputs & overlays.
It overlays the pkgs.emacs package.
There is a complimentary binary cache available which is pushed to nightly.

{
  inputs.darwin.url = "github:lnl7/nix-darwin";
  inputs.emacs.url = "github:cmacrae/emacs";

  outputs = { self, darwin, emacs }: {
    darwinConfigurations.example = darwin.lib.darwinSystem {
      modules = [
        {
          nix.binaryCaches = [
            "https://cachix.org/api/v1/cache/emacs"
          ];

          nix.binaryCachePublicKeys = [
            "emacs.cachix.org-1:b1SMJNLY/mZF6GxQE+eDBeps7WnkT0Po55TAyzwOxTY="
          ];

          nixpkgs.overlays = [
            emacs.overlay
          ];
        }
      ];
    };
  };
}

emacs's People

Contributors

bromanko avatar cmacrae avatar montchr avatar phaer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

emacs's Issues

bug: `error: function 'anonymous lambda' called with unexpected argument 'nativeComp'` on Apple Silicon

Installing emacs with nix-darwin, i got error error: function 'anonymous lambda' called with unexpected argument 'nativeComp':

.nixpkgs on  main [!+]
λ make darwin-debug
nix build .#darwinConfigurations.mydevice.system --show-trace --verbose \
	  --extra-experimental-features 'nix-command flakes'
Using saved setting for 'substituters = https://cache.nixos.org https://cachix.org/api/v1/cache/emacs' from ~/.local/share/nix/trusted-settings.json.
Using saved setting for 'trusted-public-keys = emacs.cachix.org-1:b1SMJNLY/mZF6GxQE+eDBeps7WnkT0Po55TAyzwOxTY=' from ~/.local/share/nix/trusted-settings.json.
error:
       … while calling the 'derivationStrict' builtin

         at /builtin/derivation.nix:9:12: (source not available)

       … while evaluating derivation 'darwin-system-24.05.20240626.66f253e+darwin4.5058197'
         whose name attribute is located at /nix/store/8sh7ig1gsxwgax10k4iad85bbpnygcxr-source/pkgs/stdenv/generic/make-derivation.nix:331:7

       … while evaluating attribute 'activationScript' of derivation 'darwin-system-24.05.20240626.66f253e+darwin4.5058197'

         at /nix/store/ifgsdvbl55siwqhalbnxxnycd77km640-source/modules/system/default.nix:95:7:

           94|
           95|       activationScript = cfg.activationScripts.script.text;
             |       ^
           96|       activationUserScript = cfg.activationScripts.userScript.text;

       … while calling anonymous lambda

         at /nix/store/8sh7ig1gsxwgax10k4iad85bbpnygcxr-source/lib/attrsets.nix:1205:18:

         1204|         mapAttrs
         1205|           (name: value:
             |                  ^
         1206|             if isAttrs value && cond value

       … from call site

         at /nix/store/8sh7ig1gsxwgax10k4iad85bbpnygcxr-source/lib/attrsets.nix:1208:18:

         1207|             then recurse (path ++ [ name ]) value
         1208|             else f (path ++ [ name ]) value);
             |                  ^
         1209|     in

       … while calling anonymous lambda

         at /nix/store/8sh7ig1gsxwgax10k4iad85bbpnygcxr-source/lib/modules.nix:242:72:

          241|           # For definitions that have an associated option
          242|           declaredConfig = mapAttrsRecursiveCond (v: ! isOption v) (_: v: v.value) options;
             |                                                                        ^
          243|

       … while evaluating the option `system.activationScripts.script.text':

       … while calling anonymous lambda

         at /nix/store/8sh7ig1gsxwgax10k4iad85bbpnygcxr-source/lib/modules.nix:824:28:

          823|         # Process mkMerge and mkIf properties.
          824|         defs' = concatMap (m:
             |                            ^
          825|           map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))

       … while evaluating definitions from `/nix/store/ifgsdvbl55siwqhalbnxxnycd77km640-source/modules/system/activation-scripts.nix':

       … from call site

         at /nix/store/8sh7ig1gsxwgax10k4iad85bbpnygcxr-source/lib/modules.nix:825:137:

          824|         defs' = concatMap (m:
          825|           map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))
             |                                                                                                                                         ^
          826|         ) defs;

       … while calling 'dischargeProperties'

         at /nix/store/8sh7ig1gsxwgax10k4iad85bbpnygcxr-source/lib/modules.nix:896:25:

          895|   */
          896|   dischargeProperties = def:
             |                         ^
          897|     if def._type or "" == "merge" then

       … while calling anonymous lambda

         at /nix/store/8sh7ig1gsxwgax10k4iad85bbpnygcxr-source/lib/attrsets.nix:1205:18:

         1204|         mapAttrs
         1205|           (name: value:
             |                  ^
         1206|             if isAttrs value && cond value

       … from call site

         at /nix/store/8sh7ig1gsxwgax10k4iad85bbpnygcxr-source/lib/attrsets.nix:1208:18:

         1207|             then recurse (path ++ [ name ]) value
         1208|             else f (path ++ [ name ]) value);
             |                  ^
         1209|     in

       … while calling anonymous lambda

         at /nix/store/8sh7ig1gsxwgax10k4iad85bbpnygcxr-source/lib/modules.nix:242:72:

          241|           # For definitions that have an associated option
          242|           declaredConfig = mapAttrsRecursiveCond (v: ! isOption v) (_: v: v.value) options;
             |                                                                        ^
          243|

       … while evaluating the option `system.activationScripts.applications.text':

       … while calling anonymous lambda

         at /nix/store/8sh7ig1gsxwgax10k4iad85bbpnygcxr-source/lib/modules.nix:824:28:

          823|         # Process mkMerge and mkIf properties.
          824|         defs' = concatMap (m:
             |                            ^
          825|           map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))

       … while evaluating definitions from `/nix/store/ifgsdvbl55siwqhalbnxxnycd77km640-source/modules/system/applications.nix':

       … from call site

         at /nix/store/8sh7ig1gsxwgax10k4iad85bbpnygcxr-source/lib/modules.nix:825:137:

          824|         defs' = concatMap (m:
          825|           map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))
             |                                                                                                                                         ^
          826|         ) defs;

       … while calling 'dischargeProperties'

         at /nix/store/8sh7ig1gsxwgax10k4iad85bbpnygcxr-source/lib/modules.nix:896:25:

          895|   */
          896|   dischargeProperties = def:
             |                         ^
          897|     if def._type or "" == "merge" then

       … while evaluating derivation 'system-applications'
         whose name attribute is located at /nix/store/8sh7ig1gsxwgax10k4iad85bbpnygcxr-source/pkgs/stdenv/generic/make-derivation.nix:331:7

       … while evaluating attribute 'passAsFile' of derivation 'system-applications'

         at /nix/store/8sh7ig1gsxwgax10k4iad85bbpnygcxr-source/pkgs/build-support/trivial-builders/default.nix:69:9:

           68|         inherit buildCommand name;
           69|         passAsFile = [ "buildCommand" ]
             |         ^
           70|           ++ (derivationArgs.passAsFile or [ ]);

       … while evaluating derivation 'darwin-manpages'
         whose name attribute is located at /nix/store/8sh7ig1gsxwgax10k4iad85bbpnygcxr-source/pkgs/stdenv/generic/make-derivation.nix:331:7

       … while evaluating attribute 'buildCommand' of derivation 'darwin-manpages'

         at /nix/store/8sh7ig1gsxwgax10k4iad85bbpnygcxr-source/pkgs/build-support/trivial-builders/default.nix:68:16:

           67|         enableParallelBuilding = true;
           68|         inherit buildCommand name;
             |                ^
           69|         passAsFile = [ "buildCommand" ]

       … while evaluating derivation 'options.json'
         whose name attribute is located at /nix/store/8sh7ig1gsxwgax10k4iad85bbpnygcxr-source/pkgs/stdenv/generic/make-derivation.nix:331:7

       … while evaluating attribute 'buildCommand' of derivation 'options.json'

         at /nix/store/8sh7ig1gsxwgax10k4iad85bbpnygcxr-source/pkgs/build-support/trivial-builders/default.nix:68:16:

           67|         enableParallelBuilding = true;
           68|         inherit buildCommand name;
             |                ^
           69|         passAsFile = [ "buildCommand" ]

       … while evaluating derivation 'options.json'
         whose name attribute is located at /nix/store/8sh7ig1gsxwgax10k4iad85bbpnygcxr-source/pkgs/stdenv/generic/make-derivation.nix:331:7

       … while evaluating attribute 'options' of derivation 'options.json'

         at /nix/store/8sh7ig1gsxwgax10k4iad85bbpnygcxr-source/nixos/lib/make-options-doc/default.nix:198:7:

          197|       ];
          198|       options = builtins.toFile "options.json"
             |       ^
          199|         (builtins.unsafeDiscardStringContext (builtins.toJSON optionsNix));

       … while evaluating the default value of option `services.emacs.package`

       … from call site

         at /nix/store/8sh7ig1gsxwgax10k4iad85bbpnygcxr-source/lib/options.nix:346:15:

          345|             builtins.addErrorContext "while evaluating the ${if opt?defaultText then "defaultText" else "default value"} of option `${name}`" (
          346|               renderOptionValue (opt.defaultText or opt.default)
             |               ^
          347|             );

       … while calling 'renderOptionValue'

         at /nix/store/8sh7ig1gsxwgax10k4iad85bbpnygcxr-source/lib/options.nix:383:23:

          382|   */
          383|   renderOptionValue = v:
             |                       ^
          384|     if v ? _type && v ? text then v

       … while calling anonymous lambda

         at /nix/store/ifgsdvbl55siwqhalbnxxnycd77km640-source/modules/documentation/default.nix:37:18:

           36|         scrubDerivations = namePrefix: pkgSet: mapAttrs
           37|           (name: value:
             |                  ^
           38|             let wholeName = "${namePrefix}.${name}"; in

       … from call site

         at /nix/store/8sh7ig1gsxwgax10k4iad85bbpnygcxr-source/lib/trivial.nix:895:7:

          894|     { # TODO: Should we add call-time "type" checking like built in?
          895|       __functor = self: f;
             |       ^
          896|       __functionArgs = args;

       … while calling anonymous lambda

         at /nix/store/8sh7ig1gsxwgax10k4iad85bbpnygcxr-source/lib/customisation.nix:144:34:

          143|       # Re-call the function but with different arguments
          144|       overrideArgs = mirrorArgs (newArgs: makeOverridable f (overrideWith newArgs));
             |                                  ^
          145|       # Change the result of the function call by applying g to it

       … from call site

         at /nix/store/8sh7ig1gsxwgax10k4iad85bbpnygcxr-source/lib/trivial.nix:895:7:

          894|     { # TODO: Should we add call-time "type" checking like built in?
          895|       __functor = self: f;
             |       ^
          896|       __functionArgs = args;

       … while calling anonymous lambda

         at /nix/store/8sh7ig1gsxwgax10k4iad85bbpnygcxr-source/lib/customisation.nix:136:17:

          135|     in
          136|     mirrorArgs (origArgs:
             |                 ^
          137|     let

       error: function 'anonymous lambda' called with unexpected argument 'nativeComp'

       at /nix/store/8sh7ig1gsxwgax10k4iad85bbpnygcxr-source/pkgs/applications/editors/emacs/make-emacs.nix:9:1:

            8|
            9| { lib
             | ^
           10| , stdenv
make: *** [darwin-debug] Error 1

Can install from flake/registry, cannot build/incorporate from flake/overlay

Hi,

I love this version of Emacs for MacOS - both the Yabai window patch + the support for term are lifesavers.

I cannot figure out how to use the flake in my config directly to become either the pkgs.emacs or pkgs.emacs-unstable replacement. I've tried via an overlay as well as via incorporating the flake directly.

If I install via nix registry, nix profile, it works fine.

If I try to install via the overlay / flake approach, I get an error attempting to build mesa for some reason.

error: builder for '/nix/store/4fns3gy97k9fj6ya8rifgvw7l4xmafyq-mesa-23.1.7.drv' failed with exit code 1; last 10 log lines: > C compiler for the host machine: clang (clang 11.1.0 "clang version 11.1.0") > C linker for the host machine: clang ld64 609 > C++ compiler for the host machine: clang++ (clang 11.1.0 "clang version 11.1.0") > C++ linker for the host machine: clang++ ld64 609 > Host machine cpu family: aarch64 > Host machine cpu: aarch64 > > meson.build:364:3: ERROR: Feature gbm cannot be enabled: GBM only supports DRM/KMS platforms > > A full log can be found at /private/tmp/nix-build-mesa-23.1.7.drv-0/mesa-23.1.7/build/meson-logs/meson-log.txt For full logs, run 'nix log /nix/store/4fns3gy97k9fj6ya8rifgvw7l4xmafyq-mesa-23.1.7.drv'.

I am sure this is user error for me being less proficient at nix. I'd love help or a pointer in the right direction to make the flake/overlay approach work well.

Thanks!

libgccjit.so: error: error invoking gcc driver

Emacs works fine but the native compilation doesn't. Each time I start it, I get this series of logs for every single .el in my setup:

⛔ Warning (comp): aarch64-apple-darwin-gcc-11.3.0: warning: could not understand version '13.00.00'
⛔ Warning (comp): libgccjit.so: error: error invoking gcc driver
⛔ Warning (comp): /Users/hub/.emacs.d/straight/build/anki-editor/anki-editor.el: Error: Internal native compiler error failed to compile

Looks fairly similar to this discussion: jimeh/build-emacs-for-macos#54

I am on an apple M1 with Ventura 13.2. My installation is verbatim what's in the README.

Patches no longer apply successfully with latest upstream commits

The macOS-specific patches no longer apply cleanly on recent Emacs upstream commits, causing builds to fail.

Originally noted in #6 (comment).

We may be able to reference @d12frosted's latest patch updates in emacs-plus. The v29 patches are symlinked to the patches in the v28 directory:

Also see inscapist/emacs-osx#5 – looks like they're running into a similar or identical issue with patches.

Here's the relevant section from the latest workflow run:

https://github.com/cmacrae/emacs/runs/4725513857?check_suite_focus=true

emacs> unpacking sources
emacs> unpacking source archive /nix/store/7jnpakz058kq0dwi0wllxxlif5py1hsc-source
emacs> source root is source
emacs> patching sources
emacs> applying patch /nix/store/j9fa4phwrah4rwg3va7whlxljf8qbxba-fix-window-role.patch
emacs> patching file src/nsterm.m
emacs> Hunk #1 succeeded at 8634 (offset -244 lines).
emacs> applying patch /nix/store/nlgq5vra3c0r1snj0wbmd49r78pagi5j-no-titlebar.patch
emacs> patching file src/nsterm.m
emacs> Hunk #1 FAILED at 433.
emacs> Hunk #2 succeeded at 8353 (offset 48 lines).
emacs> 1 out of 2 hunks FAILED -- saving rejects to file src/nsterm.m.rej
error: builder for '/nix/store/880sh2mrn0gsdwx1kmbq54d3iddcf39n-emacs-29.0.50.drv' failed with exit code 1;
       last 10 log lines:
       > source root is source
       > patching sources
       > applying patch /nix/store/j9fa4phwrah4rwg3va7whlxljf8qbxba-fix-window-role.patch
       > patching file src/nsterm.m
       > Hunk #1 succeeded at 8634 (offset -244 lines).
       > applying patch /nix/store/nlgq5vra3c0r1snj0wbmd49r78pagi5j-no-titlebar.patch
       > patching file src/nsterm.m
       > Hunk #1 FAILED at 433.
       > Hunk #2 succeeded at 8353 (offset 48 lines).
       > 1 out of 2 hunks FAILED -- saving rejects to file src/nsterm.m.rej
       For full logs, run 'nix log /nix/store/880sh2mrn0gsdwx1kmbq54d3iddcf39n-emacs-29.0.50.drv'.
Error: Process completed with exit code 1.

Failing with latest emacs due to withGTK3 defaulting to false

Related to nix-community/emacs-overlay#244 I believe, looks like the latest nixpkgs-unstable emacs derivation sets withGTK3 to false by default, but withXwidgets requires it to be true.

The error I'm getting when trying to build:

error: assertion '(withXwidgets -> (withGTK3 && (webkitgtk != null)))' failed

       at /nix/store/1hyrj236ljnvh1q3f7039877vd4sgrq9-source/pkgs/applications/editors/emacs/generic.nix:52:1:

           51| assert withPgtk -> withGTK3 && !withX && gtk3 != null;
           52| assert withXwidgets -> withGTK3 && webkitgtk != null;
             | ^
           53|

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.