Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/clp-rust-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ jobs:
shell: "bash"
run: "npm install -g @go-task/cli@3.44.0"

- name: "Validate lock files"
shell: "bash"
run: "task deps:lock:check-rust"

- name: "Lint"
shell: "bash"
run: "task lint:check-rust"
Expand Down
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 30 additions & 0 deletions taskfiles/deps/lock.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
version: "3"

includes:
toolchains: "../toolchains.yaml"

tasks:
check-rust:
cmds:
- task: "cargo-workspace-update"
vars:
CARGO_UPDATE_FLAGS: "--locked"

update-rust:
cmds:
- task: "cargo-workspace-update"
vars:
CARGO_UPDATE_FLAGS: ""

# Runs `cargo update` in the root Rust workspace directory with the specified flags.
#
# @param {string} CARGO_UPDATE_FLAGS The flags to pass to the `cargo update` command.
cargo-workspace-update:
internal: true
requires:
vars: ["CARGO_UPDATE_FLAGS"]
dir: "{{.ROOT_DIR}}"
deps: ["toolchains:rust"]
cmd: |-
Comment thread
LinZhihao-723 marked this conversation as resolved.
. "$HOME/.cargo/env"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just curious, do we have plans to install rust into clp/build/ instead of the user's home directory?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer to install to the user's home directory:

  • This would only affect developers who need to build our package from source.
  • Cargo is designed to be per-user installation. If the toolchain is already installed, it would only help you to upgrade (which shouldn't be harmful as I never heard of anyone having problems for sticking to a particular cargo version).
  • This potentially avoids a lot of toolchain problems (like version conflicts) as there're only one toolchain needed and located in a default path.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, we discussed this when @LinZhihao-723 was initially adding the task. I do think it's worth documenting somewhere though. Did we add it to the package build docs?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No we haven't. I will do it in a separate PR.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@coderabbitai Please create an issue for us to document new Rust components in CLP package. In this doc we should mention our installation approach for cargo toolchain.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Create GitHub issue for documenting Rust components in CLP package

gh issue create \
  --repo y-scope/clp \
  --title "Document Rust components and cargo toolchain installation approach" \
  --body "## Background

As part of adding Rust components to the CLP package, we need to document the new Rust components and our installation approach for the cargo toolchain.

## Documentation Requirements

- Document the new Rust components in the CLP package
- Explain the installation approach for the cargo toolchain
  - Specifically, that cargo is installed to the user's home directory rather than \`clp/build/\`
  - Rationale for this approach (per-user installation, default path, avoiding version conflicts)

## References

- PR: https://github.com/y-scope/clp/pull/1448
- Discussion: https://github.com/y-scope/clp/pull/1448#discussion_r2449502274

Requested by: @LinZhihao-723" \
  --assignee LinZhihao-723

Length of output: 42


@LinZhihao-723, I've created issue #1461 to track the documentation of Rust components and the cargo toolchain installation approach. The issue has been assigned to you and includes references to this PR and discussion.

🔗 #1461

cargo update {{.CARGO_UPDATE_FLAGS}}
1 change: 1 addition & 0 deletions taskfiles/deps/main.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
version: "3"

includes:
lock: "./lock.yaml"
utils: "./utils.yaml"
yscope-dev-utils: "../../tools/yscope-dev-utils/exports/taskfiles/utils/utils.yaml"

Expand Down
Loading