-
Notifications
You must be signed in to change notification settings - Fork 258
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
Allow using a different linker in deployment #1000
Comments
Since the last release, #922 has been merged, which means that the locally installed cargo will be used instead of a bundled one. I think that might solve the issue you're facing. We can wait until 0.19 and see if it works. |
Thanks @jonaro00, I'll wait until the 0.19 and if the issue still persists, I'll let you know; otherwise, I'll close this issue. |
v0.19.0 should be released on Monday (19 Jun) 🤞 |
I tested this issue on v0.19 and shuttle-cli actually did read my Maybe we can add a key to Above is just a suggestion but you may have a better idea. |
Installing external dependencies is planned, not sure when it will eventually be released. |
Similar to #703 |
@that-ambuj I just realized: You can get around this issue by having your |
Yeah, I have a global |
We will consider allowing custom linkers in the upcoming building system. Not sure how possible it is though. |
cargo shuttle run
I have two ideas right now:
What do you think about this? |
The first bullet is possible now, by gitignoring, declaring assets, and using relative path to the binaries, but as you say, version+arch issues. I should let you know that "hacking" the deployer to run apt install before deployment is possible, but not pretty. #703 (comment) We could probably add something like |
In a [target.x86_64-unknown-linux-gnu]
linker = "clang"
rustflags = ["-C", "link-arg=-fuse-ld=/path/to/ld.lld"] Please note that in one of the recent releases the binary has been renamed form Also, I also want to mention https://github.com/rui314/mold which is a Linux only linker but also faster than lld. |
Cool. Does the path |
I believe the path needs to be absolute. In most cases the binaries are located in |
@that-ambuj |
@that-ambuj We're including lld and mold in 0.28.0. I tried compiling a project without and with them, but saw no difference in compile times. You can try with your project though! (soon) |
@jonaro00 Actually, there is a slight difference in build times when using lld or mold but it may be less noticable because of the overhead introduced by docker. Bigger gains happen when rebuilding and redeploying a program. |
Describe the improvement
Hi, In my rust projects, I use a different linker like
lld
ormold
for faster compile times because I use a budget laptop for coding and rust is notorious for it's slow default compile times.Lately, I have started using https://shuttle.rs for personal projects using their cli tool
cargo-shuttle
. The issue I'm facing here that when runningcargo run
orcargo build
, cargo uses my.cargo/config.toml
file to select a linker and that works out just fine and I get great compile times but when I usecargo shuttle run
to run the shuttle project locally, the project gets rebuilt using the slow, defaultgold
linker(this is just an assumption) and it takes ~15s to rebuild after every change(I usecargo watch -cx "shuttle run"
to reload on change detection) and it is very annoying to debug sessions or just run a dev server while working in general.The default binary built using
cargo build
orcargo run
is unusable because it requires some options to be set and still doesn't work the same ascargo shuttle run
.There might be two reasons for long compile times that I can think of:
cargo shuttle run
does not respect the$HOME/.cargo/config.toml
or theproject/.cargo/config.toml
file and uses the default linker every time.cargo shuttle run
builds the binary in release mode and release binaries are known for taking a long time to compile.The improvements that can be done here are:
Above are the best ideas that I could think of, but I'd really like to hear everyone's opinion and ideas about this.
Duplicate declaration
The text was updated successfully, but these errors were encountered: