-
Notifications
You must be signed in to change notification settings - Fork 31
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
[features]: Package Manager Integration and Categorized #54
Comments
@Sunrisepeak |
now, nodejs is already installed by binary package. |
xvm module will be easy to implement and control when use binary pcakge to install nodejs(or other |
You can't always suppose users do what you want to do. Users may use their own version manager or handle it manually. You need to suppose the worst condition. |
Another problem I mentioned is the collision of (general) parents of a package. (not a sibling of a package), That means, if whole packages can be viewed as a multiple combination of trees. For every tree, each vertex has a relation map for |
A radical implementation is to preinstall version manager and call the version manager first. The package could transfer a part of role to version manager and maintain a stronger connection (We don't need to maintain a version list for these packages, because they can do better than us, all we need to do is to detect, resolve collision of these managers rather than packages, and partially call those managers.). For those package without version manager or unneeded retain the same. awesome-version-managers |
A possible solution for manager in pub enum SystemPackageManager {
// BSD
Pkg,
Pkgin,
// Linux
Apk,
Apt,
Dnf,
Pacman,
Yum,
// MacOS
#[serde(alias = "homebrew")]
Brew,
// Windows
#[serde(alias = "chocolatey")]
Choco,
Scoop,
}
pub fn detect() -> Result<..> {}
pub fn config() -> Result<..> {} Command control: pub enum CommandType {
/// Installs a system dependency.
InstallPackage,
/// Updates the registry index.
UpdateIndex,
}
/// The CLI argument format for enabling interactive mode.
#[derive(Clone, Debug)]
pub enum PromptArgument {
/// Does not support interactive.
None,
/// Enables interactive mode: `-i`
Interactive(String),
/// Disables interactive mode: `-y`
Skip(String),
}
/// The CLI argument format for including the package version to install.
#[derive(Clone, Debug)]
pub enum VersionArgument {
/// Does not support versions.
None,
/// In the same argument with the package name: `pkg=1.2.3`
Inline(String),
/// As a separate argument: `pkg --version 1.2.3`
Separate(String),
}
/// Configuration for a specific package manager vendor.
/// The fields define commands and arguments for common operations.
#[derive(Clone, Debug)]
pub struct PackageManagerConfig {
/// Mapping of command types to CLI arguments.
pub commands: HashMap<CommandType, Vec<String>>,
/// How interactive/prompt arguments are handled.
pub prompt_arg: PromptArgument,
/// List of commands that support prompts.
pub prompt_for: Vec<CommandType>,
/// How version arguments are handled.
pub version_arg: VersionArgument,
} |
A possible solution of config -- class define
-- runtime.config (contains local, global etc..)
config = {
possble setting
}
-- runtime.configFile (exist? global? local?)
-- runtime.configManager (detect and manage) |
Refactor package index referring
-- api design in package referring to `proto`:
-- output: json file parse
-- register
register_tool()
-- env
detect_version()
load_version()
locate_executable()
-- installation
download_native()
downlaod_prebuilt() |
xvm shouldnt process system's package-manager directly. install/uninstall can use xim to complete, xvm only need to focus on version control for software and env-workspace. example
(xvm-module consider to write by rust) |
That's mean you abandon the installation by system package manager, so what you have done in previous construction? Here, version semantics is necessary and unrelated to |
installation by system package manager, they are not support multi-version management(core reason), but xpm can do, because it can track installation path. (use symlink or xlings_bashrc to ref to target version)
|
You could isolate the part as I said and postpone that. Actually |
Features Describe | 功能描述
As title.
Usage Scenario | 需求背景/使用场景
Clean and selectable.
C#
anddotnet
, becauseC#
is contained indotnet,
alsoF#
,Visual Basic
... I guess same problem occur in other packages.Node
,C
,C++
, there's a missing exposition for its underneath manager. (fnm
could be used on Windows, so fornvm for Windows
, we should give the freedom for users.)npm
is installed with node, butpnpm
isn't).Maybe Solutions | 可能的实现方案 - (if you are developer)
xlings
. (Construction of env. Index shouldn't take over the role of env management)node
,deno
,bun
is runtime of js, but it's independent, so doesn't collide, however,nvm
andfnm
may collide, so parents of a package must be single in a certain env)Additional context | 额外补充
The text was updated successfully, but these errors were encountered: