bug-dejagnu
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#66984: target_alias variable set incorrectly


From: Eugene Sharygin
Subject: bug#66984: target_alias variable set incorrectly
Date: Tue, 07 Nov 2023 15:49:18 +0300
User-agent: Roundcube Webmail/1.4.13

The bug manifests when trying to call `transform` on a tool name with a non-null
`target_triplet`.

Minimal code to reproduce:

$ cat xyz.exp
puts "size is [transform size]"
$ runtest --target=powerpc-linux-gnu
[snip]
size is -size

$ runtest --version
DejaGnu version 1.6.3
Expect version 5.45.4
Tcl version 8.6

If run without a `--target` flag, it outputs "size is size", as expected. However, if `--target` is specified, it prints "size is -size" instead of
the expected output, which is "powerpc-linux-gnu-size".

The reason being the `target_alias` variable, which is initially assigned [1] to an empty string in `runtest.exp`, and which is then supposed to be defaulted
to the value of `target_triplet`, with the following code:

if {![info exists target_alias]} {
    set target_alias $target_triplet
}

Of course, `info exists` returns 1 on a variable set to an empty string.

My proposed change is simply to omit the initial assignment of `target_alias`,
like this:

--- runtest.exp.orig    2023-11-07 15:21:39.000000000 +0300
+++ runtest.exp 2023-11-07 15:37:49.802466623 +0300
@@ -82,7 +82,6 @@
 set target_os     ""         ;# type of os the tests are running on
set target_vendor "" ;# vendor name of the OS or workstation the test are running on
 set target_cpu     ""                ;# type of the cpu tests are running on
-set target_alias   ""                ;# standard abbreviation of target
 set compiler_flags ""                ;# the flags used by the compiler

 #

[1]: http://git.savannah.gnu.org/gitweb/?p=dejagnu.git;a=blob;f=runtest.exp;h=84c7e28e117abff450e2aa9a8b9bbb1e618f0040;hb=HEAD#l85 [2]: http://git.savannah.gnu.org/gitweb/?p=dejagnu.git;a=blob;f=runtest.exp;h=84c7e28e117abff450e2aa9a8b9bbb1e618f0040;hb=HEAD#l890

-- Eugene





reply via email to

[Prev in Thread] Current Thread [Next in Thread]