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

[vcpkg-artifacts] Find git using vcpkg fetch git. #569

Merged
merged 11 commits into from
Jun 6, 2022

Conversation

BillyONeal
Copy link
Member

  • Adds --x-from-script to fetch to make some attempt to make stdout only the resulting path so that scripts can embed fetching paths:

image

  • Teaches "ce" to look for VCPKG_COMMAND to find a vcpkg to launch, and to call vcpkg fetch git to get git's path.
  • (Drive by) Fix vcpkg's mapping for the regenerate command.
  • (Drive by) Spell check a few things.

I wrote this forwarder to what ce's documentation said: --registry to point to the registry. But that command on the ce side just accepts the first parameter as the path to the registry, so the mapping was wrong.

Also moves handling of --debug into the common bits.
…ing messages to stderr rather than stdout. Note that error messages still go to stdout.

Get the path to git by running `vcpkg fetch`
@BillyONeal BillyONeal force-pushed the git-install-sources branch from ae99184 to 95f1414 Compare June 3, 2022 19:52
ce/ce/vcpkg.ts Outdated
subproc.on('error', (err) => { reject(err); });
subproc.on('close', (code, signal) => {
if (code === 0) { accept(result); }
accept(undefined);
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be

Suggested change
accept(undefined);
reject("vcpkg returned nonzero exit code: " + result)

or just reject(result)?


protected:
MessageSink() = default;
~MessageSink() = default;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
~MessageSink() = default;
virtual ~MessageSink() = default;

Agreed nobody should ever be deleting it through the interface, but it seems good practice anyway.

Copy link
Member Author

Choose a reason for hiding this comment

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

Being protected already gives it the right behavior here.

virtual void print(Color c, StringView sv) override { msg::write_unlocalized_text_to_stdout(c, sv); }
};

StdOutMessageSink stdout_sink_instance;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
StdOutMessageSink stdout_sink_instance;
static StdOutMessageSink stdout_sink_instance;

Copy link
Member Author

Choose a reason for hiding this comment

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

Resolved by moving into an unnamed namespace. Ditto below.

virtual void print(Color c, StringView sv) override { msg::write_unlocalized_text_to_stderr(c, sv); }
};

StdErrMessageSink stderr_sink_instance;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
StdErrMessageSink stderr_sink_instance;
static StdErrMessageSink stderr_sink_instance;

@BillyONeal
Copy link
Member Author

image

Also added some smoke test instructions. I still need to figure out a good way to get CMake talking to rush to make this something seamless we can put into the e2e-tests.

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