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

Support declaring a default (required?) registry url #1887

Open
maciektr opened this issue Jan 15, 2025 · 0 comments
Open

Support declaring a default (required?) registry url #1887

maciektr opened this issue Jan 15, 2025 · 0 comments

Comments

@maciektr
Copy link
Contributor

Problem

Dependencies in the Scarb toml manifest can be defined either as version requirement (dep = "1.2.3") or a detailed dependency (dep = { version = "1.2.3", registry = "https://some.registry" }).
This alternatives has been defined in

pub enum TomlDependency {
/// [`VersionReq`] specified as a string, e.g. `package = "<version>"`.
Simple(VersionReq),
/// Detailed specification as a table, e.g. `package = { version = "<version>" }`.
Detailed(Box<DetailedTomlDependency>),
}
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
#[serde(rename_all = "kebab-case")]
pub struct DetailedTomlDependency {
pub version: Option<VersionReq>,
/// Relative to the file it appears in.
pub path: Option<RelativeUtf8PathBuf>,
pub git: Option<Url>,
pub branch: Option<String>,
pub tag: Option<String>,
pub rev: Option<String>,
pub registry: Option<Url>,
}

A detailed dependency of package from registry can define an optional url of the registry that should be used.

In case a dependency is specified as a version requirement (without registry url), a default registry is assumed. The default registry is https://scarbs.xyz/.

Consider adding an option to override default registry.

This could potentially serve to purposes:

  • Use different than official registry for testing purposes
  • Use a registry that you own and trust to access a limited / audited set of packages only (should it allow specifying different registry url in deps?)

Solving this task should include researching how changing registry to serve dependencies is solved in other package managers.

Also see: #1434

Proposed Solution

No response

Notes

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Triage
Development

No branches or pull requests

1 participant