Fix wasm-opt location when using local_web_sdk (#127355)

We were looking up the wrong path for `wasm-opt` previously when using the `local-web-sdk` flag.
This commit is contained in:
Jackson Gardner 2023-05-22 16:08:11 -07:00 committed by GitHub
parent 7a12d825e2
commit 758ea6c096
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -1108,7 +1108,7 @@ class CachedLocalWebSdkArtifacts implements Artifacts {
); );
case Artifact.wasmOptBinary: case Artifact.wasmOptBinary:
return _fileSystem.path.join( return _fileSystem.path.join(
_getDartSdkPath(), 'bin', 'snapshots', _getDartSdkPath(), 'bin', 'utils',
_artifactToFileName(artifact, _platform, mode), _artifactToFileName(artifact, _platform, mode),
); );
case Artifact.genSnapshot: case Artifact.genSnapshot:

View File

@ -418,6 +418,13 @@ void main() {
fileSystem.path.join('/flutter', 'prebuilts', 'linux-x64', 'dart-sdk', fileSystem.path.join('/flutter', 'prebuilts', 'linux-x64', 'dart-sdk',
'bin', 'snapshots', 'dart2js.dart.snapshot'), 'bin', 'snapshots', 'dart2js.dart.snapshot'),
); );
expect(
artifacts.getArtifactPath(
Artifact.wasmOptBinary,
platform: TargetPlatform.web_javascript),
fileSystem.path.join('/flutter', 'prebuilts', 'linux-x64', 'dart-sdk',
'bin', 'utils', 'wasm-opt'),
);
}); });
testWithoutContext('getEngineType', () { testWithoutContext('getEngineType', () {