Bug 416458 - 30 seconds delay caused by "locate libstdc++.a" from llvm ".../scripts/stdlib_path.sh"
Summary: 30 seconds delay caused by "locate libstdc++.a" from llvm ".../scripts/stdlib...
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-build (show other bugs)
Version: 8.2   Edit
Hardware: PC Linux
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: cdt-build-inbox@eclipse.org CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-09-03 12:53 EDT by fsy fsy CLA
Modified: 2020-09-04 15:27 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description fsy fsy CLA 2013-09-03 12:53:59 EDT
every CDT make-invocation is delayed by "echo `locate libstdc++.a | sort -r | head -1 | sed "s/libstdc++.a$//"`"


# time /usr/bin/locate libstdc++.a >&-
real	0m12.799s
user	0m12.766s
sys	0m0.029s


Bug introduced here:
https://github.com/eclipse/cdt/commits/master/llvm/org.eclipse.cdt.managedbuilder.llvm.ui/scripts/stdlib_path.sh

I discovered this on a plain C-Projekt which only uses the "Linux GCC"-Toolchain.


I verified my eclipse contains that shell code with:

find ~/eclipse-kepler-cdt/ -type f -exec file -skL --mime-type '{}' '+' | grep zip | cut -d: -f1 | while read line ; do unzip -p ${line} 2>&- | cat -v | grep locate | grep libstd && echo ${line}; done

=> ~/eclipse-kepler-cdt/plugins/org.eclipse.cdt.managedbuilder.llvm.ui_1.1.7.201306112328.jar


As a workaround i added ~/bin to my PATH and did:
ln -s /bin/true ~/bin/locate

Result: build/clean/... make invocations are running immediatly
Comment 1 Branko Drevensek CLA 2014-06-12 09:09:46 EDT
I can just confirm that this is still present with Luna RC3.

Testcase:
1) have Eclipse+CDT+LLVM-Family-Compiler-Build-Support installed
2) startup eclipse
3) Use wizard to create minimal C Project (Hello World ANSI C Project / Linux GCC toolchain).
4) Build this project

This seems to trigger LlvmResourceListener.resourceChanged with PRE_BUILD event, which then calls FindStdLibPath.find(), which depending on system can take seconds.