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

Allow compiling to WASM #109

Merged
merged 1 commit into from
Nov 22, 2023
Merged

Allow compiling to WASM #109

merged 1 commit into from
Nov 22, 2023

Conversation

swenson
Copy link
Contributor

@swenson swenson commented Nov 13, 2023

By updating go-sockaddr to 1.0.6 and shuffling some files around so that build tags would ignore irrelevant files for JS/WASM (such as the plugincontainer stuff that doesn't even make sense when compiling to JS/WASM).

@swenson swenson requested a review from tomhjp November 13, 2023 19:24
@swenson
Copy link
Contributor Author

swenson commented Nov 13, 2023

(Waiting on mitchellh/cli#103 before listenerutil will build under JS/WASM.)

@swenson
Copy link
Contributor Author

swenson commented Nov 13, 2023

(Also waiting on hashicorp/go-kms-wrapping#207 for configutil to build.)

Copy link
Contributor

@tomhjp tomhjp left a comment

Choose a reason for hiding this comment

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

LGTM with some minor comments. I avoided the conditional compilation path before because it makes the development experience more painful on non-Linux, but that's a secondary concern.

configutil/go.sum Show resolved Hide resolved
listenerutil/go.sum Show resolved Hide resolved
tlsutil/go.sum Show resolved Hide resolved
plugincontainer/container_reattach_linux.go Outdated Show resolved Hide resolved
plugincontainer/container_runner.go Outdated Show resolved Hide resolved
plugincontainer/container_runner.go Outdated Show resolved Hide resolved
plugincontainer/container_runner_linux.go Outdated Show resolved Hide resolved
plugincontainer/container_runner_test.go Outdated Show resolved Hide resolved
Copy link
Contributor

@tomhjp tomhjp left a comment

Choose a reason for hiding this comment

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

I'm not sure how long the upstream listenerutil fix is going to take to get merged, so once configutil is fixed, I would be supportive of excluding it from the CI in order to get the rest of this PR merged sooner.

plugincontainer/container_runner_default.go Outdated Show resolved Hide resolved
plugincontainer/container_reattach.go Outdated Show resolved Hide resolved
plugincontainer/container_runner.go Outdated Show resolved Hide resolved
@swenson
Copy link
Contributor Author

swenson commented Nov 20, 2023

All dependencies fixed now :)

Although this moves from micthellh/cli to hashicorp/cli, this shouldn't require users of this library to upgrade immediately: the only usage is withcli.Ui, which is a very simple interface that both versions are compatible with.

Copy link
Contributor

@tomhjp tomhjp left a comment

Choose a reason for hiding this comment

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

Nice job on the hashicorp/cli changes! Just one question on the replace directives

configutil/go.mod Show resolved Hide resolved
By updating go-sockaddr to 1.0.6 and shuffling some files around
so that build tags would ignore irrelevant files for JS/WASM (such
as the plugincontainer stuff that doesn't even make sense when
compiling to JS/WASM).

Update to use hashicorp/cli instead of mitchellh/cli for JS/WASM support.

Co-authored-by: Tom Proctor <[email protected]>
Copy link
Contributor

@tomhjp tomhjp left a comment

Choose a reason for hiding this comment

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

Thanks! Sorry for the merge conflicts from my PR

@swenson
Copy link
Contributor Author

swenson commented Nov 22, 2023

Thanks! No problem on the conflicts :)

@tomhjp tomhjp merged commit b4a7f3e into main Nov 22, 2023
19 checks passed
@tomhjp tomhjp deleted the wasm branch November 22, 2023 17:20
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