gbuild: State of the LibreOffice build system



Similar documents
Example of Standard API

Objectives. Chapter 2: Operating-System Structures. Operating System Services (Cont.) Operating System Services. Operating System Services (Cont.

Chapter 2 System Structures

INF-110. GPFS Installation

Valgrind BoF Ideas, new features and directions

Building and Using a Cross Development Tool Chain

Site Configuration SETUP GUIDE. Windows Hosts Single Workstation Installation. May08. May 08

MatrixSSL Getting Started

Virtuozzo Virtualization SDK

CMPT 373 Software Development Methods. Building Software. Nick Sumner Some materials from Shlomi Fish & Kitware

Writer Guide. Chapter 10 Working with Templates

Operating System Structures

TIBCO Enterprise Administrator Release Notes

Jonathan Worthington Scarborough Linux User Group

pbuilder Debian Conference 2004

Installation Guide. McAfee VirusScan Enterprise for Linux Software

Documentation and Project Organization

Chapter 3 Operating-System Structures

Developing Embedded Linux Devices Using the Yocto Project

10 STEPS TO YOUR FIRST QNX PROGRAM. QUICKSTART GUIDE Second Edition

Code Estimation Tools Directions for a Services Engagement

Cincom Smalltalk. Installation Guide P SIMPLIFICATION THROUGH INNOVATION

eggon SDK for ios 7 Integration Instructions

OLCF Best Practices. Bill Renaud OLCF User Assistance Group

Red Hat Network Satellite (On System z) 18-JUNE CAVMEN Meeting

How to Push CDR Files from Asterisk to SDReporter. September 27, 2013

Intel Do-It-Yourself Challenge Lab 2: Intel Galileo s Linux side Nicolas Vailliet

Rsnapshot: A remote filesystem snapshot utility

Easing embedded Linux software development for SBCs

Version Control with Subversion and Xcode

Working with HPC and HTC Apps. Abhinav Thota Research Technologies Indiana University

Isilon OneFS. Version 7.2. OneFS Migration Tools Guide

Understand for FORTRAN

DS License Server V6R2013x

11. Oracle Recovery Manager Overview and Configuration.

Introduction to Linux and Cluster Basics for the CCR General Computing Cluster

Chapter 1: Getting Started

LAE Enterprise Server Installation Guide

INTEL PARALLEL STUDIO XE EVALUATION GUIDE

Red Hat Developer Toolset 1.1

Xcode Project Management Guide. (Legacy)

Professional. SlickEdif. John Hurst IC..T...L. i 1 8 О 7» \ WILEY \ Wiley Publishing, Inc.

Chapter 2: Operating-System Structures. Operating System Concepts 9 th Edition

TREK GETTING STARTED GUIDE

Apache 2.0 Installation Guide

RED HAT DEVELOPER TOOLSET Build, Run, & Analyze Applications On Multiple Versions of Red Hat Enterprise Linux

System Structures. Services Interface Structure

NFS File Sharing. Peter Lo. CP582 Peter Lo

Game Design From Concepts To Implementation

OPERATING SYSTEM SERVICES

GoAnywhere Director to GoAnywhere MFT Upgrade Guide. Version: Publication Date: 07/09/2015

Profiling and Testing with Test and Performance Tools Platform (TPTP)

Software Development Processes For Embedded Development A checklist for efficient development using open-source tools

Android WebKit Development: A cautionary tale. Joe Bowser Nitobi joe.bowser@nitobi.com

Application-Level Debugging and Profiling: Gaps in the Tool Ecosystem. Dr Rosemary Francis, Ellexus

HPC Wales Skills Academy Course Catalogue 2015

The BackTrack Successor

IPMI Event Viewer Command Line Interface ***This is the user guide for the CLI only***

Linux System Administration

Make a folder named Lab3. We will be using Unix redirection commands to create several output files in that folder.

Work Environment. David Tur HPC Expert. HPC Users Training September, 18th 2015

Release Bulletin EDI Products 5.2.1

The Nix project. Sander van der Burg. June 24, Delft University of Technology, EEMCS, Department of Software Technology

SimbaEngine SDK 9.4. Build a C++ ODBC Driver for SQL-Based Data Sources in 5 Days. Last Revised: October Simba Technologies Inc.

soliddb Fundamentals & Features Copyright 2013 UNICOM Global. All rights reserved.

CS3600 SYSTEMS AND NETWORKS

TIBCO ActiveMatrix BusinessWorks Plug-in for TIBCO Managed File Transfer Software Installation

Using Karel with Eclipse

Grid Computing for Artificial Intelligence

Writing standalone Qt & Python applications for Android

PARALLELS SERVER 4 BARE METAL README

Oracle Tools and Bindings with languages

Cloud Server. Parallels. An Introduction to Operating System Virtualization and Parallels Cloud Server. White Paper.

Overview

PrimeRail Installation Notes Version A June 9,

Operating System Structure

Firebird on Linux. Author: Philippe Makowski IBPhoenix Licence: Public Documentation License Date:

Version Author(s) Web Description

How To Fix A Snare Server On A Linux Server On An Ubuntu (Amd64) (Amd86) (For Ubuntu) (Orchestra) (Uniden) (Powerpoint) (Networking

INTEGRAL OFF-LINE SCIENTIFIC ANALYSIS

bluecape s Official Website

Rudder. Sharing IT automation benefits in a team with Rudder. Benoît Peccatte bpe@normation.com. Normation Tous droits réservés normation.

DNS and LDAP persistent search

Chapter 3: Operating-System Structures. System Components Operating System Services System Calls System Programs System Structure Virtual Machines

Parsing Technology and its role in Legacy Modernization. A Metaware White Paper

QNX Software Development Platform 6.6. Installation Guide

Online Backup Client User Manual

Spatialite-gui. a GUI tool to manage SQLite and SpatiaLite databases. Just few very short notes showing How to get started as quick as possible

CS 103 Lab Linux and Virtual Machines

Q N X S O F T W A R E D E V E L O P M E N T P L A T F O R M v Steps to Developing a QNX Program Quickstart Guide

Monitoring, Tracing, Debugging (Under Construction)

The Advanced JTAG Bridge. Nathan Yawn 05/12/09

Transcription:

gbuild: State of the LibreOffice build system Michael Stahl, Red Hat, Inc. 2012-10-17 1

Overview The Historic OpenOffice.org Build System Goals for a Better Build System gbuild Architecture gbuild Status Lessons Learned gbuild Future Work 2

The Historic OpenOffice.org Build System (1) combination of build.pl / deliver.pl / dmake dmake: conceptually similar to standard make but different syntax OOo the only project using it according to folklore dmake was selected in 90s because it was the only thing that worked on Mac OS it's so obsolete it's licensed GPLv1 (!) build.pl / deliver.pl homegrown Perl scripts... 3

The Historic OpenOffice.org Build System (2) build.pl iterates over all modules (top-level directories) & invokes dmake in each directory obscure build.lst files recursive make (technically (almost) no recursion but morally equivalent) Recursive Make Considered Harmful, Peter Miller, 1997 re -stat lots of files on every dmake invocation... all dmakes in module done: build.pl invokes deliver.pl copies files listed in d.lst to "solver" doesn't "solve" anything (Solar Version) dumping ground for inter-module build 4

Example: OOo build (from scratch + running all tests)./configure --enable-foo./bootstrap source LinuxX86-64Env.Set.sh cd smoketestoo_native Xephyr :42 & DISPLAY=:42 build --all -P2 -- -P2 DISPLAY=:42 subsequenttests 5

Example: OOo build (incremental) Let's do some change in vcl... touch vcl/inc/vcl/window.hxx cd instsetoo_native build --prepare --from vcl build --all -P2 -- -P2 6

Example: OOo build: clean a single module cd module deliver -delete rm -rf $INPATH (alternatively:) cd module build --prepare --from module 7

Example: OOo build: run subsequenttests in a module cd module DISPLAY=:42 OOO_SUBSEQUENT_TESTS=t build -P2 8

Goals for a Better Build System lean prerequisites use standard tools don't want to maintain another dmake full dependencies for incremental builds easy to use & reliable even for non-experts easier parallelism, less bottlenecks, better scalability less boilerplate in makefiles less "creativity" in makefiles there should be one obvious way to to things automatically run tests during build all of that with an incremental migration path 9

Goals for a Better Build System: LO perspective LO different from OOo and other OOo based projects: Not large-corporation oriented, but community-oriented "Every time an incremental build fails a potential contributor is turned away from the project." developers push directly to master, not to feature branches low-level headers tend to change a lot incremental builds really have to just work! 10

gbuild Architecture one GNU make process to build everything but can also build single module based on GNU make 3.81+ features: eval target local variables one makefile per deliverable full dependencies can be turned off (tinderbox, distro builds) 11

gbuild Files solenv/gbuild: core implementation solenv/gbuild/platforms: platform specific bits Repository.mk: define all linktargets/jars RepositoryExternal.mk: bundled external libs RepositoryFixes.mk: ugly hacks RepositoryModule.mk: for single process build config_*.mk: configure output */*.mk: user makefiles 12

gbuild Implementation pseudo-oop in GNU make $(eval $(call gb_class_method,instance,param...)) solenv/gbuild: 10k lines of.mk + 200 lines of.awk solenv/gbuild/platform: 4.5k lines.mk + 200.awk for comparison: solenv/inc: 25k of dmake 13

gbuild Status Continuous improvement of core features Incremental migration of legacy dmake modules 14

Incremental migration: progress over time: gbuild module conversion status 250 200 150 gbuild modules all modules 100 50 0 2010-05 2010-07 2010-09 2010-11 2011-01 2011-03 2011-05 2011-07 2011-09 2011-11 2012-01 2012-03 2012-05 2012-07 2012-09 2010-04 2010-06 2010-08 2010-10 2010-12 2011-02 2011-04 2011-06 2011-08 2011-10 2011-12 2012-02 2012-04 2012-06 2012-08 2012-10 15

gbuild New Features (added during last year or so) supports standard environment variables like CPPFLAGS, CXXFLAGS, LDFLAGS cross compilation support new platforms: *BSD, Android, ios, Solaris/GCC, MSVC2012, AIX mergedlibs check object owner selective debug: --enable-debug="sw svx xmloff" full dependencies for svidl, UNO IDL new targets: Asm, Yacc/Lex, Configuration, PyUno, Extension, Dictionary, Scp/InstallModule, Cli, ExternalProject, UI 16

gbuild is a Community Effort thanks to regular contributors: David Tardon Norbert Thiebaud Matúš Kukan Peter Foley David Ostrovsky Bjoern and many more than would fit on this slide 17

Example: current LO build (from scratch + running all tests)./autogen.sh --enable-foo make check 18

Example: LO build (incremental) Let's do some change in vcl... touch vcl/inc/vcl/window.hxx make 19

Example: LO build: clean a module make module.clean 20

Example: LO build: run subsequenttests in a module make module.subsequentcheck 21

Example: LO build: run subsequenttests in a module make module.subsequentcheck and if it crashes you get a stack trace automagically! (except if you're unlucky and have to build on Windows... patches welcome) 22

Bonus Examples: LO build: debugging features Run tests in gdb: GDBCPPUNITTRACE="gdb --args" make Run tests under Valgrind: VALGRIND=memcheck make module.check VALGRIND=memcheck make module.subsequentcheck Run soffice in gdb: make debugrun 23

Lessons Learned: Namespace Pitfalls everything one make process => namespace problems! variable names target local variables not a problem except if initialization forgotten :) prefixes everywhere to avoid collisions gbuild core variables prefixed with gb_ variables in user makefiles discouraged user make file variables prefixed with module_ pattern rules GNU make 3.81 vs. 3.82 pattern rules some effort to support both 24

Lessons Learned: Performance unwanted parallelism: do not want to link sw in parallel with sd, sc... on your laptop workaround with artificial build order only deps portable shell good for performance: dash is faster than bash 25

Lessons Learned: That Other OS Windows makes build system developers unhappy: make bug 20033: make 3.81 -jn crashy command line length limit cygpath pain finally required make with support for DOS paths filesystem, process creation slow... 26

Lessons Learned: The Good full dependencies work! quite simple to extend svidl, idlc to write make dependencies fast no-op builds most user makefiles relatively simple consistently use DLLPUBLIC annotations cleaned up cruft like setsolar, set_soenv... no more shell environment sane & consistent way to use external libraries which may be from system or bundled 27

Lessons Learned: The Not So Good (1) core gbuild implementation quite complex and difficult to understand lots of function abstractions make is not a very good programming language "migrating from obscure dmake system to a pile of impenetrable spaghetti masquerading as make files" response files necessary to work around command line length limits on Windows: fortunately make 3.83 has grown $(file...) function cannot use cygwin's make package 28

Lessons Learned: The Not So Good (2) no checking of parameters when calling a function (or that function even exists) no multi-target build rules used to work in dmake GNU make rule can have multiple targets but is invoked once per target then :( requires ugly touch rules inheritance of target local variables evaluating target local variable in dependencies bottleneck in parsing? parallelizable? 29

gbuild Future Work: solver solver: an anachronism initially designed for partial builds: only check out a single module from CVS, build that against headers & libraries on NFS share partial builds are obsolete with today's disk sizes copying headers around: obsolete, very slow on Windows also breaks incremental builds why don't we instead have a runnable LO installation? would obsolete "make dev-install" too... 30

gbuild Future Work: scp2 scp2: defines contents of installation sets duplicating a lot of conditionals that are already in makefiles own way to define library names do we still need this? can make do the job directly? How many cpps do we really need? get rid of more Perl cruft in build system 31

Thank you for listening Questions? All text and image content in this document is licensed under the Creative Commons Attribution-Share Alike 3.0 License (unless otherwise specified). "LibreOffice" and "The Document Foundation" are registered trademarks. Their respective logos and icons are subject to international copyright laws. The use of these therefore is subject to the trademark policy. 32