Skip to content
This repository has been archived by the owner on Apr 11, 2022. It is now read-only.

TriremeSpec fails on Windows (Trireme issue) #19

Merged
merged 2 commits into from
May 17, 2014

Conversation

huntc
Copy link

@huntc huntc commented May 17, 2014

Running TriremeSpec on Windows yields an Exception:

[error]    'Error: Cannot find module 'C:\...\js-engine\./C:\...\js-engine\target\scala2.10\test-classes\com\typesafe\jse\test-node.js'
(/Users/Apigee/src/noderunner/target/checkout/node10/node10src/src/main/javascript/io/apigee/trireme/node10/node/module.js#340)

It looks like Trireme actually does not support Windows very well (cf: https://github.com/apigee/trireme/blob/master/node10/node10src/src/main/javascript/io/apigee/trireme/node10/main/trireme.js#L774).

A possible workaround is to pass the script content to Trireme instead of the script File.

This issue is also referenced on Play's tracker (in the comments):
playframework/playframework#2803

@huntc
Copy link

huntc commented May 12, 2014

Yeah, I've got a PR on Trireme open already and I'm talking with the main commiter (Greg) to see if we can get this fixed. I've spent most of today on this and hope we can reach a solution imminently. My objective is to get the specs here passing. I'll keep this open to track they objective. Thanks.

@tgambet
Copy link
Author

tgambet commented May 12, 2014

What do you think of this workaround?
https://github.com/tgambet/js-engine/blob/master/src/main/scala/com/typesafe/jse/Trireme.scala#L116

This is tested on Windows and Linux both and behaves as expected as far as I can tell.

@huntc
Copy link

huntc commented May 12, 2014

Thanks @tgambet ! I think that the problem runs deeper than just the source file though.

Here's my open PR for Trireme: apigee/trireme#55

The change uncovers new issues that I've been trying to resolve. Here appears to be the crux of the issue:

[Trireme Script Thread] DEBUG io.apigee.trireme.core.internal.ScriptRunner - Handling fatal exception org.mozilla.javascript.JavaScriptException: Error: Cannot find module 'C:\Users\IEUser\Documents\GitHub\js-engine\js-engine-tester\target\scala-2.10\classes\com\typesafe\jse\tester\test.js' (/Users/huntc/Projects/typesafe/trireme/node10/node10src/src/main/javascript/io/apigee/trireme/node10/node/module.js#340) domain = 0

I can confirm the existence of that file.

To reproduce on Windows:

  1. clone: https://github.com/huntc/js-engine/tree/trireme-windows (note that the trireme-windows branch is the one you need)
  2. Verify that the version of trireme in the build.sbt is as https://github.com/huntc/js-engine/blob/trireme-windows/build.sbt#L12-L13
  3. invoke the sbt console by typing "sbt" (presuming that you have sbt installed…)
  4. type "project js-engine-tester"
  5. type "run"

@huntc
Copy link

huntc commented May 16, 2014

This issue has progressed. We've been working with apigee and they have some changes in the works. We expect a new Trireme release shortly.

There were also some problems within js-engine, but not many. :-) Here's my wip branch: https://github.com/huntc/js-engine/tree/trireme-windows

huntc added a commit that referenced this pull request May 17, 2014
TriremeSpec fails on Windows (Trireme issue)
@huntc huntc merged commit 57923f8 into typesafehub:master May 17, 2014
@huntc huntc deleted the trireme-windows branch May 17, 2014 08:51
@huntc
Copy link

huntc commented May 17, 2014

The issue should now be resolved.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants