beacon-biosignals / julia_pod

k8s native julia development
MIT License
10 stars 3 forks source link

ERROR: expected the file `src/$PkgName.jl` to exist for package `$PkgName` at `/JuliaProject` #8

Open omus opened 3 years ago

omus commented 3 years ago

Project.toml files which contain a name entry require a src/${PkgName}.jl file. This will cause the sysimage-image Docker build step to fail as we only copy the Project.toml/Manifest.toml currently: https://github.com/beacon-biosignals/julia_pod/blob/e97e1e20a5efc49fe004363fb9e5a202791f0e0a/add_me_to_your_PATH/Dockerfile.template#L52

 > [sysimage-image 4/6] RUN julia --project=/JuliaProject -e 'using Pkg; Pkg.instantiate(); Pkg.build(); Pkg.precompile()':
#18 0.770     Updating registry at `~/.julia/registries/General`
#18 1.085 ERROR: expected the file `src/Example.jl` to exist for package `Example` at `/JuliaProject`
#18 1.794 Stacktrace:
#18 1.794   [1] pkgerror(msg::String)
#18 2.062     @ Pkg.Types /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Pkg/src/Types.jl:55
#18 2.149   [2] read_package(path::String)
#18 2.149     @ Pkg.Types /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Pkg/src/Types.jl:461
#18 2.149   [3] collect_project!(ctx::Pkg.Types.Context, pkg::Pkg.Types.PackageSpec, path::String, deps_map::Dict{Base.UUID, Vector{Pkg.Types.PackageSpec}})
#18 2.152     @ Pkg.Operations /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Pkg/src/Operations.jl:271
#18 2.152   [4] collect_fixed!(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}, names::Dict{Base.UUID, String})
#18 2.155     @ Pkg.Operations /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Pkg/src/Operations.jl:321
#18 2.155   [5] resolve_versions!(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec})
#18 2.156     @ Pkg.Operations /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Pkg/src/Operations.jl:382
#18 2.156   [6] up(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}, level::Pkg.Types.UpgradeLevel)
#18 2.157     @ Pkg.Operations /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Pkg/src/Operations.jl:1322
#18 2.157   [7] up(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}; level::Pkg.Types.UpgradeLevel, mode::Pkg.Types.PackageMode, update_registry::Bool, kwargs::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
#18 2.225     @ Pkg.API /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:261
#18 2.226   [8] #up#41
#18 2.226     @ /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:84 [inlined]
#18 2.226   [9] instantiate(ctx::Pkg.Types.Context; manifest::Nothing, update_registry::Bool, verbose::Bool, platform::Base.BinaryPlatforms.Platform, allow_build::Bool, allow_autoprecomp::Bool, kwargs::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
#18 2.227     @ Pkg.API /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:1340
#18 2.228  [10] instantiate
#18 2.228     @ /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:1325 [inlined]
#18 2.228  [11] #instantiate#252
#18 2.228     @ /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:1321 [inlined]
#18 2.228  [12] instantiate()
#18 2.228     @ Pkg.API /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:1321
#18 2.228  [13] top-level scope
#18 2.228     @ none:1
------
error: failed to solve: rpc error: code = Unknown desc = executor failed running [/bin/sh -c julia --project=/JuliaProject -e 'using Pkg; Pkg.instantiate(); Pkg.build(); Pkg.precompile()']: exit code: 1
omus commented 3 years ago

Discovered when writing #7

kolia commented 3 years ago

https://github.com/beacon-biosignals/julia_pod/blob/a90d8db446d0a61d710bd78e8ee66e97e155de68/add_me_to_your_PATH/sysimage.jl#L7-L14 is supposed to guard against that, wonder why it wasn't working :thinking: