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

Bug 460469

Summary: building on ecj from source FreeBSD Java6/7 fails v4.3.2
Product: [Eclipse Project] JDT Reporter: Jason Helfman <jgh>
Component: CoreAssignee: Stephan Herrmann <stephan.herrmann>
Status: CLOSED NOT_ECLIPSE QA Contact:
Severity: normal    
Priority: P3 CC: chewi, rafsarifard, stephan.herrmann
Version: 4.3   
Target Milestone: 4.15 M3   
Hardware: Other   
OS: other   
Whiteboard:
Attachments:
Description Flags
ecjsrc
none
diff from v3.8.2 to 4.3.2 none

Description Jason Helfman CLA 2015-02-20 13:15:33 EST
[helfman@its-helfman03 ~/workspace/ports/java/eclipse-ecj]$ make
===>  License EPL accepted by the user
===>   eclipse-ecj-4.3.2 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by eclipse-ecj-4.3.2 for building
===>  Extracting for eclipse-ecj-4.3.2
=> SHA256 Checksum OK for ecjsrc-4.3.2.jar.
===>  Patching for eclipse-ecj-4.3.2
===>   eclipse-ecj-4.3.2 depends on file: /usr/local/openjdk6/bin/java - found
===>   eclipse-ecj-4.3.2 depends on file: /usr/local/bin/ant - found
===>  Configuring for eclipse-ecj-4.3.2
===>  Building for eclipse-ecj-4.3.2
Buildfile: /usr/home/helfman/workspace/ports/java/eclipse-ecj/work/build.xml

build:
    [mkdir] Created dir: /usr/home/helfman/workspace/ports/java/eclipse-ecj/work/bin
    [javac] /usr/home/helfman/workspace/ports/java/eclipse-ecj/work/build.xml:27: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
    [javac] Compiling 344 source files to /usr/home/helfman/workspace/ports/java/eclipse-ecj/work/bin
    [javac] /usr/home/helfman/workspace/ports/java/eclipse-ecj/work/build.xml:35: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
    [javac] Compiling 53 source files to /usr/home/helfman/workspace/ports/java/eclipse-ecj/work/bin
   [delete] Deleting: /usr/home/helfman/workspace/ports/java/eclipse-ecj/work/META-INF/MANIFEST.MF

BUILD FAILED
/usr/home/helfman/workspace/ports/java/eclipse-ecj/work/build.xml:43: Warning: Could not find file /usr/home/helfman/workspace/ports/java/eclipse-ecj/work/scripts/binary/META-INF/MANIFEST.MF to copy.

Total time: 9 seconds
*** Error code 1
Comment 1 Jason Helfman CLA 2015-02-20 13:23:50 EST
I am able to get this to build for version 3.8.2

[helfman@its-helfman03 ~/workspace/ports/java/eclipse-ecj]$ sudo make
===>  License EPL accepted by the user
===>   eclipse-ecj-3.8.2 depends on file: /usr/local/sbin/pkg - found
=> ecjsrc-3.8.2.jar doesn't seem to exist in /usr/ports/distfiles/.
=> Attempting to fetch http://www.eclipse.org/downloads/download.php?file=/eclipse/downloads/drops/R-3.8.2-201301310800/ecjsrc-3.8.2.jar
ecjsrc-3.8.2.jar                              100% of 1383 kB  449 kBps 00m03s
===> Fetching all distfiles required by eclipse-ecj-3.8.2 for building
===>  Extracting for eclipse-ecj-3.8.2
=> SHA256 Checksum OK for ecjsrc-3.8.2.jar.
===>  Patching for eclipse-ecj-3.8.2
===>  Applying FreeBSD patches for eclipse-ecj-3.8.2
===>   eclipse-ecj-3.8.2 depends on file: /usr/local/openjdk7/bin/java - found
===>   eclipse-ecj-3.8.2 depends on file: /usr/local/bin/ant - found
===>  Configuring for eclipse-ecj-3.8.2
===>  Building for eclipse-ecj-3.8.2
Buildfile: /usr/home/helfman/workspace/ports/java/eclipse-ecj/work/build.xml

build:
    [mkdir] Created dir: /usr/home/helfman/workspace/ports/java/eclipse-ecj/work/bin
    [javac] /usr/home/helfman/workspace/ports/java/eclipse-ecj/work/build.xml:27: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
    [javac] Compiling 341 source files to /usr/home/helfman/workspace/ports/java/eclipse-ecj/work/bin
    [javac] /usr/home/helfman/workspace/ports/java/eclipse-ecj/work/build.xml:35: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
    [javac] Compiling 53 source files to /usr/home/helfman/workspace/ports/java/eclipse-ecj/work/bin
    [javac] Note: /usr/home/helfman/workspace/ports/java/eclipse-ecj/work/org/eclipse/jdt/internal/compiler/tool/EclipseCompilerImpl.java uses unchecked or unsafe operations.
    [javac] Note: Recompile with -Xlint:unchecked for details.
      [zip] Building zip: /usr/home/helfman/workspace/ports/java/eclipse-ecj/work/ecj.jar
   [delete] Deleting directory /usr/home/helfman/workspace/ports/java/eclipse-ecj/work/bin

BUILD SUCCESSFUL
Total time: 13 seconds
===>  Staging for eclipse-ecj-3.8.2
===>   eclipse-ecj-3.8.2 depends on file: /usr/local/openjdk7/bin/java - found
===>   Generating temporary packing list
install  -o root -g wheel -m 0644 /usr/home/helfman/workspace/ports/java/eclipse-ecj/work/ecj.jar /usr/home/helfman/workspace/ports/java/eclipse-ecj/work/stage/usr/local/share/java/classes/ecj-3.8.2.jar
install  -o root -g wheel -m 555 /usr/home/helfman/workspace/ports/java/eclipse-ecj/work/ecj.sh /usr/home/helfman/workspace/ports/java/eclipse-ecj/work/stage//usr/local/bin
====> Compressing man pages (compress-man)
====> Running Q/A tests (stage-qa)
Comment 2 Gunnar Wagenknecht CLA 2015-02-23 16:14:23 EST
Jason, 

Are you a maintainer/developer of the eclipse-ecj port at FreeBSD and looking into getting it compiled? If so I suggest reaching out to the JDT developers (jdt-dev@eclipse.org). Another source might be the Eclipse folks at RedHat. I know they invested a lot for building everything from source for Fedora.

The build problem looks like Ant is expecting to copy a file from 'work/scripts/binary/META-INF/MANIFEST.MF', which doesn't exist. I'm forwarding this to the JDT team for further comment.

-Gunnar
Comment 3 Stephan Herrmann CLA 2015-02-23 17:23:53 EST
I don't know about your exact setup and what's the make file you're executing, but perhaps you're just missing this file in your work area:
http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/tree/org.eclipse.jdt.core/scripts/binary/META-INF/MANIFEST.MF?h=R4_3_maintenance

Did someone exclude this file after seeing the directory name "binary"? (There's nothing binary in it, actually :) ).

If that's not it, please explain what exactly you are doing.
Comment 4 Jason Helfman CLA 2015-02-23 17:42:54 EST
Created attachment 251037 [details]
ecjsrc
Comment 5 Jason Helfman CLA 2015-02-23 17:53:32 EST
I am a committer with FreeBSD, and I am trying to build the updated ecj compiler based on the ecjsrc-4.3.2.jar

Basically, the build of this package goes into the distribution directory after it is extracted and runs the 'build' target. I was able to build v3.8.2 with no issue, however 4.3.2 does not build.

The scripts directory is not in either version, however there is a META-INF/MANIFEST.MF in both versions.

Did something change in the build process between these versions?

Thanks!
Comment 6 Jason Helfman CLA 2015-02-23 18:01:02 EST
Created attachment 251038 [details]
diff from v3.8.2 to 4.3.2

diff of build.xml from v3.8.2 and 4.3.2
Comment 7 Jason Helfman CLA 2015-02-23 18:04:34 EST
If I remove the two lines that changed in the build having to do with the MANIFEST.MF file, I am able to get a successful build, and deployment.

[helfman@its-helfman03 /usr/home/helfman/workspace/ports/java/eclipse-ecj]$ tar tvf /usr/local/share/java/ecj-4.5.jar  |grep MANIFEST
-rw-rw-rw-  0 0      0          70 Sep 11  2009 META-INF/MANIFEST.MF

Any ideas?
Comment 8 Jason Helfman CLA 2015-02-23 18:09:08 EST
correct path....

[helfman@its-helfman03 /usr/home/helfman/workspace/ports/java/eclipse-ecj]$ tar tvf /usr/local/share/java/classes/ecj-4.3.2.jar  |grep MANIFEST
-rw-r--r--  0 0      0         437 Feb 21  2014 META-INF/MANIFEST.MF
Comment 9 Stephan Herrmann CLA 2015-02-23 18:31:51 EST
(In reply to Jason Helfman from comment #5)
> I am a committer with FreeBSD, and I am trying to build the updated ecj
> compiler based on the ecjsrc-4.3.2.jar

Why would you do that? I.e., why don't you fetch the sources from git instead of this jar file? (Just curious)
 
> Basically, the build of this package goes into the distribution directory
> after it is extracted and runs the 'build' target. I was able to build
> v3.8.2 with no issue, however 4.3.2 does not build.

To check changes regarding these build scripts you may consult http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/log/org.eclipse.jdt.core/scripts?h=master
 
> The scripts directory is not in either version, however there is a
> META-INF/MANIFEST.MF in both versions.

The scripts directory exists in our git.
 
(In reply to Jason Helfman from comment #7)
> If I remove the two lines that changed in the build having to do with the
> MANIFEST.MF file, I am able to get a successful build, and deployment.

Now we're talking...
Those two lines were changed on behalf of bug 374724.
Guess who filed that bug :)
Comment 10 Jason Helfman CLA 2015-02-23 18:40:14 EST
>>Why would you do that? I.e., why don't you fetch the sources from git instead >>of this jar file? (Just curious)
 
It is far more reliable to grab a source where I can keep track of a hash of the file, so if it changes, we know there is an issue. That being said, it may be possible to do this with git, as we do this for github now.

> Basically, the build of this package goes into the distribution directory
> after it is extracted and runs the 'build' target. I was able to build
> v3.8.2 with no issue, however 4.3.2 does not build.

>>To check changes regarding these build scripts you may consult >>http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/log/org.eclipse.jdt.core>>/scripts?h=master
 
> The scripts directory is not in either version, however there is a
> META-INF/MANIFEST.MF in both versions.

>>The scripts directory exists in our git.

I can try your git repository. Is there a specific release/target/etc I can use as a source for just getting the compiler? A direct link to a release commit would be great.
 
> If I remove the two lines that changed in the build having to do with the
> MANIFEST.MF file, I am able to get a successful build, and deployment.

>>Now we're talking...
>>Those two lines were changed on behalf of bug 374724.
>>Guess who filed that bug :)

This cracked me up :)
Comment 11 Jason Helfman CLA 2015-02-23 19:49:24 EST
I am grabbing the exact build I need via tar.bz2 from the git repo, and get an error. Looks like it is looking for a scripts directory within the scripts directory.

BUILD FAILED
/usr/home/helfman/workspace/ports/java/eclipse-ecj/work/M20140221-1700/org.eclipse.jdt.core/scripts/build.xml:43: Warning: Could not find file /usr/home/helfman/workspace/ports/java/eclipse-ecj/work/M20140221-1700/org.eclipse.jdt.core/scripts/scripts/binary/META-INF/MANIFEST.MF to copy.
                        ^^^^^^^^^^^^
Total time: 1 second
*** Error code 1

Stop.
make: stopped in /usr/home/helfman/workspace/ports/java/eclipse-ecj

$ ls work/M20140221-1700/org.eclipse.jdt.core/scripts/binary/META-INF/
MANIFEST.MF
Comment 12 Eclipse Genie CLA 2020-02-16 09:11:31 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 13 Stephan Herrmann CLA 2020-02-16 09:22:37 EST
Re-assessing:

- ecjsrc-*.jar correctly contains
     scripts/binary/META-INF/MANIFEST.MF

- some make file not created by JDT invokes ant in a way that looks in a wrong
  path scripts/scripts

I guess the ant invocation simply happened in the wrong directory => NOT_ECLIPSE.

Feel free to re-open if my assessment is wrong.