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

make scala fails to produce full PDF #288

Closed
mlliarm opened this issue Apr 3, 2022 · 12 comments
Closed

make scala fails to produce full PDF #288

mlliarm opened this issue Apr 3, 2022 · 12 comments

Comments

@mlliarm
Copy link
Contributor

mlliarm commented Apr 3, 2022

Hello,

I tried building the source on my machine [1], but it's failing with errors. As a result only 5-6 pages are getting printed into PDF.

Please find the build log attached as [2] and the produced PDF as [3].

Any pointers or workarounds would be very welcome.

I'll keep googling to see if I can fix this, and if so I'll post the solution here.

Best regards,
Mike


[1]

Distributor ID:	Ubuntu
Description:	Ubuntu 18.04.6 LTS
Release:	18.04
Codename:	bionic

[2]
make_scala.log

[3]
category-theory-for-programmers-scala.pdf

@drupol
Copy link
Collaborator

drupol commented Apr 3, 2022

Hello,

Are you using Nix?

@mlliarm
Copy link
Contributor Author

mlliarm commented Apr 3, 2022

Hi,

Thanks for the reply.

Just installed Nix, and I'm getting a different error now when running nix-shell as per instructions:

milia@Newton:~/Documents/dev/latex/milewski-ctfp-pdf$ pwd
/home/milia/Documents/dev/latex/milewski-ctfp-pdf
milia@Newton:~/Documents/dev/latex/milewski-ctfp-pdf$ nix-shell
error: attribute 'flake-compat' missing

       at /home/milia/Documents/dev/latex/milewski-ctfp-pdf/shell.nix:5:65:

            4|     fetchTarball {
            5|       url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
             |                                                                 ^
            6|       sha256 = lock.nodes.flake-compat.locked.narHash;
(use '--show-trace' to show detailed location information)

:|

Installed Nix with sh <(curl -L https://nixos.org/nix/install) --daemon as suggested at the Nix installation site.

Thanks for the fast response !

ps: my shell is bash.

@mlliarm
Copy link
Contributor Author

mlliarm commented Apr 3, 2022

Full trace:

(ctfp-scala) milia@Newton:~/Documents/dev/latex/milewski-ctfp-pdf$ nix-shell --show-trace
error: attribute 'flake-compat' missing

       at /home/milia/Documents/dev/latex/milewski-ctfp-pdf/shell.nix:5:65:

            4|     fetchTarball {
            5|       url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
             |                                                                 ^
            6|       sha256 = lock.nodes.flake-compat.locked.narHash;while realising the context of a path

       at /home/milia/Documents/dev/latex/milewski-ctfp-pdf/shell.nix:1:2:

            1| (import
             |  ^
            2|   (

Thx !

@drupol
Copy link
Collaborator

drupol commented Apr 3, 2022

Tips:

  1. Do nix flake show to print all the available editions
  2. Do nix build .#<edition> to build the edition you want.

In you case, it will be: nix build .#ctfp-scala

@drupol
Copy link
Collaborator

drupol commented Apr 3, 2022

You might need to enable support of flakes, which might not be enabled by default !

See the relevant section in here: https://nixos.wiki/wiki/Flakes

@mlliarm
Copy link
Contributor Author

mlliarm commented Apr 3, 2022

I might be doing something wrong:

(ctfp-scala) milia@Newton:~/Documents/dev/latex/milewski-ctfp-pdf$ nix build .#ctfp-scala
error: experimental Nix feature 'nix-command' is disabled; use '--extra-experimental-features nix-command' to override
(ctfp-scala) milia@Newton:~/Documents/dev/latex/milewski-ctfp-pdf$ nix flake show
error: experimental Nix feature 'nix-command' is disabled; use '--extra-experimental-features nix-command' to override
(ctfp-scala) milia@Newton:~/Documents/dev/latex/milewski-ctfp-pdf$ nix build .#ctfp-scala --extra-experimental-features nix-build
warning: unknown experimental feature 'nix-build'
error: experimental Nix feature 'nix-command' is disabled; use '--extra-experimental-features nix-command' to override
(ctfp-scala) milia@Newton:~/Documents/dev/latex/milewski-ctfp-pdf$ nix build .#ctfp-scala --extra-experimental-features nix-command
error: experimental Nix feature 'flakes' is disabled; use '--extra-experimental-features flakes' to override

@drupol
Copy link
Collaborator

drupol commented Apr 3, 2022

No, you just need to enable Nix flakes :), see:

image

@mlliarm
Copy link
Contributor Author

mlliarm commented Apr 3, 2022

Thank you very much !

Your suggestion at the previous comment fixed the nix build .#ctfp-scala issue, and now I can see packages getting downloaded.

I'll update this comment once the PDF is built !

It'd be nice & perhaps useful if you could add those steps on the README.md file for future users that encounter the same issue when using Nix to build the book :)

Thanks ! <3


EDIT: took a while on my old laptop, but the 566pgs amazing book of Bartosz was built like a charm !

@drupol
Copy link
Collaborator

drupol commented Apr 3, 2022

Indeed, this is something to do ! I will try to focus on this soon !

@mlliarm
Copy link
Contributor Author

mlliarm commented Apr 3, 2022

@drupol if you'd like I can write up the missing steps in the README.md and send a PR :)

@drupol
Copy link
Collaborator

drupol commented Apr 3, 2022

That would be truly amazing :) thanks !!!

mlliarm added a commit to mlliarm/milewski-ctfp-pdf that referenced this issue Apr 3, 2022
drupol pushed a commit that referenced this issue Apr 4, 2022
* Updated README.md as per issue #288

* Added steps to install nixFlakes explicitly, ref #289
@drupol
Copy link
Collaborator

drupol commented Apr 6, 2022

Closing the issue, feel free to reopen if needed.

@drupol drupol closed this as completed Apr 6, 2022
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

No branches or pull requests

2 participants