Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always strip in release mode #5745

Merged
merged 1 commit into from
Aug 3, 2024
Merged

Always strip in release mode #5745

merged 1 commit into from
Aug 3, 2024

Conversation

konstin
Copy link
Member

@konstin konstin commented Aug 3, 2024

Decreases linux release wheel size by 2MB.

See rust-lang/cargo#14346

Fixes #5683

@konstin konstin added the enhancement New feature or improvement to existing functionality label Aug 3, 2024
@konstin konstin merged commit 0098173 into main Aug 3, 2024
57 checks passed
@konstin konstin deleted the konsti/strip-properly branch August 3, 2024 11:11
@charliermarsh
Copy link
Member

Should we make the same change in Ruff?

@konstin
Copy link
Member Author

konstin commented Aug 3, 2024

Yes, i expect it'll be some time until a fix in cargo lands on stable.

charliermarsh pushed a commit that referenced this pull request Aug 8, 2024
## Summary

In the same spirit as #5745, release builds could be a bit slightly more
size efficient by enabling LTO, which removes dead code (either in uv
through fully inlined functions or the libraries it depends on). Also
has the side-effect (more what LTO was created for) of slighly speeding
up uv.

In this case, I have measured a 5MB size decrease!.

Unfortunately, this change also comes with the disadvantage of more than
doubling the build time of a clean build on my machine (see "Test
Plan"). I have opened this pull request to show my findings and suggest
this as an option.

*I have also started looking into what effects optimizing for size
rather than speed could have, but that calls for another pr*

## Test Plan

Comparing the binary size before and after (starting off in just a
simple clone of the repository)

System info:
```
CPU: AMD Ryzen 7 3700X (16) @ 3.600GHz
Memory: 32GB @ 3200 MT/s
Uname: Linux galaxy 6.6.44-1-MANJARO #1 SMP PREEMPT_DYNAMIC Sat Aug  3 10:09:33 UTC 2024 x86_64 GNU/Linux
```

Before:
```
$ cargo build --release
<snip>
Finished `release` profile [optimized] target(s) in 1m 29s

$ du target/release/uv -h
30M	target/release/uv
```

After:
```
$ cargo build --release
<snip>
Finished `release` profile [optimized] target(s) in 3m 43s

$ du target/release/uv -h
25M	target/release/uv
```
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Aug 10, 2024
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [astral-sh/uv](https://github.com/astral-sh/uv) | patch | `0.2.33` -> `0.2.35` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>astral-sh/uv (astral-sh/uv)</summary>

### [`v0.2.35`](https://github.com/astral-sh/uv/blob/HEAD/CHANGELOG.md#0235)

[Compare Source](astral-sh/uv@0.2.34...0.2.35)

##### CLI

-   Deprecate `--system` and `--no-system` in `uv venv` ([#&#8203;5925](astral-sh/uv#5925))
-   Make `--upgrade` imply `--refresh` ([#&#8203;5943](astral-sh/uv#5943))
-   Warn when there are missing bounds on transitive dependencies with `--resolution-strategy lowest` ([#&#8203;5953](astral-sh/uv#5953))

##### Configuration

-   Add support for `no-build-isolation-package` ([#&#8203;5894](astral-sh/uv#5894))

##### Performance

-   Enable LTO optimizations in release builds to reduce binary size ([#&#8203;5904](astral-sh/uv#5904))
-   Prefetch metadata in `--no-deps` mode ([#&#8203;5918](astral-sh/uv#5918))

##### Bug fixes

-   Display portable paths in POSIX virtual environment activation commands ([#&#8203;5956](astral-sh/uv#5956))
-   Respect subdirectories when locating Git workspaces ([#&#8203;5944](astral-sh/uv#5944))

##### Documentation

-   Improve the `uv venv` CLI documentation ([#&#8203;5963](astral-sh/uv#5963))

### [`v0.2.34`](https://github.com/astral-sh/uv/blob/HEAD/CHANGELOG.md#0234)

[Compare Source](astral-sh/uv@0.2.33...0.2.34)

##### Enhancements

-   Always strip in release mode ([#&#8203;5745](astral-sh/uv#5745))
-   Assume `git+` prefix when URLs end in `.git` ([#&#8203;5868](astral-sh/uv#5868))
-   Support build constraints ([#&#8203;5639](astral-sh/uv#5639))

##### CLI

-   Create help sections for build, install, resolve, and index ([#&#8203;5693](astral-sh/uv#5693))
-   Improve CLI documentation for global options ([#&#8203;5834](astral-sh/uv#5834))
-   Improve `--python` CLI documentation ([#&#8203;5869](astral-sh/uv#5869))
-   Improve display order of top-level commands ([#&#8203;5830](astral-sh/uv#5830))

##### Bug fixes

-   Allow downloading wheels for metadata with `--no-binary` ([#&#8203;5707](astral-sh/uv#5707))
-   Reject `pyproject.toml` in `--config-file` ([#&#8203;5842](astral-sh/uv#5842))
-   Remove double-proxy nodes in error reporting ([#&#8203;5738](astral-sh/uv#5738))
-   Respect pre-release preferences from input files ([#&#8203;5736](astral-sh/uv#5736))
-   Support overlapping local and non-local requirements in forks ([#&#8203;5812](astral-sh/uv#5812))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40NDAuNyIsInVwZGF0ZWRJblZlciI6IjM3LjQ0MC43IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiXX0=-->
ibraheemdev added a commit that referenced this pull request Sep 10, 2024
## Summary

The CodSpeed flamegraphs are currently useless after
#5745.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or improvement to existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider stripping uv release binaries
2 participants