Open rehno-lindeque opened 6 years ago
Hi @rehno-lindeque , this needed the nightly compiler at the moment. Even if I try to use stable, the project relies on a library that also uses a nightly compiler such as rocket.
No worries, thanks for looking into it and interesting project. If you find it can compile on stable at some point ping me here and I'll try to look into it again.
For posterity, I didn't get around to figuring out how to build the webapp's assets but work could be continued from here:
{ stdenv, fetchFromGitHub, rustPlatform, elmPackages, closurecompiler, gnused, rsync, makeWrapper }:
rustPlatform.buildRustPackage rec {
name = "diwata-${version}";
version = "0.1.0";
buildInputs = [ elmPackages.elm closurecompiler gnused rsync makeWrapper ];
src = fetchFromGitHub {
owner = "ivanceras";
repo = "diwata";
rev = "5f0293c3e22795314fbc11403f5d9ff5e4630225";
sha256 = "0i40x2glz5zhwwx2j635i2vkma5kmrf9zzwa4ys7pprs6kj4z2nk";
fetchSubmodules = true;
};
postInstall = ''
mkdir -p $out/public
substituteInPlace "webclient/compile.sh" \
--replace "../public" "$out/public"
substituteInPlace "webclient/compile_release.sh" \
--replace "../public" "$out/public" \
--replace "google-closure-compiler-js" "closure-compiler"
cd webclient
HOME=$out ELM_HOME=$out ./compile_release.sh
wrapProgram $out/bin/diwata \
--run "cd $out"
'';
cargoSha256 = "18zrj6fxn6pyllxrzkzy9qn1smbf6gwfyf8kdhr0389babkpaqcz";
doCheck = false;
meta = with stdenv.lib; {
description = "A user-friendly database interface";
homepage = https://github.com/ivanceras/diwata;
license = licenses.apache;
maintainers = [];
platforms = platforms.all;
};
}
Added this to my overlays to build with rustc nightly:
self: super:
let
rustNightly = super.rust // rec {
rustc = super.rust.rustc.override {
configureFlags = [ "--release-channel=nightly" ];
src = self.fetchurl {
url = "https://static.rust-lang.org/dist/2018-03-01/rustc-1.24.1-src.tar.gz";
sha256 = "1vv10x2h9kq7fxh2v01damdq8pvlp5acyh1kzcda9sfjx12kv99y";
};
doCheck = false;
};
cargo = super.cargo.override {
inherit rustc;
};
};
in
{
diwata = self.callPackage (import ./pkgs/diwata.nix) {
rustPlatform = self.makeRustPlatform rustNightly;
};
(apologies for the noise)
Dependency to rocket library(which relies on the nightly compiler) has now been removed. However, the project can't still be compiled with the nightly compiler due to the use of try_from. As soon as try_from
feature is stabilized the project can then be built using the stable compiler. I think it would be enough time to have a usable build of the project.
TryFrom
has already been stablized, but the dependency of diwata which is sauron uses 2 new features that are behind the a feature flag. which are #![feature(arbitrary_self_types)]
and #![cons_generics]
. It will take a little more while before the project could use the stable compiler
Hi, I was trying to create a diwata package for NixOS (and other platforms where the nix package manager is available).
However, in order to get it to build I've had to compile with nightly rustc, which would make it tough to get it accepted into the nixpkgs collection.
I think I may have had similar problems with other dependencies. Is there any chance of a fix?