Closed dynaxis closed 9 years ago
To me this looks more like a file system or pub cache problem. Have you tried pub cache repair
and the again pub get
or pub upgrade
@zoechi per your suggestion, I tried pub cache repair
followed by deletion of pubspec.lock and pub get
. It produced the same error. And I even tried trash all of pub cache manually to no avail. I'm using SDK 1.10.1 and downgrading to test@0.12.2 solves the problem.
https://github.com/dart-lang/test/commit/1eb9d79009a215f492ac990abd3751f3c2868e91 I guess the above commit is making difference. The commit coincides with the stacktrace in my reporting.
The pub.bat on SDK refers to 'dart.exe' just as 'dart', and Platform.executable seems to report ...\bin\dart. Since there is no just 'dart' file on Windows (it's dart.exe), the resolveSymlinksSync fails with 'no such file' error.
@dynaxis that looks ugly – will investigate on our side.
It looks like symbolic link resolution is failing on Windows. This may be a dart:io
bug. @dynaxis, can you translate the error message for us?
@nex3 Sorry for the messed up error message. Due to some problem in my console setting, it is unreadable to me, too. But according to my test code trying to invoke resolveSymboliclinksSync on non-existing file (that is, ...\bin\dart
when there is ...\bin\dart.exe
), I got something like no such file exists
(I ran it in WebStorm and got the message readable).
As I stated in my last comment, the cause is rather obvious. Platform.executable
returns ...\bin\dart
instead of ...\bin\dart.exe
, and resolveSymbolicLinksSync
requires there exist the given file. That's the cause of this problem.
I hope the canonical way of getting the SDK directory is sorted out soon.
I'm not able to reproduce this on 1.11.0-dev.3.0
Perhaps this was fixed recently...
@kevmoo I tried 1.11.0.-dev3.0 this time. And Platform.executable
reports ...\bin\dart.exe
now, instead of ...\bin\dart
. That seems to solve this issue. I guess the release has its implementation of Platform.executable
different from the previous releases.
I'll upgrade to the recent dev channel version of SDK for the time being.
The following commit on runtime/bin/platform_win.cc
and related files seems to solve the issue. I'm not so familiar with Win32/64 programming, but GetModuleFileName
seems to return the full path together with the full name of the executable.
https://github.com/dart-lang/sdk/commit/e03ab1743717c39099a9161999e231699098a811
@kevmoo We should add a workaround for this so we can continue to support older versions of the SDK.
I see this error too (Win7 x64). I tried running tests after pub global activate test 0.12.2
but that failed with the same error. Please tell me we won't have to wait until SDK 1.11 is released to be able to test again.
On Edit: Note that as a workaround copying dart.exe to dart (with no extension) in the dart-sdk bin folder allows tests to run again.
I see this error too (Win7 x64). I tried running tests after
pub global activate test 0.12.2
but that failed with the same error.
The test runner doesn't (and never will) work with pub global activate
. It needs to be installed in the same package graph as the tests it's running.
Please tell me we won't have to wait until SDK 1.11 is released to be able to test again.
Certainly not. You can fix this right now by adding an upper bound to your test
constraint (test: ">=0.12.0 <0.12.3"
) and running pub get
to get an older version. I'm also going to put out a fix very soon that adds a workaround.
@nex3 The changelog says this fix was released in 0.12.3+1, but that version has not yet been published to pub.dartlang.org.
Good catch! Tagged and published.
I get the error shown in the end of this report, when I run 'pub run test' after upgrading to 0.12.3. It seems that it works fine in 0.12.2. I'm running Windows 8.1 on a x64 machine.