zmitchell / splatter

A Rust framework for creating generative art
0 stars 0 forks source link

Develop with Nix #4

Open zmitchell opened 1 year ago

zmitchell commented 1 year ago

Add a flake.nix for the repo.

zmitchell commented 1 year ago

Progress can be seen on the develop-with-nix branch. Currently blocked on being able to generate the book_tests crate. The Nix build fails with this error message:

error: couldn't read /private/tmp/nix-build-nannou-0.18.1.drv-0/source/target/release/build/book_tests-2920b8272dffc58e>
 --> guide/book_tests/tests/skeptic.rs:1:1
  |
1 | include!(concat!(env!("OUT_DIR"), "/skeptic-tests.rs"));
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: this error originates in the macro `include` (in Nightly builds, run with -Z macro-backtrace for more info)

error: could not compile `book_tests` (test "skeptic") due to previous error
warning: build failed, waiting for other jobs to finish...

I think this is related to the "Tests relying on the structure of the target/ directory" section, which states that during a Nix build the target directory has the layout target/<arch>/<profile> rather than target/profile.

The book_tests crate uses skeptic to generate tests for the book, and then does an include!(concat!(env!("OUT_DIR"), "/skeptic-tests.rs"));.

zmitchell commented 1 year ago

Blocked by #47