Skip to content

Commit 391cd00

Browse files
check source path is found when getting package_info
1 parent c7e611b commit 391cd00

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/API.jl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@ function package_info(env::EnvCache, pkg::PackageSpec, entry::PackageEntry)::Pac
6363
git_source = pkg.repo.source === nothing ? nothing :
6464
isurl(pkg.repo.source::String) ? pkg.repo.source::String :
6565
Operations.project_rel_path(env, pkg.repo.source::String)
66+
_source_path = Operations.source_path(env.manifest_file, pkg)
67+
if _source_path === nothing
68+
@debug "Manifest file $(env.manifest_file) contents:\n$(String(read(env.manifest_file)))"
69+
pkgerror("could not find source path for package $(err_rep(pkg)) based on $(env.manifest_file)")
70+
end
6671
info = PackageInfo(
6772
name = pkg.name,
6873
version = pkg.version != VersionSpec() ? pkg.version : nothing,
@@ -74,7 +79,7 @@ function package_info(env::EnvCache, pkg::PackageSpec, entry::PackageEntry)::Pac
7479
is_tracking_registry = Operations.is_tracking_registry(pkg),
7580
git_revision = pkg.repo.rev,
7681
git_source = git_source,
77-
source = Operations.project_rel_path(env, Operations.source_path(env.manifest_file, pkg)),
82+
source = Operations.project_rel_path(env, _source_path),
7883
dependencies = copy(entry.deps), #TODO is copy needed?
7984
)
8085
return info

0 commit comments

Comments
 (0)