shuttle
shuttle copied to clipboard
[Bug]: Can't update git-versioning based crates on shuttle
What happened?
Description
I'm facing a deployment issue with Rust and Shuttle. I'm developing an Axum server that serves output from an external library that uses git-based versioning. When I run cargo update locally, it updates the git-based crates to the latest commit, which is what I want. However, when deploying using Shuttle, the commit heads of the crates seem to remain pinned to the initial deployment's commit, unless there is an actual version change in the library.
I tried using cargo shuttle clean
and made sure the Cargo.lock is updated, but the issue persists. I've discussed this in Discord and we suspect it might be a caching issue, but we're not sure how to resolve it.
Is there a way to force Shuttle to update git-based crates to the latest commit during deployment? How can I ensure that my deployed server uses the latest version of the library with git-based versioning?
Any insights or advice on how to resolve this issue would be greatly appreciated.
Ongoing Discord Discussion: https://discord.com/channels/803236282088161321/1165786552392224799
Steps to reproduce
Here are the steps to reproduce the bug on your local system
Fork https://github.com/zenlang-rs/zen-lang
git clone https://github.com/zenlang-rs/backend.git
cd backend
# In cargo.toml file, Change the git link to a repo that you have hosted in (forking etc)
cargo build && cargo shuttle deploy
Now, go back and run these commands
git clone https://github.com/<your-username>/zen-lang.git
cd zen-lang
# make some changes in output of get_version() output and commit and push
Now, again redeploy
cd backend
cargo update
cargo shuttle run # this works as expected, chanegs are reflected here locally
cargo shuttle deploy # the output remains unchanged, as the new commit head is not reflected on server
Extra Info
- Backend Repo : https://github.com/zenlang-rs/backend
- Library Link: https://github.com/zenlang-rs/zen-lang
Expected Output : https://zenlang.shuttleapp.rs/api/health should have given version to be testv3
for Compiler Version (based on the one in zen-lang repo in lib)
Version
v0.29.1
Which operating system(s) are you seeing the problem on?
In deployment
Which CPU architectures are you seeing the problem on?
In deployment
Relevant log output
No response
Duplicate declaration
- [X] I have searched the issues and there are none like this.
Making cargo shuttle clean
also clean the cargo cache might solve this, but the building process will soon be revamped anyways #1547.
To force cargo to re-fetch you can use the rev = "..."
field to point to a specific commit.
So sorry for the late reply!
Making cargo shuttle clean also clean the cargo cache might solve this, but the building process will soon be revamped anyways https://github.com/shuttle-hq/shuttle/issues/1547.
Actually as discussed earlier on discord, cargo shuttle clean didn't fixed the issue for me. It might be for reasons as lock file won't update to latest commit with cargo shuttle clean (which is intended, not a bug).
As till now, I was able to solve that using cargo update
for local checks and commit pinning as you too mentioned in for deployed one! I believe builder service might possibly fix those thing for me.
I am really excited for what the New Builder Service has to offer, will patiently wait for that! Thanks :-)