Giter Site home page Giter Site logo

Building on macOS about npbackup HOT 20 CLOSED

kapitainsky avatar kapitainsky commented on May 24, 2024
Building on macOS

from npbackup.

Comments (20)

deajan avatar deajan commented on May 24, 2024

I've tried to add support for darwin in d1ada6d
But this will be a long road, since I cannot test anything.

PS: What does python -c "import os; print(os.name)" output ?

from npbackup.

kapitainsky avatar kapitainsky commented on May 24, 2024

PS: What does python -c "import os; print(os.name)" output ?

posix

from npbackup.

deajan avatar deajan commented on May 24, 2024

That's bad for me since I get the same output on Linux.
What does python -c "import sys; print(sys.platform)" say ?

from npbackup.

kapitainsky avatar kapitainsky commented on May 24, 2024

I've tried to add support for darwin in d1ada6d
But this will be a long road, since I cannot test anything.

I have cheated a bit and renamed restic_0.15.2_darwin_amd64 to restic_0.15.2_linux_amd64 - now compiling - it takes time as I do thin in VM

from npbackup.

kapitainsky avatar kapitainsky commented on May 24, 2024

It was a bit dependencies fight and also question of using right python - you can't system one as:

FATAL: Error, on macOS, for standalone mode, Apple Python is not supported due to being tied to specific OS releases, use e.g. CPython instead which is available from https://www.python.org/downloads/macos/ for download. With that, your program will work on macOS 10.9 or higher.

So it is needed to install python via brew. Also some extra deps are needed.

When/if I succeed I will document it.

from npbackup.

kapitainsky avatar kapitainsky commented on May 24, 2024

That's bad for me since I get the same output on Linux.
What does python -c "import sys; print(sys.platform)" say ?

darwin

from npbackup.

deajan avatar deajan commented on May 24, 2024

Thank you for the feedback.
I've updated in e09643c the darwin detection.
I'll happily update whatever will make MacOS compilation work ;)

Btw, does NPBackup work non compiled on MacOS ?

from npbackup.

kapitainsky avatar kapitainsky commented on May 24, 2024
Nuitka-Scons:INFO: Compiled 1 C files using ccache.
Nuitka-Scons:INFO: Cached C files (using ccache) with result 'cache miss': 1
Nuitka-Onefile:INFO: Keeping onefile build directory '/Users/db/Downloads/npbackup/BUILDS/public/linux/x64/npbackup.onefile-build'.
Nuitka:INFO: Keeping dist folder '/Users/db/Downloads/npbackup/BUILDS/public/linux/x64/npbackup.dist' for inspection, no need to use it.
Nuitka:INFO: Keeping build directory '/Users/db/Downloads/npbackup/BUILDS/public/linux/x64/npbackup.build'.
Nuitka:INFO: Created binary that runs on macOS 13.0 (x86_64) or higher.
Nuitka:INFO: Successfully created '/Users/db/Downloads/npbackup/BUILDS/public/linux/x64/npbackup.bin'.
COMPILE ERRORS False
SUCCESS: MADE public build for audience public
SUCCESS BUILDING

but as binary is in BUILDS/public/linux/x64/ I guess because I cheated with restic binary name.

Binary "works" but:

2023-06-11 13:59:59,735 :: INFO :: npbackup v2.2.0-P11-x64 2023060301 - GUI disabled - Copyright (C) 2022-2023 NetInvent
2023-06-11 13:59:59,735 :: CRITICAL :: Cannot load configuration file from /Users/db/Downloads/npbackup/BUILDS/public/linux/x64/npbackup.conf

I guess it might be related.

from npbackup.

kapitainsky avatar kapitainsky commented on May 24, 2024

Btw, does NPBackup work non compiled on MacOS ?

Not sure I understand this question:)

from npbackup.

deajan avatar deajan commented on May 24, 2024

You can just launch NPBackup without compiling it, ie python bin/npbackup. Does that work ?

from npbackup.

kapitainsky avatar kapitainsky commented on May 24, 2024

You can just launch NPBackup without compiling it, ie python bin/npbackup. Does that work ?

db@dbs-Mac npbackup % /usr/local/bin/python3 bin/npbackup 
2023-06-11 14:11:19,805 :: INFO :: npbackup v2.2.0-P11-x64 2023060301 - GUI disabled - Copyright (C) 2022-2023 NetInvent
2023-06-11 14:11:19,805 :: CRITICAL :: Cannot load configuration file from /Users/db/Downloads/npbackup/bin/npbackup.conf
2023-06-11 14:11:19,814 :: ERROR :: No configuration file found. Please use --config-file "path" to specify one or copy a config file next to the NPBackup binary

from npbackup.

kapitainsky avatar kapitainsky commented on May 24, 2024

I've updated in e09643c the darwin detection.

it now detects darwin restic binary correctly - let's see

from npbackup.

kapitainsky avatar kapitainsky commented on May 24, 2024

Progress:

Nuitka:INFO: Created binary that runs on macOS 13.0 (x86_64) or higher.
Nuitka:INFO: Successfully created '/Users/db/Downloads/npbackup/BUILDS/public/darwin/x64/npbackup.bin'.
COMPILE ERRORS False
SUCCESS: MADE public build for audience public

but when trying to run:

db@dbs-Mac x64 % ./npbackup.bin                                                          
2023-06-11 14:24:44,869 :: INFO :: npbackup v2.2.0-P11-x64 2023060301 - GUI disabled - Copyright (C) 2022-2023 NetInvent
2023-06-11 14:24:44,888 :: INFO :: Handling random variables in configuration files
2023-06-11 14:24:44,888 :: INFO :: Updating config file
2023-06-11 14:24:44,897 :: ERROR :: Repo cannot be empty
2023-06-11 14:24:44,897 :: ERROR :: No password nor password command given. Repo password cannot be empty
2023-06-11 14:24:44,897 :: CRITICAL :: No backend available. Cannot continue

I do not worry about config part - it is not done. but why GUI disabled ???

from npbackup.

kapitainsky avatar kapitainsky commented on May 24, 2024

And after more fight (does not help I know nothing about python) with python/tk dependencies and macOS peculiarities I can report that it is working (at least compiles and starts):

image

Thank you for your compile instructions - definitely it was game changer - at least for me.

from npbackup.

deajan avatar deajan commented on May 24, 2024

I was going to give you the gui-status parameter for npbackup executable, which would have told you something like tcl/tk missing probably, but I see that you did succeed building ;)

Congratulations !!

Would you mind making a PR on the build instructions file ? Might be a saver for next MacOS guy ;)

from npbackup.

kapitainsky avatar kapitainsky commented on May 24, 2024

I will update COMPILE_INSTRUCTIONS.md - but first will have to repeat all steps again. I have some notes - but expect some mess I have to clean.

from npbackup.

kapitainsky avatar kapitainsky commented on May 24, 2024

one thing - could you please add darwin example config in examples? I guess the same as Linux - but it is something missing

from npbackup.

deajan avatar deajan commented on May 24, 2024

I will update COMPILE_INSTRUCTIONS.md - but first will have to repeat all steps again. I have some notes - but expect some mess I have to clean.

Please use latest git master as compile.py might work without modifying restic binary names after latest commit

one thing - could you please add darwin example config in examples? I guess the same as Linux - but it is something missing

Like having the same file twice ?

from npbackup.

kapitainsky avatar kapitainsky commented on May 24, 2024

Please use latest git master as compile.py might work without modifying restic binary names after latest commit

I have used it - works fine.

from npbackup.

kapitainsky avatar kapitainsky commented on May 24, 2024

Like having the same file twice ?

At the moment we have in examples:

npbackup.linux.conf.dist
npbackup.windows.conf.dist

we need to add:

npbackup.darwin.conf.dist

I guess it will be the same as linux one - have not looked into details yet.

from npbackup.

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.