Releases of Perl distribution of Crypt::OpenSSL::X509 1.904 and 1.905 - a story about epic failure
Tags: perl, release, xs
Published: 2021-05-13 15:25:07

---
title: Releases of Perl distribution of Crypt::OpenSSL::X509 1.904 and 1.905 - a story about epic failure 
published: true
description: SUPA HOT failure of EPIC proportions
tags: perl, release, xs
//cover_image: https://direct_url_to_image.jpg
---
I have for some time been the maintainer of the Perl distribution: [Crypt::OpenSSL::X509](https://metacpan.org/pod/Crypt::OpenSSL::X509). The implementation is a wrapper on the OpenSSL C libraries, relying on XS.

I took over the maintenance from Dan Sully, because we where using the distribution at work and it need some maitaining. O am not a C-programmer, XS _wizard_ or compiler expert - anyway I thought I could learn something from taking on the maintainer role.

Over time I have made releases, when there was something obvious or somebody sent PRs to [the repository](https://github.com/dsully/perl-crypt-openssl-x509).

Way too seldom, I would check the CPAN testers reports to see how things were going, but a few weeks ago I was bored and I did.

The current release at the time was 1.903 and [the test results](http://matrix.cpantesters.org/?dist=Crypt-OpenSSL-X509%201.903) were not look too impressive.

![Test reports 1.903](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/50q88q0oi2mmainbwjbp.png)

So I checked some of them out and set out to address some of the issues I observed. The first one was a broken build on OpenBSD and FreeBSD.

As I mentioned:

> _I am not a compiler expert - check me out_

```text
error: nonnull parameter 'pv' will evaluate to 'true' on first encounter [-Werror,-Wpointer-bool-conversion]
if (pv && len > 1) {
```

Examples:

- [Example 1](http://www.cpantesters.org/cpan/report/119b4298-9e42-11eb-84bc-edd243e66a77)
- [Example 2](http://www.cpantesters.org/cpan/report/77bdcdd2-a0e7-11eb-84bc-edd243e66a77)
- [Example 3](http://www.cpantesters.org/cpan/report/fd7e66b6-a14b-11eb-84bc-edd243e66a77)

I read up on the issue and it seemed Perl 5.20 had an issue with this so I wanted to re-categorize it to a warning from an error for Perl versions below 5.20.0

Believe me, this required a lot of _googling_, reading and I did a lot of installation and testing with different Perl versions (luckily the issue was easily reproduced).

When I understood the issue, I was able to find [a good article on StackOverflow](https://stackoverflow.com/questions/35797295/clang-how-to-disable-werror-wpointer-bool-conversion), with what I thought would be a remedy.

Implemented and shipped release 1.904.

**Boom, bam, bop Bada-bop-boom, pow!**

That did not work out particularly well - I actually made the situation worse and completely broke the build for Linux.

![Test reports 1.904](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4bz5ss653wdmivh1n6zq.png)

Apparently GCC and LLVM are very different and I had introduced the use of an option, which is LLVM specific and is not understood by GCC.

More _googling_ and reading and I found some good resources on the two compilers:

- ["Diagnostic flags in Clang"](https://clang.llvm.org/docs/DiagnosticsReference.html) from Clang 13 documentation
- ["3.8 Options to Request or Suppress Warnings"](https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html) for GCC
- ["3.1 Option Summary"](http://gcc.gnu.org/onlinedocs/gcc/Option-Summary.html) for GCC

I got everything restructurized and got release 1.905 shipped and this time it looked much better...

![Test reports 1.905](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0ydswe73gpdlhs32ystk.png)

There are more compiler issues I want to address, but I will most certainly be more careful in the future, just fooling around with the code surrounding your main product can be just as destructive and hence stressful and time consuming.

We are now back on track and I have since shipped releases 1.9.6 and 1.9.7 and things are back to slowly improving.

I tend to do micro releases and I am seriously considering extending my toolbox locally with a Linux machine, so I get more perspective on things with a better feedback loop while developing.

Improving continuous integration for this project is also being worked on. The matrix approach of operating systems, tools/compilers and in this case Perl interpreter versions make a lot of sense and brings a lot of value and it would probably have caught the issue I introduced earlier.

It is does however require a lot of work to establish and maintain, but I think it is worth the effort. We do learn a lot from our mistakes, but we also need successes to keep motivation up.