Bug 364027 - It can't find "binary" if you put any dot in the project name
Summary: It can't find "binary" if you put any dot in the project name
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-core (show other bugs)
Version: 8.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords: needinfo
: 375342 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-11-17 08:14 EST by Juanfal CLA
Modified: 2020-09-04 15:16 EDT (History)
9 users (show)

See Also:


Attachments
Parse binaries with project name (1.81 KB, patch)
2012-01-15 22:08 EST, Marc-André Laperle CLA
malaperle: iplog-
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Juanfal CLA 2011-11-17 08:14:18 EST
Build Identifier: Indigo

It can't find "binary" if you put any dot in the project name.  Any moment you delete the dot and recompile it finds the "binary" when running.


Reproducible: Always

Steps to Reproduce:
1. Put a dot in the name of the project
2. Try to execute
Comment 1 Paul Webster CLA 2011-11-17 08:25:47 EST
What language/editor are you using?  What steps are you doing to "execute"?

PW
Comment 2 Juanfal CLA 2011-11-18 07:33:05 EST
(In reply to comment #1)
> What language/editor are you using?  What steps are you doing to "execute"?
> 
> PW


We, at the Malaga (Spain) University, use C/C++ (downloaded Indigo version with this plugin installed) in the MacOSX Snow Leopard (Eclipse 3.7 for Mac OS X).

JF
Comment 3 Marc-André Laperle CLA 2011-11-18 20:44:08 EST
Can you see the binary under "Binaries" in the Project Explorer? Sorry, I would try it myself but I don't have access to a Mac right now. I tried to create a project 'test.dot' on Windows and it correctly built and debugged the 'test.dot.exe' executable.
Comment 4 Juanfal CLA 2011-11-24 07:05:58 EST
(In reply to comment #3)
> Can you see the binary under "Binaries" in the Project Explorer? Sorry, I would
> try it myself but I don't have access to a Mac right now. I tried to create a
> project 'test.dot' on Windows and it correctly built and debugged the
> 'test.dot.exe' executable.

I also did, of course, and in Linux Ubuntu, and it all worked…  The bug is only in the Mac version (any) of Eclipse C/C++
Comment 5 Marc-André Laperle CLA 2012-01-15 22:08:17 EST
Created attachment 209513 [details]
Parse binaries with project name

(In reply to comment #4)
> (In reply to comment #3)
> > Can you see the binary under "Binaries" in the Project Explorer? Sorry, I would
> > try it myself but I don't have access to a Mac right now. I tried to create a
> > project 'test.dot' on Windows and it correctly built and debugged the
> > 'test.dot.exe' executable.
> 
> I also did, of course, and in Linux Ubuntu, and it all worked…  The bug is only
> in the Mac version (any) of Eclipse C/C++

What name did you try on Ubuntu? I tried test.dot and it didn't work. The reason it worked for me on Windows is that the binary becomes test.dot.exe and files with the extension .exe are defined as binaries in the Content Types (Preferences, General, Content Types).

The binary is not being found because of an optimization:

// Only if file has no extension, has an extension that is an integer
// or is a binary file content type

If those conditions are met, then the file is parsed to determine whether or not it's a binary.

I'm not sure we can do much to improve that. Some options:

1. Check if the file name is equal to the project name, if so parse it. That's weak since the artifact can be renamed in the project properties. But it would still be a tiny improvement.
2. Augment the CModel so that it knows about the generated artifacts. That solves the case where the artifact is being renamed in the project properties but it would still fail if it's being renamed manually or generated from an external builder like Make. I think this would be too much work for a still imperfect solution.

I did option 1 in my patch, but really, I'm not sure it's worth it since this only fixes the case where projectName == binaryName.
Comment 6 Marc-André Laperle CLA 2012-01-15 22:14:13 EST
Markus, I believe you have some experience with CModelManager and binary parsing performance (bug 194194). Do you have an opinion on the issue?
Comment 7 Markus Schorn CLA 2012-01-16 09:19:55 EST
(In reply to comment #6)
> Markus, I believe you have some experience with CModelManager and binary
> parsing performance (bug 194194). Do you have an opinion on the issue?

Testing all files with the binary parser is too slow, therefore we limited the check to files that have a known extension (*.so, *.exe, ...) or no extension.
On Unix systems you really want to check the executable flag of the file, it may be performant enough to do that on every file in the project. If not we should not do it and option 1 would be a good improvement.
Comment 8 Marc-André Laperle CLA 2012-03-26 12:47:34 EDT
*** Bug 375342 has been marked as a duplicate of this bug. ***
Comment 9 Axel Mueller CLA 2013-06-26 07:49:25 EDT
(In reply to comment #5)
> 2. Augment the CModel so that it knows about the generated artifacts. That
> solves the case where the artifact is being renamed in the project
> properties but it would still fail if it's being renamed manually or
> generated from an external builder like Make. I think this would be too much
> work for a still imperfect solution.
There was a user reporting such a problem in the CDT forum
http://www.eclipse.org/forums/index.php/m/1065534/#msg_1065534
The ManagedBuilder should quite precisely know which artifacts it builds. The performance optimization is OK (and necessary) for Makefile builds.