Skip to content

Clean up cli build #178691

Closed
Closed

Description

There are a few strange choices in the cli build infrastructure:

As rules of thumb:

  • I should be able to just run cargo build and have an OSS build of the CLI, independent of the fact that I have a vscode-distro folder as a sibling of vscode.
  • After mixing in distro, no other component in our build infrastructure should ever reach into the quality folder.
    • If there is a reason for the Insider CLI (eg.) to know specific details about the stable and exploration qualities, this should be information contained in Insider's product.json itself, not done via some build magic which reaches out to other qualities product.json files.
  • There should be zero build components reaching out to build/azure-pipelines. Only Azure Pipelines should reach in there.

Activity

  1. connor4312 commented on Mar 30, 2023

    @connor4312
    Member

    The nice thing about having build.rs look for vscode distro, is that it's then easy to locally build a CLI that supports tunnel access, which requires quality information from distros to function.

    If there is a reason for the Insider CLI (eg.) to know specific details about the stable and exploration qualities, this should be information contained in Insider's product.json itself

    This is currently necessary because, for example, the "stable" build of the CLI is able to launch Insiders servers when connected to from insiders.vscode.dev or an Insiders quality on desktop. Likewise, in its 'redirection' logic, the CLI can be configured to open a chosen quality e.g. ./code --quality [stable|insiders|exploration] .. You could argue this shouldn't be the case, but while they are, then we either need to pull this information from all qualities or duplicate all these things in each product.json--and make sure to keep them in sync!

    /// Map of quality names to arrays of app IDs used for them, for example, `{"stable":["ABC123"]}`
    pub static ref WIN32_APP_IDS: Option<HashMap<Quality, Vec<String>>> =
    option_env!("VSCODE_CLI_WIN32_APP_IDS").and_then(|s| serde_json::from_str(s).unwrap());
    /// Map of quality names to desktop download URIs
    pub static ref QUALITY_DOWNLOAD_URIS: Option<HashMap<Quality, String>> =
    option_env!("VSCODE_CLI_QUALITY_DOWNLOAD_URIS").and_then(|s| serde_json::from_str(s).unwrap());
    /// Map of qualities to the long name of the app in that quality
    pub static ref PRODUCT_NAME_LONG_MAP: Option<HashMap<Quality, String>> =
    option_env!("VSCODE_CLI_NAME_LONG_MAP").and_then(|s| serde_json::from_str(s).unwrap());
    /// Map of qualities to the application name
    pub static ref APPLICATION_NAME_MAP: Option<HashMap<Quality, String>> =
    option_env!("VSCODE_CLI_APPLICATION_NAME_MAP").and_then(|s| serde_json::from_str(s).unwrap());
    /// Map of qualities to the server name
    pub static ref SERVER_NAME_MAP: Option<HashMap<Quality, String>> =
    option_env!("VSCODE_CLI_SERVER_NAME_MAP").and_then(|s| serde_json::from_str(s).unwrap());

    I didn't/don't know of a reason why the build shouldn't be able to know about qualities other than the one currently being built, so the former option seemed the better choice.

  2. added 17 commits that reference this issue on Aug 9, 2023
    6954f13
    3bdf199
    f4eb66e
    9171e37
    b655e94
    fa4f723
    f8b47d8
    1b3791e
    c6c5e9a
    aa184d1
    cb6af6b
    227a83e
    479ddea
    2698ebf
    1623060
    bfc9cc7
    dd285c3
  3. added a commit that references this issue on Aug 11, 2023
    52840e3
  4. added
    unreleasedPatch has not yet been released in VS Code Insiders
    insiders-releasedPatch has been released in VS Code Insiders
    and removed
    unreleasedPatch has not yet been released in VS Code Insiders
    on Aug 11, 2023
  5. locked and limited conversation to collaborators on Sep 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

engineeringVS Code - Build / issue tracking / etc.insiders-releasedPatch has been released in VS Code Insiders

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions