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

Bug in emacsGcc breaking autoloads breaks working variants #215

Open
ParetoOptimalDev opened this issue Mar 18, 2022 · 2 comments
Open

Bug in emacsGcc breaking autoloads breaks working variants #215

ParetoOptimalDev opened this issue Mar 18, 2022 · 2 comments

Comments

@ParetoOptimalDev
Copy link

Diving into #212 more I found that working versions didn't work after a non-working, but they do the second time:

{ pkgs ? import (builtins.fetchTarball {
  url = "https://github.com/nixos/nixpkgs/archive/a7ecde854aee5c4c7cd6177f54a99d2c1ff28a31.tar.gz";
}) {
    overlays = [
      (import (builtins.fetchTarball {
        url = https://github.com/nix-community/emacs-overlay/archive/c4bcf4b66394a4472cc251e2350c557dac13d621.tar.gz;
      }))];}, ... }:
let
    emacsPkgs = epkgs: [
    (builtins.trace "===> ${epkgs.haskell-mode.name}" epkgs.melpaPackages.haskell-mode)
    ];
    pkgsWithOverlay = (import (builtins.fetchTarball {
      url = "https://github.com/nixos/nixpkgs/archive/a7ecde854aee5c4c7cd6177f54a99d2c1ff28a31.tar.gz";
    })) {
      overlays = [
        (import (builtins.fetchTarball {
          url = https://github.com/nix-community/emacs-overlay/archive/master.tar.gz;
        }))
      ];
    };

  # works
  myEmacsGcc = (pkgsWithOverlay.emacsPackagesGen pkgsWithOverlay.emacsGcc).emacsWithPackages (epkgs: ([
    epkgs.haskell-mode
  ]));

  myEmacsGccImportedEmacsPackages = (pkgsWithOverlay.emacsPackagesGen pkgsWithOverlay.emacsGcc).emacsWithPackages (import ./emacs-packages.nix);

  emacsWithOverlay = pkgsWithOverlay.emacsWithPackagesFromUsePackage {
    config = builtins.readFile dotEmacs; # builtins.readFile ./emacs.el;z

    # nix-shell ~/.emacs.d/flavors/emacs-haskell-mode-repro.nix --run test-emacs
    # I uncommented these and ran them in order and got really weird behavior

    # works
    # package = pkgs.emacs;
    # extraEmacsPackages = emacsPkgs;
    
    # works
    # package = pkgsWithOverlay.emacs;
    # extraEmacsPackages = emacsPkgs;

    # eldoc error: (void-function haskell-doc-current-info)
    # package = pkgsWithOverlay.emacsGcc;
    # extraEmacsPackages = emacsPkgs;

    # NOTE: same as the one that worked above
    # works
    # package = pkgsWithOverlay.emacs;
    # extraEmacsPackages = emacsPkgs;

    # doesn't work
    # package = myEmacsGcc;

    # NOTE: same as the one that worked above
    # doesn't work????
    # package = pkgsWithOverlay.emacs;
    # extraEmacsPackages = emacsPkgs;

    # eldoc error: (void-function haskell-doc-current-info)
    # package = myEmacsGccImportedEmacsPackages;

    # NOTE: same as the one that worked above
    # run 1. eldoc error: (void-function haskell-doc-current-info)
    # run 2 works
    # package = pkgsWithOverlay.emacs;
    # extraEmacsPackages = emacsPkgs;
   
  };
  dotEmacs = pkgs.writeText "dot-emacs" ''
  (require 'haskell-mode)
  '';
  trivialHaskell = pkgs.writeText "foo.hs" ''
  module Main where
  main = undefined
  '';
  testEmacsHaskell = pkgs.writeScriptBin "test-emacs" ''
    exec ${emacsWithOverlay}/bin/emacs -Q -l ${dotEmacs} ${trivialHaskell}
  '';
in pkgs.mkShell {
  buildInputs = [ testEmacsHaskell ];
}
@adisbladis
Copy link
Member

Is this in any way inherent to the Nix expressions or is it an upstream bug?
We don't track Emacs upstream issues here.

@ParetoOptimalDev
Copy link
Author

The nix expression is responsible for loading autoloads correctly.

The one in nixpkgs does, but this one in emacs-overlay doesn't load autoloads correctly.

Therefore it seemed most appropriate to create here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants