Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 143547 - New Agent Controller log file contains hard-coded paths.
Summary: New Agent Controller log file contains hard-coded paths.
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: TPTP (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P1 normal (vote)
Target Milestone: ---   Edit
Assignee: Yunan, He CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 203957 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-05-24 13:36 EDT by Paul Slauenwhite CLA
Modified: 2016-05-05 10:53 EDT (History)
8 users (show)

See Also:
paulslau: review+
jgwest: review+


Attachments
eliminate the hard-coded path from log (1.10 KB, patch)
2008-06-24 09:49 EDT, Yunan, He CLA
igor.alelekov: review-
Details | Diff
Split the path string after the last 'src' token and only log the last substring (2.95 KB, patch)
2009-01-13 04:17 EST, Chengrui Deng CLA
no flags Details | Diff
Modified patch to split the path string after the last 'src' token (3.03 KB, patch)
2009-02-03 23:00 EST, Chengrui Deng CLA
no flags Details | Diff
Updated Patch - Bug 143547 (2.95 KB, patch)
2009-02-23 19:49 EST, Jonathan West CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Slauenwhite CLA 2006-05-24 13:36:58 EDT
New Agent Controller log file contains hard-coded paths.

For example, D:\cygwin\home\build\TPTP\4.2.0\TPTP-4.2.0-200605231055\agntctrl\src\transport\TPTPClientCompTL\fileServer.c does not exist on my machine:

<CommonBaseEvent creationTime="2006-05-24T17:33:58.548000Z" globalInstanceId="AC66990CB2A540CAB3E1EF3D1D899B55" msg="File server started listening on port 10005" severity="10" version="1.0.1">
	<sourceComponentId component="AgentController" componentIdType="TPTPComponent" executionEnvironment="D:\cygwin\home\build\TPTP\4.2.0\TPTP-4.2.0-200605231055\agntctrl\src\transport\TPTPClientCompTL\fileServer.c, line 177" instanceId="1004" location="ninjazx7.torolab.ibm.com" locationType="IPV4" processId="4448" subComponent="Client Compatibility TL" threadId="3392" componentType="Eclipse_TPTP"/>
	<situation categoryName="ReportSituation">
		<situationType xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ReportSituation" reasoningScope="INTERNAL" reportCategory="LOG"/>
	</situation>
</CommonBaseEvent>
Comment 1 Karla Callaghan CLA 2006-05-24 14:10:34 EDT
The file name information comes from the compiler and reflects the file location at the time the code was compiled.  If you had built the source in your local space, you would see a file name path relative to that source.

I don't expect the source file information to be particularly useful to an individual reading the log unless they are building their own source.  If they pass the log msg on to us in a bug report, then that file name information is useful as we know exactly what build was used.
Comment 2 Karla Callaghan CLA 2006-05-31 13:03:49 EDT
Looks like the compiler uses the file names for the __FILE__ macro in the same form as it is given them on the command line. We need to change the make files but don't have the resources to do that now.

Retargeting to 4.3.
Comment 3 Karla Callaghan CLA 2006-09-15 14:06:29 EDT
Retargeting to future.  No resources for making this change in 4.3
Comment 4 Karla Callaghan CLA 2007-02-05 13:37:21 EST
Transferring ownership of new agemt controller issues with no specific target date to Mikhail for consideration in future releases.
Comment 5 Mikhail Voronin CLA 2007-10-25 08:06:10 EDT
Assign to Stanislav
Comment 6 Bing Xu CLA 2007-11-06 09:37:35 EST
*** Bug 203957 has been marked as a duplicate of this bug. ***
Comment 7 Yunan, He CLA 2008-06-24 09:49:57 EDT
Created attachment 105698 [details]
eliminate the hard-coded path from log 

Hi, I think we can simply eliminate the hard-coded path information and just leave the file name there. I have made a patch. Please check log_file_name.patch.
Comment 8 Yunan, He CLA 2008-06-24 09:51:40 EDT
Alex and Igor, could you please help review this patch. Thanks. 
Comment 9 Igor Alelekov CLA 2008-06-25 02:31:23 EDT
It seems this is not enough to keep file names only.
Not all files have unique names such as Connect2AC.c in ACTL and CCTL modules.

I'd suggest to keep part of path like this: 

TPTP-4.2.0-200605231055\agntctrl\src\transport\TPTPClientCompTL\fileServer.c

Information about build version might be useful.
Comment 10 Paul Slauenwhite CLA 2008-06-25 06:10:59 EDT
(In reply to comment #9)
> It seems this is not enough to keep file names only.
> Not all files have unique names such as Connect2AC.c in ACTL and CCTL modules.

Good point.

> I'd suggest to keep part of path like this: 
> 
> TPTP-4.2.0-200605231055\agntctrl\src\transport\TPTPClientCompTL\fileServer.c
> 
> Information about build version might be useful.

Assuming the user installs the Agent Controller in a directory with the build information.  

Since the point of this defect was that paths are hard-coded to the build machine, we should only use path relative to the source tree.  For example, transport\TPTPClientCompTL\fileServer.c.

Comment 11 Alexander N. Alexeev CLA 2008-07-08 03:17:35 EDT
Paul, could you clarify initial intention for bug fix.
Probably, the way how we can better trim paths depends from usage of log information (I suppose it is used only for debugging). 

I would prefer not to trim at all. File path is exclusively intended for problem reports and used only by developers who support the code. Full path can provide information about build environment and allows to identify right sandbox for working. I don't see reasons to eliminate useful information for the sake of beauty.

Alex.
Comment 12 Paul Slauenwhite CLA 2008-07-08 08:47:11 EDT
(In reply to comment #11)
> Paul, could you clarify initial intention for bug fix.
> Probably, the way how we can better trim paths depends from usage of log
> information (I suppose it is used only for debugging). 
> 
> I would prefer not to trim at all. File path is exclusively intended for
> problem reports and used only by developers who support the code. Full path can
> provide information about build environment and allows to identify right
> sandbox for working. I don't see reasons to eliminate useful information for
> the sake of beauty.
> 
> Alex.
> 

Agreed that this is a 'nice-to-have' defect to improve the user/consumer experience and given the latest resource changes we should probably not worry about this type of thing.  I assumed that it would be <1 PH effort to split the path string after the last 'src' token and only log the last substring.  If not, I am fine with returning it as WONTFIX.
Comment 13 Alexander N. Alexeev CLA 2008-07-08 13:52:15 EDT
> Agreed that this is a 'nice-to-have' defect to improve the user/consumer
> experience and given the latest resource changes we should probably not worry
> about this type of thing.  I assumed that it would be <1 PH effort to split the
> path string after the last 'src' token and only log the last substring.  If
> not, I am fine with returning it as WONTFIX.
Yunan, please either split the path string after the last 'src' token or close it as WONTFIX. It is up to you depending from required efforts.

Comment 14 Chengrui Deng CLA 2009-01-13 04:17:44 EST
Created attachment 122381 [details]
Split the path string after the last 'src' token and only log the last substring

  As Alexander suggested, this patch split the path string after the last '/src/'('\\src\\' on Windows) token and only log the last substring. It should be also note that the patch preconditon is '/src/'('\\src\\') token is included in path string. The filename handle process is encapsulated into a local function for better modularity purpose.

  Dear comitters, please help to review the patch. Thanks a lot.

  Thanks,
  Chengrui
Comment 15 Paul Slauenwhite CLA 2009-01-19 19:11:57 EST
Reviewed and approved.  
Comment 16 Paul Slauenwhite CLA 2009-01-19 20:00:00 EST
Requesting Jonathan (more native experience) also review given the lateness of the release.
Comment 17 Jonathan West CLA 2009-01-20 13:46:43 EST
Hi Chengrui, the LIN define is not defined anywhere in the makefile for this component, and so src_token will always default to the Windows format. Please use either __linux__ or a define in the makefile. Otherwise, the patch is good.
Comment 18 Chengrui Deng CLA 2009-02-03 23:00:30 EST
Created attachment 124633 [details]
Modified patch to split the path string after the last 'src' token

Hi, Jonathan, I have replaced LIN with __linux__ in patch code. Thanks for your information.
Comment 19 Jonathan West CLA 2009-02-23 19:49:28 EST
Created attachment 126511 [details]
Updated Patch - Bug 143547

Slightly updated the patch to use #ifdef _WIN32 (e.g. is windows), which is better than what I originally suggested.
Comment 20 Jonathan West CLA 2009-02-23 19:52:14 EST
Chengrui, I'm ready to check this in... am I correct in assuming the fix for this only includes the "Updated Patch - Bug 143547" patch, and does not include "eliminate the hard-coded path from log" patch? Let me know, thanks!
Comment 21 Chengrui Deng CLA 2009-02-23 19:57:41 EST
(In reply to comment #20)
> Chengrui, I'm ready to check this in... am I correct in assuming the fix for
> this only includes the "Updated Patch - Bug 143547" patch, and does not include
> "eliminate the hard-coded path from log" patch? Let me know, thanks!
> 

Hi, Jonathan, you are right. The "eliminate the hard-coded path from log" patch is out of date and should not be used. Thanks.
Comment 22 Jonathan West CLA 2009-02-25 20:38:56 EST
Thanks Chengrui, patch checked into HEAD.  
Comment 23 Paul Slauenwhite CLA 2009-03-02 08:38:08 EST
Verified in TPTP-4.5.3-200903010100.

Closing.