I’m trying to create multiple packages in one repository following the implicit package directories method outlined here: Code Loading · The Julia Language
The ultimate goal is to split our large single-package codebase into multiple packages on the same monorepo, in order to reduce precompilation times which are currently ~100s with any change.
So I’ve tried this structure:
├── PackageA
│ └── src
│ └── PackageA.jl
└── TopLevel
├── Project.toml
└── src
└── TopLevel.jl
This works fine:
julia> Pkg.develop(path="TopLevel/")
But if I try to develop PackageA
, I get an error message because there’s no Project.toml
file:
julia> Pkg.develop(path="PackageA")
ERROR: could not find project file (Project.toml or JuliaProject.toml) in package at `PackageA` maybe `subdir` needs to be specified
Stacktrace:
[1] pkgerror(msg::String)
@ Pkg.Types /Applications/Julia-1.10.app/Contents/Resources/julia/share/julia/stdlib/v1.10/Pkg/src/Types.jl:70
[2] resolve_projectfile!(env::Pkg.Types.EnvCache, pkg::Pkg.Types.PackageSpec, project_path::String)
@ Pkg.Types /Applications/Julia-1.10.app/Contents/Resources/julia/share/julia/stdlib/v1.10/Pkg/src/Types.jl:860
[3] handle_repo_develop!(ctx::Pkg.Types.Context, pkg::Pkg.Types.PackageSpec, shared::Bool)
@ Pkg.Types /Applications/Julia-1.10.app/Contents/Resources/julia/share/julia/stdlib/v1.10/Pkg/src/Types.jl:629
[4] handle_repos_develop!(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}, shared::Bool)
@ Pkg.Types /Applications/Julia-1.10.app/Contents/Resources/julia/share/julia/stdlib/v1.10/Pkg/src/Types.jl:705
[5] develop(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}; shared::Bool, preserve::Pkg.Types.PreserveLevel, platform::Base.BinaryPlatforms.Platform, kwargs::@Kwargs{io::Base.TTY})
@ Pkg.API /Applications/Julia-1.10.app/Contents/Resources/julia/share/julia/stdlib/v1.10/Pkg/src/API.jl:214
[6] develop(pkgs::Vector{Pkg.Types.PackageSpec}; io::Base.TTY, kwargs::@Kwargs{})
@ Pkg.API /Applications/Julia-1.10.app/Contents/Resources/julia/share/julia/stdlib/v1.10/Pkg/src/API.jl:159
[7] develop(pkgs::Vector{Pkg.Types.PackageSpec})
@ Pkg.API /Applications/Julia-1.10.app/Contents/Resources/julia/share/julia/stdlib/v1.10/Pkg/src/API.jl:148
[8] develop
@ /Applications/Julia-1.10.app/Contents/Resources/julia/share/julia/stdlib/v1.10/Pkg/src/API.jl:146 [inlined]
[9] develop(; name::Nothing, uuid::Nothing, version::Nothing, url::Nothing, rev::Nothing, path::String, mode::Pkg.Types.PackageMode, subdir::Nothing, kwargs::@Kwargs{})
@ Pkg.API /Applications/Julia-1.10.app/Contents/Resources/julia/share/julia/stdlib/v1.10/Pkg/src/API.jl:176
[10] top-level scope
@ REPL[7]:1
This happens with every variation I could think of trying, e.g. julia> Pkg.develop(path="."; subdir="PackageA")
, and activating/not activating the TopLevel
project.
Am I missing something? Does develop
require a Project.toml
? If so, how can you use packages without a Project.toml
?