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

Fix binary copying to temporary folder on custom path #502

Merged
merged 1 commit into from
Oct 9, 2024

Conversation

RiscadoA
Copy link
Contributor

@RiscadoA RiscadoA commented Oct 4, 2024

When you set a custom path for the CLI through dafny.cliPath, and set dafny.version to custom, in theory, the extension should copy all relevant DLL and executable files in the dafny.cliPath to a tmp dir, which is then used to launch the language server.

This is implemented by iterating over all files in the directory of the configured path, and copying only the ones which match a given filter: names ending with .dll, .exe, etc.
On Linux, executables usually won't have those file extensions, and thus, the file the user configured path points to might end up not being copied.
This leads to language server failing because it can't find the file specified in dafny.cliPath.

This PR simply changes the filter so that the file pointed to always passes the filter, so that it always ends up getting copied.

Currently, on Linux, the executable ends up not being copied due to not having one of the expected extensions.
This leads to unexpected behavior when specifying a path to a custom installation, where the specified binary ends up not being copied.
This becomes a problem on OSes and distributions, such as NixOS, where the extension's installer doesn't work properly.

This change makes it so that the specified binary is copied, no matter its file name.
@keyboardDrummer keyboardDrummer merged commit b60a7bd into dafny-lang:master Oct 9, 2024
2 checks passed
@keyboardDrummer
Copy link
Member

LGTM, thanks!

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