microsoft / ripgrep-prebuilt

Builds ripgrep on Azure Pipelines for multiple platforms and makes the binaries available as Github releases
MIT License
46 stars 15 forks source link

Prebuilt provides debug builds #15

Closed fxha closed 1 year ago

fxha commented 2 years ago

We recently noticed that our build size suddenly increased after updating dependencies. The reasons for this is a 40MB ripgrep application with debug information on Linux (other OSs not tested). I hope you can fix this issue and provide a release version without debug information. Thanks in advance!

$ file vscode-ripgrep/bin/rg
rg: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=153fc3eda21c189844e41173c5c07bd6738fde4c, with debug_info, not stripped

Edit: Target x86_64-unknown-linux-musl

roblourens commented 2 years ago

Good catch, we are supposed to run strip, but that changed in https://github.com/microsoft/ripgrep-prebuilt/pull/12/files#diff-76d4e149397662fc7816e58b93b9f29d24f27bc395874ca1e090ad6037477ea1R17. cc @deepak1556, I will just remove that condition, I don't think it's needed.

roblourens commented 2 years ago

Oh I see, so there is no strip for musl builds...

roblourens commented 2 years ago

@deepak1556 I can't find any way to strip the musl builds, do you have any idea?

fxha commented 2 years ago

@roblourens You likely build ripgrep via sources, right? Are there any reasons to build a release version with debug information and strip it before packing? Otherwise you could set debug=0 in Cargo.toml or remove the entry completely.

roblourens commented 2 years ago

Thanks @fxha I'll try that

deepak1556 commented 2 years ago

We build from https://github.com/BurntSushi/ripgrep and the debug info is set in the release profile https://github.com/BurntSushi/ripgrep/blob/0b36942f680bfa9ae88a564f2636aa8286470073/Cargo.toml#L80, I don't think we can override it during build via cargo ?

fxha commented 2 years ago

Of course you can overwrite repo configs with a cargo profile by creating a file named ~/.cargo/config.toml with following content:

[profile.release]
debug = false

Please see https://doc.rust-lang.org/cargo/reference/profiles.html for more details.

kkocdko commented 1 year ago

@roblourens This problem seems solved, make a new release please? It saved size a lot in vscode package.