public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* [testsuite] darwin leftover .dSYM dirs in the testsuite ?
@ 2012-03-23 14:30 Bernhard Reutner-Fischer
  2012-03-23 16:39 ` Dominique Dhumieres
  0 siblings, 1 reply; 2+ messages in thread
From: Bernhard Reutner-Fischer @ 2012-03-23 14:30 UTC (permalink / raw)
  To: Dominique Dhumieres; +Cc: Rainer Orth, mikestump, gcc

[-- Attachment #1: Type: text/plain, Size: 441 bytes --]

Hi,

<dominiq_>      blindvt: BTW since you have looked at this piece of code, you may give me some advice:
<dominiq_>      on darwin* all the tests compiled with -g generate *.dSYM folders. I'ld like to clean them.

Perhaps something like the attached? I find it a bit difficult to fit
that into the testsuite properly, so this is not a patch proposal.

Rainer, Mike, can you please advise on how we could do this properly?

TIA && cheers,

[-- Attachment #2: testsuite-darwin-dSYM-dir-removal.00.patch --]
[-- Type: text/x-diff, Size: 2744 bytes --]

Not a patch!

diff --git a/gcc/testsuite/lib/gcc-dg.exp b/gcc/testsuite/lib/gcc-dg.exp
index 4666ede..7c704fc 100644
--- a/gcc/testsuite/lib/gcc-dg.exp
+++ b/gcc/testsuite/lib/gcc-dg.exp
@@ -425,6 +425,36 @@ proc remove-build-file { pat } {
     }
 }
 
+# Remove files matching the pattern from the build machine.
+# Same as remove-build-file except that it can delete directories, too..
+# AFAICS this would need fixing in dejagnu which explicitly checks
+# isfile, pity.
+proc remove-build-dir { pat } {
+    rename standard_file saved-standard_file
+    proc standard_file { dest op args } {
+        set file [lindex $args 0]
+        verbose "dest in proc repaired-standard_file is $dest" 3
+        if { ![is_remote $dest] } {
+            if ![string compare $op "delete"] { # "deletedir" ?
+		file delete -force -- $args
+	    }
+        } else {
+            saved-standard_file $dest $op $args
+        }
+    }
+    verbose "remove-build-dir `$pat'" 2
+    set file_list "[glob -nocomplain $pat]"
+    verbose "remove-build-dir `$file_list'" 2
+    foreach output_file $file_list {
+	if [is_remote host] {
+	    # Ensure the host knows the file is gone by deleting there
+	    # first.
+	    remote_file host delete $output_file
+	}
+	remote_file build delete $output_file
+    }
+}
+
 # Remove runtime-generated profile file for the current test.
 proc cleanup-profile-file { } {
     remove-build-file "mon.out"
diff --git a/gcc/testsuite/lib/gcc.exp b/gcc/testsuite/lib/gcc.exp
index bb1763a..86996d4 100644
--- a/gcc/testsuite/lib/gcc.exp
+++ b/gcc/testsuite/lib/gcc.exp
@@ -127,7 +127,7 @@ proc gcc_target_compile { source dest type options } {
     global GCC_UNDER_TEST
     global TOOL_OPTIONS
     global TEST_ALWAYS_FLAGS
-	
+
     if {[target_info needs_status_wrapper] != "" && \
 	    [target_info needs_status_wrapper] != "0" && \
 	    [info exists gluefile] } {
@@ -161,5 +161,20 @@ proc gcc_target_compile { source dest type options } {
     lappend options "timeout=[timeout_value]"
     lappend options "compiler=$GCC_UNDER_TEST"
     set options [dg-additional-files-options $options $source]
+
+    if [istarget *-*-darwin*] {
+        # on darwin, files compiled with -g leave a .dSYM dir behind, nuke it
+        # ??? probably additional_clean_{dir,file}s or the like?
+        if {[lsearch -regexp $options "\[ \t=\]\-g"] >= 0} {
+            upvar 2 dg-final-code finalcode
+            if ![info exists finalcode] {
+                upvar 3 dg-final-code finalcode
+            }
+
+            set dsym "[file rootname [file tail $dest]].dSYM"
+            set finalcode [concat $finalcode "remove-build-dir $dsym{/\*,}\n"]
+        }
+    }
+
     return [target_compile $source $dest $type $options]
 }

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [testsuite] darwin leftover .dSYM dirs in the testsuite ?
  2012-03-23 14:30 [testsuite] darwin leftover .dSYM dirs in the testsuite ? Bernhard Reutner-Fischer
@ 2012-03-23 16:39 ` Dominique Dhumieres
  0 siblings, 0 replies; 2+ messages in thread
From: Dominique Dhumieres @ 2012-03-23 16:39 UTC (permalink / raw)
  To: rep.dot.nop, dominiq; +Cc: ro, mikestump, gcc

Hi Bernhard,

Thanks for the "Not a patch!". I have started to play with it.
In order to get something working I had to add

    rename standard_file ""
    rename saved-standard_file standard_file

at the end of the proc remove-build-dir, otherwise I had only errors

ERROR: gcc.c-torture/compile/20000105-2.c  -O3 -g : error executing dg-final: can't rename to "saved-standard_file": command already exists

I don't have any idea of the impact of this kludge on the time
taken by the test (I'll try to figure out that later).

AFAICT the number of *.dSYM directories for gcc is reduced from
over 1400 to less than 270, not too bad, but not perfect;-)
This may due to several errors I see. They are of two classes:

...
ERROR: gcc.dg/20040813-1.c: error executing dg-final: scan-assembler: too many arguments
ERROR: gcc.dg/20060410.c: error executing dg-final: scan-assembler: too many arguments
...
ERROR: c-c++-common/gomp/atomic-12.c: error executing dg-final: wrong # args: should be "cleanup-tree-dump suffix"
ERROR: c-c++-common/gomp/atomic-13.c: error executing dg-final: wrong # args: should be "cleanup-tree-dump suffix"
...

and

...
Running /opt/gcc/work/gcc/testsuite/gcc.dg/torture/tls/tls.exp ...
ERROR: tcl error sourcing /opt/gcc/work/gcc/testsuite/gcc.dg/torture/tls/tls.exp.
ERROR: torture-init: torture_without_loops is not empty as expected
    while executing
"error "torture-init: torture_without_loops is not empty as expected""
    invoked from within
"if [info exists torture_without_loops] {
	error "torture-init: torture_without_loops is not empty as expected"
    }"
    (procedure "torture-init" line 4)
    invoked from within
"torture-init"
    (file "/opt/gcc/work/gcc/testsuite/gcc.dg/torture/tls/tls.exp" line 48)
    invoked from within
"source /opt/gcc/work/gcc/testsuite/gcc.dg/torture/tls/tls.exp"
    ("uplevel" body line 1)
    invoked from within
"uplevel #0 source /opt/gcc/work/gcc/testsuite/gcc.dg/torture/tls/tls.exp"
    invoked from within
"catch "uplevel #0 source $test_file_name""
...

Although my Tcl is a little bit rusty, I think I can debug the first kind of errors.
The second kind will require to understand why torture_without_loops is not
empty, hence some of the dejagnu machinery.

Before starting debugging, I wonder if it would not be simpler to execute a
"rm -rf *.sYM" in the *.lof directories at the end of each test class (gcc, g++, ...).

Cheers,

Dominique

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-03-23 16:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-23 14:30 [testsuite] darwin leftover .dSYM dirs in the testsuite ? Bernhard Reutner-Fischer
2012-03-23 16:39 ` Dominique Dhumieres

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).