Skip to content

Can't run 'pub run test' after upgrading to 0.12.3 #133

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

Closed
dynaxis opened this issue Jun 4, 2015 · 14 comments
Closed

Can't run 'pub run test' after upgrading to 0.12.3 #133

dynaxis opened this issue Jun 4, 2015 · 14 comments

Comments

@dynaxis
Copy link

dynaxis commented Jun 4, 2015

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.

D:\msys64\home\dynaxis\work\xseed>pub run test
Unhandled exception:
Uncaught Error: FileSystemException: Cannot resolve symbolic links, path = 'D:\packages\dart-sdk\bin\dart' (OS Error: 吏
�?뺣맂 ?뚯씪??李얠쓣 ???놁뒿?덈떎.
, errno = 2)
Stack Trace:
#0      FileSystemEntity._throwIfError (dart:io/file_system_entity.dart:671)
#1      FileSystemEntity.resolveSymbolicLinksSync (dart:io/file_system_entity.dart:338)
#2      sdkDir.<anonymous closure> (package:test/src/util/io.dart:26)
#3      sdkDir (package:test/src/util/io.dart:28)
#4      sdkDir (package:test/src/util/io.dart:24)
#5      _sdkVersion (package:test/src/util/io.dart:32)
#6      _sdkVersion (package:test/src/util/io.dart:31)
#7      _supportsPubServe (package:test/src/util/io.dart:65)
#8      supportsPubServe (package:test/src/util/io.dart:60)
#9      supportsPubServe (package:test/src/util/io.dart:60)
#10     main.<main_async_body> (package:test/src/executable.dart:109)
#11     Future.Future.microtask.<anonymous closure> (dart:async/future.dart:144)
#12     _asyncRunCallbackLoop (dart:async/schedule_microtask.dart:41)
#13     _asyncRunCallback (dart:async/schedule_microtask.dart:48)
#14     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:96)
#15     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:143)

#0      _rootHandleUncaughtError.<anonymous closure> (dart:async/zone.dart:886)
#1      _asyncRunCallbackLoop (dart:async/schedule_microtask.dart:41)
#2      _asyncRunCallback (dart:async/schedule_microtask.dart:48)
#3      _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:96)
#4      _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:143)
@zoechi
Copy link

zoechi commented Jun 4, 2015

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

@dynaxis
Copy link
Author

dynaxis commented Jun 4, 2015

@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 [email protected] solves the problem.

@dynaxis
Copy link
Author

dynaxis commented Jun 4, 2015

1eb9d79
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.

@kevmoo
Copy link
Member

kevmoo commented Jun 4, 2015

@dynaxis that looks ugly – will investigate on our side.

@nex3
Copy link
Member

nex3 commented Jun 4, 2015

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?

@dynaxis
Copy link
Author

dynaxis commented Jun 5, 2015

@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.

@kevmoo
Copy link
Member

kevmoo commented Jun 5, 2015

I'm not able to reproduce this on 1.11.0-dev.3.0

Perhaps this was fixed recently...

@dynaxis
Copy link
Author

dynaxis commented Jun 5, 2015

@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.

@dynaxis
Copy link
Author

dynaxis commented Jun 5, 2015

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.

dart-lang/sdk@e03ab17

@nex3
Copy link
Member

nex3 commented Jun 5, 2015

@kevmoo We should add a workaround for this so we can continue to support older versions of the SDK.

@rbishop-bah
Copy link

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.

@nex3
Copy link
Member

nex3 commented Jun 8, 2015

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.

@seaneagan
Copy link
Contributor

@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.

@nex3
Copy link
Member

nex3 commented Jun 17, 2015

Good catch! Tagged and published.

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

No branches or pull requests

6 participants