Bug 2337728

Summary: Please update the package for the 'Tcl/Tk 9.0' Fedora change
Product: [Fedora] Fedora Reporter: Jaroslav Škarvada <jskarvad>
Component: maximaAssignee: Yaakov Selkowitz <yselkowi>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: jamatos, rdieter, yselkowi
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
URL: https://fedoraproject.org/wiki/Changes/TclTk9.0
Whiteboard:
Fixed In Version: maxima-5.47.0-7.fc43 maxima-5.47.0-7.fc42 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2025-02-07 21:49:38 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2337584    
Attachments:
Description Flags
xmaxima tcl9 patch none

Description Jaroslav Škarvada 2025-01-14 18:35:13 UTC
Fedora 42 will update Tcl/Tk to version 9.0. It seems your package uses Tcl or Tk as a dependency.
Please check that your package builds and works correctly with Tcl/Tk 9.0.
The effort is tracked in the bug 2337584, there is system wide change proposal [1]. I also tried to
rebuild the direct dependencies in Copr [2].

TL/DR:
- there is side tag "f42-build-side-103615"
- Tcl/Tk was bumped to version 9.0 in the side tag
- there are compat packages tcl8/tk8 in the side tag for backward compatibility
- if your package needs fixing, please fix it to build with the Tcl/Tk 9.0 or switch it to the compat tcl8/tk8
- build your package into the side tag "f42-build-side-103615" (if rebuild is not needed, e.g. the package
  just calls the Tcl shell and works with any Tcl version, ignore this step)
- close this bug

Full version:
If your package works correctly and doesn't require rebuild, please close this bug as rawhide.

If your package needs rebuild and correctly builds with the Tcl/Tk 9.0, please rebuild it with the
side-tag "f42-build-side-103615":
  $ fedpkg build --target=f42-build-side-103615
Optionally, you can regenerate the repo for others to be able to build with your package in the side-tag
(example YOUR_PKG_NVR="brltty-6.7-3"):
  $ koji wait-repo --build=$YOUR_PKG_NVR.fc42 f42-build-side-103615 --request
Close this bug as rawhide.

If your package doesn't build with the Tcl/Tk 9.0, please fix/port it. There is a Tcl/Tk 9.0 porting
guide [3]. Then build it with the side-tag "f42-build-side-103615":
  $ fedpkg build --target=f42-build-side-103615
Optionally, you can regenerate the repo for others to be able to build with your package in the side-tag,
(example YOUR_PKG_NVR="brltty-6.7-3"):
  $ koji wait-repo --build=$YOUR_PKG_NVR.fc42 f42-build-side-103615 --request
Close this bug as rawhide.

If your package cannot be ported or it's unrealistic to do it in the short time, please switch to the
compat Tcl/Tk 8 packages. In the spec file change the BuildRequires from the "tcl-devel"/"tk-devel" to
"tcl8-devel"/"tk8-devel". If your package needs explicit "Requires: tcl", you can use "Requires: tcl8".
Then build your package with the side-tag "f42-build-side-103615":
  $ fedpkg build --target=f42-build-side-103615
Optionally, you can regenerate the repo for others to be able to build with your package in the side-tag,
(example YOUR_PKG_NVR="brltty-6.7-3"):
  $ koji wait-repo --build=$YOUR_PKG_NVR.fc42 f42-build-side-103615 --request
Close this bug as rawhide.

If you update your package after resolving this bug (and before 2025-02-04), please build to the side-tag.

Components which bugzillas won't be resolved till 2025-01-31 will be switched to the compat tcl8/tk8
packages by proven packager and rebuilt into the side-tag.

Then at the turning point (2025-02-03) the side-tag will be pushed by me as an Bodhi update.

Thanks for your cooperation.

[1] https://fedoraproject.org/wiki/Changes/TclTk9.0
[2] https://copr.fedorainfracloud.org/coprs/jskarvad/TclTK9.0.0/
[3] https://www.tcl-lang.org/software/tcltk/9.0.html

Comment 1 Yaakov Selkowitz 2025-01-14 20:50:26 UTC
xmaxima (the script from maxima-gui) is not yet compatible with Tcl/Tk 9.0.  Besides the obvious updating of the "package require Tk" line, there are a few issues:

1) I'm getting this error with launching anything using Tk 9 (even just "wish", meaning it's not specific to this package):

```
application-specific initialization failed: Can't find a usable tk.tcl in the following directories: 
    //zipfs:/app/tk_library //zipfs:/lib/tk/tk_library //zipfs:/lib/tk /usr/share/tk9.0 /usr/share/tk9.0 /usr/share/tcl9.0/tk9.0 /usr/lib64/tcl9.0/tk9.0 /usr/lib64/tk9.0/tk9.0 /usr/share/tk9.0/tk9.0 /usr/lib/tk9.0 /lib/tk9.0 /usr/library

This probably means that tk wasn't installed properly.
```

2) Tilde (~) is used extensively for $HOME in pathnames; as Tcl 9.0 no longer expands that OOTB, the code will need to be adapted to use [file home] or [file tildeexpand], which seems doable.

3) The documentation browser does not scroll; neither the mouse wheel nor scroll bar works with 9.0.  There is also the following error message, which I wonder is related (there is no direct calls to that command in the script):

```
invalid command name "::tk::ScreenChanged"
    while executing
"::tk::ScreenChanged :0.0"
    (changing screen in event binding)
```

4) Please note that making this work with tk8 is not as simple as changing the spec file; the "exec wish" redirector in the script needs to changed to "exec wish8".

Either way, any of these changes will IIUC break compatibility between rawhide/F42+ and earlier releases.  (Not really a problem, but something to note.)

Unless you are able to assist with at least (3), then I'll need to stick with tk8 with (4) applied.

Comment 2 Jaroslav Škarvada 2025-01-14 21:15:15 UTC
(In reply to Yaakov Selkowitz from comment #1)
> xmaxima (the script from maxima-gui) is not yet compatible with Tcl/Tk 9.0. 
> Besides the obvious updating of the "package require Tk" line, there are a
> few issues:
> 
> 1) I'm getting this error with launching anything using Tk 9 (even just
> "wish", meaning it's not specific to this package):
> 
> ```
> application-specific initialization failed: Can't find a usable tk.tcl in
> the following directories: 
>     //zipfs:/app/tk_library //zipfs:/lib/tk/tk_library //zipfs:/lib/tk
> /usr/share/tk9.0 /usr/share/tk9.0 /usr/share/tcl9.0/tk9.0
> /usr/lib64/tcl9.0/tk9.0 /usr/lib64/tk9.0/tk9.0 /usr/share/tk9.0/tk9.0
> /usr/lib/tk9.0 /lib/tk9.0 /usr/library
> 
> This probably means that tk wasn't installed properly.
> ```
>
Thanks for spotting this, it seems it's compiled with the zipfs, but the build system stripped the resource. IIRC it worked when tested locally. I will recompile without the zipfs.

> 2) Tilde (~) is used extensively for $HOME in pathnames; as Tcl 9.0 no
> longer expands that OOTB, the code will need to be adapted to use [file
> home] or [file tildeexpand], which seems doable.
> 
> 3) The documentation browser does not scroll; neither the mouse wheel nor
> scroll bar works with 9.0.  There is also the following error message, which
> I wonder is related (there is no direct calls to that command in the script):
> 
> ```
> invalid command name "::tk::ScreenChanged"
>     while executing
> "::tk::ScreenChanged :0.0"
>     (changing screen in event binding)
> ```
> 
Let's test with the fixed Tk.

> 4) Please note that making this work with tk8 is not as simple as changing
> the spec file; the "exec wish" redirector in the script needs to changed to
> "exec wish8".
> 
If absolutely necessary I could provide alternatives links, but I would rather avoid it.

Comment 3 Jaroslav Škarvada 2025-01-14 22:05:39 UTC
Updated tk-9.0.0-2.fc42 is in the side-tag, please retest.

Comment 4 Yaakov Selkowitz 2025-01-15 01:02:21 UTC
Created attachment 2066027 [details]
xmaxima tcl9 patch

> Updated tk-9.0.0-2.fc42 is in the side-tag, please retest.

Thanks, that fixed issues (1) and (3).  I'm not fluent in Tcl, but the attached patch appears to take care of the tildes; does that make sense?

Comment 5 Jaroslav Škarvada 2025-01-15 10:10:21 UTC
(In reply to Yaakov Selkowitz from comment #4)
> Created attachment 2066027 [details]
> xmaxima tcl9 patch
> 
> > Updated tk-9.0.0-2.fc42 is in the side-tag, please retest.
> 
> Thanks, that fixed issues (1) and (3).  I'm not fluent in Tcl, but the
> attached patch appears to take care of the tildes; does that make sense?

I am new to Tcl 9, but the changes make sense to me and I think are according to:
https://core.tcl-lang.org/tips/doc/main/tip/602.md

Maybe you could concat with the 'file home' instead of the tilde expansion, but the effect is probably the same.

Comment 6 Jaroslav Škarvada 2025-01-15 10:43:17 UTC
Update:

There is a better way how to handle switch to compat packages, instead of build requiring tcl8-devel/tk8-devel, the following is better and backward compatible approach:
  BuildRequires: tcl-devel < 9
  BuildRequires: tk-devel < 9
The correct provides are already included in the tcl8/tk8 packages. And in a such way the package needn't be built into the side tag.

For updates please check the tracking bug 2337584.

Comment 7 Jaroslav Škarvada 2025-01-15 11:08:04 UTC
Update (auto comment):

>  BuildRequires: tcl-devel < 9
>  BuildRequires: tk-devel < 9

There is epoch, so the correct variant is:
  BuildRequires: tcl-devel < 1:9
  BuildRequires: tk-devel < 1:9

Sorry for confusion.

Comment 8 Yaakov Selkowitz 2025-01-26 19:23:29 UTC
FYI this is now blocked by gcl (and anything using it) FTBFS with -std=c23.

Comment 9 Jaroslav Škarvada 2025-02-03 19:01:11 UTC
Update (auto comment):

Tcl/Tk 9.0 update was pushed as fedora 42 update together with the tcl8/tk8 compat packages.

If your package is Tcl/Tk 9.0 compatible, build it with the tcl-devel or tk-devel build requirements (no side tag build now).

If your package isn't Tcl/Tk 9.0 compatible, the implicit dependencies should be automatically satisfied now by the compat tcl8/tk8 packages,
but the package may later fail to build (FTBFS). In such case, change the build requirement to tcl8-devel or tk8-devel. It turned out that some
packages may also require patching to use the tclsh8/wish8 instead of the tclsh/wish. This should be trivial change.

If you already handled it, thank you and please ignore this message.

Comment 10 Fedora Update System 2025-02-07 21:44:53 UTC
FEDORA-2025-3d58b1567d (maxima-5.47.0-7.fc43) has been submitted as an update to Fedora 43.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-3d58b1567d

Comment 11 Fedora Update System 2025-02-07 21:46:45 UTC
FEDORA-2025-3af9f1b25a (maxima-5.47.0-7.fc42) has been submitted as an update to Fedora 42.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-3af9f1b25a

Comment 12 Fedora Update System 2025-02-07 21:49:38 UTC
FEDORA-2025-3d58b1567d (maxima-5.47.0-7.fc43) has been pushed to the Fedora 43 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 13 Fedora Update System 2025-02-07 21:49:42 UTC
FEDORA-2025-3af9f1b25a (maxima-5.47.0-7.fc42) has been pushed to the Fedora 42 stable repository.
If problem still persists, please make note of it in this bug report.