`find_julia` uses the juliaup launcher without an error when `juliaup add` does not install the selected version
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
Research direction
Start in src/juliapkg/find_julia.py at the JuliaUp installation and lookup paths identified in the issue. Check how juliaup add success is handled and what happens when the selected executable cannot be found. Reproduce with an already installed channel that points to an older version; done means the selected version is used or an error is raised instead of saving the launcher path.
Written by the indexing model from the issue text.
Description
Description
When juliapkg resolves an environment, find_julia(upgrade=True) selects the newest compatible version in juliaup list. If this version is not installed, ju_find_julia runs juliaup add <channel> (find_julia.py#L158).
If the channel is already installed, juliaup add does not install the new version. It prints '1' is already installed. and returns exit code 0. juliapkg accepts exit code 0 as a successful installation.
Then juliapkg cannot find the selected version. Line 171 creates an exception, but it does not raise it:
Exception(f"JuliaUp just installed Julia {ver} but cannot find it")
Thus, find_julia continues and uses shutil.which("julia"). This path is the juliaup launcher ~/.juliaup/bin/julia, not a real Julia executable. juliapkg writes this path to meta.json.
With juliacall 0.9.35, Julia does not start:
ERROR: could not load library "~/.juliaup/bin/../lib/julia/sys.so"
juliacall 0.9.37 fixes this sys.so error (JuliaPy/PythonCall.jl#816). But juliapkg still uses the launcher and not the selected Julia version.
Steps to reproduce
The channel 1 must be installed and must point to an old version. This occurs when you install the channel 1 and do not run juliaup update after a new release.
- Install Julia 1.12.7:
juliaup add 1.12.7 - Make the channel
1point to 1.12.7. To get this state quickly, add this entry toInstalledChannelsin~/.julia/juliaup/juliaup.json:"1": {"Version": "1.12.7+0.x64.linux.gnu"} - Make sure that
juliaup statusshows the update1.13.2for channel1. - Make a new virtual environment. Install
juliapkg==0.1.27andjuliacall==0.9.35. Do not add ajuliapkg.jsonfile. - Run this script:
import juliapkg juliapkg.resolve(force=True) print(juliapkg.executable()) from juliacall import Main as jl
Expected result
juliapkg installs Julia 1.13.2 and uses it. If it cannot install it, juliapkg raises an error.
Actual result
juliapkg logs an installation of 1.13.2, but it uses the launcher with version 1.12.7. It does not show a warning:
[juliapkg] Locating Julia ^1.10.3
[juliapkg] Installing Julia 1.13.2 using JuliaUp
[juliapkg] Using Julia 1.12.7 at ~/.juliaup/bin/julia
juliapkg.executable() returns ~/.juliaup/bin/julia. Then import juliacall fails with the sys.so error above.
If the channel 1 is not installed, the same steps work correctly: juliapkg installs 1.13.2 and uses ~/.julia/juliaup/julia-1.13.2+0.x64.linux.gnu/bin/julia.
Versions
- juliapkg 0.1.27 (the code is the same on
main) - juliacall 0.9.35 and 0.9.37
- juliaup 1.22.7
- Python 3.12, Linux x86_64
Possible fix
- Add
raiseon line 171. - In
ju_find_julia, try the exact-version channel first (for example1.13.2).juliaup add 1.13.2always installs that version.
Workaround
Pin the exact Julia version in juliapkg.json, for example "julia": "=1.12.7".
Related
#39 (automatic Julia upgrade)
- Dominant language
- Python
- Stars
- 67
- Forks
- 24
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 2
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from JuliaPy/pyjuliapkg
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
JuliaPy/pyjuliapkg#95 · 2 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 38/100
JuliaPy/pyjuliapkg#96 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
JuliaPy/pyjuliapkg#79 · 4 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
JuliaPy/pyjuliapkg#78 · 2 comments ·
-
If you used add with dev + a relative path an absolute path ends up on Manifest.toml / meta.jsonOpen
Difficulty 3/5 1-2 days Newbie friendliness 42/100
JuliaPy/pyjuliapkg#77 · 3 comments ·
All issues in JuliaPy/pyjuliapkg
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
zach-blumenfeld/aip#13 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
nathanmarlor/foxess_modbus#1287 ·
Maintainers usually reply within 4 days
-
bug good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
OpenLakeForge/openlakeforge#498 ·
Maintainers usually reply within 1 day
-
good first issue hacktoberfest help wanted python
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 69/100
pollen-robotics/reachy_mini#1493 ·
Maintainers usually reply within 1 day