- removed comment
CST stage always regenerates all files
I notice that since recently, the Cactus CST stage always regenerates all files, which means that any change to a ccl file or the thorn list will recompile all source files, which is very slow.
I find that this patch resolves the problem:
$ git diff CSTUtils.pl
diff --git a/lib/sbin/CSTUtils.pl b/lib/sbin/CSTUtils.pl
index 532f6a77..209b9352 100644
--- a/lib/sbin/CSTUtils.pl
+++ b/lib/sbin/CSTUtils.pl
@@ -182,8 +182,8 @@ sub WriteFile
if (-e $filename)
{
# only read the file if it its size equals the length of the rdata string
- my @fileinfo = stat ($filename);
- if ($fileinfo[7] == length ($$rdata))
+ my $filesize = -s $filename;
+ if ($filesize == length ($$rdata))
{
open(IN, "< $filename");
$data_in = join ('', <IN>);
Apparently, something fishy is happening when calling stat
.
Keyword:
Comments (8)
-
-
reporter - removed comment
I see this problem on my laptop as well as on Stampede2.
The expression
@fileinfo
returns a value that prints asFile::Stat=0xabcd0123
instead of as a Perl array. The resulting comparison with$fileinfo[7]
is then always false.This is Perl 5.24.1.
-
- changed status to open
- removed comment
-
- changed status to open
- removed comment
-
- removed comment
Why did this work before? Ie when was this bug introduced?
-
reporter - removed comment
If there is a bug, then it must be a non-local consequence of changes elsewhere, maybe a Perl import statement or function definition that changes how `stat}} works here.
-
- changed status to resolved
- removed comment
-
- edited description
- changed status to closed
- Log in to comment
This change should be harmless, however, I can't see why these two methods of determining a file size should be different. They return the same number everywhere I've tested it. Where are you seeing this problem?