axodotdev / axodotdev/cargo-dist
Rework Symbol Support
- Dominant language
- Rust
- Stars
- 2.1k
- Forks
- 149
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 32
Description
I've disabled all symbols pending this redesign of the feature, due to several issues:
* People's builds were failing to find/build symbols and dying due to us messing up or them setting flags like `strip=true`
* The resulting output had dubious usefulness due to #116
I propose two fixes:
## Fix 1: We shouldn't consider it a hard error to fail to generate a pdb
This creates an awkward situation with `manifest --artifacts=all`, due to a lack of #45. I think rather than "solving" #45 we should just add an `optional: true` field to dist-manifest.json indicating the symbols artifacts are ok to fail. Then we should also change `cargo dist build` to silently remove `optional: true` entries from its output if they indeed failed (preventing CI from trying to upload nothing). Someone reading dist-manifest.json then just needs to accept that they might fail to fetch those (seems fine).
## Fix 2: We should unconditionally wrap every kind of symbol file in a zip
That will allow us to preserve the name rustc/cargo told us was the Right one. This will handle the most important aspects of #116, which is getting the symbols to a server/user with the right name. The consumer of such a zip just needs to understand they have to properly spider the folder. Ideally each folder will contain one entry.
I'm not 100% sure what to name the zips and the folders they contain. This is most awkward for `blah.dSYM` because we want `blah-v1.0.0-x86_64-apple-darwin.dSYM.tar.xz` to contain a dir containing the `.dSYM` but if we just name the dir `blah-v1.0.0-x86_64-apple-darwin.dSYM` things might freak out and think it's an actual dSYM (because those are dirs!). Maybe just call the inner dir `blah-v1.0.0-x86_64-apple-darwin-dSYM`? Are tar and zip happy with that kind of rename? I think so?
Contributor guide
Research direction
Start by tracing the cargo dist build and manifest --artifacts=all entry points, using dist-manifest.json as the output contract. Define how optional symbol artifacts behave when generation fails and how every symbol file is packaged and named, including .dSYM directories. Done means the redesign decisions are settled and the resulting manifest and archives support those cases without breaking artifact consumers.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- build-system, release
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 28/100