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

add alacritty #21801

Closed
wants to merge 1 commit into from
Closed

add alacritty #21801

wants to merge 1 commit into from

Conversation

exi
Copy link
Contributor

@exi exi commented Jan 11, 2017

Motivation for this change

Add alacritty.

This package will only build once #21800 is merged

@exi
Copy link
Contributor Author

exi commented Jan 11, 2017

@globin some love?

with rustPlatform;

buildRustPackage rec {
name = "alacritty-${version}";
Copy link
Member

Choose a reason for hiding this comment

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

usually we have the following scheme when packaging packages without releases:

  name = "alacritty-unstable-<year>-<month>-<day>";

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

cmake gcc pkgconfig freetype expat gperf
libX11 libXcursor libXxf86vm libXi
];
buildInputs = [ ];
Copy link
Member

Choose a reason for hiding this comment

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

that could be dropped then.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@gebner
Copy link
Member

gebner commented Jan 11, 2017

Should we make hydra build this package? Right now we don't build rustNightly (or rustBeta), see #18111. cc @the-kenny

@exi
Copy link
Contributor Author

exi commented Jan 11, 2017

@gebner @the-kenny #21804
Did not see the original discussion so i tried to introduce it again :)

@puffnfresh
Copy link
Contributor

I was unable to build locally due to the Rust compiler stopping compilation with:

udp_clone_smoke has been running for over 60 seconds

But was able to build by overriding it with rustPlatform = (makeRustPlatform rustNightlyBin); - tried it out, it runs well!

@exi
Copy link
Contributor Author

exi commented Jan 12, 2017

@puffnfresh i suspect that this happens because this branch is not rebased onto the latest master.
I just rebased and force pushed it and will try the build again myself.

@exi
Copy link
Contributor Author

exi commented Jan 12, 2017

@puffnfresh just tried it with this branch on top of the current master and rust beta, rust nightly and alacritty build without issues

@jb55
Copy link
Contributor

jb55 commented Jan 12, 2017

I can't seem to build either, I'm getting this: https://gist.github.com/jb55/7c438c1ecbb6ee34551aeb771e4841fe

@exi
Copy link
Contributor Author

exi commented Jan 12, 2017

@jb55 you are not building from the right branch, the nightly version this is trying to build is way too old.
did you forget to "git pull" your master or something?

@jb55
Copy link
Contributor

jb55 commented Jan 12, 2017

oops looks like my nixpkgs was dirty and had stuff in staging area. retrying now

@puffnfresh
Copy link
Contributor

I'm getting the same UDP test problems so it must be something to do with my system.

@Mic92
Copy link
Member

Mic92 commented Jan 16, 2017

@puffnfresh what operating system do you use? I had problems with failing udp tests on debian in a nix-user-chroot, but not on nixos.

@puffnfresh
Copy link
Contributor

@Mic92 I use NixOS

@exi
Copy link
Contributor Author

exi commented Jan 17, 2017

@puffnfresh @Mic92 could you check out the latest master and try again? I am wondering if this was an issue with the parallel/codegen PR that has been reverted 3 days ago

@puffnfresh
Copy link
Contributor

I merged master into this branch and tried to build but I got the hang again:

test net::udp::tests::udp_clone_smoke has been running for over 60 seconds

@exi
Copy link
Contributor Author

exi commented Jan 20, 2017

@puffnfresh this seems like a bug that might be worth raising as a separate issue.
Could you maybe create a new issue with the build log? I think this should be a bug for rustc or rustBeta or rustNightly, depending on which build is failing

@Mic92
Copy link
Member

Mic92 commented Jan 21, 2017

sandbox build failed because a dependency was attempt to download from git.

warning: custom registry support via the `registry.index` configuration is being removed, thisfunctionality will not work in the future
    Updating git repository `https://github.com/jwilm/glutin`
error: failed to load source for a dependency on `glutin`

@the-kenny
Copy link
Contributor

the-kenny commented Jan 22, 2017

@Mic92 this happens because alacritty uses a git-dependency of glutin. Not supported (yet?) on our build infrastructure. I think this error is caused by cargo not downloading git repositories in a non-deterministic way.

One would need to pin that revision and provide a separate fetchgit to download it. Alternative would be fixing cargo to use git archive or something instead of just cloning the repo.

To others: Note that the build might work on your machine if you have either a) disabled the sandbox or b) generated the hash for dependencies recently in which case it will fail again at some point

@Mic92
Copy link
Member

Mic92 commented Jan 22, 2017

@the-kenny actually buildRustPackage supports git and the package is also pinned to a revision, but it seems that cargo tries to update the pre-fetched git repository. I hope I can fix this with this behavior of cargo with this commit: #22021

@Ericson2314
Copy link
Member

Hmm, termite is now marked broken, so I am very interested in seeing this finished :).

@OJFord
Copy link

OJFord commented Feb 2, 2017

I'd also like to use alacritty, but what's the status of this? #21800 has been merged, but I don't think this works regardless?

If I build manually, having added the dependencies to my configuration.nix, I have the issue described in alacritty/alacritty#275 - but the solution there of adding a directory to $LD_LIBRARY_PATH is no good, since the directory doesn't exist on my system...

@grahamc
Copy link
Member

grahamc commented Feb 8, 2017

After this applying this patch:

diff --git a/pkgs/applications/misc/alacritty/default.nix b/pkgs/applications/misc/alacritty/default.nix
index ec312ed..952bcda 100644
--- a/pkgs/applications/misc/alacritty/default.nix
+++ b/pkgs/applications/misc/alacritty/default.nix
@@ -7,13 +7,13 @@ buildRustPackage rec {
   name = "alacritty-unstable-${version}";
   version = "2017-01-07";
 
-  depsSha256 = "138bfnrg3j49vl6j2daf1jyyng5r6d088qhsqikhyyqzjx1ih0v2";
+  depsSha256 = "1yv7nhppixgf62yy3is8wlbcpsgid3qjwp2aaj54c456k4gzhxpd";
 
   src = fetchFromGitHub {
     owner = "jwilm";
     repo = "alacritty";
-    rev = "f4b10a1dbb991861a84c5085a0ee4384d2377448";
-    sha256 = "044l5s1w2g5krngr1v4lfxv7smh6wzy9zrabnihnpf1bsg6q73nb";
+    rev = "59295e44312b3936132965636e5fac92118e5c27";
+    sha256 = "0jk0nyc8v4ky1riyfbv1z52a35zhiaspggmzqxpggbq7vnsbirx1";
   };
 
   nativeBuildInputs = [
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index be9b1f0..78b3564 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -380,7 +380,6 @@ with pkgs;
 
   alacritty = callPackage ../applications/misc/alacritty {
     inherit (xorg) libXcursor libXxf86vm libXi;
-    rustPlatform = (makeRustPlatform rustNightly);
   };
 
   amazon-glacier-cmd-interface = callPackage ../tools/backup/amazon-glacier-cmd-interface { };
diff --git a/pkgs/top-level/rust-packages.nix b/pkgs/top-level/rust-packages.nix
index e35153a..db067a1 100644
--- a/pkgs/top-level/rust-packages.nix
+++ b/pkgs/top-level/rust-packages.nix
@@ -7,9 +7,9 @@
 { runCommand, fetchFromGitHub, git }:
 
 let
-  version = "2017-01-27";
-  rev = "6a73a15e27364a0c191d61d52406bebb7639b657";
-  sha256 = "1dklswbf3acfqid4vv7g2xpqc4gswjgh4ih9xjx3a0m3a69cw9lb";
+  version = "2017-02-07";
+  rev = "e56dbd2ee8dbcc29b8c72586bff64a99268fecf3";
+  sha256 = "0n69ia1r67p9dgrhagrlii9n6wqqasbb1ggma90mawfmvfr7ay7c";
 
   src = fetchFromGitHub {
       inherit rev;

I'm (still) seeing the error about glutin.

@jgeerds
Copy link
Member

jgeerds commented Feb 24, 2017

any update?

@gilligan
Copy link
Contributor

I didn't check open PRs before packaging it on my own: https://gist.github.com/gilligan/63d4d4832fae996f3225cb59345c689e

It is working just fine for me on NixOS.

@miltador
Copy link

@gilligan, do you have any progress?

@trizinix
Copy link

The following works for me: default.nix
I used stable rust instead of nightly:

alacritty = callPackage ../applications/misc/alacritty {
  inherit (xorg) libXcursor libXxf86vm libXi;
};

@grahamc
Copy link
Member

grahamc commented Apr 2, 2017

@trizinix Building that with the sandbox enabled, I got:

warning: custom registry support via the `registry.index` configuration is being removed, this functionality will not work in the future
    Updating git repository `https://github.com/jwilm/glutin`
warning: spurious network error (2 tries remaining): [12/-1] curl error: Couldn't resolve host 'github.com'

warning: spurious network error (1 tries remaining): [12/-1] curl error: Couldn't resolve host 'github.com'

error: failed to load source for a dependency on `glutin`

Caused by:
  Unable to update https://github.com/jwilm/glutin?rev=cc64178d39a1fa06b2c5403117e5e0ef24deeac4#cc64178d

Caused by:
  failed to fetch into /tmp/nix-build-alacritty-0.1.0.drv-0/deps/git/db/glutin-2b5ecc80feb2e4c5

@trizinix
Copy link

trizinix commented Apr 2, 2017

@grahamc This issue is blocked by alacritty/alacritty#234. Alacritty depends on a fork of glutin, as specified in Cargo.toml. Cargo tries to fetch the glutin dependency from github during build time, which fails in the sandbox. As a workaround we could download glutin before the build-phase and then modify Cargo.toml accordingly.

@therealpxc
Copy link
Contributor

@trizinix I just tried doing that, but I couldn't get it to work. Does buildRustPackage not handle the patches and postPatchPhase attributes in a normal way?

@Mic92
Copy link
Member

Mic92 commented Apr 23, 2017

@therealpxc cargo runs before the patch phase. You can patch it like this: https://github.com/NixOS/nixpkgs/blob/master/pkgs/tools/misc/exa/default.nix#L47

@therealpxc
Copy link
Contributor

therealpxc commented Apr 23, 2017

Thanks, @Mic92 . Now I've implemented a temporary workaround on my machine parallel to the one they use in the exa package. But there's another problem: jwilm's custom glutin fork also uses git dependencies, so now I get the same failure because glutin depends on jwilm/rust-fontconfig. That version of fontconfig further depends on jwilm/libfontconfig, also specified as a git dependency in its Cargo.toml file.

What can we do to patch the additional sources? Can we still define them using fetchFromGitHub or do we need real derivations now, since we have to patch them?

@Mic92
Copy link
Member

Mic92 commented May 5, 2017

@therealpxc this was also the roadblock for me. I hope that #24991 will handle git support at some point.

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