better story for local dependencies

Đang mở
#363 0 bình luận 2 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
25/100
Loại issue
Tính năng
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
rust, wasm
Lĩnh vực
build-system, tooling

Hướng nghiên cứu

Xem xét cách các dependency .wit cục bộ hiện đang được phản ánh trong Cargo.toml và Cargo-component.lock được sử dụng như thế nào. Đánh giá hành vi được đề xuất với registry mặc định và ghi đè cục bộ, cùng với hướng TOML riêng có thể có; công việc được xem là hoàn tất khi đã thống nhất một thiết kế phân giải dependency có cơ sở và phù hợp cho tương lai.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

this is more of a discussion point than a definite bug or feature request, but I figured it could help to share my anecdotal experience and a pain point, maybe someone will have ideas about how to improve.

When I point to a wit on a registry, everything just works, all dependencies are resolved automatically, I don't need to do anything "extra".

However, when I point to a wit locally, I have to redefine the dependencies in Cargo.toml

This feels a bit weird - if it's already denoted in the .wit, why do I need to redefine these same exact dependencies again?

From a technical perspective - I think I see a problem here, and it does make sense to punt on this until there's a well-reasoned solution: when you define the dependencies locally, you have a choice of loading them from the registry (i.e. semver syntax) or loading locally (i.e. a direct path), and, in fact, one might think that the default should be to load locally in this case - but in practice, this is usually not what you actually want to do (i.e. I might be working on my local custom wit, but it depends on wasi::io, but I have no need to maintain a local copy of that)

My handwavey suggestion would be to not force listing the dependencies locally, make it so that everything "just works" by following the .wit and loading dependencies from the registry, but if the user lists the dependencies in their Cargo.toml (i.e. they are working on that too locally), then it overrides this default.

That said - I understand there's ongoing work to move away from Cargo-component.lock, perhaps make all of this more language-agnostic with a separate toml file, etc... needs careful thought to resolve this issue with future-proofing in mind :)

Ngôn ngữ chính
Rust
Star
593
Fork
68
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của bytecodealliance/cargo-component

Tất cả issue của bytecodealliance/cargo-component

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.