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

MacBook Pro M3 Executable #285

Open
alancairns opened this issue Sep 17, 2024 · 35 comments
Open

MacBook Pro M3 Executable #285

alancairns opened this issue Sep 17, 2024 · 35 comments
Labels
awaiting feedback Feedback needed from opener of the issue

Comments

@alancairns
Copy link

Is the an executable version of TDM for the MacBook M3? It doesn't appear to be listed on the release page below the Assets tab.

@jziolkowski
Copy link
Owner

Since I don't have a Mac, I have to rely on volunteers help in testing these releases. I'll update the assets as soon as I have verified that the builds work.

@alancairns
Copy link
Author

alancairns commented Sep 17, 2024 via email

@Jason2866
Copy link
Collaborator

Jason2866 commented Sep 17, 2024

The Mac App binary from release section does work. You can use on the M3 already. Since this is not a native build you have to install Rosetta

@jziolkowski You should tar the Mac binary. Github does not store file rights. So the execute right is lost and has to be set manually to launch the binary. You should provide the builded APP too. This one can directly started with a double click

Mabe using dmg? Like this

...
      - name: Run PyInstaller
        run: |
          python -m PyInstaller tdmgr_mac.spec
          create-dmg tdmgr_Mac_x64.dmg dist
...

@jziolkowski
Copy link
Owner

I can use whichever format is recommended these days for Macs.

As for the build env, the current macos worker is intel-based. With arm based there are library errors (with pyinstaller afaik).

That create-dmg is already present on mac builder or needs an external install? also are there noticeable differences with the tdmgr mac spec? if possible I want to have a single spec file; I can add (more) conditional checks inside

@Jason2866
Copy link
Collaborator

Jason2866 commented Sep 17, 2024

@jziolkowski You can have a look to my old tdm fork. The GH Actions does build for win and mac.
https://github.com/Jason2866/tdm/blob/development/.github/workflows/main.yml

spec file for Mac Intel and Arm is identic. Pyinstaller works fine with both.

@alancairns
Copy link
Author

I'm a bit out of my depth here so please bare with me if am asking silly questions. When I go to the webpage https://github.com/jziolkowski/tdm/releases in the assets section there are 5 files listed in the TDM 2024.9.3 section: tdmgr_2024.9.3.exe, tdmgr_2024.9.3_x64 and tdmgr_2024.9.3_x64.exe

I've just noticed that in the TDM 0.2.13 section the are two MacOS files: tdmgr_0.2.13.appImage.zip and tdmgr_0.2.13.macOS.zip. Is it one of these files I should be using?

@Jason2866
Copy link
Collaborator

The Mac binary is tdmgr_2024.9.3_x64

@jziolkowski The naming imho of the released binaries should be more clear.

To build an app for Mac you have to add in the spec file:

app = BUNDLE(exe,
             name='the name of the app',
             icon='tdmgr.icns',
             bundle_identifier='com.tasmota.tdmgr')

@alancairns
Copy link
Author

I have the app working by downloading tdmgr_0.2.13.macOS.zip which produced a file named dist.tar in the downloads folder. In Terminal I changed directory to the downloads folder the ran tar -xzf list.tar and this created a file tdmgr_0.2.13.app that I was able to run. How I will now try to build the tdmgr_2024.9.3_x64 ( I've never had to build an app before). Once again thank you both for your prompt help.

@jziolkowski
Copy link
Owner

I should have working CI with updated builds this evening

@alancairns
Copy link
Author

Thank you so much!

@jziolkowski
Copy link
Owner

My investigation shown (proved by various GH issues) that Python3.8 and 3.9 is not available on the latest macos runner (arm Mx). So for now only intel-based builds will be available until I check the implications of moving TDM to python 3.10.

I wanted to go with 3.9 since python 3.8 reaches EoL next month.

However I think it might be possible to build with 3.10 on macos arm only. We'll see.

@jziolkowski
Copy link
Owner

The naming imho of the released binaries should be more clear.

working on that, agree 100%

@jziolkowski
Copy link
Owner

ok then. I have a playground repo, I did some mac CI work tests there. Pleae check if the .dmg file works on Mac. Despite TDM name it's just a simple console app that should print 'hello world'

@jziolkowski
Copy link
Owner

@alancairns
Copy link
Author

alancairns commented Sep 18, 2024 via email

@jziolkowski
Copy link
Owner

the docs I've read say that you install the dmg. not copy the app manually. but again, no mac here, can't really test it.

@Jason2866 can you give some input? i've adapted the mac stuff from your old repo fork

@Jason2866
Copy link
Collaborator

@jziolkowski This fork with GH actions build does work https://github.com/Jason2866/tdm/tree/actions_mac
For the hell idk why the "if" to exclude Windows to pack as DMG is not working (Line 53)
The resulting APP in the DMG container is tested working. Only the Icon is missing. Needs to be added in the build spec...

@jziolkowski
Copy link
Owner

did you test the one I built? Not sure if you're referring to my build or your build

@Jason2866
Copy link
Collaborator

Your release is working. But it is not an app binary which can be used without modifications.
In short not end user ready. The one which is build in my fork is working out of the box.

@jziolkowski
Copy link
Owner

The only difference I noticed was with my create-dmg invokation in relation to relative paths. I've updated to how you invoke it.

Please check updated dmg in https://github.com/jziolkowski/citest/releases/tag/0.3

@Jason2866
Copy link
Collaborator

@jziolkowski Yours does work. Needs to run from console to see output. If started via double click nothing is shown.

@jziolkowski
Copy link
Owner

well yes, it's in console mode
i'll update the TDM repo and rebuild, we'll see with a proper GUI app

@Jason2866
Copy link
Collaborator

Jason2866 commented Sep 18, 2024

Build in my fork. Both Mac version does work. The Windows X64 is working with Wine too. It is surprisingly fast with Wine!

@jziolkowski
Copy link
Owner

wine uses the minimum set of libs needed to run a windows application. without the bloat of the entire OS it's fast indeed.

@jziolkowski
Copy link
Owner

https://github.com/jziolkowski/tdm/releases/tag/2024.9.4.dev8

let's give it a try please

@alancairns
Copy link
Author

alancairns commented Sep 18, 2024 via email

@jziolkowski
Copy link
Owner

we'll need to wait for Jason. I have no idea.

Are you extracting the .app from the .dmg file? is that how you install these apps? no idea...

@Jason2866
Copy link
Collaborator

Sorry for the delay in trying the app but I’ve been away all day today. I’ve just downloaded this version and it doesn’t open. I’m not sure if this is relevant but when in right click on any of my other apps the menu shows “Show Package Contents” just below “Open” but tdmgr_2024.9.4.dev8_mac_x86_64.app does not give this option.

Since the app is not signed (needs a Apple developer account -> $) it can't be just clicked.
After the DMG is mounted go in Finder to the APP right click and select open (or start idk don't have english installed) after that a warning window opens (downloaded from Internet security...) accept and it will start. This needs to be done only one time. Next time you can start as usual.

@alancairns
Copy link
Author

alancairns commented Sep 18, 2024 via email

@jziolkowski
Copy link
Owner

I have similar issues with .exe not being signed on windows, they make it more and more difficult to run unsigned apps. It's $100 per year for mac, and 60€ (IIRC) for windows. Yeah, not going to happen anytime soon :D

@jziolkowski
Copy link
Owner

anyway thank you both, for testing and debugging. Can I close the issue?

@alancairns
Copy link
Author

alancairns commented Sep 18, 2024 via email

@jziolkowski
Copy link
Owner

@alancairns any update here? I'd like to resolve the issue.

@jziolkowski jziolkowski added the awaiting feedback Feedback needed from opener of the issue label Sep 25, 2024
@alancairns
Copy link
Author

I have just tried it again but still doesn’t open. I am using tdmgr_0.2.13.app for the time being

@dweston
Copy link

dweston commented Oct 14, 2024

I'm another keen Tasmota user also with an Apple M3 based laptop. I'm also unable to use @Jason2866 's suggestion of right clicking the APP within its DMG mount and selecting 'Open'. However, no Internet security warning window pops up.

The relevant system log entries confirm this due to the Gatekeeper blocking execution:

2024-10-14 18:22:18.170483 (gui/501/application.?.38288397.38288397 [18380]) <Warning>: removing service since it exited with consistent failure - OS_REASON_EXEC | Gatekeeper policy blocked execution
2024-10-14 18:22:18.170499 (gui/501/application.?.38288397.38288397 [18380]) <Notice>: exited with exit reason (namespace: 9 code: 0x8) - OS_REASON_EXEC | Gatekeeper policy blocked execution, ran for 65ms

I've tried the usual gamut of methods to partially disable Gateway or otherwise authorise the tdmgr app (e.g.
sudo spctl --master-disable

and
xattr -dr com.apple.quarantine /path/to/your/copy/of/tdmgr_2024.10.2.1_mac_x86_64.app)

The only method that came close was by directly starting the app within the Terminal.app, whereupon the GUI came up but otherwise the app was non-functional. This may well be the consequence of the Python version that was present by default in the OS version my laptop came with.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting feedback Feedback needed from opener of the issue
Projects
None yet
Development

No branches or pull requests

4 participants