-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Timeout on QML file #536
Comments
Wow, that's messed up! I had to bump up the timeout value to 3 seconds for it to go through: /tmp> cloc --timeout 3 main.qml 1 text file. 1 unique file. 0 files ignored. github.com/AlDanial/cloc v 1.89 T=2.48 s (0.4 files/s, 368.5 lines/s) ------------------------------------------------------------------------------- Language files blank comment code ------------------------------------------------------------------------------- QML 1 185 20 710 ------------------------------------------------------------------------------- (this actually points out another bug: I tried giving 9084 'QML' => [ 9085 [ 'rm_comments_in_strings', '"', '/*', '*/' ], 9086 [ 'rm_comments_in_strings', '"', '//', '' ], 9087 # [ 'call_regexp_common' , 'C++' ], 9088 [ 'remove_inline' , '//.*$' ], 9089 ], then cloc runs quickly--with incorrect results though. The 71 BEGIN { 72 if (eval "use Regexp::Common;") { 73 $HAVE_Rexexp_Common = 1; 74 } else { 75 $HAVE_Rexexp_Common = 0; 76 } 77 } 78 die "HAVE_Rexexp_Common=$HAVE_Rexexp_Common"; I should look for a newer version--but no guarantees that will fix this. |
This sent me down a bit of a rabbit hole 😁. First of all, to answer your question:
Fair enough, I'll install the system version, and see if that works any better:
Hmm, that's weird. I do a bit of googling and change the test for RegExpCommon:
I am not a perl hacker (IANAPH?) so I don't really know the ins and outs of this, but it seems to me like the test is broken? (I also note that the variable is named HAVE_ReXexp_Common, not HAVE_ReGexp_Common, but that's unimportant.) Anyway, with the test changed to the above (so using the system Regexp::Common), cloc now works on the problematic QML:
...albeit with a warning, perhaps related to the timeout? Who knows. |
Update logic deciding if Regexp::Common is already installed. Min Perl version now 5.10.0 (for Regexp::Common)
Thanks for doing the background research. I agree the existence test for |
Hmm yes. Having forced it to use the system library, I previously thought I had managed to stop it timing out, but now I've tried it again, it does indeed still time out. Perhaps I'd accidentally managed to test with a copy of main.qml that included the comment line. |
Not sure if it's the same bug, but anyway...
Regexp::Common is installed; those files are automatically generated and make heavy use of unicode, but I have no idea if that is the reason. |
aerc and scdoc present no issues for me but I take it I'm not cloning the thing that produces the problem you see. What is the link to either clone or download a tarball for "aerc/refs" ? > git clone https://git.sr.ht/~sircmpwn/aerc > cloc aerc/ 174 text files. 174 unique files. 56 files ignored. github.com/AlDanial/cloc v 1.91 T=0.12 s (1257.5 files/s, 171729.2 lines/s) ------------------------------------------------------------------------------- Language files blank comment code ------------------------------------------------------------------------------- Go 145 2381 663 17221 make 1 19 1 102 Markdown 1 27 0 43 YAML 1 0 0 13 Bourne Shell 2 0 2 12 ------------------------------------------------------------------------------- SUM: 150 2427 666 17391 ------------------------------------------------------------------------------- > git clone https://git.sr.ht/~sircmpwn/scdoc > cloc scdoc 30 text files. 29 unique files. 11 files ignored. github.com/AlDanial/cloc v 1.91 T=0.02 s (1394.8 files/s, 95599.8 lines/s) ------------------------------------------------------------------------------- Language files blank comment code ------------------------------------------------------------------------------- C 9 51 17 990 Bourne Shell 9 81 6 312 C/C++ Header 3 16 20 53 make 1 12 0 50 Markdown 1 12 0 15 YAML 1 0 0 10 ------------------------------------------------------------------------------- SUM: 24 172 43 1430 ------------------------------------------------------------------------------- |
Sorry I didn't make it clear the first time... It's not aerc itself, it's the dependencies that are downloaded when you build it - "go build" will download its dependencies to $HOME/go, so try something like this in a temporary $HOME:
At least I get this result on my computers (plural), maybe I just need to buy something faster :D |
scdoc < doc/aerc.1.scd > aerc.1 /bin/sh: 1: scdoc: not found make: *** [Makefile:52: aerc.1] Error 127 Starting to go down a rabbit hole here. Can you just post the first of the problem files, |
Here's all of them just in case (fun fact: if it failed at scdoc you should already have everything in ~/go, remember to clean it up if you didn't use a temporary directory as $HOME) |
Here's what I found: cloc doesn't time out on me but is super-slow github.com/AlDanial/cloc v 1.91 T=25.05 s (0.3 files/s, 1170.1 lines/s) ------------------------------------------------------------------------------- Language files blank comment code ------------------------------------------------------------------------------- Go 7 228 29085 0 ------------------------------------------------------------------------------- SUM: 7 228 29085 0 ------------------------------------------------------------------------------- Counting only 1k lines/second is pretty terrible. I took a look in one of the files, I'm guessing regular expressions from the |
ok, thanks |
The attached C++ file generates a timeout too. The file was a bit bigger, I reduced it to 300 lines. |
您的邮件已经收到,谢谢您。祝您生活愉快。
|
@andreaplanet : Which platform are you running on? I have no issues on Linux:
Nonetheless I have a pretty good idea about the cause of your timeout: the three occurrences of the string However: work-around logic exists in cloc to attempt to correct for this. For what ever reason, the work-around succeeds for me but not you. For starters, try running with the |
I used the cloc1.94.exe downloaded from here under Windows 10.
Nice the catch "-/*+^" ... lol.... It's not an issue for me. Just reporting. :-) |
I get a timeout when invoking cloc on a particular QML file. The weird thing is, if I add a comment line as follows, it works fine:
The text was updated successfully, but these errors were encountered: