# Other bad consequences of piracy: breaking earlier package releases

**URL:** <https://discourse.julialang.org/t/other-bad-consequences-of-piracy-breaking-earlier-package-releases/143496>\
**Category:** General Usage\
**Created:** [December 3, 2026, 8:39am UTC](https://discourse.julialang.org/t/other-bad-consequences-of-piracy-breaking-earlier-package-releases/143496 "2026-12-03T08:39:16Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![tchr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tchr/32/15138_2.png) [@tchr](https://discourse.julialang.org/u/tchr)\
**Post date:** [December 3, 2026, 8:39am UTC](https://discourse.julialang.org/t/other-bad-consequences-of-piracy-breaking-earlier-package-releases/143496/1 "2026-12-03T08:39:16Z")

</div>

(@goerz suggested I cross-post this here from Slack, so it can be referenced in the future)

I learned of another good reason not to commit piracy yesterday, illustrated by the following example:

Suppose we have two packages X and Y. Y depends on X, and commit type-piracy wrt. to X’s types, e.g., defining (in Y):

```jl
using X
Base.isapprox(a::T, b::T) where T <: StructFromX = ...

```

Suppose that, one day, the author of Y realizes the shortcomings of their buccaneering ways and transfers the method to X, where it rightly belongs. A new non-breaking release of X is made with the new method, and a new release of Y is also made with the piracy removed.

All is good and piracy is in the past, right? Unfortunately, **no** : the new version of X – being non-breaking – is picked up by the resolver in all _earlier_ versions of Y. This is a problem, since now both X and Y will attempt to define the same method, resulting in an error:

```jl
WARNING: Method definition isapprox(T, T) where {T <: X.StructFromX} in module X at
  […]/X/src/X.jl:[…] overwritten in module Y at
  […]/Y/src/Y.jl:[…].
ERROR: Method overwriting is not permitted during Module precompilation.

```

The attempted fix therefore breaks every _earlier_ version of Y, that is compatible with the existing major version of X. It’s retroactively breaking releases of Y.

There are at least two ways to do this without breaking earlier releases:

1. Release a breaking version of X. But this feels off – piracy was committed by Y, not X, so X should not pay any price to fix this.
2. Retroactively compat bound Y in the General registry, capping all earlier (pirating) versions of Y to the version of X that did not define the `isapprox` method. This should ideally then be done _before_ the new version of X is released.

* * *

In my context, the situation was the following:

- I had at one point split out a sub-package Bravais (X) from a parent package Crystalline (Y). By some oversight, I had forgotten to transfer an `isapprox` method definition from Crystalline to Bravais – and belatedly realized it a few days ago, years after the split. So, obviously not intentional piracy, but simply imperfectly thorough copy-pasting work; but the same result. For now, I’ve tried to [fix it via path 2 above](https://github.com/JuliaRegistries/General/pull/178629).

But I can see a tempting route to commit the same fallacy:

- I am developing both packages Y and X (Y depending on X). I realize that X really ought to have defined methods so-and-so on its types, but want the development of Y to move fast, so I just pirate-define them temporarily in Y, intending to transfer them properly to X later. If I register a version of Y with the piracy, that version will be broken if I ever do this transfer.

A final consideration is the ability of the authors of X to break Y:

- If I am the author of X but not of Y, and for whatever reason am adversarially inclined toward Y, then I can break all earlier releases of Y if it has pirated any method of X: I simply define the pirated method in X and release a non-breaking version of X.

---

<div class="post-metadata">

**Author:** ![kimikage](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kimikage/32/14534_2.png) [@kimikage](https://discourse.julialang.org/u/kimikage)\
**Post date:** [December 3, 2026, 9:13am UTC](https://discourse.julialang.org/t/other-bad-consequences-of-piracy-breaking-earlier-package-releases/143496/2 "2026-12-03T09:13:24Z")

</div>

I feel like some important assumptions are missing here.

Why is it that only X gets a new version while Y is stuck on the old one? In most cases, Y should be able to release a patch version that supports both the new X and the legacy X. (It’s tedious, sure, but you can release patch versions for past major and minor versions too.)

Of course, there will be cases where it just doesn’t work out, but those should be edge cases. And sure, this is a valid reason to avoid casual piracy, but for people doing piracy out of necessity, it’s nothing more than wishful thinking.

If you interpret things strictly, a lot of packages are engaging in piracy against `Base`. But it hasn’t really been much of a problem. You shouldn’t overlook the effort that goes into preventing issues behind the scenes. That said, many of these are avoidable problems.

---

<div class="post-metadata">

**Author:** ![tchr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tchr/32/15138_2.png) [@tchr](https://discourse.julialang.org/u/tchr)\
**Post date:** [December 3, 2026, 9:30am UTC](https://discourse.julialang.org/t/other-bad-consequences-of-piracy-breaking-earlier-package-releases/143496/3 "2026-12-03T09:30:29Z")

</div>

> [@kimikage](#):
>
> Why would X jump to a new version while Y stays on the old one? In many cases, Y should be able to release a patch version that supports both the new X and the traditional X.

It wouldn’t, cf. (see added emphasis)

> A new non-breaking release of X is made with the new method, and a **new release of Y is also made with the piracy removed.**

The point is that it breaks the _old_ Y versions.

Example:

- The pirating Y is `"0.a.b"` and the pirated X is `"0.w.q"`. We assume Y’s compat bound on X is `X = "0.w"`.
- We add the pirated methods to X, and release `"0.w.q+1"`; similarly, we remove them from `Y`, and release `"0.a.b+1"`.
- The newly released version of Y works just fine, of course: the problem is all earlier versions of Y (including `"0.a.b"`) whose compat of X was limited to `X = "0.w"`; for them to continue working, those compat bounds have to be retroactively updated to `"0.w - 0.w.q"`.

Just to be clear: I’m not arguing that there’s anything wrong with the compat design, just noting down for future record that this is an additional detrimental possible outcome of piracy (one that I hadn’t been aware of before).

---

<div class="post-metadata">

**Author:** ![kimikage](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kimikage/32/14534_2.png) [@kimikage](https://discourse.julialang.org/u/kimikage)\
**Post date:** [December 3, 2026, 9:46am UTC](https://discourse.julialang.org/t/other-bad-consequences-of-piracy-breaking-earlier-package-releases/143496/4 "2026-12-03T09:46:14Z")

</div>

So, Y “0.a.b+1” should support both X “0.w.q” and X “0.w.q+1”.

For example, ColorTypes.jl pirates methods for types from FixedPointNumbers.jl, and it works whether or not FixedPointNumbers.jl defines those methods itself.

> <https://github.com/JuliaGraphics/ColorTypes.jl/blob/eb5bb6c9aa6fabf15d9262e04a8b04801b919ea7/src/operations.jl#L153-L158>

The biggest lesson here isn’t whether piracy is good or bad — it’s that the authors of X and Y should just get along.

---

<div class="post-metadata">

**Author:** ![tchr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tchr/32/15138_2.png) [@tchr](https://discourse.julialang.org/u/tchr)\
**Post date:** [December 3, 2026, 10:31am UTC](https://discourse.julialang.org/t/other-bad-consequences-of-piracy-breaking-earlier-package-releases/143496/5 "2026-12-03T10:31:10Z")

</div>

The issue is _not_ Y at `"0.a.b+1"`: avoiding an issue there is trivial (it can just bump its compat on X). The issue is only for Y at earlier pirating versions with non-capped X versions at `"0.w"`.  
There is no problem if everyone updates to the most recent version of everything: the issue is strictly in breaking earlier versions unintentionally.

You’re right though, that if intentional piracy is needed, the right way to do it is to do behind the kind of guard your example has. That’s a good point: it’s a way to commit piracy _deliberately_ without being at risk of this particular trap.

(But my example is not of the deliberate kind: it was _non-deliberate_ piracy and the trouble I encountered when trying to fix it. So no lesson intended; and certainly, being the author of X and Y here, I do my best to get along with myself)

---

<div class="post-metadata">

**Author:** ![kimikage](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kimikage/32/14534_2.png) [@kimikage](https://discourse.julialang.org/u/kimikage)\
**Post date:** [December 3, 2026, 10:59am UTC](https://discourse.julialang.org/t/other-bad-consequences-of-piracy-breaking-earlier-package-releases/143496/6 "2026-12-03T10:59:32Z")

</div>

It is true that older versions can sometimes break.  
But that has nothing to do with piracy anymore. It doesn’t matter whether it’s intentional or not.  
There’s a “leap” in the logic there.

An important convention is not to create a “leap” within a patch release series. Even a single patch version should introduce an overlap.  
That way, the likelihood of the package manager “breaking” things by leaving you with only X updated and only Y outdated is greatly reduced.
