Mold linker: targeting macOS/iOS now requires a commercial license
github.com
github.com
I honestly hope he succeeds in this endeavor. It shows you can do a one-person open source project and still live off of it.
https://twitter.com/rui314/status/1593464571586830336
See Licensing on https://github.com/rui314/mold/releases/tag/v1.7.0
Also `sold` is a genius name.
All software should be free-as-in-freedom, but not nescessarily free-as-in-£; though I acknowledge that the former without the latter is often problematic. Plus, even beyond the "moral should", practically speaking, going non-FOSS this means it gets excluded from GNU/Linux distro packages, which IMO would be a fatal hit for something like this.
But honestly, I'm fine with this move. It's still FOSS for FOSS-systems, while support for non-FOSS systems is non-FOSS. The folks who care about free-as-in-freedom won't be affected by this. And even then, the non-FOSS `sold` is source-available, which covers 3 of the 4 freedoms; and IMO that missing freedom is the least important.
> I still suspect they won't succeed. How many businesses are so constrained by link times on Mac that they're willing to pay to reduce them? (And go through the admin effort of paying for something.)
A reasonable amount of software is "free-as-in-£ for personal use, paid for professional use." Lots of orgs are willing to ask individual devs "are there any dev tools you use that we should be paying for" and are willing to pay the $50/mo for IntelliJ, so $10/mo for `sold` seems to me like it stands a chance? Note that `sold` is still free-as-in-£ for use in CI/CD, and is only paid for individual-developer use.
I completely agree. If you believe "software should be Free!", then you're going to be using a Linux (or other FOSS) system, not MacOS. On top of that, Apple users are happy to pay through the nose for Apple products, plus apps in the Apple app store. Many studies have shown that app developers make much more money in the Apple app store than in the Google Play store, because Apple users love spending money on stuff, and Android users tend to be much more frugal. Apple users were the ones totally happy to throw away their wired headphones and rush out and buy $150 AirPods when Apple took away their headphone jacks. So this company is smart with this move: make the product a paid product for that group of users that has proven they're happy to spend lots of money on things. If anything, this company might have erred by not pricing it high enough to make it look like a luxury purchase.
Or maybe they are not as rich, since Apple is essentially a filter for "people who are willing to spend 700+ for a phone". Or they have more choices with better free/cheaper applications. Or they are able to pirate.
In the US, though, there's definitely a perception that Apple is for richer people and Android is for cheapskates.
But yes, it is a filter, which is why business tend to start out on iOS for early revenue numbers, and only port to Android a year later at the earliest. If you start out on Android, you'll inherently have lower revenue numbers, and spending time on your Android app is basically burning money when you're still in your Angel/Series A phases.
The relevant part of the EULA [1] states:
> Individuals who use the Software only occasionally, or non-interactive use of the Software that is not explicitly invoked by an individual such as CI/CD (continuous integration/continuous delivery), are not considered Active Interactive-use Users ("AIUs"). No additional fees are required for such uses.
I had to read it multiple times to understand the CI/CD bit. It's not clear to me whether the EULA says that CI/CD is an example of "use that is explicitly invoked by an individual" or if it's an example of "non-interactive use that is not explicitly invoked by an individual" - the wording is unclear to me and can have either of the opposite interpretations.
At my day job, we occasionally test C++ code changes by compiling in a CI/CD system to obtain a container image that we can push into a staging environment. This means we have a develop-compile-test cycle where the "compile" step involves pushing to a merge request branch, waiting for CI/CD to finish, and then running a deploy script to push out the newly-built image for testing. I wonder if this would be considered "Active Interactive-use Use" or not.
[1] https://github.com/bluewhalesystems/sold/blob/main/LICENSE.m...
I agree that it’s hard to interpret, but isn’t the whole point of CI/CD that developers don’t start builds explicitly? For example, your example doesn’t mention it. You push to a branch, then wait for the build to finish, but never explicitly start it.
So, it seems they want to allow free use in CI/CD setups. Unfortunately, there are a lot of other ways to implicitly invoke the linker. Your typical IDE may already do that when you click “Run” instead of “Build”. I can easily see a lawyer argue that running make qualifies as explicit invocation, too.
> non-interactive use of the Software that is not explicitly invoked by an individual
...then we get "use of the Software that is interactive or explicitly invoked by an individual".
I would say that running make to run sold to run/test/ship an executable, or clicking "Run" to invoke sold and test the app, or pushing a branch to run CI that runs sold to obtain an executable to run/test/ship, all easily should be considered to be AIU - after all, in all cases it's a person clicking a button (or typing a command), waiting for it to run, and then doing something with the result.
For better or worse, iOS is not a niche target.
What's far worse than macOS not being a server OS is the hardware you're forced to contend with. Apple makes no server hardware. You end up with a disgusting hodgepodge of vendors making offerings that are largely redundancy in the way of massive falovers of mac minis. It's very unfortunate and makes self hosting or specifically (hardware or otherwise) needs extremely difficult.
Long link times are not specific to OS X / iOS. Large C++ codebases are some of the worst offenders and emit obscene numbers of relocations and DWARF symbols (or similar) into object files that bog linkers down. KDE, Firefox and Chrome browsers instantly come to mind. Rust and GHC generated object files also take a whiiiiiiiile to link[0].
On the businesses being constrainted by the link times subject more specifically. Über posted an article a while back enunciating the shenanigans they have to go through to build their iOS app (the app download at some point measured in a 300Mb+ vicinity): https://www.uber.com/en-GB/blog/how-uber-deals-with-large-io... . From the «Build Times» section of the blog post:
> The default pipeline builds the app in 21 minutes; the new pipeline with no machine outlining takes 53 minutes, which includes about 7 minutes of llvm-link, 14 minutes opt, 11 minutes of llc and 3 minutes of the system linker. One round of outlining takes about 7 minutes in llc, and 2 rounds take 9 minutes. Each additional round adds progressively less extra time, usually under 30 seconds. Overall, 5 rounds of outlining builds in 66 minutes — a 45-minutes addition to the baseline.
So, a default CI/CD build with no outlining heuristics applied spends 10 mins (7 + 3) out of a total of 53 mins in the linker. That is for a single CI/CD run.
And, since at least company has funded the work on fixing relocatable file generation in mold, there is indeed at least some demand:
> GHC (Glasgow Haskell Compiler) in particular uses re-linkable object files as dynamic libraries instead of real .so files, and it didn't work with mold. Now, mold can produce object files that GHC can load. Note that this work was funded by Mercury, so thanks to the company to help us improve the product.
[0] Fun fact: I have measured the memory throughput at the GHC linking time (via LLVM lld); it averages 65Gb/sec, and it can occasionally shoot over 70Gb/sec. So a faster linker still matters.
If it just works and I need to make sure I shell over the appropriate amount for our usecase it will already be easier.
If I need to pay up front to see how much real world gain we would get I am much likely not to do it. (Looking at you EE graalvm specifically now.)
Forget that for a moment. Economically speaking, there's tons of free competition and it doesn't have any real problems. That means the market price for a linker is $0. As you point out, people aren't going to pay for a faster one.
This instantly kills a lot of goodwill and puts "sold" into "unavailable" rather than "expensive" bucket.
A license for a major version number? And then buy a new license for the next major bump up?
Okay fine.
But a never-ending fire hose of money coming out of my bank account is big nope. I have enough small monthly recurring charges, thanks.
EDIT: "Sublime Text license keys are no longer tied to a single major version, instead they are now valid for all updates within 3 years of purchase" - looks like I'm a pirate then.
Why? This is an altogether better arrangement unless they take over 3 years to release the next major version.
If it actually works as an alternative linker option for static linked Haskell builds using ghc on osx I will happily pay for this. But I need more info about the suport surface area they are committing to!
"Link fast: Improve build and launch times"
https://developer.apple.com/videos/play/wwdc2022/110362
However, I guess you're right, very few business will care enough to use anything else.
The mold author previously stated that they had several $BigCorp businesses asking about a macOS version and that they were eager about it. I don't have more details other than that (I don't even know which companies), but it seems there is some interest.
… and I’m developing on macOS, re-linking a large project hundreds of times a day.
What kind of dev team doesn't multitask?
Apart from edge-cases involving linking large projects synchronously, there's no competitive advantage and the feature set is far less than lld, bfd, or even gold. It's a niche "product" most people don't need.
That's what async CI/CD unit and integration testing are for.
Also, it depends on the platform. Go doesn't have this problem. Rust does, to a degree. Interpreted languages make a linker moot.
The primary use case for mold is giant projects with massive executables. It's not a general-purpose linker, it can't improve inefficient workflows lacking automation, and it can't improve the multitasking of developer time for people who insist on waiting around instead of doing something else useful.
Ok, so what’s the point of contention here? Large projects from large companies with lots of money stand to benefit from mold.
It does.
In incremental builds, most of the time are spent in linking, not building.
Many projects don't have cutting edge build systems.
I'm also not committing temporary code just to make the CI produce a build that I'll need to download. I'll build locally.
What you’re suggesting is certainly the ideal case, but there are lots of things that can happen between where you are and where you want to end up. Saying that somebody isn’t a professional developer just because they haven’t reached the ideal state yet is bullshit.
It’s also easy to go around telling other people what they are or aren’t when you haven’t had the responsibility of building these building blocks yourself. You’re the user of them, not the creator of them. Have some respect for the giants whose shoulders you’re standing upon.
While I often do finish other development related tasks during longer builds, it doesn't make sense to context switch to something completely different during a 1-2 minute delay. I will build dozens of times a day while testing or optimizing functionality, so this can really add up.
That said recent versions of clang + lld + fission result in <20 sec compile+link times even on a multi-gigabyte executable, so the need for mold is significantly lessened. Users that are currently using gold will see a dramatic improvement.
Do you not have automated unit and integration testing?
Do you not have code review and CI before code lands?
Do you not have distributed, cached, incremental builds?
Improving build time isn’t just about changing 30-minute builds to 30-second builds, but also about changing 30-second builds into 2-second builds.
I understand that using the linker purely for trying it out internally and not actually distributing anything linked by it would not trigger the AGPL in the same way that using it in production would, but our general policy is to err on the side of safety when it comes to things like this; for example, despite longing for some of the unstable features of the nightly version of rustfmt like being able to auto-merge imports, we currently don't use it due to not wanting anything related to the nightly toolchain in the CI we use for release builds in order to be extra sure that we don't accidentally ship anything unstable (think of it sort of like a layer of "defense in depth" for the build processes due to our product being in a highly sensitive security domain). The bad reputation that larger companies have with regards to free software licenses (which in many cases is probably deserved) means that the managers and teams who genuinely want to respect licenses and be community members and therefore would be the ones who normally _would_ be ideal customers for products like this instead tend to be incredibly risk averse about GPL-related software precisely because we want to avoid being part of the problem. I'm not really sure what the long-term solution here is, but I feel like the only path out of this local minimum is for both potential developers and customers of free software to signal eagerness to engage with potential partners on the other side in good faith. Instead, my reading of most of the communications about mold's commercial potential seem to be proactively defensive with a tinge of resentment. I fully empathize with these feelings and probably would feel the similarly if not even stronger in the same situation, but ultimately that's why I have no personal interest in pursuing entrepreneurship myself; being in the right isn't always going to be sufficient for succeeding in business, and sometimes the best strategy will be to be to give the benefit of the doubt even if it hasn't yet been earned.
From the README.md:
mold is available under AGPL. Note that that does not mean that you have to license your program under AGPL if you use mold to link your program. An output of the mold linker is a derived work of the object files and libraries you pass to the linker but not a derived work of the mold linker itself.
In the same way, the sold linker is not legal to use except within its license, but this has no bearing on the binaries produced, as those are not derived work of the sold linker. The binaries produced are unrestricted, only using the sold linker in the first place is the issue.If it were a derived work, like maybe mold produces a binary that yanks some mold code, the story would be different: https://www.gnu.org/software/bison/manual/html_node/Conditio...
Why should I forgo all the robustness that gnu ld gives me and use an AGPL linker to save some cpu cycle while relying perhaps my most important build component on this thing?
No, thanks. And no amount of downvotes will help that , either.