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

Revise won't compile with PackageCompiler on Julia 1.10.1 #803

Open
andyferris opened this issue Feb 16, 2024 · 5 comments
Open

Revise won't compile with PackageCompiler on Julia 1.10.1 #803

andyferris opened this issue Feb 16, 2024 · 5 comments

Comments

@andyferris
Copy link

Since upgrading to Julia v1.10.1 (from v1.10.0) I now get the following during compilation with PackageCompiler.jl:

Failed to precompile Revise [295af30f-e4ad-537b-8983-00126c2a3abe] to "/app/.julia/compiled/v1.10/Revise/jl_mllOLx".
ERROR: LoadError: BoundsError: attempt to access 0-element Vector{Tuple{Module, String}} at index [1]
Stacktrace:
 [1] getindex(A::Vector{Tuple{Module, String}}, i1::Int64)
   @ Base ./essentials.jl:13
 [2] top-level scope
   @ /app/.julia/packages/Revise/FaTes/src/packagedef.jl:155
 [3] include(mod::Module, _path::String)
   @ Base ./Base.jl:495
 [4] include(x::String)
   @ Revise /app/.julia/packages/Revise/FaTes/src/Revise.jl:25
 [5] top-level scope
   @ /app/.julia/packages/Revise/FaTes/src/Revise.jl:44
 [6] include
   @ ./Base.jl:495 [inlined]
 [7] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt128}}, source::Nothing)
   @ Base ./loading.jl:2222
 [8] top-level scope
   @ stdin:3
in expression starting at /app/.julia/packages/Revise/FaTes/src/packagedef.jl:148
in expression starting at /app/.julia/packages/Revise/FaTes/src/Revise.jl:1
in expression starting at stdin:3

I'm using the Julia 1.10.1 amd64 linux docker container, Revise 3.5.13, PackageCompiler 2.1.17 and I'm compiling a bunch of proprietary code. Sorry, I don't have a lot more to go on at this point!

@andyferris
Copy link
Author

andyferris commented Mar 5, 2024

I was wondering if anyone had a moment to look at this?

This relates to this code:

const basebuilddir = begin
    sysimg = filter(x->endswith(x[2], "sysimg.jl"), Base._included_files)[1][2]
    dirname(dirname(sysimg))
end

while building a sysimg - the filter returns zero results. Is there some kind of fallback basebuilddir we should use while constructing a sysimg?

I'm not 100% sure what might have changed here. There was a recent change in PackageCompiler that might be somewhat relevant, but I have no idea? JuliaLang/PackageCompiler.jl#912

@timholy
Copy link
Owner

timholy commented Jul 24, 2024

I have basically never used PackageCompiler, so I don't know. Can you insert a debugging statement to print every item in Base._included_files?

@paulxshen
Copy link

Same error here. @andyferris did you get a fix?

@paulxshen
Copy link

paulxshen commented Nov 27, 2024

Workaround: cloned external package depending on Revise, removed Revise, and dev local cloned path. Revise is for development and shouldn't be included in Project.toml of an exported package

@andyferris
Copy link
Author

Yes, I made it an optional dependency and only use Revise for hot reloading in dev. It worked out OK - the dev Project.toml and Manifest.toml can have other packages (e.g. Plots.jl) for debugging and so-on.

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