Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enforce not running with startup file when selecting dynamic artifacts and improve error message #3109

Merged
merged 1 commit into from
Jun 15, 2022
Merged
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
10 changes: 8 additions & 2 deletions src/Operations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -626,9 +626,15 @@ function collect_artifacts(pkg_root::String; platform::AbstractPlatform=HostPlat
# Despite the fact that we inherit the project, since the in-memory manifest
# has not been updated yet, if we try to load any dependencies, it may fail.
# Therefore, this project inheritance is really only for Preferences, not dependencies.
select_cmd = Cmd(`$(gen_build_code(selector_path; inherit_project=true)) $(triplet(platform))`)
select_cmd = Cmd(`$(gen_build_code(selector_path; inherit_project=true)) --startup-file=no $(triplet(platform))`)
meta_toml = String(read(select_cmd))
push!(artifacts_tomls, (artifacts_toml, TOML.parse(meta_toml)))
res = TOML.tryparse(meta_toml)
if res isa TOML.ParserError
errstr = sprint(showerror, res; context=stderr)
pkgerror("failed to parse TOML output from running $(repr(selector_path)), got: \n$errstr")
else
push!(artifacts_tomls, (artifacts_toml, TOML.parse(meta_toml)))
end
else
# Otherwise, use the standard selector from `Artifacts`
artifacts = select_downloadable_artifacts(artifacts_toml; platform)
Expand Down