If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Get builds working on linux

RESOLVED FIXED in 0.2

Status

Cloud Services
General
P1
normal
RESOLVED FIXED
10 years ago
8 years ago

People

(Reporter: thunder, Assigned: anant)

Tracking

unspecified
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 4 obsolete attachments)

(Reporter)

Description

10 years ago
This involves getting a linux VM, and working on the component's makefile to get the right build options for linux.
(Reporter)

Updated

10 years ago
Target Milestone: -- → 0.2
(Reporter)

Updated

10 years ago
Priority: -- → P1
(Reporter)

Updated

10 years ago
Blocks: 433949
(Assignee)

Comment 1

10 years ago
Created attachment 321804 [details] [diff] [review]
Adds support for building component on Linux (v1)

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)
(Reporter)

Updated

10 years ago
Attachment #321804 - Flags: review?(thunder) → review+
(Assignee)

Comment 2

10 years ago
Checked-in revision 336. Needs extra testing with GCC 3.
Status: NEW → ASSIGNED
(Assignee)

Updated

10 years ago
Assignee: nobody → anarayanan
Status: ASSIGNED → NEW
Created attachment 322056 [details] [diff] [review]
patch v2: works with Gecko SDK

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.
(Reporter)

Comment 5

10 years ago
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?
(Assignee)

Comment 6

10 years ago
> 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.
(Reporter)

Comment 7

10 years ago
(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.
(Assignee)

Comment 8

10 years ago
Created attachment 322184 [details] [diff] [review]
Build on Linux (and make tests pass!)

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)
(Reporter)

Comment 9

10 years ago
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+
(Assignee)

Comment 10

9 years ago
Created attachment 323744 [details] [diff] [review]
patch v3: Update to current trunk, and add conditional run-mozilla.sh for Linux systems

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
(Assignee)

Updated

9 years ago
Attachment #323744 - Flags: review?(thunder)
(Assignee)

Comment 11

9 years ago
Created attachment 323745 [details] [diff] [review]
patch v3: Update to current trunk, and add conditional run-mozilla.sh for Linux systems

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)
(Reporter)

Comment 12

9 years ago
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+
(Assignee)

Comment 13

9 years ago
Checked-in revision 478
Status: NEW → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → FIXED

Updated

8 years ago
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.