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

[Bug]: Can't update git-versioning based crates on shuttle #1333

Closed
1 task done
rootCircle opened this issue Oct 22, 2023 · 3 comments
Closed
1 task done

[Bug]: Can't update git-versioning based crates on shuttle #1333

rootCircle opened this issue Oct 22, 2023 · 3 comments
Labels
S-Investigation This issue needs further investigation or design to figure out a solution T-Bug Something isn't working

Comments

@rootCircle
Copy link

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

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

  • I have searched the issues and there are none like this.
@rootCircle rootCircle added S-Triage Awaiting decision for what to do T-Bug Something isn't working labels Oct 22, 2023
@rootCircle rootCircle changed the title [Bug]: Can't updating git versioning based crates on shuttle [Bug]: Can't update git-versioning based crates on shuttle Oct 23, 2023
@jonaro00 jonaro00 added S-Investigation This issue needs further investigation or design to figure out a solution and removed S-Triage Awaiting decision for what to do labels Oct 23, 2023
@jonaro00
Copy link
Member

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.

@rootCircle
Copy link
Author

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 #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 :-)

@jonaro00
Copy link
Member

The new builder on shuttle.dev builds from scratch and uses docker layer caching with cargo-chef. This should no longer be an issue on there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-Investigation This issue needs further investigation or design to figure out a solution T-Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants