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

RFC: Emacs 27 derivation #65300

Closed
wants to merge 3 commits into from
Closed

RFC: Emacs 27 derivation #65300

wants to merge 3 commits into from

Conversation

ar1a
Copy link
Contributor

@ar1a ar1a commented Jul 23, 2019

Motivation for this change

Emacs 27 has a few desirable changes, like early-init.el and a native json parser (50x speed up). Unfortunately, it won't be released for a few months minimum, probably a year. I need help testing emacs, as it is so big. I also haven't checked if there any new compile options, etc, etc. This is all pretty overwhelming, so if you spot anything please let me know.

I am also wondering how we should version the release, because at a guess we can't ask for master revision because the sha256 will fail. Right now my plan was to just periodically update the rev and sha, but there's gotta be a better waaaaaaaaaaay.

You can build it with nix-build -A emacsHead

Changelog: https://github.com/emacs-mirror/emacs/blob/master/etc/NEWS

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)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@alexarice
Copy link
Contributor

I am also wondering how we should version the release, because at a guess we can't ask for master revision because the sha256 will fail. Right now my plan was to just periodically update the rev and sha, but there's gotta be a better waaaaaaaaaaay.

Perhaps you could do something similar to https://github.com/colemickens/nixpkgs-wayland

@adisbladis
Copy link
Member

This version of clean-env.patch applies on emacs master:

Dump temacs in an empty environment to prevent -dev paths from ending
up in the dumped image.

diff --git a/src/Makefile.in b/src/Makefile.in
index fd05a45df5..13f529c253 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -570,7 +570,7 @@ emacs$(EXEEXT): temacs$(EXEEXT) \
                 lisp.mk $(etc)/DOC $(lisp) \
                 $(lispsource)/international/charprop.el ${charsets}
 ifeq ($(DUMPING),unexec)
-	LC_ALL=C $(RUN_TEMACS) -batch $(BUILD_DETAILS) -l loadup --temacs=dump
+	env -i LC_ALL=C $(RUN_TEMACS) -batch $(BUILD_DETAILS) -l loadup --temacs=dump
   ifneq ($(PAXCTL_dumped),)
 	      $(PAXCTL_dumped) emacs$(EXEEXT)
   endif

@adisbladis
Copy link
Member

adisbladis commented Jul 23, 2019

This expression works without duplicating the entire file:

{ pkgs ? import <nixpkgs> {}
, lib ? pkgs.lib
}:

let
  rev = "dfb0ba79b5f41ca6fed25a03d2a5cd6996ec4753";
  sha256 = "0cr8mlcxyib4rd8xj65hb1wxwlmppgg4823z7h3dbbxi273gz5b0";

in (pkgs.emacs.override { srcRepo = true; }).overrideAttrs(old: rec {
  name = "emacs-${version}";
  version = builtins.substring 0 7 rev;

  src = pkgs.fetchFromGitHub {
    owner = "emacs-mirror";
    repo = "emacs";
    inherit sha256 rev;
  };

  patches = [
    ./clean-env.patch
    (lib.elemAt old.patches 1)
  ];

})

@adisbladis
Copy link
Member

FYI I've pushed an auto-updating emacs to mine and @etu`s overlay https://github.com/adisbladis/exwm-overlay.

Xaw3d = null;
gconf = null;
alsaLib = null;
imagemagick = null;
Copy link
Contributor

Choose a reason for hiding this comment

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

We don't support ImageMagick?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

in emacs 27 it's disabled by default, recent replaced by something else. I haven't actualy c hanged these options from what emacs26 called default.nix with anyways

@ofborg ofborg bot requested a review from jwiegley July 24, 2019 01:23
++ lib.optional (withX && (withGTK3 || withXwidgets)) wrapGAppsHook;

buildInputs =
[ ncurses gconf libxml2 gnutls alsaLib acl gpm gettext ]
Copy link
Contributor

Choose a reason for hiding this comment

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

Based off of the NEWS file, it looks like gmp and jansson should be added to buildInputs.

  • gmp: The build now requires gmp, but will fallback to using the included minigmp if it's not available. I'm thinking it would be better to use gmp from nixpkgs.
  • jansson: Emacs now uses jansson by default if it's available, for faster JSON parsing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks! i've made this change

@adisbladis
Copy link
Member

adisbladis commented Nov 1, 2019

@ar1a I'd actually like to close this PR, if a user wants bleeding edge emacs we now have the emacs overlay: https://github.com/nix-community/emacs-overlay.

Are you fine with this?

@ar1a
Copy link
Contributor Author

ar1a commented Nov 1, 2019 via email

@adisbladis adisbladis closed this Nov 1, 2019
@rcorrear
Copy link

No love in emacs-overlay for macOS users :(

@adisbladis
Copy link
Member

@rcorrear I happily accept patches for macOS in the overlay.
If you are thinking about emacsMacport upstream ( ftp://ftp.math.s.chiba-u.ac.jp/emacs/ ) does not yet have a mac port for Emacs 27.

@rcorrear
Copy link

@adisbladis I was hoping no one would comment before I was finished building it, but I'll take back my comment, I didn't understand overlays well enough :)

Took me a little while to figure out how to use them since the instructions (in your repo and almost everywhere else I found) are more tailored to NixOS users but not for (standalone) Nixpkgs users (which is what you get in macOS).

If I do find anything I can contribute to emacs-overlay I will, I'm slowly learning about Nix and overlays are something I just came across.

And yeah, I'm aware of emacsMacport not being ported yet to Emacs 27. Thanks for pointing that out though.

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

6 participants