Skip to content

macOS linked Tcl/Tk versions #43

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

Closed
tmontes opened this issue Apr 30, 2020 · 4 comments
Closed

macOS linked Tcl/Tk versions #43

tmontes opened this issue Apr 30, 2020 · 4 comments
Labels
enhancement New feature or request

Comments

@tmontes
Copy link

tmontes commented Apr 30, 2020

Hello!

First and foremost, thanks for sharing this work. :-)

My name is Tiago and I've been contributing to Mu Editor for a while now. It's a beginner friendly Python Editor and one of the challenges we face is, like many other projects, packaging it for end-user distribution. In particular on macOS and Windows, we ship a packaged version that looks and feels like pretty much other desktop applications.

Context

As of today, Mu is packaged with BeeWare's Briefcase on macOS and with pynsist on Windows. It is also packaged for some Linux distros, including Raspbian, and as a pure Python wheel, on PyPI.

Recent progress on BeeWare's Briefcase project lead me to re-evaluate it as more general and unified tool for packaging Mu for all/most targets.

Briefcase uses the concept of a "support package" which is a redistributable and relocatable Python installation, much like what this project is sharing. For that reason the BeeWare team also puts efforts into creating such redistributable Python installations.

My Experiment

While exploring the recent progress in Briefcase I confirmed BeeWare's Python still does not include modules such as tkinter, pip, or venv -- these are required by Mu (see beeware/briefcase#383). Up until today, we have been using a taylor-made Briefcase "support package" (Python installation), but that does feel like a waste of efforts -- how many projects out there are building redistributable Python installations?

Wondering if I could avoid the burden of managing Mu's own "support package", I decided to try out Python Build Standalone -- would it include the bits and pieces we need? how easy would it be to feed into Briefcase?

What I tried:

  • Downloaded the most recent 3.7.7 release for both macOS and Windows.
  • Played around with it interactively, at the REPL, in particular with tkinter, pip, and venv.
  • All working out of the box. Great!

Then, on macOS only:

  • Slighly adjusted the payloads to make them usable with Briefcase.
  • Successfully packaged a tkinter based GUI application on macOS with your Python build.
  • Great!

Where I Stumbled

Pushing it a little further, I created a very minimal tkinter based application -- a single window, displaying an embedded image file, in PNG format.

It kept failing on macOS until I realized that the underlying Tcl/Tk versions are 8.5, with no PNG image support, instead of 8.6 like the ones included in the CPython distributions from www.python.org. I then checked your Windows distribution only to see that it bundles Tcl/Tk 8.6.

I then skimmed through the build scripts in this project and, seeing references to Tcl/Tk downloads, I ran a build on my macOS system, hoping it would bring in Tcl/Tk 8.6. It did not.. (in retrospect, why would it, assuming your releases are built the same way?) :-)

Question

Not being into the nitty gritty details about the whole build process, how feasible/easy would it be to update the macOS builds to include updated Tcl/Tk? I suspect the current versions use the system included ones which are, at least on my system, running Mojave 10.14.x, in fact, 8.5.

Thanks again for sharing this project and for any feedback and pointers in how to attain my objective -- having a common, up to date, Tcl/Tk version across the different platforms.

@tmontes tmontes changed the title macOS linked tck/tk versions macOS linked tcl/tk versions Apr 30, 2020
@tmontes tmontes changed the title macOS linked tcl/tk versions macOS linked Tcl/Tk versions Apr 30, 2020
@indygreg indygreg added the enhancement New feature or request label May 10, 2020
@indygreg
Copy link
Collaborator

It should be possible to build and distribute a custom tcl/tk on macOS. It isn't implemented because I thought the tcl/tk on macOS was new enough, my perception is that building tcl/tk on macOS will be a pain, and nobody had yet complained. But since you demonstrated a very real problem and there is precedent for the official Python installers shipping tcl/tk on macOS, this makes this a very legitimate and necessary feature request.

I'll likely hash this out the next time I sit down to hack on python-build-standalone. I'm not sure when that will be, however.

@tmontes
Copy link
Author

tmontes commented May 10, 2020

@indygreg, thanks for your feedback. I'll be glad to help out, if there are any pointers you want to share. Wondering why your perception indicates that building Tcl/Tk on macOS will be a pain... :)

@indygreg
Copy link
Collaborator

Perception of pain is because it took a few days to get tcl/tk building from source on Linux. But that was primarily due to the long list of dependencies that needed to be built so we could achieve statically linked binaries. This included a bunch of random libraries related to X11. macOS might be a bit easier, as there is no X11 and we can presumably link against always-available system frameworks.

@tmontes
Copy link
Author

tmontes commented May 17, 2020

@indygreg, thanks a lot for adf957f! :-)

I took it for a quick spin and it is looking good. I will explore further and let you know if I find something unexpected in comparison to PSF's CPython.

Again, thanks.

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

No branches or pull requests

2 participants