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

Update build process to include integrated CLI #161640

Merged
merged 15 commits into from
Oct 12, 2022
Merged

Conversation

connor4312
Copy link
Member

@connor4312 connor4312 commented Sep 23, 2022

Review without whitespace diffs

  • Adds an off-by-default option that controls whether to build the Rust CLI
  • The "standalone cli" is built first in parallel, and then mixed into the standard builds. The binary name is suffixed with the quality, e.g. code-tunnel-exploration
  • The build process is largely based on the vscode-cli repo, but with a new prepare.ts script that sets variables for product.json and version information
  • Adds a compile and unit test run to PR builds
  • Updates to use hard tabs instead of spaces as Joao mentioned in the initial PR.

Example pipeline run: https://dev.azure.com/monacotools/Monaco/_build/results?buildId=186450&view=results

Fixes #159789

@connor4312 connor4312 self-assigned this Sep 23, 2022
@connor4312 connor4312 requested a review from aeschli September 23, 2022 20:37
@vscodenpa vscodenpa added this to the September 2022 milestone Sep 23, 2022
@aeschli aeschli requested a review from lszomoru September 26, 2022 13:18
Copy link
Member

@joaomoreno joaomoreno left a comment

Choose a reason for hiding this comment

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

Not yet a full review, but just an observation from a chat discussion: we should zip these up before they end up in our storage and further eat at our CDN costs.

zipping cli-alpine-x64 makes the asset go from 10MB to 4MB

@joaomoreno joaomoreno marked this pull request as draft September 26, 2022 15:50
@joaomoreno
Copy link
Member

Marking as draft, pending a full review early October.

@joaomoreno joaomoreno self-requested a review October 5, 2022 11:25
Copy link
Member

@joaomoreno joaomoreno left a comment

Choose a reason for hiding this comment

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

General comments:

  • Injecting targets/artifact names from product-build.yml makes the pipelines harder to reason about. Let's be less smart and just describe each platform/arch in the specific *.yml files.
  • Instead of build/cli directory, it's best to have cli in the names of the pipelines, as in build/darwin/cli-compile-darwin, build/cli-prepare.yml, build/cli-test.yml, etc.
  • Don't use macos, but darwin.
  • The whole vspkg usage looks very strange to me. Why is this necessary? Can we abstract this whole thing away in Cargo? If this is only about fetching openssl, can't we manually do that instead? How is this openssl usage tracked in terms of OSS licensing, component governance, Third-Party-Notices, etc?

General notes:

  • It would have been helpful to have reviewed the whitespace changes in a separate PR.

build/lib/util.ts Outdated Show resolved Hide resolved
build/azure-pipelines/product-build.yml Outdated Show resolved Hide resolved
Comment on lines 264 to 268
- ${{ if eq(parameters.VSCODE_BUILD_WIN32, true) }}:
- x64-windows-static-md
- ${{ if eq(parameters.VSCODE_BUILD_WIN32_ARM64, true) }}:
- arm64-windows-static-md
vcpkgDir: $(Build.SourcesDirectory)/build/azure-pipelines/cli/vcpkg
Copy link
Member

Choose a reason for hiding this comment

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

What about 32-bit Windows? And what if 32-bit Windows is the only Windows platform being built? This targets array will be empty. Should these steps run at all?

Copy link
Member Author

Choose a reason for hiding this comment

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

I just have not yet tested win32, though it should(?) work. That is on my plate for this month, and I can try that in this PR if you want; my goal was to get initial build bits migrated and in without changes to the CLI itself.

build/azure-pipelines/product-build.yml Show resolved Hide resolved
build/azure-pipelines/product-build.yml Outdated Show resolved Hide resolved
build/azure-pipelines/cli/prepare.ts Outdated Show resolved Hide resolved
build/azure-pipelines/cli/prepare.ts Outdated Show resolved Hide resolved
build/azure-pipelines/cli/install-rust.yml Outdated Show resolved Hide resolved
build/azure-pipelines/cli/vcpkg-deps.yml Outdated Show resolved Hide resolved
build/azure-pipelines/common/createAsset.ts Outdated Show resolved Hide resolved
@connor4312
Copy link
Member Author

connor4312 commented Oct 5, 2022

The whole vspkg usage looks very strange to me. Why is this necessary? Can we abstract this whole thing away in Cargo? If this is only about fetching openssl, can't we manually do that instead? How is this openssl usage tracked in terms of OSS licensing, component governance, Third-Party-Notices, etc?

We use this to grab a Windows build of OpenSSL. This is currently required by our SSH crate, russh, for its cryptography. However I soon plan to move this to either use native Windows wincrypt.h, or pure Rust code, depending on outcome from discussion with the crypto board. CG is aware of vcpkg (which is a Microsoft tool). I think we have to update the OSS tool's ThirdPartyNotices.txt generator to parse the Cargo.lock anyway, I will add that to my todo.

build/azure-pipelines/product-build.yml Outdated Show resolved Hide resolved
build/azure-pipelines/product-build.yml Outdated Show resolved Hide resolved
build/azure-pipelines/cli/prepare.ts Outdated Show resolved Hide resolved
Copy link
Member

@joaomoreno joaomoreno left a comment

Choose a reason for hiding this comment

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

Thanks for simplifying, we're getting there!

@connor4312
Copy link
Member Author

connor4312 commented Oct 10, 2022

What happened to this code?

Apparently I can't comment on it, but: my plan for that is to make the necessary Cargo.toml changes in vscode-distro and have them merge in. But I will do that in a followup PR (in distro) once this is in to avoid conflicts.

@connor4312 connor4312 force-pushed the build-integrated-cli branch from 46a9ad0 to fba577c Compare October 11, 2022 01:46
@connor4312 connor4312 force-pushed the build-integrated-cli branch from fba577c to ebd5936 Compare October 11, 2022 02:13
Copy link
Member

@joaomoreno joaomoreno left a comment

Choose a reason for hiding this comment

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

Last round. Happy to approve and merge this once rest of comments are addressed. ✅

build/azure-pipelines/cli/install-rust-posix.yml Outdated Show resolved Hide resolved
build/azure-pipelines/cli/install-rust-win32.yml Outdated Show resolved Hide resolved
build/azure-pipelines/cli/cli-darwin-sign.yml Show resolved Hide resolved
build/azure-pipelines/cli/cli-compile-and-publish.yml Outdated Show resolved Hide resolved
build/azure-pipelines/product-build-pr.yml Outdated Show resolved Hide resolved
@connor4312 connor4312 marked this pull request as ready for review October 11, 2022 15:42
@connor4312 connor4312 merged commit 6353f80 into main Oct 12, 2022
@connor4312 connor4312 deleted the build-integrated-cli branch October 12, 2022 15:59
@github-actions github-actions bot locked and limited conversation to collaborators Nov 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Integrate the VS Code CLI with our product builds
4 participants