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

Update build scripts #1829

Merged
merged 16 commits into from
Apr 21, 2024
Merged

Update build scripts #1829

merged 16 commits into from
Apr 21, 2024

Conversation

vkbo
Copy link
Owner

@vkbo vkbo commented Apr 20, 2024

Summary:

This PR:

  • Adds build support for M1 for MacOS
  • Updates AppImages to use Python 3.12

Related Issue(s):

Reviewer's Checklist:

  • The header of all files contain a reference to the repository license
  • The overall test coverage is increased or remains the same as before
  • All tests are passing
  • All flake8 checks are passing and the style guide is followed
  • Documentation (as docstrings) is complete and understandable
  • Only files that have been actively changed are committed

@vkbo vkbo added this to the Release 2.5 Beta 1 milestone Apr 20, 2024
@vkbo vkbo changed the title Add support for building DMGs for M1 Update build scripts Apr 20, 2024
@vkbo
Copy link
Owner Author

vkbo commented Apr 20, 2024

I've tried to update the AppImage and DMGs, and added build for ARM for MacOS.

Could either of you test these, @Ryex and @mpejcoch?

The builds are available here: https://github.com/vkbo/novelWriter/actions/runs/8766741231

@vkbo
Copy link
Owner Author

vkbo commented Apr 20, 2024

Ok, @kkostov tested the M1 build, and apparently it just exits.

@vkbo
Copy link
Owner Author

vkbo commented Apr 20, 2024

There was an error in the launch script. I removed some escaping I shouldn't have.

Should be fixed here: https://github.com/vkbo/novelWriter/actions/runs/8767345888

@kkostov
Copy link

kkostov commented Apr 21, 2024

@vkbo confirmed, the fix worked and now the app works as well 🚀

Screenshot 2024-04-21 at 04 06 31

@vkbo
Copy link
Owner Author

vkbo commented Apr 21, 2024

Great! Thanks for your help.

@vkbo vkbo merged commit bf8d224 into main Apr 21, 2024
9 checks passed
@vkbo vkbo deleted the builds/macos_m1 branch April 21, 2024 10:59
@vkbo
Copy link
Owner Author

vkbo commented Apr 22, 2024

@kkostov, according to @mpejcoch, it doesn't work without Rosetta. Not sure what all of this means as I'm not very familiar with MacOS.

@kkostov
Copy link

kkostov commented Apr 23, 2024

Rosetta is a translation mechanism allowing x86_64 binaries to run on Apple Silicon. It's an optional component. macOS would only prompt the user to install it if they try to launch a binary which is not a Universal or Apple Silicon app. More info

Unfortunately I can't remove Rosetta from my system as I need it for development purposes in order to really, really test. A quick check on the main binary of the app shows that it should be able to run without Rosetta:

Screenshot 2024-04-23 at 14 52 23

Is it possible that some internal libraries/dependencies/processes launched by the app are x86_64? I scanned the entire bin folder and all seem to be either scripts or arm64:

for file in /Applications/novelWriter.app/Contents/Resources/bin/*; do
    echo "$file:"
    file "$file"
done
/Applications/novelWriter.app/Contents/Resources/bin/2to3:
/Applications/novelWriter.app/Contents/Resources/bin/2to3: a /Users/runner/miniconda/envs/novelWriter/bin/python3.12 script text executable, ASCII text
/Applications/novelWriter.app/Contents/Resources/bin/2to3-3.12:
/Applications/novelWriter.app/Contents/Resources/bin/2to3-3.12: a /Users/runner/miniconda/envs/novelWriter/bin/python3.12 script text executable, ASCII text
/Applications/novelWriter.app/Contents/Resources/bin/bunzip2:
/Applications/novelWriter.app/Contents/Resources/bin/bunzip2: Mach-O 64-bit executable arm64
/Applications/novelWriter.app/Contents/Resources/bin/bzcat:
/Applications/novelWriter.app/Contents/Resources/bin/bzcat: Mach-O 64-bit executable arm64
/Applications/novelWriter.app/Contents/Resources/bin/bzcmp:
/Applications/novelWriter.app/Contents/Resources/bin/bzcmp: POSIX shell script text executable, ASCII text
/Applications/novelWriter.app/Contents/Resources/bin/bzdiff:
/Applications/novelWriter.app/Contents/Resources/bin/bzdiff: POSIX shell script text executable, ASCII text
/Applications/novelWriter.app/Contents/Resources/bin/bzegrep:
/Applications/novelWriter.app/Contents/Resources/bin/bzegrep: POSIX shell script text executable, ASCII text
/Applications/novelWriter.app/Contents/Resources/bin/bzfgrep:
/Applications/novelWriter.app/Contents/Resources/bin/bzfgrep: POSIX shell script text executable, ASCII text
/Applications/novelWriter.app/Contents/Resources/bin/bzgrep:
/Applications/novelWriter.app/Contents/Resources/bin/bzgrep: POSIX shell script text executable, ASCII text
/Applications/novelWriter.app/Contents/Resources/bin/bzip2:
/Applications/novelWriter.app/Contents/Resources/bin/bzip2: Mach-O 64-bit executable arm64
/Applications/novelWriter.app/Contents/Resources/bin/bzip2recover:
/Applications/novelWriter.app/Contents/Resources/bin/bzip2recover: Mach-O 64-bit executable arm64
/Applications/novelWriter.app/Contents/Resources/bin/bzless:
/Applications/novelWriter.app/Contents/Resources/bin/bzless: POSIX shell script text executable, ASCII text
/Applications/novelWriter.app/Contents/Resources/bin/bzmore:
/Applications/novelWriter.app/Contents/Resources/bin/bzmore: POSIX shell script text executable, ASCII text
/Applications/novelWriter.app/Contents/Resources/bin/c_rehash:
/Applications/novelWriter.app/Contents/Resources/bin/c_rehash: Perl script text executable
/Applications/novelWriter.app/Contents/Resources/bin/captoinfo:
/Applications/novelWriter.app/Contents/Resources/bin/captoinfo: Mach-O 64-bit executable arm64
/Applications/novelWriter.app/Contents/Resources/bin/clear:
/Applications/novelWriter.app/Contents/Resources/bin/clear: Mach-O 64-bit executable arm64
/Applications/novelWriter.app/Contents/Resources/bin/idle3:
/Applications/novelWriter.app/Contents/Resources/bin/idle3: a /Users/runner/miniconda/envs/novelWriter/bin/python3.12 script text executable, ASCII text
/Applications/novelWriter.app/Contents/Resources/bin/idle3.12:
/Applications/novelWriter.app/Contents/Resources/bin/idle3.12: a /Users/runner/miniconda/envs/novelWriter/bin/python3.12 script text executable, ASCII text
/Applications/novelWriter.app/Contents/Resources/bin/infocmp:
/Applications/novelWriter.app/Contents/Resources/bin/infocmp: Mach-O 64-bit executable arm64
/Applications/novelWriter.app/Contents/Resources/bin/infotocap:
/Applications/novelWriter.app/Contents/Resources/bin/infotocap: Mach-O 64-bit executable arm64
/Applications/novelWriter.app/Contents/Resources/bin/lzcat:
/Applications/novelWriter.app/Contents/Resources/bin/lzcat: Mach-O 64-bit executable arm64
/Applications/novelWriter.app/Contents/Resources/bin/lzcmp:
/Applications/novelWriter.app/Contents/Resources/bin/lzcmp: POSIX shell script text executable, ASCII text
/Applications/novelWriter.app/Contents/Resources/bin/lzdiff:
/Applications/novelWriter.app/Contents/Resources/bin/lzdiff: POSIX shell script text executable, ASCII text
/Applications/novelWriter.app/Contents/Resources/bin/lzegrep:
/Applications/novelWriter.app/Contents/Resources/bin/lzegrep: POSIX shell script text executable, ASCII text
/Applications/novelWriter.app/Contents/Resources/bin/lzfgrep:
/Applications/novelWriter.app/Contents/Resources/bin/lzfgrep: POSIX shell script text executable, ASCII text
/Applications/novelWriter.app/Contents/Resources/bin/lzgrep:
/Applications/novelWriter.app/Contents/Resources/bin/lzgrep: POSIX shell script text executable, ASCII text
/Applications/novelWriter.app/Contents/Resources/bin/lzless:
/Applications/novelWriter.app/Contents/Resources/bin/lzless: POSIX shell script text executable, ASCII text
/Applications/novelWriter.app/Contents/Resources/bin/lzma:
/Applications/novelWriter.app/Contents/Resources/bin/lzma: Mach-O 64-bit executable arm64
/Applications/novelWriter.app/Contents/Resources/bin/lzmadec:
/Applications/novelWriter.app/Contents/Resources/bin/lzmadec: Mach-O 64-bit executable arm64
/Applications/novelWriter.app/Contents/Resources/bin/lzmainfo:
/Applications/novelWriter.app/Contents/Resources/bin/lzmainfo: Mach-O 64-bit executable arm64
/Applications/novelWriter.app/Contents/Resources/bin/lzmore:
/Applications/novelWriter.app/Contents/Resources/bin/lzmore: POSIX shell script text executable, ASCII text
/Applications/novelWriter.app/Contents/Resources/bin/ncurses6-config:
/Applications/novelWriter.app/Contents/Resources/bin/ncurses6-config: POSIX shell script text executable, ASCII text
/Applications/novelWriter.app/Contents/Resources/bin/ncursesw6-config:
/Applications/novelWriter.app/Contents/Resources/bin/ncursesw6-config: POSIX shell script text executable, ASCII text
/Applications/novelWriter.app/Contents/Resources/bin/openssl:
/Applications/novelWriter.app/Contents/Resources/bin/openssl: Mach-O 64-bit executable arm64
/Applications/novelWriter.app/Contents/Resources/bin/pip:
/Applications/novelWriter.app/Contents/Resources/bin/pip: a /Users/runner/miniconda/envs/novelWriter/bin/python3.12 script text executable, ASCII text
/Applications/novelWriter.app/Contents/Resources/bin/pip3:
/Applications/novelWriter.app/Contents/Resources/bin/pip3: a /Users/runner/miniconda/envs/novelWriter/bin/python3.12 script text executable, ASCII text
/Applications/novelWriter.app/Contents/Resources/bin/pydoc:
/Applications/novelWriter.app/Contents/Resources/bin/pydoc: a /Users/runner/miniconda/envs/novelWriter/bin/python3.12 script text executable, ASCII text
/Applications/novelWriter.app/Contents/Resources/bin/pydoc3:
/Applications/novelWriter.app/Contents/Resources/bin/pydoc3: a /Users/runner/miniconda/envs/novelWriter/bin/python3.12 script text executable, ASCII text
/Applications/novelWriter.app/Contents/Resources/bin/pydoc3.12:
/Applications/novelWriter.app/Contents/Resources/bin/pydoc3.12: a /Users/runner/miniconda/envs/novelWriter/bin/python3.12 script text executable, ASCII text
/Applications/novelWriter.app/Contents/Resources/bin/pylupdate5:
/Applications/novelWriter.app/Contents/Resources/bin/pylupdate5: a /Users/runner/miniconda/envs/novelWriter/bin/python3.12 script text executable, ASCII text
/Applications/novelWriter.app/Contents/Resources/bin/pyrcc5:
/Applications/novelWriter.app/Contents/Resources/bin/pyrcc5: a /Users/runner/miniconda/envs/novelWriter/bin/python3.12 script text executable, ASCII text
/Applications/novelWriter.app/Contents/Resources/bin/python:
/Applications/novelWriter.app/Contents/Resources/bin/python: Mach-O 64-bit executable arm64
/Applications/novelWriter.app/Contents/Resources/bin/python3:
/Applications/novelWriter.app/Contents/Resources/bin/python3: Mach-O 64-bit executable arm64
/Applications/novelWriter.app/Contents/Resources/bin/python3-config:
/Applications/novelWriter.app/Contents/Resources/bin/python3-config: a /Users/runner/miniconda/envs/novelWriter/bin/python3.12 script text executable, ASCII text
/Applications/novelWriter.app/Contents/Resources/bin/python3.1:
/Applications/novelWriter.app/Contents/Resources/bin/python3.1: Mach-O 64-bit executable arm64
/Applications/novelWriter.app/Contents/Resources/bin/python3.12:
/Applications/novelWriter.app/Contents/Resources/bin/python3.12: Mach-O 64-bit executable arm64
/Applications/novelWriter.app/Contents/Resources/bin/python3.12-config:
/Applications/novelWriter.app/Contents/Resources/bin/python3.12-config: a /Users/runner/miniconda/envs/novelWriter/bin/python3.12 script text executable, ASCII text
/Applications/novelWriter.app/Contents/Resources/bin/pyuic5:
/Applications/novelWriter.app/Contents/Resources/bin/pyuic5: a /Users/runner/miniconda/envs/novelWriter/bin/python3.12 script text executable, ASCII text
/Applications/novelWriter.app/Contents/Resources/bin/reset:
/Applications/novelWriter.app/Contents/Resources/bin/reset: Mach-O 64-bit executable arm64
/Applications/novelWriter.app/Contents/Resources/bin/sqlite3_analyzer:
/Applications/novelWriter.app/Contents/Resources/bin/sqlite3_analyzer: POSIX shell script text executable, ASCII text
/Applications/novelWriter.app/Contents/Resources/bin/tabs:
/Applications/novelWriter.app/Contents/Resources/bin/tabs: Mach-O 64-bit executable arm64
/Applications/novelWriter.app/Contents/Resources/bin/tclsh:
/Applications/novelWriter.app/Contents/Resources/bin/tclsh: Mach-O 64-bit executable arm64
/Applications/novelWriter.app/Contents/Resources/bin/tclsh8.6:
/Applications/novelWriter.app/Contents/Resources/bin/tclsh8.6: Mach-O 64-bit executable arm64
/Applications/novelWriter.app/Contents/Resources/bin/tic:
/Applications/novelWriter.app/Contents/Resources/bin/tic: Mach-O 64-bit executable arm64
/Applications/novelWriter.app/Contents/Resources/bin/toe:
/Applications/novelWriter.app/Contents/Resources/bin/toe: Mach-O 64-bit executable arm64
/Applications/novelWriter.app/Contents/Resources/bin/tput:
/Applications/novelWriter.app/Contents/Resources/bin/tput: Mach-O 64-bit executable arm64
/Applications/novelWriter.app/Contents/Resources/bin/tset:
/Applications/novelWriter.app/Contents/Resources/bin/tset: Mach-O 64-bit executable arm64
/Applications/novelWriter.app/Contents/Resources/bin/unlzma:
/Applications/novelWriter.app/Contents/Resources/bin/unlzma: Mach-O 64-bit executable arm64
/Applications/novelWriter.app/Contents/Resources/bin/unxz:
/Applications/novelWriter.app/Contents/Resources/bin/unxz: Mach-O 64-bit executable arm64
/Applications/novelWriter.app/Contents/Resources/bin/wheel:
/Applications/novelWriter.app/Contents/Resources/bin/wheel: a /Users/runner/miniconda/envs/novelWriter/bin/python3.12 script text executable, ASCII text
/Applications/novelWriter.app/Contents/Resources/bin/wish:
/Applications/novelWriter.app/Contents/Resources/bin/wish: Mach-O 64-bit executable arm64
/Applications/novelWriter.app/Contents/Resources/bin/wish8.6:
/Applications/novelWriter.app/Contents/Resources/bin/wish8.6: Mach-O 64-bit executable arm64
/Applications/novelWriter.app/Contents/Resources/bin/xz:
/Applications/novelWriter.app/Contents/Resources/bin/xz: Mach-O 64-bit executable arm64
/Applications/novelWriter.app/Contents/Resources/bin/xzcat:
/Applications/novelWriter.app/Contents/Resources/bin/xzcat: Mach-O 64-bit executable arm64
/Applications/novelWriter.app/Contents/Resources/bin/xzcmp:
/Applications/novelWriter.app/Contents/Resources/bin/xzcmp: POSIX shell script text executable, ASCII text
/Applications/novelWriter.app/Contents/Resources/bin/xzdec:
/Applications/novelWriter.app/Contents/Resources/bin/xzdec: Mach-O 64-bit executable arm64
/Applications/novelWriter.app/Contents/Resources/bin/xzdiff:
/Applications/novelWriter.app/Contents/Resources/bin/xzdiff: POSIX shell script text executable, ASCII text
/Applications/novelWriter.app/Contents/Resources/bin/xzegrep:
/Applications/novelWriter.app/Contents/Resources/bin/xzegrep: POSIX shell script text executable, ASCII text
/Applications/novelWriter.app/Contents/Resources/bin/xzfgrep:
/Applications/novelWriter.app/Contents/Resources/bin/xzfgrep: POSIX shell script text executable, ASCII text
/Applications/novelWriter.app/Contents/Resources/bin/xzgrep:
/Applications/novelWriter.app/Contents/Resources/bin/xzgrep: POSIX shell script text executable, ASCII text
/Applications/novelWriter.app/Contents/Resources/bin/xzless:
/Applications/novelWriter.app/Contents/Resources/bin/xzless: POSIX shell script text executable, ASCII text
/Applications/novelWriter.app/Contents/Resources/bin/xzmore:
/Applications/novelWriter.app/Contents/Resources/bin/xzmore: POSIX shell script text executable, ASCII text

I also tried forcing the architecture using arch -arm64 ./novelWriter and it also worked out correctly. That exhausts the ways I know of verifying binaries. If I happen to need to reinstall my Mac, I will make a point to try to run novelWritter before Rosetta and other dev tools are installed.

@vkbo
Copy link
Owner Author

vkbo commented Apr 23, 2024

Thanks for testing. I think the issue may be somewhere in the lib folder rather than in bin.

@vkbo
Copy link
Owner Author

vkbo commented Apr 23, 2024

Seems it may be Qt5 actually. Also looks like Qt6 will be fine, so maybe the problem will solve itself when I switch novelWriter to Qt6. https://www.qt.io/blog/qt-on-apple-silicon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants