Skip to content

Commit 906d062

Browse files
authored
SAM CLI 1.85-1.86.1 fails on windows (#3718)
* SAM CLI 1.85-1.86.1 fails on windows * Modified changeLog
1 parent 209b0b8 commit 906d062

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type" : "bugfix",
3+
"description" : "Add error notification to upgrade SAM CLI v1.85-1.86.1 if on windows"
4+
}

jetbrains-core/src/software/aws/toolkits/jetbrains/core/executables/ExecutableManager.kt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,13 @@ import com.intellij.openapi.components.service
1212
import com.intellij.openapi.project.DumbAware
1313
import com.intellij.openapi.project.Project
1414
import com.intellij.openapi.startup.StartupActivity
15+
import com.intellij.openapi.util.SystemInfo
1516
import com.intellij.util.io.lastModified
1617
import software.aws.toolkits.core.utils.exists
1718
import software.aws.toolkits.core.utils.getLogger
1819
import software.aws.toolkits.core.utils.warn
1920
import software.aws.toolkits.jetbrains.core.executables.ExecutableInstance.ExecutableWithPath
21+
import software.aws.toolkits.jetbrains.services.lambda.sam.SamExecutable
2022
import software.aws.toolkits.resources.message
2123
import java.nio.file.Path
2224
import java.nio.file.Paths
@@ -190,6 +192,18 @@ class DefaultExecutableManager : PersistentStateComponent<ExecutableStateList>,
190192
try {
191193
(type as? Validatable)?.validate(path)
192194
determineVersion(type, path, autoResolved)
195+
} catch (e: IllegalStateException) {
196+
val errorMessage = if (SystemInfo.isWindows && type is SamExecutable) {
197+
message("sam.cli.version.upgrade.required.windows") + "\n" + e.asString
198+
} else {
199+
message("aws.settings.executables.executable_invalid", type.displayName, e.asString)
200+
}
201+
ExecutableInstance.InvalidExecutable(
202+
path,
203+
null,
204+
autoResolved,
205+
errorMessage
206+
)
193207
} catch (e: Exception) {
194208
val message = message("aws.settings.executables.executable_invalid", type.displayName, e.asString)
195209
LOG.warn(e) { message }

resources/resources/software/aws/toolkits/resources/MessagesBundle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1107,6 +1107,7 @@ sam.build.title=SAM build
11071107
sam.cli.version.upgrade.instructions=Learn more about upgrading SAM CLI
11081108
sam.cli.version.upgrade.reason=Learn more about SAM sync improvements...
11091109
sam.cli.version.upgrade.required=Your SAM CLI version is {0} and does not include performance improvements for Sync Serverless Applications. To continue, please upgrade to SAM CLI version {1} or higher.
1110+
sam.cli.version.upgrade.required.windows=If you are on SAM CLI version 1.85, 1.86 or 1.86.1, it has <a href= 'https://github.com/aws/aws-sam-cli/issues/5243'>known issues</a>. Please consider <a href= 'https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/install-sam-cli.html'>re-installing</a> / <a href= 'https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/manage-sam-cli-versions.html#manage-sam-cli-versions-upgrade'>upgrading</a> the latest version.
11101111
sam.cli.version.warning=SAM CLI version
11111112
sam.debug.attach=Attach Debugger
11121113
sam.debug.attach.parent=Attempt Debugger Attachment

0 commit comments

Comments
 (0)