bug#80674: DejaGNU vs. Tcl 9
Jacob Bachmeyer <[email protected]> Fri, 27 Mar 2026 22:26:46 -0500
| Newsgroups | gmane.comp.sysutils.dejagnu.bugs |
|---|---|
| Message-ID | <[email protected]> |
This is a multi-part message in MIME format.
--===============3440992240332155788==
Content-Type: multipart/alternative;
boundary="------------0iH64t7D4O8loHQk0TDW6cuU"
Content-Language: en-US
This is a multi-part message in MIME format.
--------------0iH64t7D4O8loHQk0TDW6cuU
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
On 3/27/26 02:04, Jakub Jelinek wrote:
> On Thu, Mar 26, 2026 at 08:07:37PM -0500, Jacob Bachmeyer wrote:
>
>> [...]
>>
>> For now, this is applied on the PR80674 branch. Please confirm that this
>> solves your problem.
> It does for me on Fedora 45, but for some reason not for others on Fedora
> 43, seehttps://gcc.gnu.org/PR124641 for details.
This looks like the Fedora maintainers and/or Tcl developers have
seriously screwed up.
> https://core.tcl-lang.org/tips/doc/trunk/tip/657.md mentions what the people
> are seeing, tcl 9 now expects all the channels to be UTF-8 unless told
> otherwise it seems, and various tests in gcc testsuite at least are not
> valid UTF-8, some perhaps by mistake, but in many cases intentionally to
> test how the compiler behaves in those cases.
> So the problems aren't just with the fconfigure cases, but also any
> set fd [open something r]
> which could read such tests. On the dejagnu side, that is clearly at least
> the utils.exp (proc grep) case at least,
> set fd [open $file r]
> while { [gets $fd cur_line] >= 0 } {
> One needs either
> set fd [open $file r]
> if { [package vsatisfies [package provide Tcl] 9.0-] } {
> fconfigure $fd -profile replace
> }
> while { [gets $fd cur_line] >= 0 } {
> or
> set fd [open $file r]
> if { [package vsatisfies [package provide Tcl] 9.0-] } {
> fconfigure $fd -profile tcl8
> }
> while { [gets $fd cur_line] >= 0 } {
> or
> set fd [open $file rb]
> while { [gets $fd cur_line] >= 0 } {
> or
> set fd [open $file r]
> fconfigure $fd -translation binary
> while { [gets $fd cur_line] >= 0 } {
> but haven't studied it so far more than trying all these in tclsh8.6 and
> tclsh9.0 with a file which contains invalid UTF-8.
I am very reluctant to start littering DejaGnu with Tcl interpreter
version checks.
I am also very concerned that the Tcl developers seem to have decided to
abandon backwards compatibility.
> The binary handling of text files with possibly invalid UTF-8 characters
> (the source files) could in theory have bad behavior with line endings,
> -profile tcl8 restores the tcl8 behavior but dunno how long it will be
> supported, -profile replace might do the best thing, I think people doing
> these greps in dejagnu will not search for the non-UTF-8 characters in
> there in the pattern specially because that would make the *.exp file
> non-UTF-8 too.
The bigger problem is that I am sure that none of those -profile flags
existed in Tcl8.4, which DejaGnu still supports (some of the commands in
the debugger need to be reworked for newer Tcl, as they rely on an
interface that was deprecated in 8.4 and removed in 8.5 or 8.6).
-- Jacob
--------------0iH64t7D4O8loHQk0TDW6cuU
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<div class="moz-cite-prefix">On 3/27/26 02:04, Jakub Jelinek wrote:<br>
</div>
<blockquote type="cite" cite="mid:acYsEr8KR8KmxGMp@tucnak">
<pre wrap="" class="moz-quote-pre">On Thu, Mar 26, 2026 at 08:07:37PM -0500, Jacob Bachmeyer wrote:
</pre>
<blockquote type="cite">
<pre wrap="" class="moz-quote-pre">[...]
For now, this is applied on the PR80674 branch. Please confirm that this
solves your problem.
</pre>
</blockquote>
<pre wrap="" class="moz-quote-pre">
It does for me on Fedora 45, but for some reason not for others on Fedora
43, see <a class="moz-txt-link-freetext" href="https://gcc.gnu.org/PR124641">https://gcc.gnu.org/PR124641</a> for details.</pre>
</blockquote>
<p>This looks like the Fedora maintainers and/or Tcl developers have
seriously screwed up.</p>
<blockquote type="cite" cite="mid:acYsEr8KR8KmxGMp@tucnak">
<pre wrap="" class="moz-quote-pre"><a class="moz-txt-link-freetext" href="https://core.tcl-lang.org/tips/doc/trunk/tip/657.md">https://core.tcl-lang.org/tips/doc/trunk/tip/657.md</a> mentions what the people
are seeing, tcl 9 now expects all the channels to be UTF-8 unless told
otherwise it seems, and various tests in gcc testsuite at least are not
valid UTF-8, some perhaps by mistake, but in many cases intentionally to
test how the compiler behaves in those cases.
So the problems aren't just with the fconfigure cases, but also any
set fd [open something r]
which could read such tests. On the dejagnu side, that is clearly at least
the utils.exp (proc grep) case at least,
set fd [open $file r]
while { [gets $fd cur_line] >= 0 } {
One needs either
set fd [open $file r]
if { [package vsatisfies [package provide Tcl] 9.0-] } {
fconfigure $fd -profile replace
}
while { [gets $fd cur_line] >= 0 } {
or
set fd [open $file r]
if { [package vsatisfies [package provide Tcl] 9.0-] } {
fconfigure $fd -profile tcl8
}
while { [gets $fd cur_line] >= 0 } {
or
set fd [open $file rb]
while { [gets $fd cur_line] >= 0 } {
or
set fd [open $file r]
fconfigure $fd -translation binary
while { [gets $fd cur_line] >= 0 } {
but haven't studied it so far more than trying all these in tclsh8.6 and
tclsh9.0 with a file which contains invalid UTF-8.</pre>
</blockquote>
<p>I am very reluctant to start littering DejaGnu with Tcl
interpreter version checks.</p>
<p><span style="white-space: pre-wrap">I am also very concerned that the Tcl developers seem to have decided to abandon backwards compatibility.</span></p>
<blockquote type="cite" cite="mid:acYsEr8KR8KmxGMp@tucnak">
<pre wrap="" class="moz-quote-pre">The binary handling of text files with possibly invalid UTF-8 characters
(the source files) could in theory have bad behavior with line endings,
-profile tcl8 restores the tcl8 behavior but dunno how long it will be
supported, -profile replace might do the best thing, I think people doing
these greps in dejagnu will not search for the non-UTF-8 characters in
there in the pattern specially because that would make the *.exp file
non-UTF-8 too.</pre>
</blockquote>
<p>The bigger problem is that I am sure that none of those -profile
flags existed in Tcl8.4, which DejaGnu still supports (some of the
commands in the debugger need to be reworked for newer Tcl, as
they rely on an interface that was deprecated in 8.4 and removed
in 8.5 or 8.6).</p>
<p><br>
</p>
<p>-- Jacob</p>
<p><br>
</p>
</body>
</html>
--------------0iH64t7D4O8loHQk0TDW6cuU--
--===============3440992240332155788==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline
X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KQnVnLWRlamFn
bnUgbWFpbGluZyBsaXN0CkJ1Zy1kZWphZ251QGdudS5vcmcKaHR0cHM6Ly9saXN0cy5nbnUub3Jn
L21haWxtYW4vbGlzdGluZm8vYnVnLWRlamFnbnUK
--===============3440992240332155788==--