Skip to content

Lazy artifacts cause precompilation-time warning #65

Closed
@maleadt

Description

@maleadt

As reported in JuliaGPU/CUDA.jl#2415: If a package (e.g. a JLL) has a lazy artifact that's used during precompilation, e.g. from __init__, that causes a precompilation-time warning: waiting for IO to finish::

julia> using CUDA
 │ Package CUDA not found, but a package named CUDA is available from a registry. 
 │ Install package?
 │   (docs) pkg> add CUDA 
 └ (y/n/o) [y]: y
   Resolving package versions...
   Installed CUDA_Runtime_Discovery ─ v0.3.3
   Installed SentinelArrays ───────── v1.4.3
   Installed LLVM ─────────────────── v7.2.1
   Installed UnsafeAtomicsLLVM ────── v0.1.4
   Installed CUDA_Driver_jll ──────── v0.9.0+0
   Installed GPUArrays ────────────── v10.2.0
   Installed KernelAbstractions ───── v0.9.20
   Installed CUDA_Runtime_jll ─────── v0.14.0+1
   Installed PrettyTables ─────────── v2.3.2
   Installed GPUCompiler ──────────── v0.26.5
   Installed CUDA ─────────────────── v5.4.2
    Updating `~/.julia/dev/Ferrite/docs/Project.toml`
  [052768ef] + CUDA v5.4.2
    Updating `~/.julia/dev/Ferrite/docs/Manifest.toml`
  Downloaded artifact: CUDA_Driver

[pid 611155] waiting for IO to finish:
 Handle type        uv_handle_t->data
 timer              0x1631cf0->0x7f50886d75b0
This means that a package has started a background task or event source that has not finished running. For precompilation to complete successfully, the event source needs to be closed explicitly. See the developer documentation on fixing precompilation hangs for more help.

This is not a great user experience. It can be reproduced with plain JLLWrappers-generated code, as demonstrated in JuliaGPU/CUDA.jl#2415 (comment). I'm not sure whether this is a "bug"/feature of Pkg, or whether the JLLWrapper-generated code could be improved (e.g., shouldn't the download be postponed until run time, instead of precompilation time?).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions