-
Notifications
You must be signed in to change notification settings - Fork 29.3k
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
build: add watch/compile tasks for CLI #182344
Conversation
I spent time this morning working on the 'developer experience' of the CLI in vscode, mainly getting the CLI to cross-compile chasing our initial idea of having it auto-build in a devcontainer. After some effort and disabling tunnels connections (to avoid having to pull in OpenSSL which is a huge pain to cross compile), I was able to get it to cross-compile from Linux to Windows, using the mingw linker. I could probably figure out how to get macOS working as well with more effort. However, I'm not a big fan of this, effectively it's one more 'platform' of build we need to support and test. I think a better approach is downloading the latest compiled CLI from the update server instead, as needed. That's what this PR does. It just places the CLI where it _would_ normally get compiled to by cargo; so far we don't need to do anything special outside of that. A notice is shown to users if this fallback happens.
The downloaded cli is from the latest insiders build and won't match the checked out sources. So while convenient in some cases, this is not clean and will confuse.
I find that requiring developers to install Is there any chance we can consume the part that needs openSSL as a library that we can build in a different repo? Ideally we could extract the whole basis-tunnel part into a library. Or can we compile the tunnel part only if the developer has the keys FYI @joaomoreno |
I agree with @aeschli. This doesn't resonate at all with me:
In terms of:
How could we make it less of a pain? |
If we're okay requiring developers to install Cargo, it gets a good bit easier. I can have a build flag that uses the "vendored" version of cargo and removes the need to linking against an external openssl version, which is what we do in builds by default. Alternatively, we could publish our openssl libraries to npm. Nothing secret about them really. Then we can automatically pull them in in A goal I had was to enable developers to build without having cargo at all if they never touch rust code, in anticipation of a world where the CLI becomes more than just the tool for tunnels. That was the motivating factor behind initially looking at Docker, and then trying this approach instead. |
In this latest build, I take the approach of getting OpenSSL on the fly from the |
412028d
to
ff0c299
Compare
I spent time this morning working on the 'developer experience' of the
CLI in vscode, mainly getting the CLI to cross-compile chasing our
initial idea of having it auto-build in a devcontainer.
After some effort and disabling tunnels connections (to avoid having to
pull in OpenSSL which is a huge pain to cross compile), I was able to
get it to cross-compile from Linux to Windows, using the mingw linker.
I could probably figure out how to get macOS working as well with more
effort. However, I'm not a big fan of this, effectively it's one more
'platform' of build we need to support and test.
I think a better approach is downloading the latest compiled CLI from
the update server instead, as needed. That's what this PR does. It just
places the CLI where it would normally get compiled to by cargo; so
far we don't need to do anything special outside of that.
A notice is shown to users if this fallback happens.