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

dev: initialize submodules in dev doctor #75746

Merged

Conversation

aayushshah15
Copy link
Contributor

@aayushshah15 aayushshah15 commented Jan 31, 2022

This commit adds a check to dev doctor to initialize submodules, like we do
in our Makefile.

Fixes #72247

Release note: None

@aayushshah15 aayushshah15 requested a review from a team as a code owner January 31, 2022 18:22
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@aayushshah15 aayushshah15 force-pushed the 20220124_initSubmodulesDevDoctor branch from ed05c22 to c88409c Compare January 31, 2022 18:24
if _, err = d.exec.CommandContextSilent(ctx, "git", "submodule", "update", "--init", "--recursive"); err != nil {
return err
}
if _, err = d.exec.CommandContextSilent(ctx, "mkdir", "-p", binDir); err != nil {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: You can use d.os.MkdirAll(binDir) instead of shelling out to mkdir.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

if _, err = d.exec.CommandContextSilent(ctx, "mkdir", "-p", binDir); err != nil {
return err
}
if _, err = d.exec.CommandContextSilent(ctx, "touch", submodulesMarkerPath); err != nil {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: You can use d.os.writeFile(submodulesMarkerPath, "") instead of shelling out.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

This commit adds a check to `dev doctor` to initialize submodules, like we do
in our `Makefile`.

Release note: None
@aayushshah15 aayushshah15 force-pushed the 20220124_initSubmodulesDevDoctor branch from c88409c to 8504245 Compare February 2, 2022 17:55
@aayushshah15
Copy link
Contributor Author

TFTR

bors r+

@craig craig bot merged commit 88522a3 into cockroachdb:master Feb 2, 2022
@craig
Copy link
Contributor

craig bot commented Feb 2, 2022

Build succeeded:

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.

dev: dev doctor should initialize submodules for you if necessary
3 participants