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

Add pplatex- tex error pretty printer #60666

Closed
wants to merge 1 commit into from
Closed

Add pplatex- tex error pretty printer #60666

wants to merge 1 commit into from

Conversation

SRGOM
Copy link
Member

@SRGOM SRGOM commented May 1, 2019

Tested and currently using on my local computer
Sorry for the sloppy pull request but I'm very new to Nix and I cannot justify spending too much time to get everything working perfectly. I feel like I've spent good time getting the initial work done and any expert can bring this up to standard in minutes. That said, I'm sure you guys are busy too so please feel free to reject.

Motivation for this change

Sick of terrible TeX errors, pplatex pretty prints them and makes them (actually) readable.

Things done
  • Tested on my own machine by doing an (import .....) inside configuration.nix.

  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)

  • Built on platform(s)

    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)

  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"

  • Tested execution of all binary files (usually in ./result/bin/)

  • Determined the impact on package closure size (by running nix path-info -S before and after)

  • Assured whether relevant documentation is up to date

  • Fits CONTRIBUTING.md.


Tested and currently using on my local computer
@ofborg ofborg bot added 6.topic: TeX Issues regarding texlive and TeX in general 10.rebuild-darwin: 0 10.rebuild-linux: 0 labels May 1, 2019
Copy link
Member

@symphorien symphorien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution! I have added some comments to improve the expression (notably you are not allowed to import nixpkgs within nixpkgs), I hope this will help.

@@ -0,0 +1,40 @@
with
import <nixpkgs> {}
;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of these three lines, use:

{ cmake, stdenv, pkgconfig, pcre, texlive, fetchFromGitHub }:

And then add a line for you package in pkgs/top-level/all-packages.nix like:

pplatex = callPackage ../tools/typesetting/tex/pplatex {};

To test you package, run nix-build /path/to/nixpkgs/clone -A pplatex.

buildInputs =
[
pkgs.cmake
pkgs.gnumake
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make already part of stdenv

pkgs.gnumake
pkgs.pkgconfig
pkgs.pcre
pkgs.texlive.combined.scheme-small
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove the pkgs. prefix of all buildInputs.


buildInputs =
[
pkgs.cmake
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cmake and pkgconfig should be nativeBuildInputs instead of buildInputs.

'';
homepage = https://github.com/stefanhepp/pplatex;
license = stdenv.lib.licenses.gpl3Plus;
maintainers = [ stdenv.lib.maintainers.srgom ];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you would need to add an entry into maintainers/maintainers-list.nix to put yourself as a maintainer

@SRGOM
Copy link
Member Author

SRGOM commented May 5, 2019

Thank you for your kind pointers- they will be useful in future packages, I want to do things the right way.

@alexarice
Copy link
Contributor

@SRGOM, are you planning on leaving this for someone else to finish? The software looks interesting

@SRGOM
Copy link
Member Author

SRGOM commented May 8, 2019

@alexarice You guys have been kind to give me pointers but I am very new to nix and cannot afford to spend any more time on this. I plan on come back to it at a later date but wouldn't mind if somebody else finished this.

@teto
Copy link
Member

teto commented May 14, 2019

@SRGOM you can have a look at some changes here teto@6a58278

@SRGOM
Copy link
Member Author

SRGOM commented May 16, 2019

To my untrained eye, the changes seem to be exactly what I did (thus I can say it would compile) + resolution of all(?) the comments on this PR. So I think good to go.

@SRGOM
Copy link
Member Author

SRGOM commented May 16, 2019

On second thoughts, you actually do need some sort of tex dependency. I think I may have tried using the minimal scheme too but that didn't work. If you have actually compiled this on your machine then great but if you haven't then please consider putting back the tex dependency

@SRGOM
Copy link
Member Author

SRGOM commented May 19, 2019

@teto I don't want to sound impolite but the wording of your comment got me wondering- are you suggesting that I copy your changes and add to this PR? While I would be fine doing so, I'm more than 100% open to you or anybody else taking over this PR or just creating a new PR from the perfect code that you've already written.
Thank you very much in either case- you guys are very welcoming.

@teto
Copy link
Member

teto commented May 19, 2019

I was voluntarily vague as I prefer to encourage new contributors but if you have no interest then it's fine to leave it to others. The thing is I already have many open PRs, it gets hard for me to keep track of all of them so I prefer to complete some of these first before adding another one.

Bottomline is I may open my PR but I can't give an estimate so if you are in a hurry, you can just cherry-pick the change. Latex is not needed, just pcre is listed in dependencies and the program worked fine without it.

@SRGOM
Copy link
Member Author

SRGOM commented May 20, 2019

No hurry at all, since you've done all the hard work already. To some my style may seem lousy but I feel that as a new contributor if I an do the initial hard part, then it doesn't take anyone long to do final fixups. What's a quick git checkout plus a few ctrl-r (to invoke history) for experienced people is hours of work for me at this stage.

Thank you, I will close this PR and let you take it forward.

@teto
Copy link
Member

teto commented May 20, 2019

I disagree, the approach you mention doesn't scale. True some steps might be faster for seasoned developers/maintainers but even if they are 10 times faster, if everyone discharges the work on these people then work adds up.

if I an do the initial hard part, then it doesn't take anyone long to do final fixups

depends but most of the time the final fixups take longer than the initial part I would say, otherwise we wouldn't have > 1000 PRs waiting for merge. It's easy to get something going but the devil is in the details as they say.

@SRGOM
Copy link
Member Author

SRGOM commented May 20, 2019

You're obviously right about devil being in the details. It's the last 10% that takes 90% of time in most cases. And since you've been here much longer than I am, probably right about the not-scaling part too. But the alternative for me would have been not submitting the PR. I'm just trying to thank and give back in whichever way I can, whatever little I can.

@SRGOM
Copy link
Member Author

SRGOM commented Nov 15, 2019

Continued here: #73461
With comments addressed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: TeX Issues regarding texlive and TeX in general 10.rebuild-darwin: 0 10.rebuild-linux: 0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants