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

1.8.1 not recognised as the latest version? #406

Closed
ghyatzo opened this issue Sep 18, 2022 · 12 comments · Fixed by #454
Closed

1.8.1 not recognised as the latest version? #406

ghyatzo opened this issue Sep 18, 2022 · 12 comments · Fixed by #454

Comments

@ghyatzo
Copy link
Contributor

ghyatzo commented Sep 18, 2022

Hello,

I am encountering this message everytime i start julia

The latest version of Julia in the `release~aarch64` channel is 1.7.2+0~aarch64. You currently have `1.8.1+0.aarch64` installed. Run:

  juliaup update

to install Julia 1.7.2+0~aarch64 and update the `release~aarch64` channel to that version.

I have installed the release, release~aarch64 and release~x64 versions, and a similar message pops up with all of them.
Of course i ran juliaup update and I am at the latest version.

The installed julia versions run flawlessly though, so the functionality is not affected.

I am on an M1 mac with MacOS 12.5.1

@albheim
Copy link

albheim commented Sep 30, 2022

What version of juliaup are you running, juliaup --version? Have you tried juliaup self update?

Don't really know what I'm talking about though, but my thought was that the self update is to update juliaup itself, and if you have an old juliaup maybe it has old definitions of the channels? Unclear how you managed to get the newer versions to begin with though.

@ghyatzo
Copy link
Contributor Author

ghyatzo commented Sep 30, 2022

juliaup version is 1.7.23.
juliaup self update return

Checking for self-updates
Juliaup unchanged on channel 'release' - 1.7.23

Not really sure what you mean by this though

Unclear how you managed to get the newer versions to begin with though.

@albheim
Copy link

albheim commented Sep 30, 2022

Okay, no clue then.

Unclear how you managed to get the newer versions to begin with though.

was just in case

if you have an old juliaup maybe it has old definitions of the channels

was true, but since it seems it wasn't it can be disregarded.

@ghyatzo
Copy link
Contributor Author

ghyatzo commented Oct 7, 2022

After checking the code, and try to guess where it was taking bad informations, I suspected that I had some issues with the installation folders.
I tried to uninstall and reinstall and now it works.

by the way, the uninstalling process is waaay to aggressive. I know I had some misconfigured folders, but still, it deleted a lot of folders it wasn't supposed to. Without asking anything or doublechecking. It cost me an afternoon to reinstall everything the way it was. Please fix this.
Also, maybe don't delete the config folder in $JULIA_DEPOT_PATH, it would be nice to keep the startup.jl file between reinstalls.

shall I close this issue and open another one with these comments?

@albheim
Copy link

albheim commented Oct 7, 2022

I just tried the uninstall, and it seemed reasonable to me, the config was still there and so was any other julia related things I wouldn't expect juliaup to remove. How did you configure your julia?

Here is the code, on the surface it seems to only touch stuff it created, though I haven't gone deeper so I don't really know what is happening.
https://github.com/JuliaLang/juliaup/blob/main/src/command_selfuninstall.rs

@ghyatzo
Copy link
Contributor Author

ghyatzo commented Oct 7, 2022

I have a custom filesystem in ~/.local/ that mimicks the /usr/local/ structure, where I have a bin folder in the PATH where I symlink binaries from various packages. At the time I had juliaup and the rustup and rust toolchain installed in ~/.local/.
At first I installed juliaup there, but julia still had the JULIA_DEPOT_PATH in ~/.julia.

Then, and this is where I think broke something, changed the depot path to ~/.local/julia, and updated julia through juliaup.

Upon uninstalling juliaup, my bin folder, as well as all the rustup and cargo folders got deleted. So my guess is that juliaup somehow recognised as its homefolder ~/.local instead of ~/.local/juliaup, or something along those lines.

Maybe the culprit is

if paths.juliauphome != paths.juliaupselfhome {
        eprint!("Deleting Juliaup folder {:?}.", paths.juliaupselfhome);
        match std::fs::remove_dir_all(&paths.juliaupselfhome) {
            Ok(_) => eprintln!(" Success."),
            Err(_) => eprintln!(" Failed.")
        };
    }

which in my case seems to resolve in remove_dir_all('~/.local')...

EDIT: Yup, just confirmed:
Screenshot 2022-10-07 at 22 02 18

Why not just define a JULIAUP_HOME env variable, like rustup does? anyhow, calling remove_dir_all without checks on a folder you hope is the right one seems a bit reckless...

EDIT 2: this screenshot was taken with a fresh install.

@ghyatzo
Copy link
Contributor Author

ghyatzo commented Oct 8, 2022

I found that the main issue is me symlinking the juliaup binary to ~/.local/bin/.
Since at that point when generating the paths in global_paths.rs, my_own_path resolves to ~/.local/bin/juliaup therefore, juliaupselfbin = "~/.local/bin/" and juliaupselfhome = "~/.local/".

In a standard settings the values would be [...]/juliaup/bin/juliaup, [...]/juliaup/bin/, [...]/juliaup/.

May I propose a change on the notes of

let my_own_path = match std::env::var("JULIAUP_HOME") {
    Ok(val) => {
        let path = PathBuf::from(val.to_string().split(entry_sep).next().unwrap());
        if !path.is_absolute() { some error };
        path.join("bin").join("juliaup");
    }
    Err(_) => {
        std::end::current_exe()
            .with_context(|| "Could not determine the path of the running exe.")?;
    }
}

with JULIAUP_HOME pointing towards the juliaup folder that contains the binaries, and if not defined you fall back on the previous method of determining the juliaupselfhome.
sorry, I am a bit rusty with rust (pun intended)

@ViralBShah
Copy link
Member

I believe this is no longer an issue.

@ghyatzo
Copy link
Contributor Author

ghyatzo commented Oct 13, 2022

I believe this is no longer an issue.

I can make a PR with what was proposed above, if that is what you mean.
Or maybe my use case is too nonsense and not worth supporting? I do realise I set up things a bit unhortodoxly

@davidanthoff
Copy link
Collaborator

I'm tempted to just solve this in the following way: if a user selects an already existing folder as the install folder during the Juliaup folder, show a warning that one should not install Juliaup into an existing folder. Isn't that what we essentially want?

@davidanthoff
Copy link
Collaborator

Or we could also make the self uninstall command saver, i.e. instead of deleting the entire directory, only delete the (known) files that make up Juliaup, then check if the folders are empty and only then delete them. That actually seems by far the safest and easiest way around this.

@ghyatzo
Copy link
Contributor Author

ghyatzo commented Nov 22, 2022

I'm tempted to just solve this in the following way: if a user selects an already existing folder as the install folder during the Juliaup folder, show a warning that one should not install Juliaup into an existing folder. Isn't that what we essentially want?

I believe the main issue is not that juliaup is within an existing folder but that the self_path is based on the running executable. The juliaup filesystem works even within other directories, the only problem is having a more solid way to reference the self_path, since if you symlink the executables then the self_path is no longer the original nested bin directory withing the juliaup home but the folder that you put the symlinks into.

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

Successfully merging a pull request may close this issue.

4 participants