MobileRead Forums

MobileRead Forums (https://www.mobileread.com/forums/index.php)
-   Plugins (https://www.mobileread.com/forums/forumdisplay.php?f=268)
-   -   MacOS ActiveState TCL 8.6.x and Sigil issue (https://www.mobileread.com/forums/showthread.php?t=342998)

DiapDealer 11-12-2021 08:34 AM

MacOS ActiveState TCL 8.6.x and Sigil issue
 
Something has changed on the ActiveState side of things. I'm not certain why there's no longer an 8.6.x download for mac.

EDIT: drastic changes at ActiveState apparently. All community editions have been phased out. we'll probably need to update our Sigil documentation for Macs that describe how to get ActiveTcl 8.6.x.

KevinH 11-12-2021 11:09 AM

Wow! ActiveState seems to be making even a bigger money grab! So sad ...

I will download and build the latest TCL/TK 8.6.12 from source for macOS and try to wrap an installer around it and either wrap an installer around or try to include it with the embedded python builds somehow. I never understood why Python did not include it like it does for Windows.

DiapDealer 11-12-2021 12:36 PM

Quote:

Originally Posted by KevinH (Post 4171971)
Wow! ActiveState seems to be making even a bigger money grab! So sad ...

Agreed.

Quote:

Originally Posted by KevinH (Post 4171971)
I never understood why Python did not include it like it does for Windows.

If I'm reading stuff right, it seems that Python.org's Python installers might do just that starting with Python 3.9.8 (or 3.10). Might be worth checking out the source for those python versions and see if the ability to build Tk/TCL from source is incorporated into the Mac build process like it is with Windows.

KevinH 11-12-2021 01:04 PM

I hope so.

Until then I have grabbed tcl8.6.12 and tk8.6.12 and build static library versions and will try to make the Python 3.8.3 version use those when building its tkinter. I really hate to embed the entire tcl tk framework when it is not really needed.

Let's hope this all goes away in Python 3.9.8.

I will grab the source and take a look.


Quote:

Originally Posted by DiapDealer (Post 4171990)
Agreed.

If I'm reading stuff right, it seems that Python.org's Python installers might do just that starting with Python 3.9.8 (or 3.10). Might be worth checking out the source for those python versions and see if the ability to build Tk/TCL from source is incorporated into the Mac build process like it is with Windows.


KevinH 11-12-2021 01:27 PM

Well the Tk TCL sources are not part of the Python-3.9.8 source releases and I see nothing in configure or setup.py to actually grab and install them.

That said, according to python.org you see:

Quote:

built-in 8.6.11
As of Python 3.9.1, all current universal2 Python installers for macOS downloadable from python.org supply their own private copies of Tcl/Tk 8.6.11. They do not look for or use any third-party or system copies of Tcl/Tk. This is an Aqua Cocoa Tk.
So it appears they are building their own installer binaries to include it, just *not* providing the steps or source to do so.

DiapDealer 11-12-2021 02:01 PM

It's in the 'Mac' folder of the 3.9.8 source. Much like on Windows, the 'build_install.py' script downloads 3rd-party library sources and builds them. From the readme.rst file in the Mac/BuildScript folder:

- builds the following third-party libraries

* OpenSSL 1.1.1
* Tcl/Tk 8.6
* NCurses
* SQLite
* XZ
* libffi

I'm hoping you'll be able apply any necessary patches, then build and install to $DESTROOT

@Doitsu: sorry for the mess, I'll clean up your plugin thread when we're done, here.

KevinH 11-12-2021 03:08 PM

Okay, I took a peek at it and did see where it builds tcktk things but it does not apply the required patches to make both xz and openssl work properly back to mac OS 10.12 when built on later macOS versions.

And it hard codes the location of tk tck which makes a completely relocatable Python framework a bit of a stickler to produce.

I am going to have to spend some time recreating how to make a Python 3.9 build that is relocatable (or 3.10).

I should probably do it for whichever version of Python we plan on moving to. Since 3.10.0 just came out, I am thinking 3.9.8 as the next version of Python for the next Sigil build.

Are you okay moving to Python 3.9.8 on Windows? If not, I can try to backport the changes and make a Python 3.8.3 with the latest tk and tcl embedded in it. Or we can update to the latest version of Python 3.8 and try.

Just let me know if 3.9.8, 3.8.3, or 3.8.X would be best for Windows and I will take a stab at building it on macOS.

DiapDealer 11-12-2021 03:19 PM

I've built a Windows version of Python 3.9.x and successfully built Sigil with it (I've also used a stock Python.org 3.9.x successfully), but I've not tested it all that heavily for any subtle problems. But sans any huge issues that I might encounter, I've no problem with moving to 3.9.8. The main thing I have to keep in mind for Windows is PyQt/Qt/Python/Python module compatibility. That "magic" intersection where everything will play nice together. ;)

I just have to avoid making Python 3.9.8 any kind of hard minimum, so that I don't leave a bunch of *nix distros in the dust.

DiapDealer 11-12-2021 03:24 PM

Windows Python 3.9 will stay compatible with my existing Windows PyQt5/Qt 5.12.x binaries, so that would probably be the path of least resistance for now.

I'm not ready to lose WebEngine support for even more graphics-cards in still-fairly-recent systems by moving to Qt5.15. I understand that move would leave even some relatively new-ish macOS versions in the lurch, no?

EDIT: actually, 3.9.x will put me in a bit of a bind with the PyQt5-sip module. If I can build a compatible version myself, it won't be a problem for my Sigil Windows installers, but it might leave me needing to rethink Windows continuous integration for Sigil a bit.

KevinH 11-12-2021 03:59 PM

No problems I can stick with Python 3.8.3 easily enough if necessary. Just let me know.

odamizu 11-13-2021 02:42 AM

If I already have ActiveTcl 8.6.9 installed (and also have 8.6.9 installer saved), is it safe to update to macOS Monterey? or is Monterey incompatible with Sigil 1.8.0 and plugins that require ActiveTcl 8.6.x? Thank you

Quote:

Originally Posted by troubledMan (Post 4171867)
... In the process to move from macOS High Sierra to macOS Monterey, after installed everything needed, so I think, I've found this log when trying to use the [kindlegen] plugin:

Spoiler:

Status: failed

Traceback (most recent call last):
File "/Applications/Sigil.app/Contents/plugin_launchers/python/launcher.py", line 141, in launch
target_script = __import__(script_module)
File "/Users/####/Library/Application Support/sigil-ebook/sigil/plugins/KindleGen/plugin.py", line 25, in <module>
from tkinter import Tk, BOTH, StringVar, IntVar, BooleanVar, PhotoImage, messagebox, DISABLED
File "tkinter/__init__.py", line 36, in <module>
ImportError: dlopen(/Applications/Sigil.app/Contents/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/_tkinter.cpython-38-darwin.so, 0x0002): Library not loaded: /Library/Frameworks/Tcl.framework/Versions/8.6/Tcl
Referenced from: /Applications/Sigil.app/Contents/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/_tkinter.cpython-38-darwin.so
Reason: tried: '/Library/Frameworks/Tcl.framework/Versions/8.6/Tcl' (no such file), '/System/Library/Frameworks/Tcl.framework/Versions/8.6/Tcl' (no such file)
Error: dlopen(/Applications/Sigil.app/Contents/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/_tkinter.cpython-38-darwin.so, 0x0002): Library not loaded: /Library/Frameworks/Tcl.framework/Versions/8.6/Tcl
Referenced from: /Applications/Sigil.app/Contents/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/_tkinter.cpython-38-darwin.so
Reason: tried: '/Library/Frameworks/Tcl.framework/Versions/8.6/Tcl' (no such file), '/System/Library/Frameworks/Tcl.framework/Versions/8.6/Tcl' (no such file)


I think it is related with some called Tcl, isn't it? What can I do to resolve this?

Environment:
- macOS 12.0.1
- Sigil 1.8.0 (in default location)
- Kindle Previewer 3.59.1 (in default location)
- KindleGen plugin 0.5.5 (Checked "Use Bundle Python")

Quote:

Originally Posted by Doitsu (Post 4171891)
You'll need to install ActiveTcl.)


DiapDealer 11-13-2021 08:52 AM

I would guess you'd be OK, but I wouldn't bet the farm on it. It probably depends on whether the ActiveState installer (or the program it installs) has any "phone home" capabilities. Kevin may have more info on that front (plus I'd recommend deferring to him on all things, MacOS anyway).

DiapDealer 11-13-2021 09:11 AM

Also keep in mind that I *think* you could still get (and legally use) the newest versions of Tk/TCL free for personal use (though I don't know how many machines you could activate it for simultaneously). You'd just need to create a free personal account and install it using their Active Platform software to get the latest versions.

KevinH 11-13-2021 10:51 AM

It should work just fine.

I always build the latest opensource version of tcl tk and install it via the build process instead of the ActiveState version. It is free to use with no limits. It just does not cone with the ActiveState "extras" but Sigil does not need them anyway.

You could also install tcl and tk via HomeBrew as well.

I am also going to try to build a macOS installer .pkg for the opensource tcl/tk Frameworks and I will post it when I get something working.


Quote:

Originally Posted by odamizu (Post 4172188)
If I already have ActiveTcl 8.6.9 installed (and also have 8.6.9 installer saved), is it safe to update to macOS Monterey? or is Monterey incompatible with Sigil 1.8.0 and plugins that require ActiveTcl 8.6.x? Thank you


odamizu 11-14-2021 02:32 AM

Thank you! I'm still on the fence about updating to Monterey. I'm currently using Catalina.

KevinH, what version macOS do you prefer nowadays, especially for Sigil?

KevinH 11-14-2021 09:31 AM

I have to keep an older version around to properly build projects to keep things working back to 10.12 so my main dev machine runs Mojave but it is a 2013 iMac.

My 2020 MacBookPro laptop runs Catalina. Neither Big Sur nor Monterey added anything much over Catalina that I would find compelling to do an upgrade. And I never update my machines until well into or even near the end of the next release cycle when I do decide to update. So BigSur would be my choice over Monterey anyway.

Apple creating a new OS release once each year and only supporting the last 3 with updates is true madness on Apple's part.

I try not to support such nonsense which is why Sigil works back to 10.12 Sierra (and it only came out in 2016!).


Quote:

Originally Posted by odamizu (Post 4172435)
Thank you! I'm still on the fence about updating to Monterey. I'm currently using Catalina.

KevinH, what version macOS do you prefer nowadays, especially for Sigil?


odamizu 11-14-2021 03:29 PM

Quote:

Originally Posted by DiapDealer (Post 4172270)
Also keep in mind that I *think* you could still get (and legally use) the newest versions of Tk/TCL free for personal use ...

I've been clicking around ActiveState's website, and it appears that if you're just signing up for a free account now, you only have access to 8.5 (for macOS). However, if I log in with my pre-existing free account, I have access to 8.6.9, which is the last installer I downloaded. I have no access to any version newer than 8.6.9.

Quote:

Originally Posted by KevinH (Post 4172512)
... my main dev machine runs Mojave ... My 2020 MacBookPro laptop runs Catalina ...

Thank you! In that case, my interest in Monterey decreases :)

DiapDealer 11-14-2021 03:54 PM

Quote:

Originally Posted by odamizu (Post 4172570)
I've been clicking around ActiveState's website, and it appears that if you're just signing up for a free account now, you only have access to 8.5 (for macOS). However, if I log in with my pre-existing free account, I have access to 8.6.9, which is the last installer I downloaded. I have no access to any version newer than 8.6.9.

That's from the website, right? I was under the impression that a registered account entitled the user to use the Active Platform command line tools to download/install/activate newer versions. I could be wrong, though. I haven't tried it. Nor am I encouraging anyone else to do so. ;)

KevinH 11-14-2021 04:49 PM

I have built a TclTk v 8.6.12 from latest sources. It is a dmg file that when mounted provides a TclTk-8.6.12.pkg installer.

It is not-signed as I do not have a installer pkg signing privs, since Sigil has never needed a .pkg installer.

If you have a machine without an ActiveState ActiveTCL installed, please give it a try. It appears to work on my machine with Sigil just fine.

I posted the TclTk_8.6.12.dmg to our github Sigil 1.8.0 Releases page.

odamizu 11-15-2021 01:03 AM

1 Attachment(s)
Quote:

Originally Posted by DiapDealer (Post 4172578)
That's from the website, right? I was under the impression that a registered account entitled the user to use the Active Platform command line tools to download/install/activate newer versions. I could be wrong, though. I haven't tried it. Nor am I encouraging anyone else to do so. ;)

Ummm ... so, I have only ever gone to ActiveState's website to download ActiveTcl. All the other stuff kinda confuses me and what you asked kinda confuses me.

At some point ActiveState required me to register for a free account to download ActiveTcl from their website, which I did. The website then gave me a dashboard and words like project and builds and forking, which I don't really understand.

Now when I log in, I see a dashboard with two options:

Attachment 190260

If I click on the second choice, I am offered ActiveTcl-8.6.9.8609.2-macosx...

If I go to the Overview tab and click View All Available Builds I get the same thing. Ditto if I click the Download Builds tab.

I'm not sure about command line tools and it's entirely possible that I'm missing a whole other developer section that I don't understand :o

odamizu 11-15-2021 01:30 AM

Quote:

Originally Posted by KevinH (Post 4172598)
I have built a TclTk v 8.6.12 from latest sources. It is a dmg file that when mounted provides a TclTk-8.6.12.pkg installer ...

If you have a machine without an ActiveState ActiveTCL installed, please give it a try. It appears to work on my machine with Sigil just fine.

I only have the one computer, which already has ActiveTcl 8.6.9 installed, but I am happy to test your 8.6.12 installer on top of 8.6.9.

I downloaded TclTk_8.6.12.dmg from GitHub Sigil 1.8.0 Release page and copied it to Desktop.

I opened the installer, agreed to license terms, clicked Install, only to get:

"This package is incompatible with this version of macOS. The package is trying to install content to the system volume. Contact the software manufacturer for assistance."

I am running Catalina 10.15.7.

Is this happening because I already have 8.6.9 installed? (I'm kinda nervous about uninstalling 8.6.9 since everything is currently working.)

ETA: Not sure if this adds any other useful information, but I launched ActiveState's ActiveTcl 8.6.9.8609.2 installer to see what would happen. The first pop-up window I get says: "This package will run a program to determine if the software can be installed". When I click Continue, a second pop-up says: "An existing installation has been found on your system. Another non-system installation of Tcl exists on this system in /Library/Frameworks/Tcl.framework. Please consider uninstalling it before proceeding with the current installation." I stopped there.

KevinH 11-15-2021 09:27 AM

Hmm ... I think this is because of macOS settings you have that do not allow for unsigned packages. My TclTk puts things in the proper /Library/Frameworks location just like the ActiveState one but it is unsigned. It appears to work on Mojave. Perhaps Catalina locks things down further?

DiapDealer 11-15-2021 09:35 AM

Quote:

Originally Posted by odamizu (Post 4172675)
Ummm ... so, I have only ever gone to ActiveState's website to download ActiveTcl. All the other stuff kinda confuses me and what you asked kinda confuses me.

At some point ActiveState required me to register for a free account to download ActiveTcl from their website, which I did. The website then gave me a dashboard and words like project and builds and forking, which I don't really understand.

Now when I log in, I see a dashboard with two options:

Attachment 190260

If I click on the second choice, I am offered ActiveTcl-8.6.9.8609.2-macosx...

If I go to the Overview tab and click View All Available Builds I get the same thing. Ditto if I click the Download Builds tab.

I'm not sure about command line tools and it's entirely possible that I'm missing a whole other developer section that I don't understand :o

I'm flying a bit blind myself. I'm just going by some descriptions of something called the "Active Platform" that sounded to me like it ran on the local machine (from the command-line). But I could be wrong. The free account may be limited to 8.5 on macOS using that method as well.

I think the bottom line, here is that ActiveState has really jumped the shark on this change. ;)

KevinH 11-15-2021 11:11 AM

Hi Odamizu,

Okay I was able to reproduce the exact issue you are seeing on my own Catalina based laptop. It seems for Catalina and later you need to build the pkg with pkgbuild command with --install-location set otherwise it thinks your package is tryting to be installed someplace it should not be even if it is not.

So I have rebuilt the TclTk_8.6.12.dmg installer to use pkgbuild and that extra command line setting.

I have now tested installing the new TclTk_8.6.12.pkg on my Catalina laptop and it properly installed things to where they belong.

So please try regrabbing TclTk_8.6.12.dmg from Sigil 1.8 releases page and giving it a go. It should install just fine as it is an upgrade of what ActiveState put there. If not, I can lead you through fixing things manually.

Hope this does the trick.

KevinH

Quote:

Originally Posted by odamizu (Post 4172677)
I only have the one computer, which already has ActiveTcl 8.6.9 installed, but I am happy to test your 8.6.12 installer on top of 8.6.9.

I downloaded TclTk_8.6.12.dmg from GitHub Sigil 1.8.0 Release page and copied it to Desktop.

I opened the installer, agreed to license terms, clicked Install, only to get:

"This package is incompatible with this version of macOS. The package is trying to install content to the system volume. Contact the software manufacturer for assistance."

I am running Catalina 10.15.7.

Is this happening because I already have 8.6.9 installed? (I'm kinda nervous about uninstalling 8.6.9 since everything is currently working.)

ETA: Not sure if this adds any other useful information, but I launched ActiveState's ActiveTcl 8.6.9.8609.2 installer to see what would happen. The first pop-up window I get says: "This package will run a program to determine if the software can be installed". When I click Continue, a second pop-up says: "An existing installation has been found on your system. Another non-system installation of Tcl exists on this system in /Library/Frameworks/Tcl.framework. Please consider uninstalling it before proceeding with the current installation." I stopped there.


odamizu 11-15-2021 05:21 PM

Quote:

Originally Posted by KevinH (Post 4172775)
... Okay I was able to reproduce the exact issue you are seeing on my own Catalina based laptop ... I have rebuilt the TclTk_8.6.12.dmg installer ... please try regrabbing TclTk_8.6.12.dmg from Sigil 1.8 releases page and giving it a go ...

Success! Thank you! Looks like Mac users don't need to go to ActiveState's website for TclTk anymore :)

KevinH 11-15-2021 05:33 PM

Great news! Thank you for testing it!

troubledMan 11-16-2021 04:56 AM

Quote:

Originally Posted by KevinH (Post 4172857)
Great news! Thank you for testing it!

No, thank you very much for completing that task in so little time.

It's OK under macOS Monterey. I tried to uninstall Sigil-Kindlegen-TclTk 8.5 first, but I had to left TclTk, as the script provided by Active pointed to different locations to those indicated in the log (¿?) that the installation script left in the user root (AT.postflight.1166):

Has /Library/Tcl/teapot = 0
HOME______ = /Users/****
USER______ = ****
pkgdir____ = /Volumes/ActiveTcl-8.5/ActiveTcl-8.5.pkg
installdir = /
repository = /Library/Tcl/teapot
shell_____ = /usr/local/bin/tclsh8.5
Having a seed repository.
No existing repository, copying the seed to the repository-to-be at /Library/Tcl/teapot
/usr/local/bin/teacup link make /Library/Tcl/teapot /usr/local/bin/tclsh8.5
Ok
/usr/local/bin/teacup default /Library/Tcl/teapot
/Library/Tcl/teapot
Forcing ownership of /Users/geum/Library/Application Support/ActiveState to geum
___done


So, I've installed again Sigil & KindleGen (last versions) and the non ActiveState package made by KevinH and, bingo! Everything is as it should. Well, no: if I set the compression level to 2 in the plugin interface, there is no output, as it was in my previous installation under macOS High Sierra.

Again, thank you!


All times are GMT -4. The time now is 08:27 PM.

Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.