Skip to content

Respect Cargo.lock for dependencies version#4028

Merged
prsunny merged 3 commits intosonic-net:masterfrom
qiluo-msft:qiluo/locked
Dec 3, 2025
Merged

Respect Cargo.lock for dependencies version#4028
prsunny merged 3 commits intosonic-net:masterfrom
qiluo-msft:qiluo/locked

Conversation

@qiluo-msft
Copy link
Copy Markdown
Contributor

@qiluo-msft qiluo-msft commented Dec 1, 2025

What I did

Why I did it
Currently cargo update will update dependencies in the Cargo.lock file to the latest version on the specified branch. The sonic-swss-common Rust code is possibly not aligned with libswsscommon package, which will make sonic-buildimage build fail.

How I verified it
Verify local sonic-buildimage build passing, even there is sonic-swss-common changes on c-api.

Details if related

@qiluo-msft qiluo-msft requested a review from prsunny as a code owner December 1, 2025 22:28
@qiluo-msft qiluo-msft requested review from Pterosaur and Copilot and removed request for Copilot and prsunny December 1, 2025 22:28
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@saiarcot895
Copy link
Copy Markdown
Contributor

We'd still somehow need to handle the locked version being significantly different from the swss-common version/hash being used in the pipeline (as build artifacts).

prabhataravind
prabhataravind previously approved these changes Dec 2, 2025
@yue-fred-gao
Copy link
Copy Markdown

with locked, we lose the ability to automatically upgrade dependencies to pick up fixes. Are we going to manually upgrade?

Copilot AI review requested due to automatic review settings December 2, 2025 20:18
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@liushilongbuaa
Copy link
Copy Markdown
Contributor

@qiluo-msft , How about using Cargo.lock in swss, dash-ha repo for UT. When UT passed, PR can be merged into swss repo.
When advance submodule ref in sonic-buildimage repo, we add a patch in src/sonic-swss.patch/series. The patch will change Cargo.toml file change dependency swss-common from github commit to local folder(../sonic-swss-common). In this scenario, we will use Cargo.toml instead of Cargo.lock. So, in debian/rules we can't add --lock option.

qiluo-msft added a commit to sonic-net/sonic-swss-common that referenced this pull request Dec 9, 2025
…1124)

This reverts commit 7682785.

Following the proper fix sonic-swss (sonic-net/sonic-swss#4028). Now we could bring back the commit.

What I did in the PR:
Fix several potential crash issues:

unwrap() function may crash in runtime.
Drop should not crash.
Clone should not crash, so remove it.
Protect casting Duration
@mssonicbld
Copy link
Copy Markdown
Collaborator

Cherry-pick PR to 202511: #4051

@r12f
Copy link
Copy Markdown

r12f commented Dec 9, 2025

hi @qiluo-msft , I wonder if you could help pick this PR to 202412 as well?

@qiluo-msft qiluo-msft deleted the qiluo/locked branch December 9, 2025 19:59
qiluo-msft added a commit to qiluo-msft/sonic-swss that referenced this pull request Dec 9, 2025
Why I did it
Currently cargo update will update dependencies in the Cargo.lock file to the latest version on the specified branch. The sonic-swss-common Rust code is possibly not aligned with libswsscommon package, which will make sonic-buildimage build fail.

How I verified it
Verify local sonic-buildimage build passing, even there is sonic-swss-common changes on c-api.
@qiluo-msft
Copy link
Copy Markdown
Contributor Author

hi @qiluo-msft , I wonder if you could help pick this PR to 202412 as well?

ack

mssonicbld added a commit to mssonicbld/sonic-swss-common that referenced this pull request Dec 10, 2025
…onic-net#1118)

Following the proper fix sonic-swss (sonic-net/sonic-swss#4028). Now we could bring back the commit.

What I did in the PR:
Fix several potential crash issues:
1. unwrap() function may crash in runtime.
2. Drop should not crash.
3. Clone should not crash, so remove it.
4. Protect casting Duration
vmittal-msft added a commit to sonic-net/sonic-swss-common that referenced this pull request Dec 11, 2025
…1136)

Following the proper fix sonic-swss (sonic-net/sonic-swss#4028). Now we could bring back the commit.

What I did in the PR:
Fix several potential crash issues:
1. unwrap() function may crash in runtime.
2. Drop should not crash.
3. Clone should not crash, so remove it.
4. Protect casting Duration

Co-authored-by: Vineet  Mittal <46945843+vmittal-msft@users.noreply.github.com>
gpunathilell pushed a commit to gpunathilell/sonic-swss that referenced this pull request Dec 12, 2025
Why I did it
Currently cargo update will update dependencies in the Cargo.lock file to the latest version on the specified branch. The sonic-swss-common Rust code is possibly not aligned with libswsscommon package, which will make sonic-buildimage build fail.

How I verified it
Verify local sonic-buildimage build passing, even there is sonic-swss-common changes on c-api.
kalash-nexthop pushed a commit to kalash-nexthop/sonic-swss that referenced this pull request Dec 16, 2025
Why I did it
Currently cargo update will update dependencies in the Cargo.lock file to the latest version on the specified branch. The sonic-swss-common Rust code is possibly not aligned with libswsscommon package, which will make sonic-buildimage build fail.

How I verified it
Verify local sonic-buildimage build passing, even there is sonic-swss-common changes on c-api.

Signed-off-by: Kalash Nainwal <kalash@nexthop.ai>
@r12f
Copy link
Copy Markdown

r12f commented Dec 27, 2025

Cherry pick here: Azure/sonic-swss.msft#184

Pterosaur pushed a commit to Janetxxx/sonic-swss that referenced this pull request Jan 6, 2026
Why I did it
Currently cargo update will update dependencies in the Cargo.lock file to the latest version on the specified branch. The sonic-swss-common Rust code is possibly not aligned with libswsscommon package, which will make sonic-buildimage build fail.

How I verified it
Verify local sonic-buildimage build passing, even there is sonic-swss-common changes on c-api.
baorliu pushed a commit to baorliu/sonic-swss that referenced this pull request Feb 23, 2026
Why I did it
Currently cargo update will update dependencies in the Cargo.lock file to the latest version on the specified branch. The sonic-swss-common Rust code is possibly not aligned with libswsscommon package, which will make sonic-buildimage build fail.

How I verified it
Verify local sonic-buildimage build passing, even there is sonic-swss-common changes on c-api.

Signed-off-by: Baorong Liu <96146196+baorliu@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.