Skip to main content
Aleksandr Shoronov
Telegram logo Mastodon logo

Fragile semantic patch

Every knows that package management is hard job. I think that it even deserved to be put into the list the most hard things in computer programming alongside with naming and caching.

Recently I faced with strange behaviour of quite usual command during development of React Native application:

pod install

I received strange and weird error without any additional hints:

[!] Invalid `Podfile` file:859: unexpected token at
`info Run CLI with --verbose flag for more details.

After hours of debugging I found that ruby script for support of React Native modules under hood calling through API module @react-native-community/cli-config for gettings all configurations of potentially React Native platorm dependencies.

And everything works good before my decision to update React Native to the next minor. Mentioned configuration library was updated from 8.02 to 8.0.4 version. And guess what happened between two patches? Right! Behaviour of library dramatically changed: validation warnings become errors. In my particular case problem was slightly different: during pod install my dependencies tree consists of only production dependencies, but library going through all dependencies (development and production) and trying to read directory of every dependency. And before update to the next patch this fragment of code was wrapped with try...catch, but after patch this behaviour had been changed.

If you are not caring about semantic versioning, which said:

Major version X (X.y.z | X > 0) MUST be incremented if any backwards incompatible changes are introduced to the public API. It MAY also include minor and patch level changes

you are also not caring about your users, even this public library is dependency of you other public library. Please, don't do so!