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

TOML Parser error, while "Updating registry at ~/.julia/registries/General.toml" #45583

Closed
mgiugliano opened this issue Jun 4, 2022 · 4 comments

Comments

@mgiugliano
Copy link

I just upgraded to 1.7.3, from 1.7.* and noticed the following bug.

My ~/.julia/config/startup.jl file contains

ENV["JULIA_EDITOR"] = "vim"
ENV["PYTHON"] = "/usr/local/bin/python3"
ENV["JUPYTER"]= "/usr/local/bin/jupyter"

println("Setup successful")

Unless I comment the println, I get this error while updating my packages: i.e. typing at Julia 1.7.3 REPL (macOS Monterey 12.4 (21F79) on MPB (16-inch, 2019)), ']' and then 'up':

    Updating registry at `~/.julia/registries/General.toml`
ERROR: TOML Parser error:
none:1:6 error: expected equal sign after key
  Setup successful
       ^
Stacktrace:
  [1] parse
    @ ./toml_parser.jl:441 [inlined]
  [2] parse(str::String)
    @ TOML /Applications/Julia-1.7.app/Contents/Resources/julia/share/julia/stdlib/v1.7/TOML/src/TOML.jl:71
  [3] collect_artifacts(pkg_root::String; platform::Base.BinaryPlatforms.Platform)
    @ Pkg.Operations /Applications/Julia-1.7.app/Contents/Resources/julia/share/julia/stdlib/v1.7/Pkg/src/Operations.jl:588
  [4] download_artifacts(env::Pkg.Types.EnvCache; platform::Base.BinaryPlatforms.Platform, julia_version::VersionNumber, verbose::Bool, io::Base.TTY)
    @ Pkg.Operations /Applications/Julia-1.7.app/Contents/Resources/julia/share/julia/stdlib/v1.7/Pkg/src/Operations.jl:614
  [5] up(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}, level::Pkg.Types.UpgradeLevel; skip_writing_project::Bool)
    @ Pkg.Operations /Applications/Julia-1.7.app/Contents/Resources/julia/share/julia/stdlib/v1.7/Pkg/src/Operations.jl:1267
  [6] up(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}; level::Pkg.Types.UpgradeLevel, mode::Pkg.Types.PackageMode, update_registry::Bool, skip_writing_project::Bool, kwargs::Base.Pairs{Symbol, Base.TTY, Tuple{Symbol}, NamedTuple{(:io,), Tuple{Base.TTY}}})
    @ Pkg.API /Applications/Julia-1.7.app/Contents/Resources/julia/share/julia/stdlib/v1.7/Pkg/src/API.jl:333
  [7] up(pkgs::Vector{Pkg.Types.PackageSpec}; io::Base.TTY, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Pkg.API /Applications/Julia-1.7.app/Contents/Resources/julia/share/julia/stdlib/v1.7/Pkg/src/API.jl:149
  [8] up(pkgs::Vector{Pkg.Types.PackageSpec})
    @ Pkg.API /Applications/Julia-1.7.app/Contents/Resources/julia/share/julia/stdlib/v1.7/Pkg/src/API.jl:144
  [9] do_cmd!(command::Pkg.REPLMode.Command, repl::REPL.LineEditREPL)
    @ Pkg.REPLMode /Applications/Julia-1.7.app/Contents/Resources/julia/share/julia/stdlib/v1.7/Pkg/src/REPLMode/REPLMode.jl:407
 [10] do_cmd(repl::REPL.LineEditREPL, input::String; do_rethrow::Bool)
    @ Pkg.REPLMode /Applications/Julia-1.7.app/Contents/Resources/julia/share/julia/stdlib/v1.7/Pkg/src/REPLMode/REPLMode.jl:385
 [11] do_cmd
    @ /Applications/Julia-1.7.app/Contents/Resources/julia/share/julia/stdlib/v1.7/Pkg/src/REPLMode/REPLMode.jl:376 [inlined]
 [12] (::Pkg.REPLMode.var"#24#27"{REPL.LineEditREPL, REPL.LineEdit.Prompt})(s::REPL.LineEdit.MIState, buf::IOBuffer, ok::Bool)
    @ Pkg.REPLMode /Applications/Julia-1.7.app/Contents/Resources/julia/share/julia/stdlib/v1.7/Pkg/src/REPLMode/REPLMode.jl:549
 [13] #invokelatest#2
    @ ./essentials.jl:716 [inlined]
 [14] invokelatest
    @ ./essentials.jl:714 [inlined]
 [15] run_interface(terminal::REPL.Terminals.TextTerminal, m::REPL.LineEdit.ModalInterface, s::REPL.LineEdit.MIState)
    @ REPL.LineEdit /Applications/Julia-1.7.app/Contents/Resources/julia/share/julia/stdlib/v1.7/REPL/src/LineEdit.jl:2493
 [16] run_frontend(repl::REPL.LineEditREPL, backend::REPL.REPLBackendRef)
    @ REPL /Applications/Julia-1.7.app/Contents/Resources/julia/share/julia/stdlib/v1.7/REPL/src/REPL.jl:1232
 [17] (::REPL.var"#49#54"{REPL.LineEditREPL, REPL.REPLBackendRef})()
    @ REPL ./task.jl:429

When I comment the println, the error disappears and I get

    Updating registry at `~/.julia/registries/General.toml`
  No Changes to `~/.julia/environments/v1.7/Project.toml`
  No Changes to `~/.julia/environments/v1.7/Manifest.toml`

@fredrikekre
Copy link
Member

I can't reproduce this. From the stracktrace it looks like it fails pasing a Artifacts.toml file, so might be related to some package you have in your environment. Can you provide more information?

@KristofferC
Copy link
Member

I think you are running with --startup-file=yes which then triggers a bug in Pkg. You would have to remove the print command from your startup file or not run with --startup-file=yes.

@mgiugliano
Copy link
Author

@KristofferC

Indeed, I have Julia aliased to
julia --startup-file=yes --quiet

As I wrote in my issue report, I have removed println. I thought it was useful to report it anyway.

Following your instructions and running
function collect_artifacts(pkg_root::String; platform::AbstractPlatform=HostPlatform()) [...] returns an error:

ERROR: UndefVarError: AbstractPlatform not defined
Stacktrace:
 [1] top-level scope
   @ REPL[3]:1

Below I paste the list of packages I have installed:

     Status `~/.julia/environments/v1.7/Project.toml`
  [6e4b80f9] BenchmarkTools v1.3.1
  [336ed68f] CSV v0.10.4
  [717857b8] DSP v0.7.6
  [39dd38d3] Dierckx v0.5.2
  [31c24e10] Distributions v0.25.62
  [634d3b9d] DrWatson v2.9.1
  [68837c9b] FHist v0.8.0
  [cc61a311] FLoops v0.2.0
  [5789e2e9] FileIO v1.14.0
  [587475ba] Flux v0.13.3
  [713c75ef] Franklin v0.10.74
  [e9467ef8] GLMakie v0.6.5
  [c91e804a] Gadfly v1.3.4
  [f67ccb44] HDF5 v0.16.9
  [7073ff75] IJulia v1.23.3
  [033835bb] JLD2 v0.4.22
  [23992714] MAT v0.10.3
  [5fb14364] OhMyREPL v0.5.12
  [91a5bcdd] Plots v1.29.1
  [c3e4b0f8] Pluto v0.19.8
  [7f904dfe] PlutoUI v0.7.39
  [92933f4c] ProgressMeter v1.7.2
  [438e738f] PyCall v1.93.1
  [d330b81b] PyPlot v2.10.0
  [1fd47b50] QuadGK v2.4.2
  [295af30f] Revise v3.3.3
  [276daf66] SpecialFunctions v2.1.6
  [2913bbd2] StatsBase v0.33.16
  [f3b207a7] StatsPlots v0.14.34
  [d833ac1a] TheFix v0.2.4
  [9a3f8284] Random

@KristofferC
Copy link
Member

I deleted my comment since I figured out what the problem was and it is no longer useful to test it. Something like JuliaLang/Pkg.jl#3109 should fix this.

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

3 participants