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
asciidoctor: include the asciidoctor-epub3 gem #64298
Conversation
This has two benefits: - Anyone else using the `mathematical` gem will benefit from the config. - The gem config overrides the default one, so we were losing the fixes for other gems. I had to change how the update script works. Now it looks at the `gems` passthru from `bundlerApp`.
This is another common output target for asciidctor that requires an additional gem. The previous commit is necessary for this to work, so that we get the gem config for nokogiri correctly.
@@ -1,6 +1,6 @@ | |||
#!/usr/bin/env bash | |||
rm gemset.nix Gemfile.lock |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we do this before building the shell then we can't build the shell!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed! The more general issue is that the updater script is depending on the project to be working. So as soon as it breaks it becomes harder to repair it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see a way to avoid this while still piggybacking off the app definition to get all the dependencies....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤦♂️ probably I was running a nix-shell inside nix-shell... I wish there was bundix --force-update
@@ -1,6 +1,6 @@ | |||
#!/usr/bin/env bash | |||
rm gemset.nix Gemfile.lock |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed! The more general issue is that the updater script is depending on the project to be working. So as soon as it breaks it becomes harder to repair it.
}; | ||
} | ||
in app.overrideAttrs (attrs: { passthru = attrs.passthru // { updateShell = shell; }; }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in app.overrideAttrs (attrs: { passthru = attrs.passthru // { updateShell = shell; }; }) | |
in app |
attach the shell directly on the app.passthru to avoid the overhead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't work as app.gems
isn't defined then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I pushed f726160 which demonstrates how to implement it. The key is that nix is a lazily-evaluated language.
Also I've realised that I may want to include the |
Comments addressed. I've opted not to include the |
Actually, given the environment variables work, I can just wrap the executable. The remaining annoyance is that kindlegen is unfree. I guess I could gate that behind |
kindlegen is unfree, so we don't include it by default. The derivation can be overridden to include it.
Okay, I wrapped the executable and that works nicely. I've put something in so |
}; | ||
} | ||
in app.overrideAttrs (attrs: { passthru = attrs.passthru // { updateShell = shell; }; }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I pushed f726160 which demonstrates how to implement it. The key is that nix is a lazily-evaluated language.
Nice, thanks. |
@michaelpj let me know if you agree with my changes, if yes I will merge the PR. |
Yes, they're good! |
This had the effect of breaking the default NixOS configuration on armv6l and armv7l, because it pulls Java into the build-time closure through epubcheck. Java has been broken on these platforms for quite a while, and this PR simply made the issue obvious. On the other hand, this is the only usage of Java in a basic NixOS system, and pulls in many other dependencies (at build time, so binary cache users are not affected), so I am wondering if we want to disable epubcheck by default. I can't decide whether this is a good idea, or if we are better having a more fully featured package. Is there any specific use-case that needs epubcheck? |
Hm, I'd assumed that Java would be an unproblematic package! I also didn't know the default configuration depended on this (why? the manual?). I think disabling epubcheck would be fine. Alternatively, we could override it to disable epubcheck at the use site which is problematic, e.g. where the manual uses it if that's the problem. |
The dependency chain is: |
@michaelpj: can you send a PR to disable epubcheck please? |
I'm working on fixing Java on ARM as well, and should have a PR by this weekend. |
Motivation for this change
This is another common output format for asciidoctor, and this gem is at least semi-official (maintained by the asciidoctor maintainer).
Things done
The first commit does some cleaning, by allowing us to use the default gem config in nixpkgs. We need this in the second commit as it makes nokogiri work. We could combine the configs properly, but it seems better to put our configuration for the mathematical gem centrally in case other people need to use it.
I also had to change how the update script works, but I think it's reasonable still.
The second commit actually adds the
asciidoctor-epub3
gem. I've tested that this does actually work thereafter.cc @worldofpeace @danbst who've looked at asciidoctor changes recently.
sandbox
innix.conf
on non-NixOS)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)nix path-info -S
before and after)