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

Problem: default.nix was too complicated #63

Merged
merged 2 commits into from Aug 28, 2017

Conversation

ericsagnes
Copy link
Contributor

WIP: Do not merge yet!

Solution: simplify it.

This change slightly how default.nix is working and require an update in the documentation and need a review to be sure the changes are not removing any functionality.

Before this PR:

$ nix-build --argstr rs test_nand

After this PR:

$ nix-build --argstr node test_nand

The backend default is rust, to change it to something else, eg purs:

$ nix-build --argstr node test_nand  --argstr backend purs

cc @sjmackenzie

@sjmackenzie
Copy link
Member

I see, yes this is better!

@ericsagnes
Copy link
Contributor Author

Updated the docs so this should be ready to merge now.
By the way, by testing the example from the doc I noticed that the worktest_bench test was failing with the following error:

About to use rustc to compile some lib - rustc-serialize
warning: due to multiple output types requested, the explicitly specified output file name will be adapted for each output type

warning: due to multiple output types requested, the explicitly specified output file name will be adapted for each output type

error[E0460]: found possibly newer version of crate `memchr` which `aho_corasick` depends on
   --> src/lib.rs:475:1
    |
475 | extern crate aho_corasick;
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: perhaps that crate needs to be recompiled?
    = note: crate `memchr` path #1: /nix/store/2ncxxpr82a3hllsvaw5vp8vwf5v9vdj0-memchr/libmemchr.rlib
    = note: crate `aho_corasick` path #1: /nix/store/7ya728q7pn4azs8l8kam914xpsl0vp2d-aho-corasick/libaho_corasick.rlib

error: aborting due to previous error

builder for ‘/nix/store/ydlgak4jnbx26lwi01ad8vvkz3y38jaw-regex.drv’ failed with exit code 101
cannot build derivation ‘/nix/store/bzsqb7vi5aijk53gsr3indhdqnbzvhm2-rs_http.drv’: 1 dependencies couldn't be built
cannot build derivation ‘/nix/store/6pvf0hldc3a7k1nwjbjw57bbyhj2c32l-rs_workbench.drv’: 1 dependencies couldn't be built
cannot build derivation ‘/nix/store/lv4f577347grknvx3zrbs5w1n7wkql83-rs_test.drv’: 1 dependencies couldn't be built
cannot build derivation ‘/nix/store/qqlkjbl4vsbw9clwfdbw8vb0lh12sh7n-rs_test.drv’: 1 dependencies couldn't be built
error: build of ‘/nix/store/qqlkjbl4vsbw9clwfdbw8vb0lh12sh7n-rs_test.drv’ failed

The same error happens on master so this should not be due to this PR contents.

It might be worth to set a travis file to run a test suite on every commit.

@ericsagnes ericsagnes changed the title [WIP] Problem: default.nix was hard too complicated Problem: default.nix was hard too complicated Jul 23, 2017
@ericsagnes ericsagnes changed the title Problem: default.nix was hard too complicated Problem: default.nix was too complicated Jul 23, 2017
@sjmackenzie
Copy link
Member

This error is due to nixcrates it's not related to this issue.

@sjmackenzie
Copy link
Member

I'll be looking at this to replace nixcrates https://nest.pijul.com/pmeunier/nix-rust but this is after all this non-code related stuff has passed!

Solution: Add some tests
@ericsagnes
Copy link
Contributor Author

Added a commit to provide a way to run some nix tests + a travis file.

Running nix-build tests will run the tests defined in test/default.nix (building test_nand, bench and bench_load), and if travis is set up on this repo, it will run that command upon every commit.

@sjmackenzie
Copy link
Member

okay just activated it!

@sjmackenzie
Copy link
Member

sjmackenzie commented Jul 23, 2017

maybe good to add the --keep-going argument to build all the components?

@ericsagnes
Copy link
Contributor Author

I think that in the context of CI it makes more sense to fail fast as we only want to know if tests are passing or not.

--keep-going would force travis to build more even if a test is failing.
And as travis do not cache build products like Hydra does, it would just consume more computing power for no real added value.

@sjmackenzie
Copy link
Member

okay fair enough

@sjmackenzie
Copy link
Member

"should be ready to merge now" <-- ah sorry didn't read that.

@sjmackenzie sjmackenzie merged commit 81ab5da into fractalide:master Aug 28, 2017
@sjmackenzie
Copy link
Member

thanks! It feels much cleaner 👍

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

Successfully merging this pull request may close these issues.

None yet

2 participants