Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 385010

Summary: CBI should build and consume native filesystem libraries.
Product: [Eclipse Project] Platform Reporter: Krzysztof Daniel <krzysztof.daniel>
Component: ResourcesAssignee: Krzysztof Daniel <krzysztof.daniel>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3 CC: david_williams, john.arthorne, krzysztof.daniel, sptaszkiewicz, Szymon.Brandys, thanh.ha
Version: 4.2.1Flags: john.arthorne: review+
Target Milestone: 4.2.2+   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on: 391152    
Bug Blocks: 372792    
Attachments:
Description Flags
Patch proposition:
none
Patch v2
none
macosx build issue
none
Patch revisisted (changed the order of the qualifiers in the profiles)
none
Patch for linux only
none
Patch in a git format none

Description Krzysztof Daniel CLA 2012-07-13 04:14:45 EDT
As it was done for SWT and launchers.
Comment 1 Krzysztof Daniel CLA 2012-07-13 04:21:36 EDT
Created attachment 218684 [details]
Patch proposition:

x86_64 on linux tested.
win32 requires some attention as I was not sure which script should be invoked when.
Comment 2 Krzysztof Daniel CLA 2012-07-13 04:25:16 EDT
Created attachment 218685 [details]
Patch v2
Comment 3 Thanh Ha CLA 2012-07-17 13:34:57 EDT
Created attachment 218831 [details]
macosx build issue

I tested on Linux x86_64 and it built fine.

When I tested on Macosx x86_64 maven reported that the build was success however investigating the log shows that make had an issue. It seems it tried to use macosx "powerpc" compiler which does not exist on my Intel based Mac.

I've attached a log of building the module org.eclipse.core.filesystem.macosx


I will test the Windows x86_64 build when I'm home tonight.
Comment 4 Thanh Ha CLA 2012-08-01 15:42:52 EDT
(In reply to comment #3)
> Created attachment 218831 [details]
> macosx build issue
> 
> I tested on Linux x86_64 and it built fine.
> 
> When I tested on Macosx x86_64 maven reported that the build was success
> however investigating the log shows that make had an issue. It seems it
> tried to use macosx "powerpc" compiler which does not exist on my Intel
> based Mac.
> 
> I've attached a log of building the module org.eclipse.core.filesystem.macosx
> 
> 
> I will test the Windows x86_64 build when I'm home tonight.

For Windows we cannot run make_x64.bat directly. Instead it should be called via cmd as follows. 

    <exec executable="cmd" newenvironment="false" dir="../org.eclipse.core.filesystem/natives/win32/x64/">
        <arg value="/c"/>
        <arg value="make_x64.bat"/>
    </exec>


After this modification when I look into the directory ../org.eclipse.core.filesystem/natives/win32/x64 I can see a new file exists now localfile.obj so I guess make_x64.bat ran.

I still have some concerns though. When I look at make_x64.bat I see in one of the lines it's trying to call a file which does not exist on my system so I don't know where it comes from:

    call "%MSSDK%\bin\SetEnv.Cmd" /Release /x64 /xp

My other concern is in org.eclipse.core.filesystem.win32.x86_64 I noticed the timestamp on the file os/win32/x86_64/localfile_1_0_0.dll is from a month ago which makes me think that we did not compile anything to replace this file. Is this expected?

I also posted this detail on cbi-dev: 
  http://dev.eclipse.org/mhonarc/lists/cbi-dev/msg00574.html
Comment 5 Krzysztof Daniel CLA 2012-09-19 02:36:47 EDT
Created attachment 221226 [details]
Patch revisisted (changed the order of the qualifiers in the profiles)
Comment 6 Krzysztof Daniel CLA 2012-09-19 02:49:04 EDT
Thanh,

you may need to delete the dll file in the beginning. Build scripts pretty often skip the build if the target file was already built.
Comment 7 Thanh Ha CLA 2012-09-26 09:42:50 EDT
(In reply to comment #5)
> Created attachment 221226 [details]
> Patch revisisted (changed the order of the qualifiers in the profiles)

I noticed the new patch is missing the Windows and Macosx patches, is this intentional?
Comment 8 Krzysztof Daniel CLA 2012-09-26 10:56:35 EDT
(In reply to comment #7)

> I noticed the new patch is missing the Windows and Macosx patches, is this
> intentional?

No. I thought this was the case were I was not able to come up with win/macos build. Unfortunately - even if I provide that patch for those two platforms I will not be able to test them.
Comment 9 Thanh Ha CLA 2012-09-26 11:01:20 EDT
(In reply to comment #8)
> (In reply to comment #7)
> 
> > I noticed the new patch is missing the Windows and Macosx patches, is this
> > intentional?
> 
> No. I thought this was the case were I was not able to come up with
> win/macos build. Unfortunately - even if I provide that patch for those two
> platforms I will not be able to test them.

Ok sounds reasonable to me. I'm not sure how to get around the mac powerpc compiler issue so I can't get a working patch for that. 

I'm retesting the Windows one now to see if the dll file is created if I delete it first. If that works I guess I'll need to find a way to get maven to delete it before running the script and come up with a patch.
Comment 10 Thanh Ha CLA 2012-09-26 14:33:31 EDT
(In reply to comment #6)
> you may need to delete the dll file in the beginning. Build scripts pretty
> often skip the build if the target file was already built.

I tried deleting the DLL however it does not seem to have any affect. I the following log is what I get when I try to build. It seems like the problem is the build's not able to find some files.


[INFO] --- maven-antrun-plugin:1.7:run (natives) @ org.eclipse.core.filesystem.win32.x86_64 ---
[INFO] Executing tasks

main:
     [exec] Could Not Find c:\eclipse.aggregator\eclipse.platform.resources\bundles\org.eclipse.core.filesystem\natives\
win32\x64\localfile_
     [exec] c:\eclipse.aggregator\eclipse.platform.resources\bundles\org.eclipse.core.filesystem\natives\win32\x64>del l
ocalfile.obj
     [exec]
     [exec] c1_0_0*
     [exec] The system cannot find the path specified.
     [exec] :\eclipse.aggregator\eclipse.platform.resources\bundles\org.eclipse.core.filesystem\natives\win32\x64>del lo
calfile_1_0_0*
     [exec]
     [exec] c:\eclipse.aggregator\eclipse.platform.resources\bundles\org.eclipse.core.filesystem\natives\win32\x64>set J
AVA_HOME=c:\Program Files\Java\j2sdk1.4.2_18
     [exec]
     [exec] c:\eclipse.aggregator\eclipse.platform.resources\bundles\org.eclipse.core.filesystem\natives\win32\x64>call
"\bin\SetEnv.Cmd" /Release /x64 /xp
     [exec]
     [exec] c:\eclipse.aggregator\eclipse.platform.resources\bundles\org.eclipse.core.filesystem\natives\win32\x64>set w
in_include=\include
     [exec]
     [exec] c:\eclipse.aggregator\eclipse.platform.resources\bundles\org.eclipse.core.filesystem\natives\win32\x64>set l
ib_includes=UUID.LIB LIBCMT.LIB OLDNAMES.LIB KERNEL32.LIB
     [exec]
     [exec] c:\eclipse.aggregator\eclipse.platform.resources\bundles\org.eclipse.core.filesystem\natives\win32\x64>set j
dk_include=c:\Program Files\Java\j2sdk1.4.2_18\include
     [exec]
     [exec] c:\eclipse.aggregator\eclipse.platform.resources\bundles\org.eclipse.core.filesystem\natives\win32\x64>set d
ll_name=localfile_1_0_0
     [exec]
     [exec] c:\eclipse.aggregator\eclipse.platform.resources\bundles\org.eclipse.core.filesystem\natives\win32\x64>cl ..
\localfile.c -I"\include" -I"c:\Program Files\Java\j2sdk1.4.2_18\include" -I"c:\Program Files\Java\j2sdk1.4.2_18\include
\win32" -LD -Felocalfile_1_0_0 /link UUID.LIB LIBCMT.LIB OLDNAMES.LIB KERNEL32.LIB /Subsystem:CONSOLE
     [exec] Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.30729.01 for 80x86
     [exec] Copyright (C) Microsoft Corporation.  All rights reserved.
     [exec]
     [exec] localfile.c
     [exec] Microsoft (R) Incremental Linker Version 9.00.30729.01
     [exec] Copyright (C) Microsoft Corporation.  All rights reserved.
     [exec]
     [exec] /dll
     [exec] /implib:localfile_1_0_0.lib
     [exec] /out:localfile_1_0_0.dll
     [exec] UUID.LIB
     [exec] LIBCMT.LIB
     [exec] OLDNAMES.LIB
     [exec] KERNEL32.LIB
     [exec] /Subsystem:CONSOLE
     [exec] localfile.obj
     [exec] LINK : fatal error LNK1181: cannot open input file 'UUID.LIB'
     [exec] Result: 2
[INFO] Executed tasks
[INFO]
Comment 11 Krzysztof Daniel CLA 2013-01-30 08:26:23 EST
Created attachment 226316 [details]
Patch for linux only

Could we revisit this one and at least get the patch for Linux released for Kepler?

It has no effects on existing workflow unless explicitly enabled during CBI build. If this is a concern for some, I'll fix the problems it might cause or it may be reverted.
Comment 12 Thanh Ha CLA 2013-01-30 09:28:21 EST
(In reply to comment #11)
> Created attachment 226316 [details]
> Patch for linux only
> 
> Could we revisit this one and at least get the patch for Linux released for
> Kepler?
> 
> It has no effects on existing workflow unless explicitly enabled during CBI
> build. If this is a concern for some, I'll fix the problems it might cause
> or it may be reverted.

I tested the latest Linux-only patch and was able to successfully build the natives.

Can someone from the platform team release this into R3_8_maintenance and master?
Comment 13 Szymon Brandys CLA 2013-01-31 03:38:40 EST
I will release it next week when M5 settles down.
Comment 14 Krzysztof Daniel CLA 2013-02-11 09:30:13 EST
In case you have any questions - I will be happy to answer :).
Comment 15 Krzysztof Daniel CLA 2013-03-12 10:07:09 EDT
Created attachment 228258 [details]
Patch in a git format
Comment 16 Szymon Brandys CLA 2013-03-13 10:32:43 EDT
It needs to wait.
Comment 17 Szymon Brandys CLA 2013-03-26 10:32:28 EDT
Krzysztof and Thanh, is the patch from comment 15 the final version to release?
Comment 18 Krzysztof Daniel CLA 2013-03-28 03:59:09 EDT
Yes, it is.
Comment 19 David Williams CLA 2013-04-24 11:31:10 EDT
So ... may I ask for status? Seems pretty late to be putting into M7 ... or has it already been and bug just not updated?
Comment 20 John Arthorne CLA 2013-04-30 09:25:47 EDT
Out of curiosity, what is the Rhino dependency for?
Comment 22 John Arthorne CLA 2013-05-01 11:14:44 EDT
Using this bug for 4.2.2+, and bug 391152 for 4.3 stream.
Comment 23 Krzysztof Daniel CLA 2013-05-06 05:45:56 EDT
Regarding rhino - that's a good question. I guess they're here because all maven-antrun-plugin calls originate from the SWT which required rhino to process parts of swt builds that were written in js. It might be it is a direct dependency of ant as well. I guess I could remove it.