Non-deterministic call ordering in downstream crates
Maintainers usually reply within 1 day
@robjtede is already working on this.
Since Sep 25, 2026.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
Research direction
The issue is about non-deterministic call ordering in compiled output affecting downstream crates. Look at the guard methods (Get, Post) in actix_web::guard and how they are used in resource definitions. The diffoscope output shows swapped calls. Investigate the code generation or macro expansion that leads to this ordering. Reproducing requires building a downstream crate multiple times and comparing assembly. The fix likely involves ensuring deterministic ordering in macro or code generation.
Written by the indexing model from the issue text.
Description
https://github.com/actix/actix-web/pull/4090 was closed as slop. Unfortunately, it fixed a real issue in that crates using some actix-web methods, when compiled, can have a different call ordering in the output. Example diffoscope output:
│ │ ├── objdump --line-numbers --disassemble --demangle --reloc --no-show-raw-insn --section=.text {}
│ │ │ @@ -4507744,21 +4507744,21 @@
│ │ │ lea 0x158(%rsp),%rdi
│ │ │ lea 0x200(%rsp),%rsi
│ │ │ lea -0x1d7c588(%rip),%rdx
│ │ │ mov $0x14,%ecx
│ │ │ call 1fbcf40 <<actix_web::resource::Resource>::name>
│ │ │ movb $0x1,0x3b7(%rsp)
│ │ │ lea 0x2d8(%rsp),%rdi
│ │ │ + call 2021a20 <actix_web::guard::Get>
│ │ │ - call 2021a80 <actix_web::guard::Post>
│ │ │ lea 0x2c0(%rsp),%rdi
│ │ │ lea 0x2d8(%rsp),%rsi
│ │ │ call 109e510 <actix_web::guard::Any::<actix_web::guard::MethodGuard>>
│ │ │ movb $0x1,0x3b6(%rsp)
│ │ │ lea 0x2f0(%rsp),%rdi
│ │ │ + call 2021a80 <actix_web::guard::Post>
│ │ │ - call 2021a20 <actix_web::guard::Get>
│ │ │ movb $0x0,0x3b6(%rsp)
│ │ │ lea 0x2a8(%rsp),%rdi
│ │ │ lea 0x2c0(%rsp),%rsi
│ │ │ lea 0x2f0(%rsp),%rdx
│ │ │ call f30190 <<actix_web::guard::AnyGuard>::or::<actix_web::guard::MethodGuard>>
│ │ │ movb $0x0,0x3b6(%rsp)
│ │ │ movb $0x0,0x3b7(%rsp)
Expected Behavior
Downstream crates should have deterministic call ordering.
Current Behavior
Downstream crates can have re-ordered calls between different builds.
Possible Solution
I'm not a rust developer, so I can't speak to the quality of the slop solution. However, some kind of deterministic ordering for these methods does appear to fix downstream build reproducibility problems. I will consult with an actual rust developer on our team to see if there's a better solution, and will propose a PR with a hand-written comment explaining the need.
Steps to Reproduce (for bugs)
The original reproducer in the slop PR seems to match what we're doing in our non-public code.
Context
Some distros are moving towards enforcing build reproducibility: https://lwn.net/Articles/1072314/
Your Environment
- Rust Version (I.e, output of
rustc -V): rustc 1.95.0 (59807616e 2026-04-14) - Actix Web Version: 4.9.0
- Dominant language
- Rust
- Stars
- 24.9k
- Forks
- 2k
- Avg merge
- 19h 9m
- Merged PRs (30d)
- 61
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from actix/actix-web
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
[actix-multipart] Generic "Payload error" when request exceeds size limitPossibly taken @robjtede claimed this 47 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
actix/actix-web#4168 · 4 comments · 1 assignee ·
Maintainers usually reply within 1 day
-
Change `HttpRequest::content_type` to return `Option<&str>`Possibly taken @Sruhvx-jpg claimed this 65 days ago. OpenA-http
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
actix/actix-web#3797 · 1 comment ·
Maintainers usually reply within 1 day
-
A-web C-improvement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
actix/actix-web#2666 · 4 comments · 2 reactions ·
Maintainers usually reply within 1 day
-
A-http A-web
Difficulty 4/5 3-5 days Newbie friendliness 20/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
aws/aws-emulator#30 · 1 comment ·
-
tormach-plasma refusal text with no machine reads "no machine is not declared a plasma machine"Openarea:post bug effort:low P2 source:agent
Difficulty 1/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Chat images never show without ImageMagick: ffprobe fallback uses an option string ffprobe 9 rejectsOpen
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
eliasstravik/herdr-projects#1011 ·
-
design-data-spec
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
adobe/spectrum-design-data#1744 ·
Maintainers usually reply within 1 day