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: copy built binaries rather than symlinking them #79068

Merged
merged 1 commit into from
Mar 30, 2022

Conversation

rickystewart
Copy link
Collaborator

This uses more disk space but is resilient to the confusing case
where your Bazel output_base gets deleted (either due to
bazel clean --expunge or if your output_base gets wiped due to a
macOS upgrade).

Release note: None

@rickystewart rickystewart requested review from rail and mari-crl March 30, 2022 17:50
@rickystewart rickystewart requested a review from a team as a code owner March 30, 2022 17:50
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Contributor

@mari-crl mari-crl left a comment

Choose a reason for hiding this comment

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

Code LGTM!

To save disk space (and, though minor, IO time) for people who have their output_base on the same filesystem as their workspace, can we first attempt to hard link before falling back to copying if hard linking fails?

This uses more disk space but is resilient to the confusing case
where your Bazel `output_base` gets deleted (either due to
`bazel clean --expunge` or if your `output_base` gets wiped due to a
macOS upgrade).

Release note: None
@rickystewart
Copy link
Collaborator Author

To save disk space (and, though minor, IO time) for people who have their output_base on the same filesystem as their workspace, can we first attempt to hard link before falling back to copying if hard linking fails?

I tried this but the restrictive permissions (no w) that Bazel has on the built binaries confuse things. For example after I dev build short if I try to rm cockroach then I get the following message:

cockroach$ rm cockroach
override r-xr-xr-x  ricky/wheel for cockroach? y

@mari-crl
Copy link
Contributor

To save disk space (and, though minor, IO time) for people who have their output_base on the same filesystem as their workspace, can we first attempt to hard link before falling back to copying if hard linking fails?

I tried this but the restrictive permissions (no w) that Bazel has on the built binaries confuse things. For example after I dev build short if I try to rm cockroach then I get the following message:

cockroach$ rm cockroach
override r-xr-xr-x  ricky/wheel for cockroach? y

Makes sense u_u Unfortunate, but I'm happy with this! :)

@rickystewart
Copy link
Collaborator Author

TFTR!

bors r=mari-crl

@craig
Copy link
Contributor

craig bot commented Mar 30, 2022

Build succeeded:

@craig craig bot merged commit 093d5cf into cockroachdb:master Mar 30, 2022
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.

3 participants