hmemcpy / milewski-ctfp-pdf

Bartosz Milewski's 'Category Theory for Programmers' unofficial PDF and LaTeX source
https://bartoszmilewski.com/2014/10/28/category-theory-for-programmers-the-preface/
Other
11.02k stars 597 forks source link

Haskell version being created when using scala command #295

Closed HarvMarv closed 2 years ago

HarvMarv commented 2 years ago

Hi, I didn't know where else to post this and I'm unsure if this problem is specific to my platform, but I will describe below on the chance this sheds light on any issue.

Problem

When running nix build #.ctfp-scala in terminal, only the haskell pdf is created.

System info: OS: MacOS Monterey 12.5.1 Hardware: Apple M1 Pro

Additional info: I have followed the guide in the Readme to the T so I am using Nix.

Other things I've tried: I have removed the result directory and then ran nix-collect-garbage to try to build cleanly, but still get the same result (haskell version of the book)

Thank you

drupol commented 2 years ago

Let me get back to you this afternoon about this.

drupol commented 2 years ago

Could you try nix build .#ctfp-scala -o ctfp-scala.pdf ?

HarvMarv commented 2 years ago

Apologies for the confusion - I seem to have fixed the issue.

I once again cleaned any residual files by deleting result/ and running nix-collect-garbage.

I then tried to build nix build #.ctfp and subsequently nix build #.ctfp-scala - I guess the base pdf has to be built before building the scala snippets in order for nix to not get confused?

If this is correct, I am happy to open a pull request with a note in the readme detailing this quirk.

drupol commented 2 years ago

No, the syntax is first the dot, then the hash. You can just build the Scala version with the command I wrote up there.

Can you try and report back?

Tips: There is no need to do nix-collect-garbage -d, just nix build is enough.

HarvMarv commented 2 years ago

The command you gave me works as expected, thank you. Looking through my command history I see that I was using nix build #.ctfp-scala (hash then dot).

I guess nix took my non-existant flake and disregarded it in order to build the default flake - I didn't notice because nix did not produce any visible errors or warnings regarding this

drupol commented 2 years ago

Ok cool ! Glad we found out the issue.

Going to close the issue, feel free to re-open if you feel something hasn't been fixed regarding this issue.

HarvMarv commented 2 years ago

Thank you for your help, drupol