Skip to content
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

IO library doesn't work in 64-bit version for Windows #1759

Closed
DartBot opened this issue Feb 18, 2012 · 8 comments
Closed

IO library doesn't work in 64-bit version for Windows #1759

DartBot opened this issue Feb 18, 2012 · 8 comments
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. closed-invalid Closed as we don't believe the reported issue is generally actionable library-io

Comments

@DartBot
Copy link

DartBot commented Feb 18, 2012

This issue was originally filed by ivan.su...@gmail.com


What steps will reproduce the problem?

  1. Create sample app in dart folder.
  2. Add #import('../libraries/io/io.dart');
  3. try to create any variable with type from this library. E.g. something like this:

class socket_listener{
  Socket testSocket;
  ...
}

What is the expected output? What do you see instead?
 Expected:
  Library became visible in the Libraries tab.
  testSocket can be used further

 See:
  Library is not available in the libraries view
  Socket type is unknown in the editor
  If I'm openning io.dart file I'm getting error in
    buffer_list.dart file (no such type "ByteArray")

What version of the product are you using? On what operating system?
  I was using both stable and then latest one (v 0.1.0.201202170045 build 4349) for Windows 64-bits.

@sethladd
Copy link
Contributor

Sounds like this developer is trying to access the dart:io libraries from within a Dart program in the Dart Editor.

I tried this script on Editor 4337 on Mac OS X. I do not have a Windows 64 bit machine.

#import('dart:io');
void main() {
  Socket socket;
}

The script ran without apparent error.


Added Area-Editor, Triaged labels.

@DartBot
Copy link
Author

DartBot commented Feb 19, 2012

This comment was originally written by ivan.susl...@gmail.com


Actually, yes, that's true. Everything works if 'dart:io' library comes along.

I've end up with this issue first time when trying to link two libraries 'dart:dom' and 'dart:io' in one package. If I would do so, it brings error: "duplicate top-level definition 'File'", so, I've tried to make direct link to io.dart file.

Is it so, that I can't use next imports together?

#import('dart:io');
#import('dart:dom');

Actually, one more stupid question. Why following defenition ends up with the error:

//-----code starts----
#import('dart:io');

class SocketTest {
  Socket echoSocket;
    
  SocketTest() {
    try {
      echoSocket = new Socket('localhost', 1);
      ...
    } catch (...) {
      ....
    }
  }
}
//-----code ends----

Error:
Generating Javascript...
error: File not found: dart:io
SocketTest.dart:8:24: error: cannot find type Socket
      echoSocket = new Socket('localhost', 1);
                       ^^^^^^
SocketTest.dart:8:24: error: cannot find type Socket
      echoSocket = new Socket('localhost', 1);
                       ^^^^^^
SocketTest.dart:8:20: error: member lookup failed for "Object"
      echoSocket = new Socket('localhost', 1);
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
compilation failed with 4 errors
Compilation failed

@keertip
Copy link
Contributor

keertip commented Feb 22, 2012

Marked this as being blocked by #1736.

@danrubel
Copy link

dart:io is a VM library while dart:dom and dart:html are browser librares, so you cannot use dart:io with either dart:dom or dart:html in the same Dart application today.

There very well may be a dart:io library for browser based apps in the future, but not today.

If I've missed something here, please feel free to reopen and elaborate further.


Added WontFix label.

@DartBot
Copy link
Author

DartBot commented Feb 23, 2012

This comment was originally written by ivan.sus...@gmail.com


Thanks, that's clear.
However, there was another question in my previous comment.

Why definition echoSocket = new Socket('address', port);

generates error:
Generating Javascript...
error: File not found: dart:io
SocketTest.dart:8:24: error: cannot find type Socket
      echoSocket = new Socket('localhost', 1);
                       ^^^^^^
SocketTest.dart:8:24: error: cannot find type Socket
      echoSocket = new Socket('localhost', 1);
                       ^^^^^^
SocketTest.dart:8:20: error: member lookup failed for "Object"
      echoSocket = new Socket('localhost', 1);
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
compilation failed with 4 errors
Compilation failed

@danrubel
Copy link

Removed Area-Editor label.
Added Area-IO, Triaged labels.

@madsager
Copy link
Contributor

The dart:io library is only available on the standalone VM. In comment 2 it seems that you are attempting to generate JavaScript code from a Dart script using dart:io? That is not possible.

dart:io is a server-side library only available on the standalone VM. You need to create a 'script' solution in the Editor and specify the VM binary to use for running it.

Hope this helps.


Added Invalid label.

@kevmoo
Copy link
Member

kevmoo commented May 14, 2014

Removed Area-IO label.
Added Area-Library, Library-IO labels.
Marked this as being blocked by #1736.
Unmarked this as being blocked by #1736.

@DartBot DartBot added Type-Defect area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. library-io closed-invalid Closed as we don't believe the reported issue is generally actionable labels May 14, 2014
copybara-service bot pushed a commit that referenced this issue Nov 3, 2022
…t, test_process, webdev

Revisions updated by `dart tools/rev_sdk_deps.dart`.

browser_launcher (https://github.com/dart-lang/browser_launcher/compare/981ca88..5fa0bd6):
  5fa0bd6  2022-11-01  Kevin Moore  Update lints, require Dart 2.17, add dependabot (#34)

dartdoc (https://github.com/dart-lang/dartdoc/compare/3273437..179ada0):
  179ada02  2022-11-02  Sam Rawlins  Change _HashableChildLibraryElementVisitor to be a RecursiveElementVisitor (#3242)
  a6e7d908  2022-11-02  Sam Rawlins  Make Inheritable.isOverride late final non-nullable (#3235)
  c4f52cf9  2022-11-02  Sam Rawlins  Test records support in typedefs (#3239)
  f74e129f  2022-11-02  Sam Rawlins  Make Accessor.documentationComment late final non-nullable (#3240)
  ad50bfbc  2022-10-31  dependabot[bot]  Bump github/codeql-action from 2.1.28 to 2.1.29 (#3238)

http (https://github.com/dart-lang/http/compare/738a55b..6339026):
  6339026  2022-11-02  Brian Quinlan  Make timeout and cache controllable per-request. (#815)
  51dbca2  2022-10-31  Brian Quinlan  Add a streaming request example. (#813)

mime (https://github.com/dart-lang/mime/compare/bf041aa..d80f4d0):
  d80f4d0  2022-11-02  Liu YuanYuan  Add .avif to extension map (#70)
  3a6b14e  2022-11-01  dependabot[bot]  Bump actions/checkout from 3.0.2 to 3.1.0 (#72)

string_scanner (https://github.com/dart-lang/string_scanner/compare/10435a4..4a5cbc5):
  4a5cbc5  2022-10-31  Kevin Moore  Make code in readme consistent with example (#49)

test (https://github.com/dart-lang/test/compare/b82fc0b..173a36f):
  173a36f2  2022-11-01  Jacob MacDonald  prep packages to publish (#1780)
  fd8e2b68  2022-10-31  Devon Carew  fix an issue with the github reporter (#1779)

test_process (https://github.com/dart-lang/test_process/compare/068f9f8..1774aa7):
  1774aa7  2022-11-01  dependabot[bot]  Bump actions/checkout from 3.0.2 to 3.1.0 (#36)

webdev (https://github.com/dart-lang/webdev/compare/c350055..069b870):
  069b870  2022-11-01  Elliott Brooks (she/her)  Prepare webdev for release to v.2.7.12 (#1775)
  cb06447  2022-11-01  Elliott Brooks (she/her)  Prep DWDS for release (#1774)
  daa154d  2022-11-01  Elliott Brooks (she/her)  Reset MV3 extension to nice starting point (#1773)
  98a6142  2022-11-01  Jakub Vrána  Remove // ignore: unsafe_html. (#1759)
  939e285  2022-10-31  Elliott Brooks (she/her)  Update documentation for Webdev release process (#1771)
  0428ffb  2022-10-31  Elliott Brooks (she/her)  Update package:file to latest version (#1770)

Change-Id: I5020d718f6c009bca4f9b5e69232dc425b9d3409
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/267761
Commit-Queue: Kevin Moore <kevmoo@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
Auto-Submit: Devon Carew <devoncarew@google.com>
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. closed-invalid Closed as we don't believe the reported issue is generally actionable library-io
Projects
None yet
Development

No branches or pull requests

6 participants