SCM: a Look at Scons and GNU Arch

SCM: a Look at Scons and GNU Arch

SCM: A look at SCons and GNU Arch ¡ ¢ £ ¤ ¥ Ben Leslie ¦ § ¡ ¨ © ¢ § ¨ ¡ © ¨ © 1 WHAT IS SCM? CM is the discpline of controlling the evolution of complex systems; SCM is its specialization for computer programs and associated documents WHAT IS SCM? 2 WHAT IS SCM? CM is the discpline of controlling the evolution of complex systems; SCM is its specialization for computer programs and associated documents No really, what is it ? WHAT IS SCM? 2-A WHAT IS SCM? CM is the discpline of controlling the evolution of complex systems; SCM is its specialization for computer programs and associated documents No really, what is it ? • Versioning WHAT IS SCM? 2-B WHAT IS SCM? CM is the discpline of controlling the evolution of complex systems; SCM is its specialization for computer programs and associated documents No really, what is it ? • Versioning • Building WHAT IS SCM? 2-C BUILD SYSTEM – PURPOSE Automate construction process • Build rules – how to change .c into .o • Capture all build rules Rebuild exactly what is needed BUILD SYSTEM – PURPOSE 3 BUILD SYSTEM – PURPOSE Automate construction process • Build rules – how to change .c into .o • Capture all build rules Rebuild exactly what is needed • Build everything required – correctness. BUILD SYSTEM – PURPOSE 3-A BUILD SYSTEM – PURPOSE Automate construction process • Build rules – how to change .c into .o • Capture all build rules Rebuild exactly what is needed • Build everything required – correctness. • Don’t build anymore then needed – performance. BUILD SYSTEM – PURPOSE 3-B BUILD SYSTEM – PURPOSE Automate construction process • Build rules – how to change .c into .o • Capture all build rules Rebuild exactly what is needed • Build everything required – correctness. • Don’t build anymore then needed – performance. • Determine dependencies – robustness. BUILD SYSTEM – PURPOSE 3-C BUILD SYSTEM – PURPOSE Automate construction process • Build rules – how to change .c into .o • Capture all build rules Rebuild exactly what is needed • Build everything required – correctness. • Don’t build anymore then needed – performance. • Determine dependencies – robustness. • Easily extensible – flexibility. BUILD SYSTEM – PURPOSE 3-D BUILD SYSTEM – PURPOSE Automate construction process • Build rules – how to change .c into .o • Capture all build rules Rebuild exactly what is needed • Build everything required – correctness. • Don’t build anymore then needed – performance. • Determine dependencies – robustness. • Easily extensible – flexibility. • Easily to use – convenience. BUILD SYSTEM – PURPOSE 3-E BUILD SYSTEM – TOOLS The incumbent make BUILD SYSTEM – TOOLS 4 BUILD SYSTEM – TOOLS The incumbent make It’s sort of a graffiti recorder — Bill Joy BUILD SYSTEM – TOOLS 4-A BUILD SYSTEM – TOOLS The incumbent make + automake, autoconf, libtool, gcc -M It’s sort of a graffiti recorder — Bill Joy BUILD SYSTEM – TOOLS 4-B BUILD SYSTEM – TOOLS The incumbent make + automake, autoconf, libtool, gcc -M It’s sort of a graffiti recorder — Bill Joy Others around Ant, bake, cook, bras, jam, odin, vesta BUILD SYSTEM – TOOLS 4-C BUILD SYSTEM – TOOLS The incumbent make + automake, autoconf, libtool, gcc -M It’s sort of a graffiti recorder — Bill Joy Others around Ant, bake, cook, bras, jam, odin, vesta My fave SCons BUILD SYSTEM – TOOLS 4-D SCONS Features • Written in python • Build scripts essentially python EDSL • Cross-platform • Gets depencies correct • Usage scales – easy to write simple and complex systems • Friendly user group SCONS 5 SCONS Features • Written in python • Build scripts essentially python EDSL • Cross-platform • Gets depencies correct • Usage scales – easy to write simple and complex systems • Friendly user group • id software uses it for Doom3 ;) SCONS 5-A SC ONS Example usage: Example SConstruct file: - H ¡ ¢ ELLO £ ¡ ¢ ¤ W ¥ ORLD ¦ § ¨ © ¢ SC ONS - H ELLO W ORLD 6 SCONS - DEPENDENCY CALCULATION Implicit: Scons parses source files with a Scanner to determine dependencies. • Scanner knows about generated files. • Easy to write your own Scanner • Command line arguments are also implicit dependencies. (E.g: Change cflags) Explicit: Scons allows you to specify explicit dependencies. £ ¡ ¢ ¢ ¢ ¥ ¤ © ¢ © ¦ ¤ ¡ SCONS - DEPENDENCY CALCULATION 7 SCONS - CHANGE DETECTION MD5Sum: Calculate a files MD5Sum to determine if it has changed. Timestamp: Optional to revert to timestamp method. Built files: Default is to always rebuild. Optionally treat as other files. So if a .o is unchanged by rebuild nothing else is done. SCONS - CHANGE DETECTION 8 SC ONS project to be easily built. Multiple environments inherit the environment’s defaults. compiler, flags etc. All programs builtEvironments in an environment ¢ ¢ ¢ ¢ - E ¥ ¡ ¥ ¡ £ £ NVIRONMENTS ¡ ¡ ¡ ¡ ¢ ¢ ¢ ¢ £ £ ¡ ¡ £ £ ¤ ¤ ¤ ¤ ¥ ¥ ¡ ¡ ¢ ¢ ¦ ¦ encapsulate a set of build logic. E.g: which ¥ ¥ ¥ £ ¤ ¢ © © ¡ ¢ SC ¤ ¤ ¦ ¦ ¥ ¥ ONS ¥ ¥ ¦ ¦ ¥ £ can be specified enabling large § § ¤ ¢ ¨ ¨ ¡ ¢ © © - E ¡ ¡ NVIRONMENTS £ 9 SCONS - MISC Clean is handled automatically by SCons. Just ¢ . PATH is not preserved! Need to manually propagate. Debugging is nice. It is just python so you can easily use ¡ ¤ . ¡ Command line args are nicely exposed so you can provide options to your build. (E.g: ¢ © ¥ ¡ ). Hierarchical builds are £ supported. (Think make’s include support, not make’s recursive build support. SCONS - MISC 10 RANT: CHANGE DETECTION IN LINUX SUCKS! RANT: CHANGE DETECTION IN LINUX SUCKS! 11.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    24 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us