digital-asset / daml

The Daml smart contract language
https://www.digitalasset.com/developers
797 stars 199 forks source link

Daml Studio 2.9x error, "Invalid argument `multi-ide'" for older projects #19869

Open wallacekelly-da opened 2 weeks ago

wallacekelly-da commented 2 weeks ago

Affected Daml version

In VS Code, opening 2.8.x or earlier projects with the 2.9.1 - 2.9.4 Daml Extension.

Bug description

As reported in the forums, if you open a 2.8.x or earlier project using a 2.9.x Daml Extension, then VS Code displays:

The Daml Language Server server crashed 5 times in the last 3 minutes. The server will not be restarted.

The Daml Language Server output includes the following:

Invalid argument `multi-ide`

The "script results" link does not appear above Daml script functions in the editor.

To reproduce

  1. In the Daml Extension settings, enable the early access feature, "Multi Package Ide Support".

  2. Create a 2.8.9 Daml project.

    DAML_SDK_VERSION=2.8.9 daml new daml289
  3. Use VS Code's "Install Specific Version" feature to alternately install the 2.9.4 and then the 2.8.9 extension.

image

  1. Observe the following:

Expected behavior

The latest Daml Extension is compatible with projects built with previous Daml SDK versions.

samuel-williams-da commented 2 weeks ago

To add some technical details: daml studio does not automatically replace the extension with the selected SDK version, if that version is older than the one already installed. As a result, if you have launched the extension with 2.9+, and enabled multi-ide, launching it with an older project will attempt to call multi-ide on an older daml SDK

The easiest fix for this is to have the extension either check the SDK version, or recover if multi-ide can't launch by launching normal ide. Since this issue still exists, running daml studio --replace=always in an older package (< 2.8) will still break, so we still want the most recent extension to be used, but for it to handle older IDE's gracefully.