Skip to content

win8.1 dart command-line: find: > bin [: No such file or directory #21770

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
DartBot opened this issue Dec 2, 2014 · 26 comments
Closed

win8.1 dart command-line: find: > bin [: No such file or directory #21770

DartBot opened this issue Dec 2, 2014 · 26 comments
Labels
area-dart-cli Use area-dart-cli for issues related to the 'dart' command like tool. area-sdk Use area-sdk for general purpose SDK issues (packaging, distribution, …). P1 A high priority bug; for example, a single project is unusable or has many test failures type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@DartBot
Copy link

DartBot commented Dec 2, 2014

This issue was originally filed by [email protected]


What steps will reproduce the problem?

Call one of these command-line tools from Windows 8.1:
pub
dartfmt
dartanalyzer
dart2js

Example:

C:\Users\esmarques>set DART_SDK=c:\dart\dart-sdk
C:\Users\esmarques>cd c:\tmp\devel\negentropia\wwwroot\dart
c:\tmp\devel\negentropia\wwwroot\dart>call c:\dart\dart-sdk\bin\pub get
find: > bin [: No such file or directory
Resolving dependencies...
Got dependencies!

What is the expected output?
Clean run, like previous Dart SDKs.

What do you see instead?
find: > bin [: No such file or directory

What version of the product are you using?
Build 42033
Dart Editor version 1.9.0.dev_00_00 (DEV)
Dart SDK version 1.9.0-dev.0.0

On what operating system?
64-bit Windows 8.1

@kasperl
Copy link

kasperl commented Dec 3, 2014

Everton, can you let us know in which version this worked for you? You mention it working in previous Dart SDKs. It looks like the scripts cannot locate the 'find' utility. Can you run find from the command line?

 C:> find
 C:> find.exe
 C:> where find
 C:> where find.exe

Johnni, you did a change to dart2js.bat recently but most of the other command-line tool wrappers haven't changed.


cc @johnniwinther.
Added this to the 1.9 milestone.
Removed Priority-Unassigned label.
Added Priority-High, Area-SDK, Triaged labels.

@johnniwinther
Copy link
Member

The dart2js.bat in dart-sdk/bin/ hasn't changed (it runs the snapshot). The old sdk/bin/dart2js.bat was copied into sdk/bin/dart2js_sdk.bat from which dart-sdk/bin/dart2js.bat is generated.

I cannot reproduce the problem on Windows 7.

@DartBot
Copy link
Author

DartBot commented Dec 3, 2014

This comment was originally written by [email protected]


Guys, I cannot reproduce this issue today on my Win8.1.
I am clueless.
I guess it might be some weirdness specific to my system.
So please feel free to disregard this issue.
Sorry for the noise.

@DartBot
Copy link
Author

DartBot commented Dec 5, 2014

This comment was originally written by [email protected]


Have the same issue on Win 7.

@DartBot
Copy link
Author

DartBot commented Dec 15, 2014

This comment was originally written by [email protected]


I'm seeing this in Dart SDK version 1.8.3 and 1.9.0 in Windows 8.1 from Windows PowerShell. It works fine in CMD

@DartBot
Copy link
Author

DartBot commented Dec 15, 2014

This comment was originally written by @aam


It sounds like cygwin find.exe gets used instead of Windows system find.exe. Can you check your path environment variable("set path" in cmd shell, "gci env:" in powershell) - whether cygwin folder comes up before windows system path(comspec environment variable)?

@DartBot
Copy link
Author

DartBot commented Dec 15, 2014

This comment was originally written by @seaneagan


I am seeing this only when calling the executables from cygwin (I have 64 bit installed).

$ where find
C:\cygwin64\bin\find.exe
C:\Windows\System32\find.exe

$ where find.exe
C:\cygwin64\bin\find.exe
C:\Windows\System32\find.exe

There are other issues running from cygwin as well, see issue #20822.

@DartBot
Copy link
Author

DartBot commented Dec 26, 2014

This comment was originally written by [email protected]


I have the same issue with Windows 7 32bit and Dart SDK from (cca) 1.2 to 1.8.3. I have Dart SDK installed (unzipped and added to %PATH% system variable) both for current user and globally. The problem appears only if I run e.g. dartanalyzer locally, globally this message disappears.

@kevmoo
Copy link
Member

kevmoo commented Feb 19, 2015

Removed this from the 1.9 milestone.

@kasperl
Copy link

kasperl commented Mar 20, 2015

Added this to the 1.10 milestone.

@kevmoo
Copy link
Member

kevmoo commented Apr 20, 2015

Removed this from the 1.10 milestone.
Added this to the 1.11 milestone.

@DartBot DartBot added Type-Defect P1 A high priority bug; for example, a single project is unusable or has many test failures area-sdk Use area-sdk for general purpose SDK issues (packaging, distribution, …). labels Apr 20, 2015
@DartBot DartBot added this to the 1.11 milestone Apr 20, 2015
@kevmoo kevmoo removed this from the 1.11 milestone Jun 23, 2015
@genesem
Copy link

genesem commented Jul 9, 2015

Hello guys.
I ran into the same issues and maybe found the source of your errors
(I found the fix in my case.. maybe this will help you to).

The source of the problem was "find" command whichcomes with git tools.
And the path to "git tools" was set before the path to windows "find" util.
So the git find was called and show up exactly this error.

To fix: I just set the path "c:\windows\system32" to appear before the "c:\git\bin"
in the windows path variable.
So windows "find" command has priority and your bat scripts starts to work as expected.

How to check : If console command "find --help" returns an error this means dos find is run
and "pub.bat & others" should work perfectly.

@kevmoo
Copy link
Member

kevmoo commented Jul 9, 2015

@genesem that sounds like something we could work around in our script.

Thoughts, @sgjesse?

@sgjesse
Copy link
Contributor

sgjesse commented Jul 10, 2015

One option could be to replace

find

with

%WINDIR%\System32\find.exe

If %WINDIR% is messed up most likely nothing will work anyway.

@genesem
Copy link

genesem commented Jul 10, 2015

May I offer to use findstr command instead?
it is present only on windows platform.

@kevmoo kevmoo added type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) and removed triaged labels Mar 1, 2016
@Camron
Copy link

Camron commented Jan 2, 2017

This bug just happened to me on Windows 10 from cmd. I had to use @sgjesse's fix.

@vCillusion
Copy link

vCillusion commented Jun 26, 2020

I can reproduce this odd behaviour in Windows 10 on the beta channel.

> flutter format lib/main.dart
"flutter format" is deprecated and will be removed in a future release, use "dart format" instead.
find: ‘> bin [’: No such file or directory
Formatted lib/main.dart

> dart format lib/main.dart
find: ‘> bin [’: No such file or directory
Unchanged lib/main.dart

> where find
C:\Program Files\Git\usr\bin\find.exe
C:\Windows\System32\find.exe

@vsmenon
Copy link
Member

vsmenon commented Aug 10, 2020

@mit-mit @athomas - should this still be a P1?

@mit-mit
Copy link
Member

mit-mit commented Aug 11, 2020

From the comment in #21770 (comment) it sounds like this also applies to the new dart CLI tool. We should fix that one (and can skip other tools that will be deprecated for the dart tool).

Tagging for Sept., cc @jwren

@mit-mit mit-mit added this to the September Release 2020 milestone Aug 11, 2020
@mit-mit mit-mit added the area-dart-cli Use area-dart-cli for issues related to the 'dart' command like tool. label Aug 11, 2020
@zichangg
Copy link
Contributor

I can confirm using git cl presubmit on Windows 10 also shows this error.

@a-siva
Copy link
Contributor

a-siva commented Aug 13, 2020

@franklinyow Who needs to own this issue? It has a milestone for September 2020 but no owner. If we can't find a specific owner I would suggest dropping the September 2020 milestone.

@jwren
Copy link
Member

jwren commented Aug 13, 2020

@bkonyi -- who did you mention this morning that has Windows experience?

@bkonyi
Copy link
Contributor

bkonyi commented Aug 13, 2020

@jwren well, I have a Windows machine but I'm OOO potentially all next week. @zichangg is probably the best person to refer this to.

@a-siva
Copy link
Contributor

a-siva commented Aug 13, 2020

@zichangg has already verified that it does reproduce on a Windows 10 machine but it is not clear if it is a VM issue based on #21770 (comment)

@aam
Copy link
Contributor

aam commented Aug 14, 2020

This has already been diagnosed and proposed solution(use %SystemRoot%\System32\find.exe instead of find) was implemented in some bat files but not all:

./sdk/bin/dartdoc.bat:37:                                             ^| %SystemRoot%\System32\find.exe ">     %~n1 [" 2^>nul`) do (
./sdk/bin/dartanalyzer.bat:63:                                             ^| %SystemRoot%\System32\find.exe ">     %~n1 [" 2^>nul`) do (
./sdk/bin/dart2js.bat:53:                                             ^| %SystemRoot%\System32\find.exe ">     %~n1 [" 2^>nul`) do (
./sdk/bin/dartfmt_sdk.bat:37:                                             ^| find ">     %~n1 ["`) do (
./sdk/bin/dart2js_sdk.bat:50:                                             ^| find ">     %~n1 [" 2^>nul`) do (
./sdk/bin/dart2native.bat:36:                                             ^| %SystemRoot%\System32\find.exe ">     %~n1 [" 2^>nul`) do (
./sdk/bin/dartdevc_sdk.bat:52:                                             ^| find ">     %~n1 ["`) do (
./sdk/bin/pub_sdk.bat:46:                                             ^| find ">     %~n1 [" 2^>nul`) do (
./sdk/bin/dartdevc.bat:59:                                             ^| find ">     %~n1 [" 2^>nul`) do (
./sdk/bin/dartanalyzer_sdk.bat:45:                                             ^| find ">     %~n1 [" 2^>nul`) do (
./sdk/bin/dartfix.bat:37:                                             ^| find ">     %~n1 [" 2^>nul`) do (
./sdk/bin/pub.bat:49:                                             ^| %SystemRoot%\System32\find.exe ">     %~n1 [" 2^>nul`) do (
./sdk/bin/dartfmt.bat:50:                                             ^| %SystemRoot%\System32\find.exe ">     %~n1 [" 2^>nul`) do (

What needs to be done is that the rest of .bat files have to be changed to %SystemRoot%\System32\find.exe.

@aam
Copy link
Contributor

aam commented Aug 14, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-dart-cli Use area-dart-cli for issues related to the 'dart' command like tool. area-sdk Use area-sdk for general purpose SDK issues (packaging, distribution, …). P1 A high priority bug; for example, a single project is unusable or has many test failures type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests