Giter Site home page Giter Site logo

Comments (11)

HaleTom avatar HaleTom commented on July 2, 2024

As background for the desire for a binary package:

  • I want to save user's time in compiling
  • Provide access to the skeleton config file
  • Provide access to the documentation

Both of the last two are difficult using the AppImage format, and the AppImage also contains many non-needed libraries (newer versions of which Arch already has)

from nixnote2.

robert7 avatar robert7 commented on July 2, 2024

Hi,
I understand what you want to do, but I think it is not the "correct" way. Therefore you'll get various unnecessary problems..

The Idea of AppImage is:

  • the application in AppImage packaging is "self contained" - it contains all the dependencies in a coherent set - which plays together well
  • yes its bigger then native package, but I think the people today don't care so much whenever the app is 50MB or 3MB. They care more whenever it works out of the box.
  • yes it may be, that some libraries included in the AppImage are older then on your system, but the someway guaranteed to work
  • the AppImage should work on ~all distributions and it should be really "plug&play" - download/mark as executable - run - it should work

As you start replacing libraries by LD_LIBRARY_PATH and removing parts of the AppImage this all may break..
I think correct way would be to build a binary package for your distribution. I have no idea how this work on Arch - and have no time to study it now. But the idea would be to do something like the pre-built binary "deb" packages, which are build in the PPA for Ubuntu - one package per Ubuntu version.

With that being said, what you want to do, can be reached (but I think you'll get further problems along the way.. so the problems only start :) )..

The error message you get happens when Nixnote is searching for application data. It expects to be run as $SOMEDIR/bin/nixnote2 then it searches for the data in $SOMEDIR/share/nixnote2. Thats all. The algorithm can be overriden by --programDataDir command line option.

Example (2 executions one failed - then one with manual override):

 /d/dev/nixnote2/qmake-build-debug  ./nixnote2                                                                                           5.3s
ERROR 2018-10-23 08:42:32.449 src/settings/filemanager.cpp:58 Binary needs to be started from 'appdir' directory...
ERROR 2018-10-23 08:42:32.449 src/settings/filemanager.cpp:59 E.g. use something like: cd $$PROJECT_DIR; ./appdir/usr/bin/nixnote2
robert7@LP-RSPIEGEL:/d/dev/nixnote2/qmake-build-debug$ 


 /d/dev/nixnote2/qmake-build-debug  ./nixnote2 --programDataDir=/d/dev/nixnote2/appdir/usr/share/nixnote2 --logLevel=1                  110ms
INFO  2018-10-23 08:42:42.290 src/settings/startupconfig.cpp:342 "Set programDataDir via command line to /d/dev/nixnote2/appdir/usr/share/nixnote2"
INFO  2018-10-23 08:42:42.290 src/settings/startupconfig.cpp:315 Changed logLevel via command line option to 1
DEBUG 2018-10-23 08:42:42.290 src/settings/startupconfig.cpp:733 Setting command: #0 to value=true
DEBUG 2018-10-23 08:42:42.290 src/main.cpp:131 Startup config ret=0, guiAvailable=true
DEBUG 2018-10-23 08:42:42.358 src/settings/filemanager.cpp:95 Setting up file paths:  startupConfigDirPath="", startupUserDataDir="", startupProgramDirPath="/d/dev/nixnote2/appdir/usr/share/nixnote2/"
DEBUG 2018-10-23 08:42:42.358 src/settings/filemanager.cpp:110 Checking whenever legacy config dir exists: "/home/robert7/.nixnote"
DEBUG 2018-10-23 08:42:42.358 src/settings/filemanager.cpp:114 Legacy config/data dir found. falling back to that: "/home/robert7/.nixnote/"
DEBUG 2018-10-23 08:42:42.358 src/settings/filemanager.cpp:312 Checking write access for directory "/home/robert7/.nixnote"
DEBUG 2018-10-23 08:42:42.358 src/settings/filemanager.cpp:312 Checking write access for directory "/home/robert7/.nixnote"
DEBUG 2018-10-23 08:42:42.358 src/settings/filemanager.cpp:141 Resulting file paths: configDir="/home/robert7/.nixnote/", userDataDir="/home/robert7/.nixnote/", programDataDir="/d/dev/nixnote2/appdir/usr/share/nixnote2/"

from nixnote2.

robert7 avatar robert7 commented on July 2, 2024

I improved the error message. Now it says:

 /d/dev/nixnote2  ./qmake-build-debug/nixnote2                                                                                                 7.1s
ERROR 2018-10-24 10:43:23.465 src/settings/filemanager.cpp:58 Binary needs to be started from application directory...
ERROR 2018-10-24 10:43:23.466 src/settings/filemanager.cpp:59 Expected runtime pathname is $SOMEDIR/bin/nixnote2, then application data is expected in $SOMEDIR/share/nixnote2
ERROR 2018-10-24 10:43:23.466 src/settings/filemanager.cpp:62 E.g. use something like: cd $PROJECT_DIR/appdir; ./usr/bin/nixnote2. Or you may use --programDataDir command line option for manual override.

from nixnote2.

robert7 avatar robert7 commented on July 2, 2024

The updated message is available in 2.0.1-beta5a (but its just a clue/info ).
Let me know in case "--programDataDir" did not worked for you.

from nixnote2.

HaleTom avatar HaleTom commented on July 2, 2024

Brilliant, thanks for the --programDataDir tip. I'll look into it over the next few days!

from nixnote2.

HaleTom avatar HaleTom commented on July 2, 2024

I downloaded today's AppImage and tried with a bunch of possible options to --programDataDir:

% pwd        
/home/ravi/code/aur/nixnote2-bin/pkg-root/usr/bin/nixnote
% ./nixnote2 
ERROR 2018-10-28 13:40:42.629 src/settings/filemanager.cpp:58 Binary needs to be started from application directory...
ERROR 2018-10-28 13:40:42.629 src/settings/filemanager.cpp:59 Expected runtime pathname is $SOMEDIR/bin/nixnote2, then application data is expected in $SOMEDIR/share/nixnote2
ERROR 2018-10-28 13:40:42.629 src/settings/filemanager.cpp:62 E.g. use something like: cd $PROJECT_DIR/appdir; ./usr/bin/nixnote2. Or you may use --programDataDir command line option for manual override.
% ./nixnote2 --programDataDir /home/ravi/code/aur/nixnote2-bin/squashfs-root/usr/bin/nixnote/
ERROR 2018-10-28 13:41:11.315 src/settings/filemanager.cpp:58 Binary needs to be started from application directory...
ERROR 2018-10-28 13:41:11.315 src/settings/filemanager.cpp:59 Expected runtime pathname is $SOMEDIR/bin/nixnote2, then application data is expected in $SOMEDIR/share/nixnote2
ERROR 2018-10-28 13:41:11.315 src/settings/filemanager.cpp:62 E.g. use something like: cd $PROJECT_DIR/appdir; ./usr/bin/nixnote2. Or you may use --programDataDir command line option for manual override.
% ./nixnote2 --programDataDir /home/ravi/code/aur/nixnote2-bin/squashfs-root/usr/bin/ 
ERROR 2018-10-28 13:41:21.241 src/settings/filemanager.cpp:58 Binary needs to be started from application directory...
ERROR 2018-10-28 13:41:21.241 src/settings/filemanager.cpp:59 Expected runtime pathname is $SOMEDIR/bin/nixnote2, then application data is expected in $SOMEDIR/share/nixnote2
ERROR 2018-10-28 13:41:21.241 src/settings/filemanager.cpp:62 E.g. use something like: cd $PROJECT_DIR/appdir; ./usr/bin/nixnote2. Or you may use --programDataDir command line option for manual override.
% ./nixnote2 --programDataDir /home/ravi/code/aur/nixnote2-bin/squashfs-root/usr/    
ERROR 2018-10-28 13:41:25.483 src/settings/filemanager.cpp:58 Binary needs to be started from application directory...
ERROR 2018-10-28 13:41:25.483 src/settings/filemanager.cpp:59 Expected runtime pathname is $SOMEDIR/bin/nixnote2, then application data is expected in $SOMEDIR/share/nixnote2
ERROR 2018-10-28 13:41:25.483 src/settings/filemanager.cpp:62 E.g. use something like: cd $PROJECT_DIR/appdir; ./usr/bin/nixnote2. Or you may use --programDataDir command line option for manual override.
% ./nixnote2 --programDataDir /home/ravi/code/aur/nixnote2-bin/squashfs-root/    
ERROR 2018-10-28 13:41:29.998 src/settings/filemanager.cpp:58 Binary needs to be started from application directory...
ERROR 2018-10-28 13:41:29.998 src/settings/filemanager.cpp:59 Expected runtime pathname is $SOMEDIR/bin/nixnote2, then application data is expected in $SOMEDIR/share/nixnote2
ERROR 2018-10-28 13:41:29.998 src/settings/filemanager.cpp:62 E.g. use something like: cd $PROJECT_DIR/appdir; ./usr/bin/nixnote2. Or you may use --programDataDir command line option for manual override.
% ./nixnote2 --programDataDir /home/ravi/code/aur/nixnote2-bin/squashfs-root/usr/lib
ERROR 2018-10-28 13:44:01.877 src/settings/filemanager.cpp:58 Binary needs to be started from application directory...
ERROR 2018-10-28 13:44:01.877 src/settings/filemanager.cpp:59 Expected runtime pathname is $SOMEDIR/bin/nixnote2, then application data is expected in $SOMEDIR/share/nixnote2
ERROR 2018-10-28 13:44:01.877 src/settings/filemanager.cpp:62 E.g. use something like: cd $PROJECT_DIR/appdir; ./usr/bin/nixnote2. Or you may use --programDataDir command line option for manual override.
% ./nixnote2 --programDataDir /home/ravi/code/aur/nixnote2-bin/squashfs-root/usr/share
ERROR 2018-10-28 13:44:17.970 src/settings/filemanager.cpp:58 Binary needs to be started from application directory...
ERROR 2018-10-28 13:44:17.970 src/settings/filemanager.cpp:59 Expected runtime pathname is $SOMEDIR/bin/nixnote2, then application data is expected in $SOMEDIR/share/nixnote2
ERROR 2018-10-28 13:44:17.970 src/settings/filemanager.cpp:62 E.g. use something like: cd $PROJECT_DIR/appdir; ./usr/bin/nixnote2. Or you may use --programDataDir command line option for manual override.
% ./nixnote2 --programDataDir /home/ravi/code/aur/nixnote2-bin/squashfs-root/usr/share/nixnote2
ERROR 2018-10-28 13:44:25.347 src/settings/filemanager.cpp:58 Binary needs to be started from application directory...
ERROR 2018-10-28 13:44:25.348 src/settings/filemanager.cpp:59 Expected runtime pathname is $SOMEDIR/bin/nixnote2, then application data is expected in $SOMEDIR/share/nixnote2
ERROR 2018-10-28 13:44:25.348 src/settings/filemanager.cpp:62 E.g. use something like: cd $PROJECT_DIR/appdir; ./usr/bin/nixnote2. Or you may use --programDataDir command line option for manual override.

Note, all of the above directories exist (they were entered by tab-expansion).

Perhaps it's the code that checks for the existence of the given directory?

% ./nixnote2 --programDataDir /root/DOESNOTEXIST
ERROR 2018-10-28 13:46:12.833 src/settings/filemanager.cpp:58 Binary needs to be started from application directory...
ERROR 2018-10-28 13:46:12.834 src/settings/filemanager.cpp:59 Expected runtime pathname is $SOMEDIR/bin/nixnote2, then application data is expected in $SOMEDIR/share/nixnote2
ERROR 2018-10-28 13:46:12.834 src/settings/filemanager.cpp:62 E.g. use something like: cd $PROJECT_DIR/appdir; ./usr/bin/nixnote2. Or you may use --programDataDir command line option for manual override.

from nixnote2.

HaleTom avatar HaleTom commented on July 2, 2024

In the message, is SOMEDIR the root of the place it's being run from?

What is PROJECT_DIR?

from nixnote2.

robert7 avatar robert7 commented on July 2, 2024

$SOMEDIR is the "install prefix". If you unpack the AppImage into /home/ravi/code/aur/nixnote2-bin/squashfs-root then it its /home/ravi/code/aur/nixnote2-bin/squashfs-root/usr.
Then if you run /home/ravi/code/aur/nixnote2-bin/squashfs-root/usr/bin/nixnote2 then it should find the data by itself as it should be in /home/ravi/code/aur/nixnote2-bin/squashfs-root/usr/share/nixnote2.

Or you can say nixnote2 --programDataDir /home/ravi/code/aur/nixnote2-bin/squashfs-root/usr/share/nixnote2.

$PROJECT_DIR is the "project directory" - where you checkout the project from git, then its get per default installed in $PROJECT_DIR/appdir and $SOMEDIR would be $PnixnROJECT_DIR/appdir/usr.

simple case with appimage
screen_20181029_01

here data is NOT relocated, but I point to data dir manually
screen_20181029_02

example where you compiled & installed to default location
screen_20181029_03

here finaly example where binary is in non standard path but I point manually to data
screen_20181029_04

from nixnote2.

robert7 avatar robert7 commented on July 2, 2024

--programDataDirneed to be a path with following files:
screen_20181029_05

from nixnote2.

HaleTom avatar HaleTom commented on July 2, 2024

Thanks for the examples!

I worked out it was a syntax thing...

--programDataDir /d/dev/nixnote2/appdir/usr/share/nixnote2 doesn't work

--programDataDir=/d/dev/nixnote2/appdir/usr/share/nixnote2 does work

The = is mandatory but no warning is printed if it is not given.

from nixnote2.

robert7 avatar robert7 commented on July 2, 2024

The = is mandatory but no warning is printed if it is not given.

yes. that's true.

from nixnote2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.