Red Light Green Light with libffi
Today I released the first release of libffi in 5 years, and I did it with a new project called Red Light Green Light.
If you aren't familiar with it, libffi is a low-level C/assembly library that provides the magic glue between dynamic languages like Python, Ruby, and Javascript to native C libraries at runtime. As the principal author and maintainer, I've been working on libffi for over 20 years! And with the help of many contributors, libffi now supports 29 major processor families and runs on everything from ios/android to mainframes. It's what lets Python talk to OpenSSL, Minecraft talk to OpenGL, lives under the hood of the Wayland display protocol, and eases the porting of OpenJDK to new processors.
As I was preparing this release, I spent a fair bit of time shoring up CI testing. This mostly meant firing up processor emulators on travis-ci where we can cross-compile to different architectures and run test-suites on the emulators.
One of the challenges, given the imperfect state of certain emulators, was to decide whether or not a failing test result was 'good enough' to pass build. This is where Red Light Green Light comes in.
Red Light Green Light implements auditable quality gates by reading test reports (container scan reports, unit testing reports, etc), and evaluating them against user-provided policy expressed in text files stored in git. This results in either a Red Light or a Green Light, letting us know whether or not the artifact under test is ready to proceed to the next stage of the pipeline. All of the original reports, analyses, and policy references are then archived for audit purposes.
For libffi, this meant I could write exception policies to allow for test failures caused by bugs in the processor emulators, letting travis-ci pass the build. But for other projects, I use it to evaluate OpenSCAP server and container scan results as well as Junit test results, all with a git-centric, developer-friendly workflow. While still a work-in-progress, I invite you to check it out at https://github.com/atgreen/red-light-green-light!
Anthony Green
Developer | Open Source Supporter | Hydrospatial Advocate
4 年Maintaining needed software glue that others rely on. Well Done! Red Light Green Light is an interesting read.
This is awesome Anthony.
Nice! libffi rules.
Chief Architect at Red Hat
5 年Another milestone, my friend, well done. I will look at RLGL.