actix / actix/actix-web

Non-deterministic call ordering in downstream crates

Đang mở
#4,149 3 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Rust
Star
24.8k
Fork
1.9k
Merge trung bình
23 giờ 10 phút
Pull request đã merge (30 ngày)
26

Mô tả

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 <::name>
│ │ │ movb $0x1,0x3b7(%rsp)
│ │ │ lea 0x2d8(%rsp),%rdi
│ │ │ + call 2021a20
│ │ │ - call 2021a80
│ │ │ lea 0x2c0(%rsp),%rdi
│ │ │ lea 0x2d8(%rsp),%rsi
│ │ │ call 109e510 >
│ │ │ movb $0x1,0x3b6(%rsp)
│ │ │ lea 0x2f0(%rsp),%rdi
│ │ │ + call 2021a80
│ │ │ - call 2021a20
│ │ │ movb $0x0,0x3b6(%rsp)
│ │ │ lea 0x2a8(%rsp),%rdi
│ │ │ lea 0x2c0(%rsp),%rsi
│ │ │ lea 0x2f0(%rsp),%rdx
│ │ │ call f30190 <::or::>
│ │ │ 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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.