SHA256
1
0
forked from pool/juliaup

Accepting request 1144762 from science

- Remove improve-error-message-if-version-or-channel-is-not-installed.patch as
  this is part of the patches now.
- Update to version 0.13.0:
  * Fix formatting
  * Move the clap def structs to separate file
  * change wording for comment for help text
  * format: run cargo fmt.
  * improvement: new message for `juliaup self uninstall command` if feature
    `selfupdate` is disabled
  * cleanup: add a period for each info/error messages.
  * refactor: remove redundant versiondb_data. also remove
    versiondb_data.available_versions since users cant access those
  * Fix usage of drop
  * Update all deps
  * Replace unmaintained action-rs actions
  * Don't detect ttyname if it is not needed
  * Describe 'julia +channel' after primary help text
  * juliaup-init.sh: backport changes from rustup
  * fixup: message should be more clear and generic
  * Try removing an unused import.
  * Only register the CTRL-C handler when it's safe to do so.
  * Format code.
  * Use double fork to prevent zombies.
  * launcher: replace parent process on supported platforms.
  * fix other error messages as well
  * fix error message on tests channel selection
  * fix an oopsie on one of the messages
  * run cargo fmt
  * remove redundant use
  * remove comment. irrelevant and unrelated now
  * make julialauncher have saner error messages for channels and versions

OBS-URL: https://build.opensuse.org/request/show/1144762
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/juliaup?expand=0&rev=15
This commit is contained in:
Ana Guerrero 2024-02-07 17:49:18 +00:00 committed by Git OBS Bridge
commit 29818e1bf1
7 changed files with 46 additions and 256 deletions

View File

@ -1,21 +1,7 @@
<services>
<service mode="manual" name="obs_scm">
<param name="url">https://github.com/JuliaLang/juliaup</param>
<param name="versionformat">@PARENT_TAG@</param>
<param name="scm">git</param>
<param name="revision">c5df6faf6cdb26951bf378e1633a0cf4bfe77a78</param>
<param name="versionrewrite-pattern">v(.*)</param>
<param name="versionrewrite-replacement">\1</param>
<param name="changesgenerate">enable</param>
</service>
<service mode="manual" name="tar" />
<service mode="manual" name="recompress">
<param name="file">*.tar</param>
<param name="compression">zstd</param>
</service>
<service mode="manual" name="set_version"/>
<service mode="manual" name="download_files" />
<service name="cargo_vendor" mode="manual">
<param name="srcdir">juliaup</param>
<param name="src">juliaup*.tar.gz</param>
<param name="compression">zst</param>
<param name="update">true</param>
</service>

View File

@ -1,230 +0,0 @@
From 6c5918a2dc7926927c0b35c795eafca006652776 Mon Sep 17 00:00:00 2001
From: Soc Virnyl Estela <contact@uncomfyhalomacro.pl>
Date: Sun, 10 Dec 2023 16:53:32 +0800
Subject: [PATCH 1/7] make julialauncher have saner error messages for channels
and versions
Signed-off-by: Soc Virnyl Estela <contact@uncomfyhalomacro.pl>
---
src/bin/julialauncher.rs | 46 +++++++++++++++++++++++++++++++++++++---
1 file changed, 43 insertions(+), 3 deletions(-)
diff --git a/src/bin/julialauncher.rs b/src/bin/julialauncher.rs
index 1201237f..0290c764 100644
--- a/src/bin/julialauncher.rs
+++ b/src/bin/julialauncher.rs
@@ -159,13 +159,53 @@ fn get_julia_path_from_channel(
juliaupconfig_path: &Path,
juliaup_channel_source: JuliaupChannelSource,
) -> Result<(PathBuf, Vec<String>)> {
+ use juliaup::global_paths::get_paths;
+ use juliaup::versions_file::load_versions_db;
+
+ let paths = get_paths().with_context(|| "Trying to load all global paths.")?;
+ let versiondb_data =
+ load_versions_db(&paths).with_context(|| "command failed to load versions db.")?;
+ // TODO Use versiondb data instead of config_data.
+ // RATIONALE:
+ // Using versiondb.available_channels is more useful
+ // because we can just check if the channel provided by the user
+ // is also a valid channel of the versiondb.available_channels.
+ // Because having to error because it's not installed yet
+ // running `julialauncher` by itself will download and run
+ // latest release of julia is inconsistent behavior.
+ // So we should check for available_channels instead of installed
+ // channels.
let channel_info = config_data
.installed_channels
.get(channel)
.ok_or_else(|| match juliaup_channel_source {
- JuliaupChannelSource::CmdLine => UserError { msg: format!("ERROR: Invalid Juliaup channel `{}` at command line.", channel).to_string() }.into(),
- JuliaupChannelSource::EnvVar => UserError { msg: format!("ERROR: Invalid Juliaup channel `{}` in environment variable JULIAUP_CHANNEL.", channel).to_string() }.into(),
- JuliaupChannelSource::Override => UserError { msg: format!("ERROR: Invalid Juliaup channel `{}` in directory override.", channel).to_string() }.into(),
+ JuliaupChannelSource::CmdLine => {
+ if versiondb_data.available_channels.contains_key(channel) {
+ UserError { msg: format!("`{}` is not installed. Please run `juliaup add {}` to install channel or version", channel, channel) }
+ } else if versiondb_data.available_versions.contains_key(channel) {
+ UserError { msg: format!("`{}` is not installed. Please run `juliaup add {}` to install channel or version", channel, channel) }
+ } else {
+ UserError { msg: format!("ERROR: Invalid Juliaup channel `{}` is not installed. Please run `juliaup list` to check a valid channel or version", channel) }
+ }
+ }.into(),
+ JuliaupChannelSource::EnvVar=> {
+ if versiondb_data.available_channels.contains_key(channel) {
+ UserError { msg: format!("`{}` for environment variable JULIAUP_CHANNEL is not installed. Please run `juliaup add {}` to install channel or version", channel, channel) }
+ } else if versiondb_data.available_versions.contains_key(channel) {
+ UserError { msg: format!("`{}` for environment variable JULIAUP_CHANNEL is not installed. Please run `juliaup add {}` to install channel or version", channel, channel) }
+ } else {
+ UserError { msg: format!("ERROR: Invalid Juliaup channel `{}` in environment variable JULIAUP_CHANNEL. Please run `juliaup list` to check a valid channel or version", channel) }
+ }
+ }.into(),
+ JuliaupChannelSource::Override=> {
+ if versiondb_data.available_channels.contains_key(channel) {
+ UserError { msg: format!("`{}` for directory override is not installed. Please run `juliaup add {}` to install channel or version", channel, channel) }
+ } else if versiondb_data.available_versions.contains_key(channel) {
+ UserError { msg: format!("`{}` for directory override is not installed. Please run `juliaup add {}` to install channel or version", channel, channel) }
+ } else {
+ UserError { msg: format!("ERROR: Invalid Juliaup channel `{}` in directory override. Please run `juliaup list` to check a valid channel or version", channel) }
+ }
+ }.into(),
JuliaupChannelSource::Default => anyhow!("The Juliaup configuration is in an inconsistent state, the currently configured default channel `{}` is not installed.", channel)
})?;
From a0bac66c6c52f3cd32086f337c714c35b01a3c4d Mon Sep 17 00:00:00 2001
From: Soc Virnyl Estela <contact@uncomfyhalomacro.pl>
Date: Sun, 10 Dec 2023 16:58:11 +0800
Subject: [PATCH 2/7] remove comment. irrelevant and unrelated now
Signed-off-by: Soc Virnyl Estela <contact@uncomfyhalomacro.pl>
---
src/bin/julialauncher.rs | 10 ----------
1 file changed, 10 deletions(-)
diff --git a/src/bin/julialauncher.rs b/src/bin/julialauncher.rs
index 0290c764..1744103a 100644
--- a/src/bin/julialauncher.rs
+++ b/src/bin/julialauncher.rs
@@ -165,16 +165,6 @@ fn get_julia_path_from_channel(
let paths = get_paths().with_context(|| "Trying to load all global paths.")?;
let versiondb_data =
load_versions_db(&paths).with_context(|| "command failed to load versions db.")?;
- // TODO Use versiondb data instead of config_data.
- // RATIONALE:
- // Using versiondb.available_channels is more useful
- // because we can just check if the channel provided by the user
- // is also a valid channel of the versiondb.available_channels.
- // Because having to error because it's not installed yet
- // running `julialauncher` by itself will download and run
- // latest release of julia is inconsistent behavior.
- // So we should check for available_channels instead of installed
- // channels.
let channel_info = config_data
.installed_channels
.get(channel)
From 62650cd4c627a71c2b3e0d7e6a6e6046290d7b79 Mon Sep 17 00:00:00 2001
From: Soc Virnyl Estela <contact@uncomfyhalomacro.pl>
Date: Sun, 10 Dec 2023 16:59:38 +0800
Subject: [PATCH 3/7] remove redundant use
Signed-off-by: Soc Virnyl Estela <contact@uncomfyhalomacro.pl>
---
src/bin/julialauncher.rs | 2 --
1 file changed, 2 deletions(-)
diff --git a/src/bin/julialauncher.rs b/src/bin/julialauncher.rs
index 1744103a..043aff82 100644
--- a/src/bin/julialauncher.rs
+++ b/src/bin/julialauncher.rs
@@ -159,8 +159,6 @@ fn get_julia_path_from_channel(
juliaupconfig_path: &Path,
juliaup_channel_source: JuliaupChannelSource,
) -> Result<(PathBuf, Vec<String>)> {
- use juliaup::global_paths::get_paths;
- use juliaup::versions_file::load_versions_db;
let paths = get_paths().with_context(|| "Trying to load all global paths.")?;
let versiondb_data =
From e50633b22cd6b949ee45eb8a16d81d8d6edb287d Mon Sep 17 00:00:00 2001
From: Soc Virnyl Estela <contact@uncomfyhalomacro.pl>
Date: Sun, 10 Dec 2023 17:00:15 +0800
Subject: [PATCH 4/7] run cargo fmt
Signed-off-by: Soc Virnyl Estela <contact@uncomfyhalomacro.pl>
---
src/bin/julialauncher.rs | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/bin/julialauncher.rs b/src/bin/julialauncher.rs
index 043aff82..32c43112 100644
--- a/src/bin/julialauncher.rs
+++ b/src/bin/julialauncher.rs
@@ -159,7 +159,6 @@ fn get_julia_path_from_channel(
juliaupconfig_path: &Path,
juliaup_channel_source: JuliaupChannelSource,
) -> Result<(PathBuf, Vec<String>)> {
-
let paths = get_paths().with_context(|| "Trying to load all global paths.")?;
let versiondb_data =
load_versions_db(&paths).with_context(|| "command failed to load versions db.")?;
From ccd1dcbdb6735e0488e6b3fbd0602cf388cd4b64 Mon Sep 17 00:00:00 2001
From: Soc Virnyl Estela <contact@uncomfyhalomacro.pl>
Date: Sun, 10 Dec 2023 17:31:12 +0800
Subject: [PATCH 5/7] fix an oopsie on one of the messages
Signed-off-by: Soc Virnyl Estela <contact@uncomfyhalomacro.pl>
---
src/bin/julialauncher.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/bin/julialauncher.rs b/src/bin/julialauncher.rs
index 32c43112..8487fb4e 100644
--- a/src/bin/julialauncher.rs
+++ b/src/bin/julialauncher.rs
@@ -172,7 +172,7 @@ fn get_julia_path_from_channel(
} else if versiondb_data.available_versions.contains_key(channel) {
UserError { msg: format!("`{}` is not installed. Please run `juliaup add {}` to install channel or version", channel, channel) }
} else {
- UserError { msg: format!("ERROR: Invalid Juliaup channel `{}` is not installed. Please run `juliaup list` to check a valid channel or version", channel) }
+ UserError { msg: format!("ERROR: Invalid Juliaup channel `{}`. Please run `juliaup list` to check a valid channel or version", channel) }
}
}.into(),
JuliaupChannelSource::EnvVar=> {
From e692fe981462316ba21360e8945acf7c583dc380 Mon Sep 17 00:00:00 2001
From: Soc Virnyl Estela <contact@uncomfyhalomacro.pl>
Date: Sun, 10 Dec 2023 17:41:59 +0800
Subject: [PATCH 6/7] fix error message on tests channel selection
Signed-off-by: Soc Virnyl Estela <contact@uncomfyhalomacro.pl>
---
tests/channel_selection.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/channel_selection.rs b/tests/channel_selection.rs
index 35034837..1ac9da7b 100644
--- a/tests/channel_selection.rs
+++ b/tests/channel_selection.rs
@@ -99,7 +99,7 @@ fn channel_selection() {
.env("JULIAUP_DEPOT_PATH", depot_dir.path())
.assert()
.failure()
- .stderr("ERROR: Invalid Juliaup channel `1.8.6` at command line.\n");
+ .stderr("ERROR: Invalid Juliaup channel `1.8.6`. Please run `juliaup list` to check a valid channel or version\n");
Command::cargo_bin("julialauncher")
.unwrap()
From d8233b717001f198033106e2cb68712fa3c2a217 Mon Sep 17 00:00:00 2001
From: Soc Virnyl Estela <contact@uncomfyhalomacro.pl>
Date: Sun, 10 Dec 2023 17:46:27 +0800
Subject: [PATCH 7/7] fix other error messages as well
Signed-off-by: Soc Virnyl Estela <contact@uncomfyhalomacro.pl>
---
tests/channel_selection.rs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/channel_selection.rs b/tests/channel_selection.rs
index 1ac9da7b..58867da1 100644
--- a/tests/channel_selection.rs
+++ b/tests/channel_selection.rs
@@ -111,7 +111,7 @@ fn channel_selection() {
.assert()
.failure()
.stderr(
- "ERROR: Invalid Juliaup channel `1.7.4` in environment variable JULIAUP_CHANNEL.\n",
+ "ERROR: Invalid Juliaup channel `1.7.4` in environment variable JULIAUP_CHANNEL. Please run `juliaup list` to check a valid channel or version\n",
);
Command::cargo_bin("julialauncher")
@@ -124,5 +124,5 @@ fn channel_selection() {
.env("JULIAUP_CHANNEL", "1.7.4")
.assert()
.failure()
- .stderr("ERROR: Invalid Juliaup channel `1.8.6` at command line.\n");
+ .stderr("ERROR: Invalid Juliaup channel `1.8.6`. Please run `juliaup list` to check a valid channel or version\n");
}

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0baf567ec84fb60431c2aad90b43e36575f0ec0c4f8e3cebdff1649c2e43bc7b
size 699087

3
juliaup-1.13.0.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:2dc9a457e42432084dda423486b20e578f8c843a0314ef2677b05e843714ff3a
size 794880

View File

@ -1,3 +1,38 @@
-------------------------------------------------------------------
Sun Jan 14 00:32:19 UTC 2024 - Soc Virnyl Estela <uncomfy+openbuildservice@uncomfyhalomacro.pl>
- Remove improve-error-message-if-version-or-channel-is-not-installed.patch as
this is part of the patches now.
- Update to version 0.13.0:
* Fix formatting
* Move the clap def structs to separate file
* change wording for comment for help text
* format: run cargo fmt.
* improvement: new message for `juliaup self uninstall command` if feature
`selfupdate` is disabled
* cleanup: add a period for each info/error messages.
* refactor: remove redundant versiondb_data. also remove
versiondb_data.available_versions since users cant access those
* Fix usage of drop
* Update all deps
* Replace unmaintained action-rs actions
* Don't detect ttyname if it is not needed
* Describe 'julia +channel' after primary help text
* juliaup-init.sh: backport changes from rustup
* fixup: message should be more clear and generic
* Try removing an unused import.
* Only register the CTRL-C handler when it's safe to do so.
* Format code.
* Use double fork to prevent zombies.
* launcher: replace parent process on supported platforms.
* fix other error messages as well
* fix error message on tests channel selection
* fix an oopsie on one of the messages
* run cargo fmt
* remove redundant use
* remove comment. irrelevant and unrelated now
* make julialauncher have saner error messages for channels and versions
-------------------------------------------------------------------
Tue Dec 12 19:37:00 UTC 2023 - Soc Virnyl Estela <uncomfy+openbuildservice@uncomfyhalomacro.pl>

View File

@ -1,7 +1,7 @@
#
# spec file for package juliaup
#
# Copyright (c) 2023 SUSE LLC
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -18,18 +18,17 @@
# We will keep this for now
%global oldest_supported_julia_version 0.7.0
%global latest_julia_version 1.8.3
%global latest_julia_version 1.10.1
Name: juliaup
Version: 1.12.5
Version: 1.13.0
Release: 0
Summary: Julia installer and version multiplexer
License: (0BSD OR MIT OR Apache-2.0) AND Apache-2.0 AND (Apache-2.0 OR BSL-1.0) AND (Apache-2.0 OR ISC OR MIT) AND (Apache-2.0 OR MIT) AND (Apache-2.0 OR Apache-2.0 WITH LLVM-exception OR MIT) AND (Apache-2.0 OR MIT OR Zlib) AND (Apache-2.0 OR MIT OR Zlib) AND (MIT OR Unlicense) AND (Apache-2.0 OR Zlib OR MIT) AND Apache-2.0 AND ISC AND MIT AND MPL-2.0 AND MIT
Group: Development/Languages/Other
URL: https://github.com/JuliaLang/juliaup
Source0: %{name}-%{version}.tar.zst
Source0: https://github.com/JuliaLang/juliaup/archive/refs/tags/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
Source1: vendor.tar.zst
Patch0: https://patch-diff.githubusercontent.com/raw/JuliaLang/juliaup/pull/767.patch#/improve-error-message-if-version-or-channel-is-not-installed.patch
BuildRequires: cargo-packaging
BuildRequires: rust+cargo
BuildRequires: zstd

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:5aa24130a16c3d8c497b966770020c795748d6abb606d2fe19bb26f042c47a7f
size 39463808
oid sha256:d5b83cef64073237f362692f9a21b47fa2e7d45ccab604eb9e340bfbf160c3d2
size 35595748