04 Apr 2026
Planet Mozilla
The Rust Programming Language Blog: docs.rs: building fewer targets by default
Building fewer targets by default
On 2026-05-01, docs.rs will make a breaking change to its build behavior.
Today, if a crate does not define a targets list in its docs.rs metadata, docs.rs builds documentation for a default list of five targets.
Starting on 2026-05-01, docs.rs will instead build documentation for only the default target unless additional targets are requested explicitly.
This is the next step in a change we first introduced in 2020, when docs.rs added support for opting into fewer build targets. Most crates do not compile different code for different targets, so building fewer targets by default is a better fit for most releases. It also reduces build times and saves resources on docs.rs.
This change only affects:
- new releases
- rebuilds of old releases
How is the default target chosen?
If you do not set default-target, docs.rs uses the target of its build servers: x86_64-unknown-linux-gnu.
You can override that by setting default-target in your docs.rs metadata:
[]
= "x86_64-apple-darwin"
How do I build documentation for additional targets?
If your crate needs documentation to be built for more than the default target, define the full list explicitly in your Cargo.toml:
[]
= [
"x86_64-unknown-linux-gnu",
"x86_64-apple-darwin",
"x86_64-pc-windows-msvc",
"i686-unknown-linux-gnu",
"i686-pc-windows-msvc"
]
When targets is set, docs.rs will build documentation for exactly those targets.
docs.rs still supports any target available in the Rust toolchain. Only the default behavior is changing.
04 Apr 2026 12:00am GMT
The Rust Programming Language Blog: Changes to WebAssembly targets and handling undefined symbols
Rust's WebAssembly targets are soon going to experience a change which has a risk of breaking existing projects, and this post is intended to notify users of this upcoming change, explain what it is, and how to handle it. Specifically, all WebAssembly targets in Rust have been linked using the --allow-undefined flag to wasm-ld, and this flag is being removed.
What is --allow-undefined?
WebAssembly binaries in Rust today are all created by linking with wasm-ld. This serves a similar purpose to ld, lld, and mold, for example; it takes separately compiled crates/object files and creates one final binary. Since the first introduction of WebAssembly targets in Rust, the --allow-undefined flag has been passed to wasm-ld. This flag is documented as:
--allow-undefined Allow undefined symbols in linked binary. This options
is equivalent to --import-undefined and
--unresolved-symbols=ignore-all
The term "undefined" here specifically means with respect to symbol resolution in wasm-ld itself. Symbols used by wasm-ld correspond relatively closely to what native platforms use, for example all Rust functions have a symbol associated with them. Symbols can be referred to in Rust through extern "C" blocks, for example:
unsafe extern "C"
The symbol mylibrary_init is an undefined symbol. This is typically defined by a separate component of a program, such as an externally compiled C library, which will provide a definition for this symbol. By passing --allow-undefined to wasm-ld, however, it means that the above would generate a WebAssembly module like so:
(module
(import "env" "mylibrary_init" (func $mylibrary_init))
;; ...
)
This means that the undefined symbol was ignored and ended up as an imported symbol in the final WebAssembly module that is produced.
The precise history here is somewhat lost to time, but the current understanding is that --allow-undefined was effectively required in the very early days of introducing wasm-ld to the Rust toolchain. This historical workaround stuck around till today and hasn't changed.
What's wrong with --allow-undefined?
By passing --allow-undefined on all WebAssembly targets, rustc is introducing diverging behavior between other platforms and WebAssembly. The main risk of --allow-undefined is that misconfiguration or mistakes in building can result in broken WebAssembly modules being produced, as opposed to compilation errors. This means that the proverbial can is kicked down the road and lengthens the distance from where the problem is discovered to where it was introduced. Some example problematic situations are:
-
If
mylibrary_initwas typo'd asmylibraryinitthen the final binary would import themylibraryinitsymbol instead of calling the linkedmylibrary_initC symbol. -
If
mylibrarywas mistakenly not compiled and linked into a final application then themylibrary_initsymbol would end up imported rather than producing a linker error saying it's undefined. -
If external tooling is used to process a WebAssembly module, such as
wasm-bindgenorwasm-tools component new, these tools don't know what to do with"env"imports by default and they are likely to provide an error message of some form that isn't clearly connected back to the original source code and where the symbols was imported from. -
For web users if you've ever seen an error along the lines of
Uncaught TypeError: Failed to resolve module specifier "env". Relative references must start with either "/", "./", or "../".this can mean that"env"leaked into the final module unexpectedly and the true error is the undefined symbol error, not the lack of"env"items provided.
All native platforms consider undefined symbols to be an error by default, and thus by passing --allow-undefined rustc is introducing surprising behavior on WebAssembly targets. The goal of the change is to remove this surprise and behave more like native platforms.
What is going to break, and how to fix?
In theory, not a whole lot is expected to break from this change. If the final WebAssembly binary imports unexpected symbols, then it's likely that the binary won't be runnable in the desired embedding, as the desired embedding probably doesn't provide the symbol as a definition. For example, if you compile an application for wasm32-wasip1 if the final binary imports mylibrary_init then it'll fail to run in most runtimes because it's considered an unresolved import. This means that most of the time this change won't break users, but it'll instead provide better diagnostics.
The reason for this post, however, is that it's possible users could be intentionally relying on this behavior. For example your application might have:
unsafe extern "C"
// ...
And then perhaps some JS code that looks like:
;
Effectively it's possible for users to explicitly rely on the behavior of --allow-undefined generating an import in the final WebAssembly binary.
If users encounter this then the code can be fixed through a #[link] attribute which explicitly specifies the wasm_import_module name:
unsafe extern "C"
// ...
This will have the same behavior as before and will no longer be considered an undefined symbol to wasm-ld, and it'll work both before and after this change.
Affected users can also compile with -Clink-arg=--allow-undefined as well to quickly restore the old behavior.
When is this change being made?
Removing --allow-undefined on wasm targets is being done in rust-lang/rust#149868. That change is slated to land in nightly soon, and will then get released with Rust 1.96 on 2026-05-28. If you see any issues as a result of this fallout please don't hesitate to file an issue on rust-lang/rust.
04 Apr 2026 12:00am GMT
03 Apr 2026
Planet Mozilla
Mozilla Localization (L10N): Enhancing Comment Management in Pontoon
We're excited to highlight the work of Serah Nderi, a volunteer contributor to Pontoon who has quickly made a meaningful impact on the project. Since getting involved earlier this year, Serah has contributed a steady stream of improvements - including 10 patches in just the past two months - ranging from good-first issues to fully fledged features.
Serah joined the Mozilla community as an Outreachy intern on the SpiderMonkey team, where she demonstrated both strong technical skills and a passion for languages. That combination naturally led her to Pontoon, where she has been contributing not only as a developer but also as a localizer, exploring translations for languages like Kiswahili and Kikuyu.
Her latest contribution introduces long-awaited functionality for editing and deleting comments in Pontoon, improving collaboration and moderation workflows for translators and project managers alike.
You can follow Serah's work on GitHub and connect with her on LinkedIn.
Last year, I earned a B1 certification in German and TOPIK I certification in Korean. This year, I decided to explore something at the intersection of technology and languages, which led me to start contributing to Pontoon.
Pontoon is Mozilla's web-based localization platform, used by thousands of contributors to translate Firefox and other Mozilla projects into hundreds of languages.
I began by adding Kiswahili translations and exploring localization for my mother tongue, Kikuyu. While Kikuyu doesn't yet have a project manager and presents unique challenges, it made the experience even more interesting. After working on a few good-first issues, I decided to take on a larger challenge: implementing a full feature-the ability for users to edit and delete comments.
Previously, users could only add comments. If a comment contained a typo or needed clarification, the only option was to add another comment. This often led to cluttered discussions and made collaboration less efficient. I set out to improve this experience.
Under the hood
The frontend implementation had a natural starting point. Pontoon comments already included actions like pinning, so adding Edit and Delete followed a similar interaction pattern.
One of the main challenges was handling comment content. Comments in Pontoon are stored as serialized HTML paragraphs with support for @mentions. To enable editing, I needed to deserialize this stored content back into the editor so that users would see a fully functional input field pre-populated with their original comment-including mentions. When saving, the content is serialized again before being stored.
In addition to the UI changes, I implemented the backend views for editing and deleting comments, along with the necessary tests. The final result allows users to edit and delete their own comments, while project managers can delete any comment for moderation purposes.
This feature makes discussions in Pontoon more flexible, reduces noise from duplicate comments, and improves the overall collaboration experience for localization teams.
03 Apr 2026 10:00am GMT

