Bug 162991 - java/openjdk6 fails to build
Summary: java/openjdk6 fails to build
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-java (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-01 08:50 UTC by c.kworr
Modified: 2014-06-06 23:46 UTC (History)
1 user (show)

See Also:


Attachments
openjdk6.patch.txt (840 bytes, text/plain)
2012-03-08 07:48 UTC, c.kworr
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description c.kworr 2011-12-01 08:50:09 UTC
OpenJDK 6 fails to build for me:

gmake[6]: Entering directory `/tmp/ports/.amd_mnt/faz/host/usr/ports/java/openjdk6/work/build/bsd-amd64/hotspot/outputdir/bsd_amd64_compiler2/product'
gmake[6]: *** No rule to make target `/tmp/ports/.amd_mnt/faz/host/usr/ports/java/openjdk6/work/hotspot/src/cpu/amd64/vm/x86_64.ad', needed by `../generated/adfiles/bsd_x86_64.ad'.  Stop.
gmake[6]: *** Waiting for unfinished jobs....
gmake[6]: Leaving directory `/tmp/ports/.amd_mnt/faz/host/usr/ports/java/openjdk6/work/build/bsd-amd64/hotspot/outputdir/bsd_amd64_compiler2/product'
gmake[5]: *** [ad_stuff] Error 2
gmake[5]: Leaving directory `/tmp/ports/.amd_mnt/faz/host/usr/ports/java/openjdk6/work/build/bsd-amd64/hotspot/outputdir/bsd_amd64_compiler2/product'
gmake[4]: *** [product] Error 2
gmake[4]: Leaving directory `/tmp/ports/.amd_mnt/faz/host/usr/ports/java/openjdk6/work/build/bsd-amd64/hotspot/outputdir'
gmake[3]: *** [generic_build2] Error 2
gmake[3]: Leaving directory `/tmp/ports/.amd_mnt/faz/host/usr/ports/java/openjdk6/work/hotspot/make'
gmake[2]: *** [product] Error 2
gmake[2]: Leaving directory `/tmp/ports/.amd_mnt/faz/host/usr/ports/java/openjdk6/work/hotspot/make'
gmake[1]: *** [hotspot-build] Error 2
gmake[1]: Leaving directory `/tmp/ports/.amd_mnt/faz/host/usr/ports/java/openjdk6/work'
gmake: *** [build_product_image] Error 2
*** Error code 1

How-To-Repeat: My world and ports are built by clang. Inspecting that directory I can see that there's:

# ls /tmp/ports/.amd_mnt/faz/host/usr/ports/java/openjdk6/work/hotspot/src/cpu/
sparc/ x86/   zero/

But no amd64.
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2011-12-01 08:50:18 UTC
Responsible Changed
From-To: freebsd-ports-bugs->freebsd-java

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 c.kworr 2012-03-08 07:48:32 UTC
Ok, I found time to investigate it.

Everything is about arch guessing. java/openjdk7 substitutes amd64 for 
x86_64 while java/openjdk6 doesn't. I just added missing bits from 
correspondent java/openjdk7 patch.

Redports build: https://redports.org/buildarchive/20120307160255-45601

Patch attached.

-- 
Sphinx of black quartz judge my vow.
Comment 3 Jung-uk Kim freebsd_committer freebsd_triage 2012-03-08 18:09:51 UTC
On Thursday 08 March 2012 02:50 am, Volodymyr Kostyrko wrote:
>  Ok, I found time to investigate it.
>
>  Everything is about arch guessing. java/openjdk7 substitutes amd64
> for x86_64 while java/openjdk6 doesn't. I just added missing bits
> from correspondent java/openjdk7 patch.
>
>  Redports build:
> https://redports.org/buildarchive/20120307160255-45601
>
>  Patch attached.

Sorry but it doesn't make any sense.  I guess you are patching this:

...
# Platform settings specific to BSD
ifeq ($(PLATFORM), bsd)
  OS_VERSION := $(shell uname -r)
  # Arch and OS name/version
  mach := $(shell uname -m)
  archExpr = case "$(mach)" in \
                i[3-9]86) \
                    echo i586 \
                    ;; \
                *) \
                    echo $(mach) \
                    ;; \
      esac
  ARCH        := $(shell $(archExpr) )
  ARCH_FAMILY := $(ARCH)
...

Unless "UNAME_m" environment variable is set, there is no way that 
this patch does anything at all.

% uname -r
10.0-CURRENT
% uname -m
amd64
% env UNAME_m=x86_64 uname -m
x86_64

I believe OpenJDK7 added it because some BSDs (e.g., DragonFlyBSD) 
return x86_64 for "uname -m".

BTW, does "make DISABLE_MAKE_JOBS=yes" make any difference?

Thanks,

Jung-uk Kim
Comment 4 c.kworr 2012-03-12 15:26:26 UTC
> I believe OpenJDK7 added it because some BSDs (e.g., DragonFlyBSD)
> return x86_64 for "uname -m".

So why it ends up in our port and not in DragonFlyBSD's pkgsrc?

> BTW, does "make DISABLE_MAKE_JOBS=yes" make any difference?

Actually after successful build I can't reproduce this issue anymore. I 
seem to miss some bits of data so I'll try to retest in clean environment.

-- 
Sphinx of black quartz judge my vow.
Comment 5 Jung-uk Kim freebsd_committer freebsd_triage 2012-03-12 16:50:12 UTC
On Monday 12 March 2012 11:26 am, Volodymyr Kostyrko wrote:
> Jung-uk Kim wrote:
> > On Thursday 08 March 2012 02:50 am, Volodymyr Kostyrko wrote:
> >>   Ok, I found time to investigate it.
> >>
> >>   Everything is about arch guessing. java/openjdk7 substitutes
> >> amd64 for x86_64 while java/openjdk6 doesn't. I just added
> >> missing bits from correspondent java/openjdk7 patch.
> >>
> >>   Redports build:
> >> https://redports.org/buildarchive/20120307160255-45601
> >>
> >>   Patch attached.
> >
> > Sorry but it doesn't make any sense.  I guess you are patching
> > this:
> >
> > ...
> > # Platform settings specific to BSD
> > ifeq ($(PLATFORM), bsd)
> >    OS_VERSION := $(shell uname -r)
> >    # Arch and OS name/version
> >    mach := $(shell uname -m)
> >    archExpr = case "$(mach)" in \
> >                  i[3-9]86) \
> >                      echo i586 \
> >                      ;; \
> >                  *) \
> >                      echo $(mach) \
> >                      ;; \
> >        esac
> >    ARCH        := $(shell $(archExpr) )
> >    ARCH_FAMILY := $(ARCH)
> > ...
> >
> > Unless "UNAME_m" environment variable is set, there is no way
> > that this patch does anything at all.
> >
> > % uname -r
> > 10.0-CURRENT
> > % uname -m
> > amd64
> > % env UNAME_m=x86_64 uname -m
> > x86_64
> >
> > I believe OpenJDK7 added it because some BSDs (e.g.,
> > DragonFlyBSD) return x86_64 for "uname -m".
>
> So why it ends up in our port and not in DragonFlyBSD's pkgsrc?

OpenJDK7 patchset is shared with other BSDs:

https://wikis.oracle.com/display/OpenJDK/BSDPort

OpenJDK6 patchset was based on early OpenJDK7 patchsets and it may or 
may not build on other platforms.  I am 99% sure it won't build on 
DragonFlyBSD/x86-64, BTW.

> > BTW, does "make DISABLE_MAKE_JOBS=yes" make any difference?
>
> Actually after successful build I can't reproduce this issue
> anymore. I seem to miss some bits of data so I'll try to retest in
> clean environment.

These parallel build problems are very hard to reproduce.  Actually, I 
was never able to reproduce it myself.

Jung-uk Kim
Comment 6 Jung-uk Kim freebsd_committer freebsd_triage 2014-06-06 23:46:19 UTC
I just mark the port as MAKE_JOBS_UNSAFE (r356867).