Dart support on Windows


#1

Hi,

I’m Michael, a product manager from the Dart core team.

We would like to collaborate on adding Dart support on Windows. Dart is currently supported on Linux and macOS, but fails on Windows.

How can we help getting Dart supported?

Kind regards,
Michael Thomsen


#2

Hello, there.

The bulk of Dart logic comes from this file:

https://github.com/nex3 and https://github.com/a14n are current maintainers.

Once we have a WIP that can possibly work on Windows, we can enable Dart over at https://staging.travis-ci.com/, and start real testing.


#3

Thanks, we would be happy to take a look at needed changes to dart.rb. I see a few places that need change already around how the .rb file handles OS values.

Is there a way to test those changes locally?


#4

@BanzaiMan would love a quick response to my question above! Thanks, Michael


#5

Hello, Michael,

Local testing is in theory possible (run the app ruing Dockerfile in the repo, send the appropriate POST request), but not exactly easy (travis.rb plugin use is documented, but I know it has problems at the moment).

So, in practical terms, open a PR, and we’ll deploy it to https://staging.travis-ci.com, and we’ll test.

Would that work for you?


#6

Sounds great, I created https://github.com/travis-ci/travis-build/pull/1563


#7

@BanzaiMan a few questions:

  1. Is TRAVIS_HOME an environment variable that Travis sets? If so, what is it set to on Linux & Windows?
  2. When Travis executes a shell command from the ruby file such as sh.cmd "rm ${TRAVIS_HOME}/dartsdk.zip", what kind of shell/bash environment does that run in on Windows?

I’m asking as the quick test I did shows some errors I’m having trouble understanding:
https://github-apps-staging.travis-ci.com/mit-mit/experiments/jobs/237551


#8
  1. $HOME is /c/Users/travis. https://staging.travis-ci.com/BanzaiMan/com_testing/builds/239043#L16
  2. In travis-build, sh.cmd … is a method to build the AST that gets compiled into a Bash script , which will then be executed in the VM running your build. In the case of Windows jobs, it is ‘git bash’ that runs the rm … command.

The build’s output is admittedly confusing, partly because some I/O happens out of order. For example, the output from dart --version appears at the end on line 41.

As for the command pub not being found, it appears to me that it is a *.bat file in dart-sdk/bin inside the zip archive. Maybe executing the batch files may require additional considerations for git bash. (I am not sure.)


#9

It looks like a known issue in git bash (msysgit/msysgit/issues/101):

mit@mit3-w
$ pub.bat --version
Pub 2.0.0

mit@mit3-w
$ pub --version
bash: pub: command not found

Let me see what I can do to work around it.