Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/Apps/Apps.jl
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,8 @@ function add(pkg::PackageSpec)
sourcepath = source_path(ctx.env.manifest_file, pkg)
project = get_project(sourcepath)
# TODO: Wrong if package itself has a sourcepath?
entry = PackageEntry(; apps = project.apps, name = pkg.name, version = project.version, tree_hash = pkg.tree_hash, path = pkg.path, repo = pkg.repo, uuid = pkg.uuid)
# PackageEntry requires version::Union{VersionNumber, Nothing}, but project.version can be VersionSpec
entry = PackageEntry(; apps = project.apps, name = pkg.name, version = project.version isa VersionNumber ? project.version : nothing, tree_hash = pkg.tree_hash, path = pkg.path, repo = pkg.repo, uuid = pkg.uuid)
manifest.deps[pkg.uuid] = entry

_resolve(manifest, pkg.name)
Expand Down Expand Up @@ -258,8 +259,8 @@ function develop(pkg::PackageSpec)
pkg.repo.source = nothing
end


entry = PackageEntry(; apps = project.apps, name = pkg.name, version = project.version, tree_hash = pkg.tree_hash, path = sourcepath, repo = pkg.repo, uuid = pkg.uuid)
# PackageEntry requires version::Union{VersionNumber, Nothing}, but project.version can be VersionSpec
entry = PackageEntry(; apps = project.apps, name = pkg.name, version = project.version isa VersionNumber ? project.version : nothing, tree_hash = pkg.tree_hash, path = sourcepath, repo = pkg.repo, uuid = pkg.uuid)
manifest = ctx.env.manifest
manifest.deps[pkg.uuid] = entry

Expand Down
7 changes: 6 additions & 1 deletion src/Operations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,12 @@ function update_manifest!(env::EnvCache, pkgs::Vector{PackageSpec}, deps_map, ju
# Build package entries
for pkg in pkgs
entry = PackageEntry(;
name = pkg.name, version = pkg.version, pinned = pkg.pinned,
name = pkg.name,
# PackageEntry requires version::Union{VersionNumber, Nothing}
# pkg.version may be a VersionSpec in some cases (e.g., when freeing a package)
# so we convert non-VersionNumber values to nothing
version = pkg.version isa VersionNumber ? pkg.version : nothing,
pinned = pkg.pinned,
tree_hash = pkg.tree_hash, path = pkg.path, repo = pkg.repo, uuid = pkg.uuid
)
if is_stdlib(pkg.uuid, julia_version)
Expand Down