Skip to content

Control the included quota and storage providers via Go build tags#5

Closed
robstradling wants to merge 1 commit intopostgresql_supportfrom
cmd_build_tags
Closed

Control the included quota and storage providers via Go build tags#5
robstradling wants to merge 1 commit intopostgresql_supportfrom
cmd_build_tags

Conversation

@robstradling
Copy link
Copy Markdown
Owner

google#3644 (comment) notes that the log-signer and log-server binaries are huge, due in part to the presence of multiple quota and storage providers. This PR enables providers to be included selectively via Go build tags.

By default and for backwards compatibility, all providers are included:

> go build && ls -sh trillian_log_server
62M trillian_log_server*

Specify one build tag to include just one provider:

> go build -tags=cloudspanner && ls -sh trillian_log_server
54M trillian_log_server*
> go build -tags=crdb && ls -sh trillian_log_server
37M trillian_log_server*
> go build -tags=mysql && ls -sh trillian_log_server
34M trillian_log_server*
> go build -tags=postgresql && ls -sh trillian_log_server
40M trillian_log_server*

Specify multiple, comma-separated build tags to include multiple providers. e.g.,:

> go build -tags=mysql,postgresql && ls -sh trillian_log_server
40M trillian_log_server*
> go build -tags=cloudspanner,crdb,mysql,postgresql && ls -sh trillian_log_server
62M trillian_log_server*

@mhutchinson
Copy link
Copy Markdown

I dig this. My only hesitation is that the build rules needing to list all other provider targets is somewhat brittle. But for how often we add new storage providers, we can probably live with it.

Want to raise this as a draft PR against the repo and assign Al Cutter?

@robstradling
Copy link
Copy Markdown
Owner Author

I dig this. My only hesitation is that the build rules needing to list all other provider targets is somewhat brittle. But for how often we add new storage providers, we can probably live with it.

Yeah, I agree it's not ideal. The alternative was to break backcompat though, which I figured was a non-starter.

Want to raise this as a draft PR against the repo and assign Al Cutter?

I'll make a note to do this after google#3644 has been merged.

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