nix-community / emacs2nix

Automatically generate Nix expressions for Emacs packages
GNU General Public License v3.0
29 stars 17 forks source link

Running melpa-stable-packages.sh starts bash with no other indication #23

Closed DamienCassou closed 8 years ago

DamienCassou commented 8 years ago
$ ./melpa-stable-packages.sh --threads 4 --melpa ../melpa --output melpa-stable-package.nix shell-switcher
bash-4.3$ 

what should I do now?

DamienCassou commented 8 years ago

I'm on a6b598ee66ad40bd842039766f6c82b591ad3946

ttuegel commented 8 years ago

I can't reproduce this. What version of Nix are you using? Here I have

$ nix-shell --version
nix-shell (Nix) 1.11.2
DamienCassou commented 8 years ago
/tmp $ git clone https://github.com/ttuegel/emacs2nix
Cloning into 'emacs2nix'...
remote: Counting objects: 1949, done.        
remote: Compressing objects: 100% (57/57), done.        
remote: Total 1949 (delta 29), reused 0 (delta 0), pack-reused 1892        
Receiving objects: 100% (1949/1949), 313.19 KiB | 383.00 KiB/s, done.
Resolving deltas: 100% (1101/1101), done.
Checking connectivity... done.
/tmp $ cd emacs2nix/
/tmp/emacs2nix $ git clone https://github.com/melpa/melpa
Cloning into 'melpa'...
remote: Counting objects: 25737, done.        
remote: Total 25737 (delta 0), reused 0 (delta 0), pack-reused 25737        
Receiving objects: 100% (25737/25737), 7.91 MiB | 4.33 MiB/s, done.
Resolving deltas: 100% (13395/13395), done.
Checking connectivity... done.
/tmp/emacs2nix $ git submodule update --init
Submodule 'hnix' (https://github.com/ttuegel/hnix.git) registered for path 'hnix'
Cloning into 'hnix'...
remote: Counting objects: 817, done.        
remote: Total 817 (delta 0), reused 0 (delta 0), pack-reused 817        
Receiving objects: 100% (817/817), 351.53 KiB | 372.00 KiB/s, done.
Resolving deltas: 100% (490/490), done.
Checking connectivity... done.
Submodule path 'hnix': checked out '05a59fb890a2af42de8c2451841e121245c5ff0a'
/tmp/emacs2nix $ ./melpa-stable-packages.sh --threads 4 --melpa melpa --output melpa-stable-package.nix shell-switcher
bash-4.3$ exit
exit
/tmp/emacs2nix $ nix-shell --version
nix-shell (Nix) 1.11.2
ttuegel commented 8 years ago

Yeah, that works for me and produces in melpa-stable-package.nix:

{ callPackage }: {
    shell-switcher = callPackage ({ fetchFromGitHub, fetchurl, lib, melpaBuild }:
    melpaBuild {
        pname = "shell-switcher";
        version = "1.0.1";
        src = fetchFromGitHub {
          owner = "DamienCassou";
          repo = "shell-switcher";
          rev = "2c5575ae859a82041a4bacd1793b844bfc24c34f";
          sha256 = "0ia7sdip4hl27avckv3qpqgm3k4ynvp3xxq1cy53bqfzzx0gcria";
        };
        recipeFile = fetchurl {
          url = "https://raw.githubusercontent.com/milkypostman/melpa/31574cd756f4f93e2c6bcad5eca33a3294cccd54/recipes/shell-switcher";
          sha256 = "07g9naiv2jk9jxwjywrbb05dy0pbfdx6g8pkra38rn3vqrjzvhyx";
          name = "shell-switcher";
        };
        packageRequires = [];
        meta = {
          homepage = "https://melpa.org/#/shell-switcher";
          license = lib.licenses.free;
        };
      }) {};
  }

Is it possible that the #! line in melpa-stable-packages.sh is picking up a different version of nix-shell? This error is what I would expect if an older version of nix-shell were used that does not support the #!nix-shell syntax.

DamienCassou commented 8 years ago

Is it possible that the #! line in melpa-stable-packages.sh is picking up a different version of nix-shell?

I replaced the first line by this with exactly the same result:

#!/nix/store/cza0kkcp7qwwr4qgdlm4xkaschir0xl8-nix-1.11.2/bin/nix-shell

This error is what I would expect if an older version of nix-shell were used that does not support the #!nix-shell syntax.

I confirm that removing the line #!nix-shell produces the exact same result.

DamienCassou commented 8 years ago

If you can't fix this, could you please send nixpkgs or me an updated melpa-stable-packages.nix so I can start using it? https://github.com/NixOS/nixpkgs/issues/14802

Thanks

ttuegel commented 8 years ago

Just updated Nixpkgs.

The only other thing I can think of for you to try is running cabal clean and/or deleting the dist/ directory. I guess there could be some leftover build artifact which is causing trouble.

DamienCassou commented 8 years ago

That didn't work either.

ttuegel commented 8 years ago

What is the result of running this sequence of commands?

$ nix-shell -A env
# Run the following within the nix-shell
$ cabal run melpa2nix -- --stable --work /tmp/melpa2nix --threads 4 --melpa ../melpa --output melpa-stable-package.nix shell-switcher

I'm trying to determine if the problem is with the script, or with melpa2nix itself. That is the sequence of commands which the script should be executing.

DamienCassou commented 8 years ago

I've changed laptop, reinstalled nixos on it, migrated my home directory, erased the emac2nix folder, cloned it again and it now seems to work fine: https://github.com/NixOS/nixpkgs/pull/17336.