SlideShare une entreprise Scribd logo
1  sur  25
Tribute to rvm




                               Introducing cvm
                 The best way to manage your C++ applications dependencies



                                                                 Offirmo, 18/01/2013
cvm
C++ Version Manager


  a tool
      to automatically manage
        your C++ application's dependencies
Once upon a time…

…there was a programmer…



…who was developping an honest C++
application…
His C++ app was not standalone…


His app was based on a C++ lib called :


He was using                          of course.


He was also unit-testing using : UnitTest++


…and using cmake to build. (and gcc of course)
One day, the app got (somewhat) ready to go in
production.


         The programmer set up a clean linux
box
          and began installing his app…
          (Note : it's a server app)




   Then the troubles arrived...
● Ubuntu 10.04 LTS (at that time, and make a better example ;)
● Clean, no packages installed

● Current situation :
● My app : git clone https://github.com/abcd/xyz
  ● So I need git : sudo apt-get install git

● Need gcc & co. : sudo apt-get install build-essentials

● Need wt : sudo apt-get install witty witty-dbg witty-

dev
● Need Boost : sudo apt-get install libboost-dev
● Nedd UnitTest++, which has no packet :

    wget …
    make     (yes, it's a very simple lib)
● Need cmake : sudo             apt-get install cmake
● Let's compile :

    cmake ../xyz
    make

                 Fail !!!
●First cmake can't find UnitTest++ that I installed
manually in a custom dir, so :
     export … (have fun with pathes)
●Then cmake of Ubuntu 10.04 is too old for my
app, I need to install latest from source :
     wget …
     ./bootstrap --prefix="…"
     make                                       Pain !!!
     make install
●   Default Wt is also too old :               Pain!!!
     git clone …
     cmake ../… -PREFIX … -DCONFIGDIR …
     make
                                               Fail !!!
     make install
     --> but FAIL because Boost is too old !
●   So for Boost :
      ...
            Well, you get it…
Pain ! Fail ! %$# !
 Completely value-less task !
Utter loss of time and energy !
Unworthy of us programmers !
proposed solution : the cvm tool
sudo apt-get install git
git clone git://github.com/Offirmo/cvm.git
                                   cvm
(add cvm/bin to the path)
     cvm
git clone git://github.com/abcd/myapp.git
                                myapp

cvm new myapp

cd myapp
cvm set_compfile   Installation of
cvm update
cvm upgrade
                   dependencies
                                            Done !
mkdir ../build
cd ../build
                                App build
cvm_exec cmake ../myapp
cvm_exec make
The magic…
●   The app provides a «component file» listing its
    dependencies :
    (simplified)
    # As far as I know, no particular gcc version is required
    require compiler.gcc
    require lib.std

    # need a recent version
    require lib.UnitTest++, version : 1.4+

    # need a recent version
    require lib.Boost,      version : 1.51+

    # need a recent version
    require lib.Wt,         version : 3.2.3
The magic…
●   Then cvm automatically setup the environment
    so that all dependencies are met !

    cvm set_compfile         Set the « component file »
    cvm update
                             compute dependencies
    cvm upgrade              (who needs what, which
                             version)

                            Install everything needed :
                             - use apt-get if possible
                             - download and build from
                            source else
The magic…
●   Of course, cvm must know about the
    components :
    ●   corresponding apt packets
    ●   download url
    ●   how to build them
    ●   ...
●   So cvm has a database of components
Does it ring a bell ?
●   Other languages have such a tool for a while
    ●   ex. ruby "bundler" http://gembundler.com/




●   It's a shame that C++ still didn't have it !
    ●   Fixed ;)
More awesomness...
●   cvm installs everything in user-land
    ●   No need to be admin (except for apt-get install)
●   cvm doesn't mess with the env vars
    ●   set them on demand, hence the cvm_exec wrapper
●   cvm can ensure exact components versions
    ●   Perfect for production environment
●   cvm can maintain separate sets of components
    ●   So you can have different versions of the
        components for different apps/versions
More awesomness...
●   cvm has more nice features
    ●   Not listed here for brievity, see «bonuses»
●   cvm is easy to install
    ●   Just bash scripts !
●   cvm is totally free
    ●   Copyfree license, do whatever you want with it !
Current status
● cvm works (at last for me on my machine ;)
● It is still rough :


  ● compfile syntax still in progress


  ● multi-users usage needs to be enhanced


  ● only 16 components at this time (jan-2013)


    ● But easy to add some !


  ● Code and architecture would benefit from a little

    cleanup to ease contributions
● Comments and suggestions are welcomed !


● Fork me on github ! (doc on internals coming soon)
One more thing...
●   Why c.v.m. ?
    ●   Because of rvm (ruby version manager) https://rvm.io/




●   Like rvm, cvm is meant to play with multiple
    compilers : gcc 4.7 (for C++11), clang...
    ●   This feature is not available yet (jan-2013)
Thank you !


https://github.com/Offirmo/cvm
Bonuses
Dependencies handling
Of course, cvm computes dependencies recursively and
resolves them.

Example 1 :
 My app --> Boost 1.49+
 My app --> Wt 3.2.3 --> Boost 1.41+
   --> Latest known Boost newer or equal to 1.49 will be
installed

Example 2 :
My app --> Boost 1.40      (exact version)
My app --> Wt 3.2.3 --> Boost 1.41+
  --> Error ! cvm can't resolve those conflicting requests
The real dependency graph of my app is :



                             The orange parts
                             are non-trivial to
                             install on my target
                             OS (no correct
                             packet)

                             While developping,
                             I installed
                             everything by hand
                             when needed. Then
                             I forgot about it...
The corresponding compfile is…
##   C++ VM component set definition
##   see https://github.com/Offirmo/cvm
##
##   Thanks to this file and the C++VM tool,
##   all exact dependencies are installed.

cvm_minimum_required_version 1.0

# As far as I know, no particular gcc version is required
require compiler.gcc
require lib.std

require lib.UnitTest++, version : 1.4+

# need a recent version
require lib.Boost,      version : 1.51+

# sqlite is an optional   dependency of Wt. We want a decent version
for some bugfixes
require lib.sqlite,       version : 3.7+
# exact version of Wt +   ensure that sqlite is built before
require lib.Wt,           version : 3.2.3, require : lib.sqlite
Additional features
● cvm automatically set env vars needed by
autotools and cmake, so they correctly find the
manually installed libs (over the system one)
● cvm can automatically detect headers for libs

that don't provide a «make install»
● cvm automatically creates a folder with all

headers so you can provide it to your IDE code
indexer (ex. Eclipse)
● cvm try to save resources by caching common

resources : downloaded archives and source
code (src not duplicated if out-of-src build is
available)
Links :
● https://rvm.io/

● http://gembundler.com/




S/O
● http://stackoverflow.com/q/14263324/587407

● http://stackoverflow.com/q/1827705/587407




Image credits :
● http://tecfa.unige.ch/tecfa/teaching/UVLibre/0001/bin17/troubles.html

● wikipedia

Contenu connexe

Tendances

scaling compiled applications - highload 2013
scaling compiled applications - highload 2013scaling compiled applications - highload 2013
scaling compiled applications - highload 2013ice799
 
Porting and Maintaining your C++ Game on Android without losing your mind
Porting and Maintaining your C++ Game on Android without losing your mindPorting and Maintaining your C++ Game on Android without losing your mind
Porting and Maintaining your C++ Game on Android without losing your mindBeMyApp
 
Vagrant for Virtualized Development
Vagrant for Virtualized DevelopmentVagrant for Virtualized Development
Vagrant for Virtualized DevelopmentAdam Culp
 
Panther loves Symfony apps
Panther loves Symfony appsPanther loves Symfony apps
Panther loves Symfony appsSimone D'Amico
 
Vagrant are you still develop in a non-virtual environment-
Vagrant  are you still develop in a non-virtual environment-Vagrant  are you still develop in a non-virtual environment-
Vagrant are you still develop in a non-virtual environment-Anatoly Bubenkov
 
Debugging Ruby (with Pry)
Debugging Ruby (with Pry)Debugging Ruby (with Pry)
Debugging Ruby (with Pry)LukeBergen
 
Debugging Rails 3 Applications
Debugging Rails 3 ApplicationsDebugging Rails 3 Applications
Debugging Rails 3 ApplicationsNathan Broadbent
 
Ruby application based on http
Ruby application based on httpRuby application based on http
Ruby application based on httpRichard Huang
 
Subversion @ JUG Milano 11 dic 2009
Subversion @ JUG Milano 11 dic 2009Subversion @ JUG Milano 11 dic 2009
Subversion @ JUG Milano 11 dic 2009Andrea Francia
 
Gearman: A Job Server made for Scale
Gearman: A Job Server made for ScaleGearman: A Job Server made for Scale
Gearman: A Job Server made for ScaleMike Willbanks
 
Performance tips for Symfony2 & PHP
Performance tips for Symfony2 & PHPPerformance tips for Symfony2 & PHP
Performance tips for Symfony2 & PHPMax Romanovsky
 
Cucumber.js: Cuke up your JavaScript!
Cucumber.js: Cuke up your JavaScript!Cucumber.js: Cuke up your JavaScript!
Cucumber.js: Cuke up your JavaScript!Julien Biezemans
 
Learn Puppet : Quest Guide for the Learning VM
Learn Puppet : Quest Guide for the Learning VMLearn Puppet : Quest Guide for the Learning VM
Learn Puppet : Quest Guide for the Learning VMKumaran Balachandran
 

Tendances (20)

scaling compiled applications - highload 2013
scaling compiled applications - highload 2013scaling compiled applications - highload 2013
scaling compiled applications - highload 2013
 
Rusty Python
Rusty PythonRusty Python
Rusty Python
 
Porting and Maintaining your C++ Game on Android without losing your mind
Porting and Maintaining your C++ Game on Android without losing your mindPorting and Maintaining your C++ Game on Android without losing your mind
Porting and Maintaining your C++ Game on Android without losing your mind
 
Vagrant for Virtualized Development
Vagrant for Virtualized DevelopmentVagrant for Virtualized Development
Vagrant for Virtualized Development
 
Short intro to project butter
Short intro to project butterShort intro to project butter
Short intro to project butter
 
Introduction to Vagrant
Introduction to VagrantIntroduction to Vagrant
Introduction to Vagrant
 
Panther loves Symfony apps
Panther loves Symfony appsPanther loves Symfony apps
Panther loves Symfony apps
 
Vagrant are you still develop in a non-virtual environment-
Vagrant  are you still develop in a non-virtual environment-Vagrant  are you still develop in a non-virtual environment-
Vagrant are you still develop in a non-virtual environment-
 
Debugging Ruby (with Pry)
Debugging Ruby (with Pry)Debugging Ruby (with Pry)
Debugging Ruby (with Pry)
 
Debugging Rails 3 Applications
Debugging Rails 3 ApplicationsDebugging Rails 3 Applications
Debugging Rails 3 Applications
 
Vagrant
Vagrant Vagrant
Vagrant
 
Ruby application based on http
Ruby application based on httpRuby application based on http
Ruby application based on http
 
Vagrant for real
Vagrant for realVagrant for real
Vagrant for real
 
Subversion @ JUG Milano 11 dic 2009
Subversion @ JUG Milano 11 dic 2009Subversion @ JUG Milano 11 dic 2009
Subversion @ JUG Milano 11 dic 2009
 
Gearman: A Job Server made for Scale
Gearman: A Job Server made for ScaleGearman: A Job Server made for Scale
Gearman: A Job Server made for Scale
 
Vagrant
VagrantVagrant
Vagrant
 
Inner Symfony’s Daemons
 Inner Symfony’s Daemons Inner Symfony’s Daemons
Inner Symfony’s Daemons
 
Performance tips for Symfony2 & PHP
Performance tips for Symfony2 & PHPPerformance tips for Symfony2 & PHP
Performance tips for Symfony2 & PHP
 
Cucumber.js: Cuke up your JavaScript!
Cucumber.js: Cuke up your JavaScript!Cucumber.js: Cuke up your JavaScript!
Cucumber.js: Cuke up your JavaScript!
 
Learn Puppet : Quest Guide for the Learning VM
Learn Puppet : Quest Guide for the Learning VMLearn Puppet : Quest Guide for the Learning VM
Learn Puppet : Quest Guide for the Learning VM
 

Similaire à Introducing cvm...

C installation guide
C installation guideC installation guide
C installation guidevikas mishra
 
Life of a Chromium Developer
Life of a Chromium DeveloperLife of a Chromium Developer
Life of a Chromium Developermpaproductions
 
End-to-end CI/CD deployments of containerized applications using AWS services
End-to-end CI/CD deployments of containerized applications using AWS servicesEnd-to-end CI/CD deployments of containerized applications using AWS services
End-to-end CI/CD deployments of containerized applications using AWS servicesMassimo Ferre'
 
Cfgmgmt Challenges aren't technical anymore
Cfgmgmt Challenges aren't technical anymoreCfgmgmt Challenges aren't technical anymore
Cfgmgmt Challenges aren't technical anymoreJulien Pivotto
 
Mpeg guide
Mpeg  guideMpeg  guide
Mpeg guidekimsach
 
2012 04-19 theory-of_operation
2012 04-19 theory-of_operation2012 04-19 theory-of_operation
2012 04-19 theory-of_operationbobwolff68
 
Virtual Infrastructure
Virtual InfrastructureVirtual Infrastructure
Virtual InfrastructureBryan McLellan
 
How to configure an environment to cross-compile applications for beagleboard-xM
How to configure an environment to cross-compile applications for beagleboard-xMHow to configure an environment to cross-compile applications for beagleboard-xM
How to configure an environment to cross-compile applications for beagleboard-xMDalton Valadares
 
Ci For The Web 2.0 Guy Or Gal
Ci For The Web 2.0 Guy Or GalCi For The Web 2.0 Guy Or Gal
Ci For The Web 2.0 Guy Or GalChad Woolley
 
Os dev tool box
Os dev tool boxOs dev tool box
Os dev tool boxbpowell29a
 
OPTEE on QEMU - Build Tutorial
OPTEE on QEMU - Build TutorialOPTEE on QEMU - Build Tutorial
OPTEE on QEMU - Build TutorialDalton Valadares
 
Composer & Drupal
Composer & DrupalComposer & Drupal
Composer & Drupaldrubb
 
GDG-ANDROID-ATHENS Meetup: Build in Docker with Jenkins
GDG-ANDROID-ATHENS Meetup: Build in Docker with Jenkins GDG-ANDROID-ATHENS Meetup: Build in Docker with Jenkins
GDG-ANDROID-ATHENS Meetup: Build in Docker with Jenkins Mando Stam
 
Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014biicode
 
Raising the Bar on Robotics Code Quality
Raising the Bar on Robotics Code QualityRaising the Bar on Robotics Code Quality
Raising the Bar on Robotics Code QualityThomas Moulard
 
The Secrets of The FullStack Ninja - Part A - Session I
The Secrets of The FullStack Ninja - Part A - Session IThe Secrets of The FullStack Ninja - Part A - Session I
The Secrets of The FullStack Ninja - Part A - Session IOded Sagir
 
Настройка окружения для кросскомпиляции проектов на основе docker'a
Настройка окружения для кросскомпиляции проектов на основе docker'aНастройка окружения для кросскомпиляции проектов на основе docker'a
Настройка окружения для кросскомпиляции проектов на основе docker'acorehard_by
 
DevOps(4) : Ansible(2) - (MOSG)
DevOps(4) : Ansible(2) - (MOSG)DevOps(4) : Ansible(2) - (MOSG)
DevOps(4) : Ansible(2) - (MOSG)Soshi Nemoto
 

Similaire à Introducing cvm... (20)

C installation guide
C installation guideC installation guide
C installation guide
 
Life of a Chromium Developer
Life of a Chromium DeveloperLife of a Chromium Developer
Life of a Chromium Developer
 
End-to-end CI/CD deployments of containerized applications using AWS services
End-to-end CI/CD deployments of containerized applications using AWS servicesEnd-to-end CI/CD deployments of containerized applications using AWS services
End-to-end CI/CD deployments of containerized applications using AWS services
 
Cfgmgmt Challenges aren't technical anymore
Cfgmgmt Challenges aren't technical anymoreCfgmgmt Challenges aren't technical anymore
Cfgmgmt Challenges aren't technical anymore
 
Mpeg guide
Mpeg  guideMpeg  guide
Mpeg guide
 
2012 04-19 theory-of_operation
2012 04-19 theory-of_operation2012 04-19 theory-of_operation
2012 04-19 theory-of_operation
 
Virtual Infrastructure
Virtual InfrastructureVirtual Infrastructure
Virtual Infrastructure
 
How to configure an environment to cross-compile applications for beagleboard-xM
How to configure an environment to cross-compile applications for beagleboard-xMHow to configure an environment to cross-compile applications for beagleboard-xM
How to configure an environment to cross-compile applications for beagleboard-xM
 
Ci For The Web 2.0 Guy Or Gal
Ci For The Web 2.0 Guy Or GalCi For The Web 2.0 Guy Or Gal
Ci For The Web 2.0 Guy Or Gal
 
Os dev tool box
Os dev tool boxOs dev tool box
Os dev tool box
 
OPTEE on QEMU - Build Tutorial
OPTEE on QEMU - Build TutorialOPTEE on QEMU - Build Tutorial
OPTEE on QEMU - Build Tutorial
 
Composer & Drupal
Composer & DrupalComposer & Drupal
Composer & Drupal
 
Building For Mer
Building For MerBuilding For Mer
Building For Mer
 
GDG-ANDROID-ATHENS Meetup: Build in Docker with Jenkins
GDG-ANDROID-ATHENS Meetup: Build in Docker with Jenkins GDG-ANDROID-ATHENS Meetup: Build in Docker with Jenkins
GDG-ANDROID-ATHENS Meetup: Build in Docker with Jenkins
 
Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014
 
QEMU in Cross building
QEMU in Cross buildingQEMU in Cross building
QEMU in Cross building
 
Raising the Bar on Robotics Code Quality
Raising the Bar on Robotics Code QualityRaising the Bar on Robotics Code Quality
Raising the Bar on Robotics Code Quality
 
The Secrets of The FullStack Ninja - Part A - Session I
The Secrets of The FullStack Ninja - Part A - Session IThe Secrets of The FullStack Ninja - Part A - Session I
The Secrets of The FullStack Ninja - Part A - Session I
 
Настройка окружения для кросскомпиляции проектов на основе docker'a
Настройка окружения для кросскомпиляции проектов на основе docker'aНастройка окружения для кросскомпиляции проектов на основе docker'a
Настройка окружения для кросскомпиляции проектов на основе docker'a
 
DevOps(4) : Ansible(2) - (MOSG)
DevOps(4) : Ansible(2) - (MOSG)DevOps(4) : Ansible(2) - (MOSG)
DevOps(4) : Ansible(2) - (MOSG)
 

Dernier

Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 

Dernier (20)

Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 

Introducing cvm...

  • 1. Tribute to rvm Introducing cvm The best way to manage your C++ applications dependencies Offirmo, 18/01/2013
  • 2. cvm C++ Version Manager a tool to automatically manage your C++ application's dependencies
  • 3. Once upon a time… …there was a programmer… …who was developping an honest C++ application…
  • 4. His C++ app was not standalone… His app was based on a C++ lib called : He was using of course. He was also unit-testing using : UnitTest++ …and using cmake to build. (and gcc of course)
  • 5. One day, the app got (somewhat) ready to go in production. The programmer set up a clean linux box and began installing his app… (Note : it's a server app) Then the troubles arrived...
  • 6. ● Ubuntu 10.04 LTS (at that time, and make a better example ;) ● Clean, no packages installed ● Current situation :
  • 7. ● My app : git clone https://github.com/abcd/xyz ● So I need git : sudo apt-get install git ● Need gcc & co. : sudo apt-get install build-essentials ● Need wt : sudo apt-get install witty witty-dbg witty- dev ● Need Boost : sudo apt-get install libboost-dev ● Nedd UnitTest++, which has no packet : wget … make (yes, it's a very simple lib) ● Need cmake : sudo apt-get install cmake ● Let's compile : cmake ../xyz make Fail !!!
  • 8. ●First cmake can't find UnitTest++ that I installed manually in a custom dir, so : export … (have fun with pathes) ●Then cmake of Ubuntu 10.04 is too old for my app, I need to install latest from source : wget … ./bootstrap --prefix="…" make Pain !!! make install ● Default Wt is also too old : Pain!!! git clone … cmake ../… -PREFIX … -DCONFIGDIR … make Fail !!! make install --> but FAIL because Boost is too old ! ● So for Boost : ... Well, you get it…
  • 9. Pain ! Fail ! %$# ! Completely value-less task ! Utter loss of time and energy ! Unworthy of us programmers !
  • 10. proposed solution : the cvm tool sudo apt-get install git git clone git://github.com/Offirmo/cvm.git cvm (add cvm/bin to the path) cvm git clone git://github.com/abcd/myapp.git myapp cvm new myapp cd myapp cvm set_compfile Installation of cvm update cvm upgrade dependencies Done ! mkdir ../build cd ../build App build cvm_exec cmake ../myapp cvm_exec make
  • 11. The magic… ● The app provides a «component file» listing its dependencies : (simplified) # As far as I know, no particular gcc version is required require compiler.gcc require lib.std # need a recent version require lib.UnitTest++, version : 1.4+ # need a recent version require lib.Boost, version : 1.51+ # need a recent version require lib.Wt, version : 3.2.3
  • 12. The magic… ● Then cvm automatically setup the environment so that all dependencies are met ! cvm set_compfile Set the « component file » cvm update compute dependencies cvm upgrade (who needs what, which version) Install everything needed : - use apt-get if possible - download and build from source else
  • 13. The magic… ● Of course, cvm must know about the components : ● corresponding apt packets ● download url ● how to build them ● ... ● So cvm has a database of components
  • 14. Does it ring a bell ? ● Other languages have such a tool for a while ● ex. ruby "bundler" http://gembundler.com/ ● It's a shame that C++ still didn't have it ! ● Fixed ;)
  • 15. More awesomness... ● cvm installs everything in user-land ● No need to be admin (except for apt-get install) ● cvm doesn't mess with the env vars ● set them on demand, hence the cvm_exec wrapper ● cvm can ensure exact components versions ● Perfect for production environment ● cvm can maintain separate sets of components ● So you can have different versions of the components for different apps/versions
  • 16. More awesomness... ● cvm has more nice features ● Not listed here for brievity, see «bonuses» ● cvm is easy to install ● Just bash scripts ! ● cvm is totally free ● Copyfree license, do whatever you want with it !
  • 17. Current status ● cvm works (at last for me on my machine ;) ● It is still rough : ● compfile syntax still in progress ● multi-users usage needs to be enhanced ● only 16 components at this time (jan-2013) ● But easy to add some ! ● Code and architecture would benefit from a little cleanup to ease contributions ● Comments and suggestions are welcomed ! ● Fork me on github ! (doc on internals coming soon)
  • 18. One more thing... ● Why c.v.m. ? ● Because of rvm (ruby version manager) https://rvm.io/ ● Like rvm, cvm is meant to play with multiple compilers : gcc 4.7 (for C++11), clang... ● This feature is not available yet (jan-2013)
  • 21. Dependencies handling Of course, cvm computes dependencies recursively and resolves them. Example 1 : My app --> Boost 1.49+ My app --> Wt 3.2.3 --> Boost 1.41+ --> Latest known Boost newer or equal to 1.49 will be installed Example 2 : My app --> Boost 1.40 (exact version) My app --> Wt 3.2.3 --> Boost 1.41+ --> Error ! cvm can't resolve those conflicting requests
  • 22. The real dependency graph of my app is : The orange parts are non-trivial to install on my target OS (no correct packet) While developping, I installed everything by hand when needed. Then I forgot about it...
  • 23. The corresponding compfile is… ## C++ VM component set definition ## see https://github.com/Offirmo/cvm ## ## Thanks to this file and the C++VM tool, ## all exact dependencies are installed. cvm_minimum_required_version 1.0 # As far as I know, no particular gcc version is required require compiler.gcc require lib.std require lib.UnitTest++, version : 1.4+ # need a recent version require lib.Boost, version : 1.51+ # sqlite is an optional dependency of Wt. We want a decent version for some bugfixes require lib.sqlite, version : 3.7+ # exact version of Wt + ensure that sqlite is built before require lib.Wt, version : 3.2.3, require : lib.sqlite
  • 24. Additional features ● cvm automatically set env vars needed by autotools and cmake, so they correctly find the manually installed libs (over the system one) ● cvm can automatically detect headers for libs that don't provide a «make install» ● cvm automatically creates a folder with all headers so you can provide it to your IDE code indexer (ex. Eclipse) ● cvm try to save resources by caching common resources : downloaded archives and source code (src not duplicated if out-of-src build is available)
  • 25. Links : ● https://rvm.io/ ● http://gembundler.com/ S/O ● http://stackoverflow.com/q/14263324/587407 ● http://stackoverflow.com/q/1827705/587407 Image credits : ● http://tecfa.unige.ch/tecfa/teaching/UVLibre/0001/bin17/troubles.html ● wikipedia