NSS:NewHGLayout: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
(initial version)
 
Line 57: Line 57:


Contact kaie if you would like write access.
Contact kaie if you would like write access.
[[Category:NSS]]

Revision as of 14:57, 27 February 2013

Hints around building, testing and using the new NSS code layout, which involves separate HG (Mercurial) repositories for NSPR and NSS.

For general information about HG see: NSS:UsingHG

Checkout

Prepare a new directory, which will be the common parent directory for multiple trees. Then use multiple commands for the initial checkout code.

 mkdir workarea
 cd workarea
 hg clone https://hg.mozilla.org/projects/nspr
 hg clone https://hg.mozilla.org/projects/nss
 # optional: get jss
 hg clone https://hg.mozilla.org/projects/jss


Building

In order to build both NSPR and NSS in one step, set the usual environment variables, e.g. BUILD_OPT to empty or 1, USE_64 to empty or 1, OS_TARGET to empty or WIN95, etc. (If you're building JSS (java) also set JAVA_HOME.)

Run:

 cd workarea/nss
 make nss_build_all
 # optional: jss
 cd workarea/jss
 make


Output files

During build, the object files created by the compiler will be created inside the nspr and nss directories. (We use a .hgignore file in each repository to tell hg to ignore them, so that hg commands like "hg stat" will not show them.)

The distribution files and the tests_results files will be created one level above the nspr/nss repositories, inside the workarea:

 ls workarea/dist
 ls workarea/tests_results

(At a later time, we could change the buildsystem to create all output files outside of the nspr/nss directories, too. However, given that we can use .hgignore, that's not a high priority.)

Testing

Ensure you still have the environment variables used during the build. If necessary, set the HOST and DOMSUF variables and run:

 cd workarea/nss/tests
 ./all.sh
 # optional: jss
 cd workarea/jss
 export PLATFORM=`make platform`
 export DISTDIR=`pwd`/../dist
 cd org/mozilla/jss/tests
 perl all.pl dist $DISTDIR/$PLATFORM


Playground

If you'd like to use a playground for experimental and learning purposes:

 mkdir playground
 cd playground
 hg clone http://nss-crypto.org/hg/nspr-playground/ nspr
 hg clone http://nss-crypto.org/hg/nss-playground/ nss

Contact kaie if you would like write access.