Closed Bug 433922 Opened 16 years ago Closed 16 years ago

Get builds working on linux

Categories

(Cloud Services :: General, defect, P1)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: hello, Assigned: anant)

References

Details

Attachments

(1 file, 4 obsolete files)

This involves getting a linux VM, and working on the component's makefile to get the right build options for linux.
Target Milestone: -- → 0.2
Priority: -- → P1
Blocks: 433949
Patches the Makefile to build component on Linux. Also patches WeaveCrypto.h because prefixing method name with WeaveCrypto:: produces an error with -Wall on GCC/Linux.
Attachment #321804 - Flags: review?(thunder)
Attachment #321804 - Flags: review?(thunder) → review+
Checked-in revision 336. Needs extra testing with GCC 3.
Status: NEW → ASSIGNED
Assignee: nobody → anarayanan
Status: ASSIGNED → NEW
Attached patch patch v2: works with Gecko SDK (obsolete) — Splinter Review
I had problems building and testing against the Gecko SDK, so Anant made me a patch to fix that.  There was one minor problem with the patch, which I fixed.  Here's the fixed version of the patch.

Note: this patch also runs xpcshell through run-mozilla.sh so LD_LIBRARY_PATH gets set correctly.

Note: With this patch, I can build against a Firefox trunk build, but test_pbe fails with the output:

WARNING: NS_ENSURE_SUCCESS(rv, rv) failed with result 0x80520012: file /mnt/hgfs/myk/Mozilla/source/mozilla/js/src/xpconnect/loader/mozJSComponentLoader.cpp, line 1192
*** test pending
Assertion failure: padlen > 0 && padlen <= padsize, at p7local.c:588

However, all three tests succeed when I build against the Gecko SDK.
Attachment #322056 - Flags: review?
Attachment #322056 - Flags: review? → review?(thunder)
(In reply to comment #3)
> Note: With this patch, I can build against a Firefox trunk build, but test_pbe
> fails with the output:

Note: but only if the Firefox trunk build is a debug build.  If it's an optimized build, the tests succeed.
Comment on attachment 322056 [details] [diff] [review]
patch v2: works with Gecko SDK


> libdirs := $(sdkdir)/lib $(sdkdir)/bin
>-libs := xpcomglue_s xpcom xpcom_core nspr4 \
>+libs := xpcom nspr4 \
>         crmf smime3 ssl3 nss3 nssutil3 softokn3 \
>         plds4 plc4

Hm, really?  This doc says we should keep xpcomglue_s:

http://developer.mozilla.org/en/docs/XPCOM_Glue

Though, not xpcom_core.  Hmm.

> ifeq ($(os),Linux)
>-	$(cxx) -o $@ $(cppflags) $(ldflags) $(cpp_sources)
>+	$(cxx) $(cppflags) -o $@ $(cpp_sources) $(ldflags)
> else

Is that accidental, or do we really need it?

>-xpcshell = $(sdkdir)/bin/xpcshell -v 180
>+xpcshell = $(sdkdir)/bin/run-mozilla.sh $(sdkdir)/bin/xpcshell -v 180

Will this work in all platforms?
> Hm, really?  This doc says we should keep xpcomglue_s:
> 
> http://developer.mozilla.org/en/docs/XPCOM_Glue
> 
> Though, not xpcom_core.  Hmm.

xpcom_core isn't necessary, that was my bad. As for xpcomglue_s, since we have /path/to/sdk/lib xpcomglue_s.a in the link line explicitly, I don't think we need to mention -lxpcomglue_s (atleast that's what my understanding of static linking is, which may be wrong). In any case, the symbols defined in xpcomglue_s are in the final .so, so it works.

> Is that accidental, or do we really need it?

On Linux, seems like compiling and linking in the same step is what works best. I'll be attaching a patch next for not doing the compiling in the previous dependency for make (we don't need the .o files).
 
> >-xpcshell = $(sdkdir)/bin/xpcshell -v 180
> >+xpcshell = $(sdkdir)/bin/run-mozilla.sh $(sdkdir)/bin/xpcshell -v 180
> 
> Will this work in all platforms?

Mac and Linux, yes. No idea about windows, but I think there's and equivalent .bat or something. Need someone on Windows to check this one out.
(In reply to comment #6)
> > Hm, really?  This doc says we should keep xpcomglue_s:
> > 
> > http://developer.mozilla.org/en/docs/XPCOM_Glue
> > 
> > Though, not xpcom_core.  Hmm.
> 
> xpcom_core isn't necessary, that was my bad. As for xpcomglue_s, since we have
> /path/to/sdk/lib xpcomglue_s.a in the link line explicitly, I don't think we
> need to mention -lxpcomglue_s (atleast that's what my understanding of static
> linking is, which may be wrong). In any case, the symbols defined in
> xpcomglue_s are in the final .so, so it works.

Hmm. Ok.  Does it not work with the -lxpcomglue_s in there?

> On Linux, seems like compiling and linking in the same step is what works best.
> I'll be attaching a patch next for not doing the compiling in the previous
> dependency for make (we don't need the .o files).

Okay.
 
> > >-xpcshell = $(sdkdir)/bin/xpcshell -v 180
> > >+xpcshell = $(sdkdir)/bin/run-mozilla.sh $(sdkdir)/bin/xpcshell -v 180
> > 
> > Will this work in all platforms?
> 
> Mac and Linux, yes. No idea about windows, but I think there's and equivalent
> .bat or something. Need someone on Windows to check this one out.

Ok, I have a vmware setup (windows vista) we can use to test.  Special-case per-os if it's not going to work on all of them.
All good to go (except on Windows, which hasn't been tested with run-mozilla.sh).
Attachment #321804 - Attachment is obsolete: true
Attachment #322056 - Attachment is obsolete: true
Attachment #322184 - Flags: review?(thunder)
Attachment #322056 - Flags: review?(thunder)
Comment on attachment 322184 [details] [diff] [review]
Build on Linux (and make tests pass!)

Ok, r+ pending a windows test.
Attachment #322184 - Flags: review?(thunder) → review+
This patch applies cleanly against current trunk and changes two things:

a) Adds run-mozilla.sh to run xpcshell only on Linux systems.
b) Changes #!/usr/bin/env perl -w header to simply #!/usr/bin/perl -w because the former doesn't work correctly on Linux.
Attachment #322184 - Attachment is obsolete: true
Attachment #323744 - Flags: review?(thunder)
Sorry, uploaded the wrong patch last time, this is the correct one.
Attachment #323744 - Attachment is obsolete: true
Attachment #323745 - Flags: review?(thunder)
Attachment #323744 - Flags: review?(thunder)
Comment on attachment 323745 [details] [diff] [review]
patch v3: Update to current trunk, and add conditional run-mozilla.sh for Linux systems

Looks good.
Attachment #323745 - Flags: review?(thunder) → review+
Checked-in revision 478
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Component: Weave → General
Product: Mozilla Labs → Weave
QA Contact: weave → general
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: