Menu

#32 Failed to update default plugins -> java.lang.NullPointerException?

0.5
pending
nobody
None
5
2019-01-05
2018-12-28
No

At latest svn, rev 682, I get this at startup (Linux):

15:54:19  WARN: Failed to update default plugins
java.lang.NullPointerException
    at ch.rakudave.jnetmap.util.IO.updateUserFiles(IO.java:185)
    at ch.rakudave.jnetmap.controller.Controller.<init>(Controller.java:73)
    at ch.rakudave.jnetmap.controller.Controller.main(Controller.java:62)

But the GUI shows up just fine.

Discussion

  • rakudave

    rakudave - 2018-12-28

    Ticket moved from /p/jnetmap/feature-requests/41/

     
  • rakudave

    rakudave - 2018-12-28
    • status: open --> closed-fixed
    • Group: Next Release --> 0.5
     
  • rakudave

    rakudave - 2018-12-28

    It tries to unpack a set of default plugins into your local settings folder. If there aren't any, the message isn't great (improved in latest commit). The build.sh does bundle some plugins, however mvn on its own does not (yet), which is probably why you got that error.

     
  • Bjørn Forsman

    Bjørn Forsman - 2018-12-28

    Thanks!

    I didn't know about ./build/build.sh. I simply built with "mvn package", which you guessed right. Looking at build.sh now, I see it does lots of things I like (man page, desktop file++) but some things that are troublesome for packaging for Nix (https://nixos.org/nix/):

    1. It hardcodes /usr prefix.
    2. In addition to preparing generic stuff like manpage and desktop file, it builds rpm, deb and exe files (unneeded when building for Nix)
    3. I must pass custom args to mvn. (Proper Nix packages are built in sandboxes, so to build jnetmap I'm currently doing a two step process where the first process is building a .m2 directory of all deps with fixed/known output hash, then the app is built against this .m2 snapshot directory in offline mode.)

    Should I add an issue about making build.sh more generic? Or define what is the API for downstream package writers (maven pom.xml file or a wrapper like build.sh)?

     
  • rakudave

    rakudave - 2018-12-28
    • status: closed-fixed --> pending
     
  • rakudave

    rakudave - 2018-12-28

    The build.sh is basically only meant to run when doing a release, not when just building the jar. And what it does is plattform-specific per binary that it assembles. I agree that most of the things in there could probably be done in maven, but since that's a recent change there's still a lot of stuff done in bash. I'm always open to patches ;-)
    Or (if that's an option) you could use the .tar.gz (or similar) instead of building from source?

     
  • Bjørn Forsman

    Bjørn Forsman - 2018-12-29

    How would you like to receive patches? File attachments to feature requests?

    I prefer to build from source (nor did I see any stable references to build artifacts per svn rev, so building from source allow me to do CI/CD). It would probably not be that hard to change build.sh to fit my needs. (Maybe add optional param, use environment variable for PREFIX etc.)

     
  • rakudave

    rakudave - 2018-12-29

    Either that, or I've just added you to the project so you should be able to commit directly.

    Hm ok, so what would you need from a direct source build, other than the default plugins? Sorry for not being more familiar with Nix, but since it's cross-plattform-ish I don't think all the ancillary stuff (such as .desktop-files) would be usefull for this case?

     
  • Bjørn Forsman

    Bjørn Forsman - 2018-12-29

    Thanks for giving me commit access, but I'm not sure that I dare pushing stuff directly just yet. :-)

    For source build on Linux I think it'd be good to easily get the plugins as well as desktop file and manpage, and have configurable PREFIX/DESTDIR.

    Hm, I didn't think of Nix' cross-platform abilities, as I only use it on Linux. I know there are macOS users and recently some cross-compilation work allows directly building Windows software. I'm not sure how that fits with jnetmap build infrastructure.

     
  • rakudave

    rakudave - 2019-01-05

    Hm yeah so at the moment everything is set to /usr in many files, which - come to think of it - is also not very BSD friendly, as they need /usr/local. So this is definitely something that should be improved, but it'd need some major refactoring (e.g. time). I'll keep you posted...

     

Log in to post a comment.