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

CondaPkg constantly uninstalling, reinstalling all packages #109

Open
habemus-papadum opened this issue Oct 7, 2023 · 4 comments
Open

Comments

@habemus-papadum
Copy link

Hi, On windows 11, Julia 1.9.3, CondaPkg v0.2.21, CondaPkg frequently uninstalls all packages and the reinstalls all of them when calling resolve -- this doesn't happen every single time, but maybe around 80% of the time, which is quite difficult. Is there are a way to better understand why resolve is causing this behavior?

Thanks

@habemus-papadum
Copy link
Author

The issue seems to be triggered here:

meta.load_path == load_path || return false

The C drive has different capitalization in the first entry, see below:

meta.load_path
["C:\\Users\\nehal\\src\\julia-fun\\warpsnwefts\\Project.toml", "C:\\Users\\nehal\\.julia\\environments\\v1.9\\Project.toml", "C:\\Users\\nehal\\.julia\\juliaup\\julia-1.9.3+0.x64.w64.mingw32\\share\\julia\\stdlib\\v1.9"]
load_path
["c:\\Users\\nehal\\src\\julia-fun\\warpsnwefts\\Project.toml", "C:\\Users\\nehal\\.julia\\environments\\v1.9\\Project.toml", "C:\\Users\\nehal\\.julia\\juliaup\\julia-1.9.3+0.x64.w64.mingw32\\share\\julia\\stdlib\\v1.9"]

@habemus-papadum
Copy link
Author

I haven't gotten to the bottom, but my guess it is something to do with a difference in how vscode and the julia command line specify the project on startup

@cjdoris
Copy link
Collaborator

cjdoris commented Oct 10, 2023

Well isn't that fun! You've got to love case-insensitive filesystems...

This particular issue should be a straightforward fix - just needs a more nuanced load_path comparison than ==.

However, I'm surprised it's actually reinstalling everything - resolve_can_skip_1 just provides a quick check. If the set of packages to install hasn't actually changed, then it should still take a fast route, namely it executes

CondaPkg.jl/src/resolve.jl

Lines 510 to 532 in baa6132

# the state is sufficiently clean that we can modify the existing conda environment
changed = false
if !isempty(removed_pip_pkgs) && !shared
dry_run && return
changed = true
_resolve_pip_remove(io, removed_pip_pkgs, load_path)
end
if !isempty(removed_pkgs) && !shared
dry_run && return
changed = true
_resolve_conda_remove(io, conda_env, removed_pkgs)
end
if !isempty(specs) && (!isempty(added_pkgs) || !isempty(changed_pkgs) || (meta.channels != channels) || changed)
dry_run && return
changed = true
_resolve_conda_install(io, conda_env, specs, channels)
end
if !isempty(pip_specs) && (!isempty(added_pip_pkgs) || !isempty(changed_pip_pkgs) || changed)
dry_run && return
changed = true
_resolve_pip_install(io, pip_specs, load_path)
end
changed || _log(io, "Dependencies already up to date")
but each inner if block is a no-op because the set of packages hasn't changed. Is this not the case?

@habemus-papadum
Copy link
Author

That makes sense; the packages should have not changed. I will try to revisit this in a few days to isolate futher

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

No branches or pull requests

2 participants