190 likes | 232 Views
Explore the transition from Make generic to Codeine tool, a non-drug command-line tool for building, managing repositories, and artifacts in C++ development. Learn how to use and migrate to Codeine for a more efficient development process.
E N D
CODEINE Frederic Hoguin / Andrzej Dworak / Miguel Hermo Serans / Joel Lauener BE-CO TM 28th March 2019
Agenda • Current BE-CO C++ tooling • What is Codeine • How to use it • Under the hood • Current status • A look at the future
Current BE-CO C++ tooling • Current build system uses Make.generic which is based on Make.common (originally the makefile for LynxOS FECs) SVN Make.common NFS (/acc/local) Make.generic User’s project Source files Makefile Makefile.dep
Typical C++ product layout + src |--+ project-product | |--+ <source files> | + test | |--+ <source files> + Makefile + Makefile.dep + build | + bin | |--+ CPU + test | + bin | |--+ CPU Input (provided by the user) Output (generated by Make.generic)
What’s wrong with Make.generic? • Using Makefile for building is fine • But we use it for EVERYTHING: • Release process (SVN tagging, NFS copy) • Dependency resolution (Makefile.dep) • Testing, static analysis, etc… • Product meta information is scattered in make variables • Little to no control over user made variables/target • Products depend on specific versions of Make.generic • The current system is hard to control, evolve and maintain • This is a pain to work with…
“Codeine is typically used to treat mild to moderate degrees of pain.”
What is Codeine • Codeine is NOT a drug • Codeine is NOT a build system • It is a command line tool that ease developer’s life • It is a front-end to other tools: • Build System • Repository Manager • Artifact Manager • It uses a well defined format to store product’s meta information • It is non-intrusive and can live together with Make.generic or any other in-place build system
Why do it now? • C++ products have to be migrated to GIT • We need to support GIT release • Make.generic would need to be modified • Add support for GIT release • Keep support of old SVN release • Add a new make variable to choose the type of release • Developing Codeine now is a good opportunity to not do this twice
How to use Codeine? usage: codeine command [parameters] commands: * clean * compile * configure * help * new-project * release * test • Usage: • Few invocation examples: $ codeine new-project –project my_project-p my_product $ codeine compile –target L867
Want to give it a try? • “codeine” has a system command is not yet available • But you can try it using the full path to the binary: $ /acc/local/L867/accsoft/accsoft-codeine/PRO/bin/codeine
The meta-information (product.xml) • “Compatible” with Java’s product.xml <?xml version="1.0" encoding="UTF-8"?> <products buildSystemType="makefile" repositoryType="svn"> <product name="my_product" project="my_project" version="1.0.0" type="lib"> <description>Project description</description> <repository path="test_project/test_project-test_lib-cpp"/> <targets> <target name="L866"/> <target name="L867"/> </targets> </product> </products>
Migrating to Codeine • Create a product.xml with the new-project command • Content of Makefile must either go into: • product.xml: Meta-information (project/product name, version, etc…) • Makefile.user: Specific targets/variables • The src directory stays as it is, Codeine use the same structure • Currently Codeine as nothing for dependency management • Makefile.depis still used to store dependencies • No changes at all • Dependency management will be implemented later
Under the hood • Codeine is written in C++ 11 (ish) • It has very little dependencies • accsoft-commons-utils • Functional tests are written in Python • Why not write Codeine itself in Python? • Eat your own food • Improve usability of the tool • Make sure Codeine is available on all its supported platforms • Codeine is a system tool and should depend solely on the OS, and the tools it integrates
A simple architecture ArtifactManager N BuildSystem Codeine CLI RepositoryManager 1 1 N Command
NFS ArtifactManager Make.generic SVN N BuildSystem Codeine CLI RepositoryManager 1 1 N test Command release compile
Current status • Codeine version 0.1.0 is released • It has been released with… Codeine! • It supports the current BE-CO C++ tooling: • Can build binaries, libraries and/or test suites using Make.generic • Can release product in SVN + NFS • SVN projects can already be migrated to Codeine
A look at the future • Milestone 1 (April 2019): GIT migration • Add GIT support (it is just about creating a new RepositoryManager!) • Add a command to migrate Make.generic products to Codeine • Milestone 2 (Q3/Q4 2019): Dependency management • Extend product.xml to support dependencies specification • Investigation of CMake, conan.io, pkg-config • Eradication of Makefile.dep and Makefile.user • 2020 onwards: Icing on the cake • Integration with ABI checker and static analysis tools • Add support for shared libraries • Integration with CMake, BE-CO deploy script, RPMs..
NFS conan RPM ArtifactManager CMake Make.generic SVN GIT N RepositoryManager BuildSystem Codeine CLI 1 1 N test Command release compile