olivierkes / manuskript

A open-source tool for writers
http://www.theologeek.ch/manuskript
GNU General Public License v3.0
1.74k stars 229 forks source link

Install on Mac Catalina Requires Signed Installer #696

Open cydov opened 4 years ago

cydov commented 4 years ago

The current version of Mac OSX Catalina 10.15.1 (19B88) requires that all packages for installation be signed. You can opt-in those, but there are so many branching libraries in your install that after 2 hours of trying to sign them all and let them install I was still having libraries show up requiring signing.

I have tried using zsh to install, but this did nothing to free this up. I do not have the requisite >2 hours at one sitting to install this app. Please, I know that getting Mac software signed isn't trivial, but your current installer is completely unusable.

worstje commented 4 years ago

There is currently at least one Mac-packaging pull request outstanding (PR #570) that is currently blocked because we have no active developers who can test its functioning, nevermind actively test and maintain the Mac build for whatever new issues pop up as the Mac platform evolves.

We are more than willing to review and integrate any pull requests that fix Mac-related issues, but without anyone that owns a Mac that can at least test and vet such patches it simply is not going to happen.

In the meanwhile, is running from source a viable option? You may have to reference and crosscheck against the wiki articles for Linux / Windows since I suspect that wiki article might be slightly outdated.

CorruptedArk commented 4 years ago

@worstje Today I followed the steps to run from source on Catalina. The install was successful with no obvious problems. I haven't done extensive testing, but it does seem to be a valid workaround until a signed installer can be implemented.

cydov commented 4 years ago

I was also able to get the package to install from source. I have looked into how to get a signed installer created, but with the holiday distracting me, I forgot about it.

I do have a Mac available to me and do have some experience with software development, although I do not have a lot of experience with Python.

avasilescu commented 4 years ago

@worstje @CorruptedArk Yesterday I also followed the steps to run from source on Catalina. I had a few issues which took some time to resolve. Mainly, homebrew did not correctly do symbolic links of Python3 and PyQT5, which took a lot of googling to resolve. I ended up having to force the symbolic link and that worked out.

Just wanted to throw it out there that though the instructions will get you there, it is not bulletproof (due to Homebrew having some issue).

gedakc commented 4 years ago

Mainly, homebrew did not correctly do symbolic links of Python3 and PyQT5, which took a lot of googling to resolve. I ended up having to force the symbolic link and that worked out.

@avasilescu, what exact symbolic links did you need to create to get homebrew to work?

gedakc commented 4 years ago

Help is needed from the macOS X community to both Package Manuskript for OS X and Run Manuskript on OS X. The automated Travis CI builds are failing.

Labeling this issue as Help Wanted.

cydov commented 4 years ago

I can help with this. I have a MacBook and dev experience. I haven't offered earlier because I am rather new to python.

gedakc commented 4 years ago

Thanks @cidothia for the offer to help. A suggested first step would be to ensure you can install and run Manuskript from source code. Then you could update and test the instructions to Run Manuskript on OS X.

The automated Travis Continuous Integration build could be tackled after that. The build steps start with the .travis.yml file, which calls package/prepare_osx.sh to install Manuskript and the required software (e.g., python).

GaryMcBride commented 4 years ago

I got Manuskript running on my Mac yesterday by following the instructions on Run Manuskript on OS X which is correct. Manuskript is an awesome app and I'd like to help you with testing and packaging on OS X. I'm not sure where to start, though. Do I need a Travis CI account, or can I run travis.yml locally?

gedakc commented 4 years ago

Thanks @GaryMcBride for your offer of assistance.

Do I need a Travis CI account, or can I run travis.yml locally?

An account will be needed to test the Travis Continuous Integration build because this runs on the Travis server infrastructure.

Prior to creating an account you might look at the contents of the travis.xml file. Basically this file invokes scripts for "osx" that are also stored in the Manuskript repository under the package directory.

When testing Travis CI the key elements are to ensure that Manuskript installs correctly, and that the PyInstaller package builds successfully. The deploy step uses api keys that are specific to @olivierkes account and so will fail when run under other accounts.

GaryMcBride commented 4 years ago

I'll give this a go and get back to you within a few days.

sijpkes commented 4 years ago

I got this working on Catalina from the source version with homebrew.

  1. Install Homebrew
  2. Download and unzip the tar.gz file
  3. Open a terminal and:
brew install python3
pip3 install pyqt5 
pip3 install lxml
cd [where you unzipped the folder]/manuskript-0.11.0
./bin/manuskript

Voila!

You will need to create an Alias or shell script to make a clickable icon on the Desktop or in Applications.

tatts85 commented 4 years ago

@sijpkes - I have also got this working, as per your instructions. Thanks!

Could someone please explain how to create an Alias / Shell script?

sijpkes commented 4 years ago

I'll do you one better than a shell script:

Open TextEdit and copy this:

#!/bin/bash

[root location ...]/manuskript-0.11.0/bin/manuscript

Save the file as manuskript.command to somewhere you can find it (I'll use Desktop) Then in Terminal:

cd ~/Desktop
chmod +x manuskript.command

Now you will be able to click the file to open manuskript.

The terminal window will stay open in the background. This is unavoidable since I found that if I open it using nohup (the standard way to run a command and close a terminal window), I got the same errors that prompted the question from the OP.

I can live with that, I just minimize the Terminal window.

sijpkes commented 4 years ago

@gedakc I managed to package a version with Travis CI by changing the xcode version to 11.3 in .travis.yml. This also allows Manuskript to run using the nohup command I mentioned in my last post.

This rough and ready build is available on my fork here.

Please see pull request #744

gedakc commented 4 years ago

Thanks you @sijpkes for working on this issue. From looking at the Travis CI logs for olivierkes / manuskript build 448 I can see that it succeeded with xcode version 11.3. Good work. :-)

In an effort to support as many versions of macOS as possible, would you be able to try to find the lowest version of xcode on Travis CI that works?

In reviewing the diff of the PR changes it appears that there is a missing newline at the end of the file which makes it look like the "secure" value changed. Would you be able to fix this so that only the minimum necessary changes are reflected in the diff?

Also some explanation of the reason for the changes in the commit message would be appreciated.

Thanks, Curtis

leongeyer commented 4 years ago

My route, still on Mojave:

HVFrancis commented 3 years ago

Ok, newcomer here. I haven't seen this error listed here, but I'm hoping someone can help. I'm on a MacBook Pro-Retina (mid 2015), running MacOS Catalina 10.15.5.

First, I had to add this line to the manuskript script in /manuskript/bin
sys.path.append(['/usr/local/lib/python3.9/site-packages']) so my system could find PyQt5

Now, when I run the script, I'm getting this error:

Traceback (most recent call last): File "./manuskript", line 16, in <module> from manuskript import main File "/Users/howardfrancis/Manskript/manuskript/bin/../manuskript/main.py", line 8, in <module> import manuskript.ui.views.webView File "/Users/howardfrancis/Manskript/manuskript/bin/../manuskript/ui/views/webView.py", line 34, in <module> from PyQt5.QtWidgets import QTextEdit ImportError: dlopen(/usr/local/lib/python3.9/site-packages/PyQt5/sip.so, 2): Symbol not found: _PyCMethod_New Referenced from: /usr/local/lib/python3.9/site-packages/PyQt5/sip.so Expected in: flat namespace in /usr/local/lib/python3.9/site-packages/PyQt5/sip.so

Google doesn't help me. And I don't know enough Python (yet!) to solve this. So, if anyone here has any ideas what might be wrong (or at least where to look... It's more fun to look for them!) I'd appreciate it.

In return I can continue to help contribute to what might be needed to make installing Manuskript on a Mac simpler.

Thanks, Howard

worstje commented 3 years ago

I don't use a Mac so I don't know crap about how it is packaged, and haven't worked on Manuskript in a while, but my guess is that it is some sort of Python version incompatibility. The Symbol not found: _PyCMethod_New seems to imply that somehow, the PyQt5 sip.so library cannot find something it needs. Either something changed in Python 3.9, or you got a buggy version of PyQt5 (wouldn't be the first time for that to have weird breakages tbh) or there's some other weird stuff going on due to the packaging.

I don't know to what extent older Python versions are viable on Mac, but have you tried installing Py3.7 and seeing how that version behaves when running from source?

igbanam commented 3 years ago

I thought to try this out, because the idea of guided writing is appealing. I just went through "Allow Anyway" for a bajillion things the script needs — all .dylib, .so, and other component apps necessary. I got it working though, after some 12 minutes of drone-like resilience. I would dearly love if this gets packaged.

Some examples of my errors are…

╭─   ~/projects ·················································································································· ✘ ABRT took  9s  3.0.0 at  06:35:05 PM ─╮
╰─❯ manuskript                                                                                                                                                                 ─╯
Debug: Web rendering engine used: QTextEdit
Running manuskript version 0.10.0.
Preferred translation: ['en-NG'] (based on available ui languages)
No translation found or loaded. (manuskript_en_NG.qm)
Using the builtin translation.
Traceback (most recent call last):
  File "manuskript", line 13, in <module>
  File "manuskript/main.py", line 231, in run
  File "manuskript/main.py", line 154, in prepare
  File "/usr/local/lib/python3.7/site-packages/PyInstaller/loader/pyimod03_importers.py", line 627, in exec_module
  File "manuskript/mainWindow.py", line 7, in <module>
ImportError: dlopen(/opt/homebrew/Caskroom/manuskript/0.10.0/manuskript/PyQt5/Qt.so, 2): no suitable image found.  Did find:
    /opt/homebrew/Caskroom/manuskript/0.10.0/manuskript/PyQt5/Qt.so: code signature in (/opt/homebrew/Caskroom/manuskript/0.10.0/manuskript/PyQt5/Qt.so) not valid for use in process using Library Validation: library load disallowed by system policy
[64342] Failed to execute script manuskript

My entire saga is in this gist-28eda92…

EzraGoldwin commented 2 years ago

i am completely noob and i got this message kindly help CRITICAL> An unhandled exception has occurred! Traceback (most recent call last): File "/Users/ezra/Documents/./manuskript/bin/manuskript", line 13, in main.run() File "/Users/ezra/Documents/manuskript/bin/../manuskript/main.py", line 305, in run app, MW = prepare(arguments) File "/Users/ezra/Documents/manuskript/bin/../manuskript/main.py", line 41, in prepare manuskript.logging.logRuntimeInformation() File "/Users/ezra/Documents/manuskript/bin/../manuskript/logging.py", line 353, in logRuntimeInformation from lxml import etree ModuleNotFoundError: No module named 'lxml'

TheJackiMonster commented 2 years ago

@EzraGoldwin The error states that you don't have installed the lxml module for Python. So I'm not sure how you run Manuskript currently or if you use homebrew to install packages for example. But I assume you have to look up how to install python-lxml on your system to run it. If you have pip (a tool to install modules for Python) installed, it should be rather straight forward.

EzraGoldwin commented 2 years ago

thank you for your reply but now i get this

Defaulting to user installation because normal site-packages is not writeable Requirement already satisfied: lxml in /Users/user/Library/Python/3.8/lib/python/site-packages (4.6.4) WARNING: You are using pip version 20.2.3; however, version 21.3.1 is available. You should consider upgrading via the '/Library/Developer/CommandLineTools/usr/bin/python3 -m pip install --upgrade pip' command.

EzraGoldwin commented 2 years ago

it worked thank you TheJackiMonster

astennuke commented 2 years ago

could anyone help me download this app? i don't understand anything but i think i've tried everything. very fustrating. im on a macbook air, M1, 2020, 12.2.1. (if that helps anything.)

igbanam commented 2 years ago

Trying to install this app made me reevaluate the reasons I needed a writing app in the first place 🥲

Ended up preferring Pandoc

TheJackiMonster commented 2 years ago

@astennuke Best I can do is pointing to the wiki page here. We currently don't have a binary release because it would require a signing process and a physical device to build on. So the best option is running the application from source which as far as I know requires homebrew for installing the necessary dependencies.