Skip to content

Conversation

@BillyONeal
Copy link
Member

The last two paths in try_load_port translated a nonexistent port directory or missing CONTROL file into errors, which is the try_load_port_required interface. No path returned the "nullptr scfl" result.

The only caller of try_load_port in registries.cpp therefore clearly wanted the "_required" behavior.

The last two paths in try_load_port translated a nonexistent port directory or missing CONTROL file into errors, which is the try_load_port_required interface. No path returned the "nullptr scfl" result.

The only caller of try_load_port in registries.cpp therefore clearly wanted the "_required" behavior.
std::string spdx_location = "git+https://github.com/Microsoft/vcpkg#ports/";
spdx_location.append(port_name.data(), port_name.size());
return Paragraphs::try_load_port(m_fs, port_name, PortLocation{path, std::move(spdx_location)})
return Paragraphs::try_load_port_required(m_fs, port_name, PortLocation{path, std::move(spdx_location)})
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As an aside, I think this behavior is wrong, and this really should return the nullptr case. However, fixing that I believe is what resulted in #1486 (comment)

This PR intentionally does not change existing product behavior.

const PortLocation& port_location)
{
auto load_result = try_load_port(fs, port_name, port_location);
auto load_result = try_load_port(fs, port_location);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is the only caller, should try_load_port be inlined?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I intend to add other callers :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Specifically, how I discovered this situation: overlay-ports want to try-load-port and it's OK if there's no port there: because it might be a directory containing overlays rather than the overlay itself)

@BillyONeal BillyONeal merged commit 5a30615 into microsoft:main Oct 29, 2024
6 checks passed
@BillyONeal BillyONeal deleted the fix-try-load-port branch October 29, 2024 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants