Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

Developing on Windows? #39

Closed
tom-sherman opened this issue Feb 27, 2020 · 19 comments
Closed

Developing on Windows? #39

tom-sherman opened this issue Feb 27, 2020 · 19 comments

Comments

@tom-sherman
Copy link
Contributor

Currently all of the scripts are written in bash which is possible to get working on WSL, but it may be a bridge too far for a lot of people. Maybe these scripts could be ported to Node?

@Daniel15
Copy link
Contributor

Daniel15 commented Feb 27, 2020

Around 48% of developers are on Windows according to Stack Overflow's developer surveys (https://insights.stackoverflow.com/survey/2019#technology-_-developers-primary-operating-systems) so this seems like a reasonable suggestion. A technology would need good native Windows support (not just WSL) to get widespread adoption.

@MareikeTaeubner
Copy link

I tried to run the test suite on windows in the git bash, but failed at this:

 scripts/dev-rome test
⚠ Disk caching has been disabled due to the ROME_CACHE=0 environment variable ⚠
ome.tskages@romejsclinisrc
ome-dev the following files to C:UsersmareiAppDataLocalTemp
  - <filelink target="C:\Users\marei\AppData\Local\Temp\rome-dev\index.js">index.js</filelink> <filesize dim>2406244</                                                                                                                                                         filesize> <inverse>entry</inverse>
  - <filelink target="C:\Users\marei\AppData\Local\Temp\rome-dev\index.js.map">index.js.map</filelink> <filesize dim>9                                                                                                                                                         5</filesize> <inverse>sourcemap</inverse>
  - <filelink target="C:\Users\marei\AppData\Local\Temp\rome-dev\bundlebuddy.json">bundlebuddy.json</filelink> <filesi                                                                                                                                                         ze dim>470739</filesize> <inverse>stats</inverse>
# rome test
⚠ Disk caching has been disabled due to the ROME_CACHE=0 environment variable ⚠
ℹ Bundling 16 test files

ome-devindex.js:1824:10 internalError ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  ✖ Invalid hex digit for unicode escape (49)

  1.  ___R$$priv$romejs$string$escape$unescapeString_ts$UNEXPECTED_DEFAULT_THROWER (<filelink target="C:\Users\marei\A                                                                                                                                                         ppData\Local\Temp\rome-dev\index.js" line="1824" column="10" />)
    1823 │   const ___R$$priv$romejs$string$escape$unescapeString_ts$UNEXPECTED_DEFAULT_THROWER = (message, index) =>                                                                                                                                                          {
  > 1824 │     throw new TypeError(message + ' (' + String(index) + ')');
         │           ^
    1825 │   };

  2.  ___R$romejs$string$escape$unescapeString_ts$default (<filelink target="C:\Users\marei\AppData\Local\Temp\rome-de                                                                                                                                                         v\index.js" line="1868" column="18" />)
    1866 │           if (!___R$romejs$parser$core$index_ts$isHexDigit(char)) {
    1867 │             const pos = codeStartIndex + i;
  > 1868 │             throw unexpected(___R$romejs$string$escape$messages_ts$INVALID_HEX_DIGIT_FOR_ESCAPE, pos);
         │                   ^
    1869 │           }
    1870 │         }

  3.  StringMarkupParser.tokenizeWithState (<filelink target="C:\Users\marei\AppData\Local\Temp\rome-dev\index.js" lin                                                                                                                                                         e="2009" column="28" />)
  4.  StringMarkupParser.lookahead (<filelink target="C:\Users\marei\AppData\Local\Temp\rome-dev\index.js" line="1448"                                                                                                                                                          column="29" />)
  5.  StringMarkupParser.nextToken (<filelink target="C:\Users\marei\AppData\Local\Temp\rome-dev\index.js" line="1390"                                                                                                                                                          column="52" />)
  6.  StringMarkupParser.expectToken (<filelink target="C:\Users\marei\AppData\Local\Temp\rome-dev\index.js" line="156                                                                                                                                                         7" column="13" />)
  7.  StringMarkupParser.parseTag (<filelink target="C:\Users\marei\AppData\Local\Temp\rome-dev\index.js" line="2082"                                                                                                                                                          column="15" />)
  8.  StringMarkupParser.parseChild (<filelink target="C:\Users\marei\AppData\Local\Temp\rome-dev\index.js" line="2147                                                                                                                                                         " column="20" />)
  9.  StringMarkupParser.parse (<filelink target="C:\Users\marei\AppData\Local\Temp\rome-dev\index.js" line="2157" col                                                                                                                                                         umn="27" />)
  10. ___R$romejs$string$markup$parse_ts$parseMarkup (<filelink target="C:\Users\marei\AppData\Local\Temp\rome-dev\ind                                                                                                                                                         ex.js" line="2165" column="95" />)
      and 9 others...

  ⚠ This diagnostic was derived from an internal Rome error. The problem likely isn't with your code. Please report this if necessary ⚠

@MareikeTaeubner
Copy link

MareikeTaeubner commented Mar 1, 2020

After debugging a bit, I found that it fails at file paths including backslashes at this point in vendor/rome.cjs, which seems to be compiled from @romejs/string-escape/unescapeString.ts line 83

  if (modifier === 'u') {
        // Get the next 4 characters as the code point
        const codeStartIndex = modifierIndex + 1;
        const rawCode = input.slice(codeStartIndex, codeStartIndex + 4);
        console.log('#################',input)
        // Validate that we have at least 4 digits
        if (rawCode.length < 4) {
          // (index of the point start + total point digits)
          const lastDigitIndex = codeStartIndex + rawCode.length - 1;
          throw unexpected(
            ___R$project$rome$$romejs$string$escape$messages_ts$NOT_ENOUGH_CODE_POINTS,
            lastDigitIndex,
          );
        }

        // Validate that each character is a valid hex digit
        for (let i = 0; i < rawCode.length; i++) {
          const char = rawCode[i];
          console.log('#########', char, '############');

The printed output is then:

################# C:\Users\marei\src\rome\packages\@romejs\cli\utils\setProcessTitle.ts
######### t ############

With 't' not being a valid hex code. I admit I have no idea where to start searching to fix this though. Does anyone have more insight?

@sebmck
Copy link
Contributor

sebmck commented Mar 1, 2020

I have to admit I didn't really think about Windows and figured that WSL would have bash. Is there any shell language that is supported out of the box on Linux and Windows? I really don't want to write what is essentially a list of commands to execute in Node. The overhead is unnecessary and for things like scripts/node it's extremely weird.

@sebmck
Copy link
Contributor

sebmck commented Mar 1, 2020

@MareikeTaeubner Reason for that error: We have a markup abstraction #4 for passing around formatted strings. It makes it so that we don't need to worry about ANSI formatting in those callsites, and that we can render in the future to HTML etc. It looks HTML-ish and the strings are parsed with the same semantics as JavaScript strings. Unfortunately this means that \ is considered an escape character. Right now in these markup strings we do this <filelink target="${path.join()}" />. On Windows we will correctly use \ as the path separator which will essentially make it an escape.

@sebmck
Copy link
Contributor

sebmck commented Mar 1, 2020

I've created #82 which removes unescaping markup attribute values. I can't think of a place where we'd even want that. I've kept Windows paths in mind, including UNC paths, when designing the path handling in the rest of Rome, so hopefully the rest is fine. I assume so since the vendored Rome successfully compiled trunk.

@sebmck
Copy link
Contributor

sebmck commented Mar 1, 2020

@MareikeTaeubner Could you try from master? If that fixes it then the remaining thing is to address the shell scripts and we'll have support for contributors on Windows.

@MareikeTaeubner
Copy link

MareikeTaeubner commented Mar 1, 2020

Sadly it still fails with the same path. :(

Personally I don't have a problem with using the gitbash - you install it with git anyway. A space in the username (and therefore in the path of the homedir) seemed to be an issue on my husbands machine though. I'll have another look at that after this one.

Edit: Added the entire stacktrace since it looks a little bit different than 3 days ago

scripts/dev-rome test
Building trunk
⚠ Disk caching has been disabled due to the ROME_CACHE=0 environment variable ⚠
ome.tskages@romejsclinisrc
[email protected]                                                                                              elapsed 0.91s 18 op/s 16C:\Users\marei\src\rome\packages\@romejs\cli\utils\setProcessTitle.ts #################
########## t #############
[TypeError: Invalid hex digit for unicode escape (46)
  at ___R$$priv$project$rome$$romejs$string$escape$unescapeString_ts$UNEXPECTED_DEFAULT_THROWER (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:1906:10) generated source location      
  at ___R$project$rome$$romejs$string$escape$unescapeString_ts$default (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:1960:18) generated source location
  at StringMarkupParser.tokenizeWithState (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:2107:28) generated source location
  at StringMarkupParser.lookahead (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:1507:29) generated source location
  at StringMarkupParser.nextToken (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:1445:52) generated source location
  at StringMarkupParser.expectToken (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:1634:13) generated source location
  at StringMarkupParser.parseTag (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:2183:15) generated source location
  at StringMarkupParser.parseChild (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:2250:20) generated source location
  at StringMarkupParser.parse (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:2260:27) generated source location
  at ___R$project$rome$$romejs$string$markup$parse_ts$parseMarkup (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:2268:109) generated source location
  at ___R$$priv$project$rome$$romejs$string$markup$format_ts$formatReduceFromInput (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:3627:92) generated source location
  at ___R$project$rome$$romejs$string$markup$format_ts$stripMarkupTags (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:3697:11) generated source location
  at ___R$project$rome$$romejs$cli$reporter$Reporter_ts$default.stripMarkup (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:47540:13) generated source location
  at ___R$project$rome$$romejs$cli$reporter$Progress_ts$default.setText (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:4157:32) generated source location
  at ___R$project$rome$$romejs$cli$reporter$Progress_ts$default.pushText (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:4162:11) generated source location
  at ___R$project$rome$$romejs$cli$reporter$Progress_ts$default.processRemoteClientMessage (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:4021:22) generated source location
  at ___R$project$rome$$romejs$cli$reporter$Reporter_ts$default.processRemoteClientMessage (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:46906:10) generated source location
  at <anonymous (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:65543:22) generated source location
  at ___R$project$rome$$romejs$events$BridgeEvent_ts$default.call (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:4846:41) generated source location
  at ___R$project$rome$$romejs$events$BridgeEvent_ts$default.dispatchRequest (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:4987:19) generated source location
  at ___R$project$rome$$romejs$core$common$bridges$MasterBridge_ts$default.handleMessageRequest (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:46532:21) generated source location     
  at ___R$project$rome$$romejs$core$common$bridges$MasterBridge_ts$default.handleMessage (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:46490:15) generated source location
  at Object.sendMessage (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:46702:15) generated source location
  at ___R$project$rome$$romejs$core$common$bridges$MasterBridge_ts$default.sendMessage (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:46455:11) generated source location
  at ___R$project$rome$$romejs$events$BridgeEvent_ts$default.send (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:5029:18) generated source location
  at <anonymous (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:64713:43) generated source location
  at ___R$project$rome$$romejs$events$Event_ts$default.send (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:4825:6) generated source location
  at dispatch (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:47779:39) generated source location
  at Object.pushText (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:47831:10) generated source location
  at ___R$project$rome$$romejs$core$master$dependencies$DependencyGraph_ts$default.resolve (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:61400:24) generated source location
  at process.processTicksAndRejections (internal/process/task_queues.js:97:4)
  at <anonymous (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:61323:8) generated source location
  at ___R$project$rome$$romejs$core$master$WorkerQueue_ts$default.processWorker (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:60702:10) generated source location] Promise {
  <rejected> [TypeError: Invalid hex digit for unicode escape (46)
    at ___R$$priv$project$rome$$romejs$string$escape$unescapeString_ts$UNEXPECTED_DEFAULT_THROWER (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:1906:10) generated source location    
    at ___R$project$rome$$romejs$string$escape$unescapeString_ts$default (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:1960:18) generated source location
    at StringMarkupParser.tokenizeWithState (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:2107:28) generated source location
    at StringMarkupParser.lookahead (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:1507:29) generated source location
    at StringMarkupParser.nextToken (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:1445:52) generated source location
    at StringMarkupParser.expectToken (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:1634:13) generated source location
    at StringMarkupParser.parseTag (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:2183:15) generated source location
    at StringMarkupParser.parseChild (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:2250:20) generated source location
    at StringMarkupParser.parse (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:2260:27) generated source location
    at ___R$project$rome$$romejs$string$markup$parse_ts$parseMarkup (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:2268:109) generated source location
    at ___R$$priv$project$rome$$romejs$string$markup$format_ts$formatReduceFromInput (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:3627:92) generated source location
    at ___R$project$rome$$romejs$string$markup$format_ts$stripMarkupTags (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:3697:11) generated source location
    at ___R$project$rome$$romejs$cli$reporter$Reporter_ts$default.stripMarkup (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:47540:13) generated source location
    at ___R$project$rome$$romejs$cli$reporter$Progress_ts$default.setText (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:4157:32) generated source location
    at ___R$project$rome$$romejs$cli$reporter$Progress_ts$default.pushText (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:4162:11) generated source location
    at ___R$project$rome$$romejs$cli$reporter$Progress_ts$default.processRemoteClientMessage (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:4021:22) generated source location
    at ___R$project$rome$$romejs$cli$reporter$Reporter_ts$default.processRemoteClientMessage (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:46906:10) generated source location        
    at <anonymous (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:65543:22) generated source location
    at ___R$project$rome$$romejs$events$BridgeEvent_ts$default.call (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:4846:41) generated source location
    at ___R$project$rome$$romejs$events$BridgeEvent_ts$default.dispatchRequest (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:4987:19) generated source location
    at ___R$project$rome$$romejs$core$common$bridges$MasterBridge_ts$default.handleMessageRequest (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:46532:21) generated source location   
    at ___R$project$rome$$romejs$core$common$bridges$MasterBridge_ts$default.handleMessage (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:46490:15) generated source location
    at Object.sendMessage (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:46702:15) generated source location
    at ___R$project$rome$$romejs$core$common$bridges$MasterBridge_ts$default.sendMessage (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:46455:11) generated source location
    at ___R$project$rome$$romejs$events$BridgeEvent_ts$default.send (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:5029:18) generated source location
    at <anonymous (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:64713:43) generated source location
    at ___R$project$rome$$romejs$events$Event_ts$default.send (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:4825:6) generated source location
    at dispatch (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:47779:39) generated source location
    at Object.pushText (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:47831:10) generated source location
    at ___R$project$rome$$romejs$core$master$dependencies$DependencyGraph_ts$default.resolve (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:61400:24) generated source location        
    at process.processTicksAndRejections (internal/process/task_queues.js:97:4)
    at <anonymous (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:61323:8) generated source location
    at ___R$project$rome$$romejs$core$master$WorkerQueue_ts$default.processWorker (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:60702:10) generated source location] {
    [Symbol()]: [
      [Object], [Object], [Object],
      [Object], [Object], [Object],
      [Object], [Object], [Object],
      [Object], [Object], [Object],
      [Object], [Object], [Object],
      [Object], [Object], [Object],
      [Object], [Object], [Object],
      [Object], [Object], [Object],
      [Object], [Object], [Object],
      [Object], [Object], [Object],
      [Object], [Object], [Object]
    ]
  }
}
✖ Fatal error occurred: TypeError: Invalid hex digit for unicode escape (46)
  at ___R$$priv$project$rome$$romejs$string$escape$unescapeString_ts$UNEXPECTED_DEFAULT_THROWER
  (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:1906:10) generated source location
  at ___R$project$rome$$romejs$string$escape$unescapeString_ts$default
  (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:1960:18) generated source location
  at StringMarkupParser.tokenizeWithState
  (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:2107:28) generated source location
  at StringMarkupParser.lookahead (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:1507:29)
  generated source location
  at StringMarkupParser.nextToken (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:1445:52) generated source location
  at StringMarkupParser.expectToken
  (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:1634:13) generated source location
  at StringMarkupParser.parseTag (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:2183:15)
  generated source location
  at StringMarkupParser.parseChild (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:2250:20) generated source location
  at StringMarkupParser.parse
  (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:2260:27) generated source location
  at ___R$project$rome$$romejs$string$markup$parse_ts$parseMarkup
  (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:2268:109) generated source location
  at ___R$$priv$project$rome$$romejs$string$markup$format_ts$formatReduceFromInput
  (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:3627:92) generated source location
  at ___R$project$rome$$romejs$string$markup$format_ts$stripMarkupTags
  (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:3697:11) generated source location
  at ___R$project$rome$$romejs$cli$reporter$Reporter_ts$default.stripMarkup
  (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:47540:13) generated source location
  at ___R$project$rome$$romejs$cli$reporter$Progress_ts$default.setText
  (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:4157:32) generated source location
  at ___R$project$rome$$romejs$cli$reporter$Progress_ts$default.pushText
  (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:4162:11) generated source location
  at ___R$project$rome$$romejs$cli$reporter$Progress_ts$default.processRemoteClientMessage
  (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:4021:22) generated source location
  at ___R$project$rome$$romejs$cli$reporter$Reporter_ts$default.processRemoteClientMessage
  (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:46906:10) generated source location
  at <anonymous (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:65543:22) generated source
  location
  at ___R$project$rome$$romejs$events$BridgeEvent_ts$default.call (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:4846:41) generated source location
  at
  ___R$project$rome$$romejs$events$BridgeEvent_ts$default.dispatchRequest (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:4987:19) generated source location
  at
  ___R$project$rome$$romejs$core$common$bridges$MasterBridge_ts$default.handleMessageRequest (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:46532:21) generated source location        
  at
  ___R$project$rome$$romejs$core$common$bridges$MasterBridge_ts$default.handleMessage (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:46490:15) generated source location
  at
  Object.sendMessage (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:46702:15) generated source location
  at
  ___R$project$rome$$romejs$core$common$bridges$MasterBridge_ts$default.sendMessage (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:46455:11) generated source location
  at
  ___R$project$rome$$romejs$events$BridgeEvent_ts$default.send (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:5029:18) generated source location
  at <anonymous
  (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:64713:43) generated source location
  at ___R$project$rome$$romejs$events$Event_ts$default.send
  (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:4825:6) generated source location
  at dispatch (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:47779:39) generated source location

   at Object.pushText (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:47831:10) generated source location
  at
  ___R$project$rome$$romejs$core$master$dependencies$DependencyGraph_ts$default.resolve (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:61400:24) generated source location
  at
  process.processTicksAndRejections (internal/process/task_queues.js:97:4)
  at <anonymous (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:61323:8) generated source location
  at
  ___R$project$rome$$romejs$core$master$WorkerQueue_ts$default.processWorker (C:\Users\marei\src\rome\scripts\vendor\rome.cjs:60702:10) generated source location
Executing trunk
internal/modules/cjs/loader.js:985
  throw err;
  ^

Error: Cannot find module 'C:\Users\marei\AppData\Local\Temp\rome-dev\index.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:982:15)
    at Function.Module._load (internal/modules/cjs/loader.js:864:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
    at internal/main/run_main_module.js:18:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

@sebmck
Copy link
Contributor

sebmck commented Mar 1, 2020

Ah, we haven't updated the version of Rome that compiles trunk so the error is still in the vendored version. 3238667 updates it.

@sebmck
Copy link
Contributor

sebmck commented Mar 1, 2020

Created #86 to add Windows to GitHub Actions.

@MareikeTaeubner
Copy link

MareikeTaeubner commented Mar 1, 2020

Nice! After this I was able to run the test suite! :D

...just to fail at another point ^^"
At the first run I had this problem:

 /C:/Users/marei/AppData/Local/Temp/rome-dev/index.js:48284:71 internalError ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  ✖ Test worker was unresponsive for 10 seconds. Possible infinite loop. Below is a stack trace before the test was terminated.

  1.  compute (/C:/Users/marei/AppData/Local/Temp/rome-dev/index.js:48284:71)
  2.  main (/C:/Users/marei/AppData/Local/Temp/rome-dev/index.js:48265:16)
  3.  bisectSplit (/C:/Users/marei/AppData/Local/Temp/rome-dev/index.js:48467:17)
  4.  bisect (/C:/Users/marei/AppData/Local/Temp/rome-dev/index.js:48440:21)
  5.  compute (/C:/Users/marei/AppData/Local/Temp/rome-dev/index.js:48332:11)
  6.  main (/C:/Users/marei/AppData/Local/Temp/rome-dev/index.js:48265:16)
  7.  bisectSplit (/C:/Users/marei/AppData/Local/Temp/rome-dev/index.js:48466:16)
  8.  bisect (/C:/Users/marei/AppData/Local/Temp/rome-dev/index.js:48440:21)
  9.  compute (/C:/Users/marei/AppData/Local/Temp/rome-dev/index.js:48332:11)
  10. main (/C:/Users/marei/AppData/Local/Temp/rome-dev/index.js:48265:16)
      and 10 others...

Then I tried to run it again to see whether I can reproduce it again I failed at this (and the output was a lot shorter):

scripts/dev-rome test
Building trunk
⚠ Disk caching has been disabled due to the ROME_CACHE=0 environment variable ⚠
ℹ Bundling packages/@romejs/cli/bin/rome.ts
✔ Saved the following files to ~/AppData/Local/Temp/rome-dev
  - index.js 2.81MB  entry 
  - index.js.map 95B  sourcemap 
  - bundlebuddy.json 590kB  stats 
Executing trunk
⚠ Disk caching has been disabled due to the ROME_CACHE=0 environment variable ⚠
ℹ Bundling 27 test files
ℹ Running tests
-e196-4ec6-bf2d-80acab34e78e
For help, see: https://nodejs.org/en/docs/inspector
{
  callFrameId: '{"ordinal":0,"injectedScriptId":1}',
  functionName: 'promiseRejectHandler',
  functionLocation: { scriptId: '20', lineNumber: 73, columnNumber: 29 },
  location: { scriptId: '20', lineNumber: 73, columnNumber: 29 },
  url: 'internal/process/promises.js',
  scopeChain: [
    {
      type: 'local',
      object: [Object],
      name: 'promiseRejectHandler',
      startLocation: [Object],
      endLocation: [Object]
    },
    {
      type: 'closure',
      object: [Object],
      startLocation: [Object],
      endLocation: [Object]
    },
    { type: 'global', object: [Object] }
  ],
  this: { type: 'undefined' }
}
{
  callFrameId: '{"ordinal":1,"injectedScriptId":0}',
  functionName: '',
  functionLocation: { scriptId: '519', lineNumber: 50627, columnNumber: 72 },
  location: { scriptId: '519', lineNumber: 50649, columnNumber: 6 },
  url: 'file:///C:/Users/marei/src/rome/packages/@romejs/js-parser/__rtests__/index.ts',
  scopeChain: [],
  this: { type: 'undefined' }
}
[TypeError: Cannot read property 'get' of undefined
  at ___R$project$rome$$romejs$core$master$testing$TestRunner_ts$default._handleWorkerTimeout (C:\Users\marei\AppData\Local\Temp\rome-dev\index.js:63927:61) generated source location   
  at global.runMicrotasks
  at process.processTicksAndRejections (internal/process/task_queues.js:97:4)] Promise {
  <rejected> [TypeError: Cannot read property 'get' of undefined
    at ___R$project$rome$$romejs$core$master$testing$TestRunner_ts$default._handleWorkerTimeout (C:\Users\marei\AppData\Local\Temp\rome-dev\index.js:63927:61) generated source location 
    at global.runMicrotasks
    at process.processTicksAndRejections (internal/process/task_queues.js:97:4)] {
    [Symbol()]: [ [Object], [Object], [Object] ]
  }
}
✖ Fatal error occurred: TypeError: Cannot read property 'get' of undefined
  at ___R$project$rome$$romejs$core$master$testing$TestRunner_ts$default._handleWorkerTimeout
  (C:\Users\marei\AppData\Local\Temp\rome-dev\index.js:63927:61) generated source location
  at global.runMicrotasks
  at process.processTicksAndRejections
  (internal/process/task_queues.js:97:4)

At the third try, I got another error ^^":


[___R$project$rome$$romejs$diagnostics$errors_ts$DiagnosticsError: Error occurred while consuming at undefined (1:23368): Expected a string at \<emphasis>params.callFrames[13]scopeChain[0]name\</emphasis>

 unknown:1:23368 json ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  ✖ Expected a string at params.callFrames[13]scopeChain[0]name

- Expected a string at \<emphasis>params.callFrames[13]scopeChain[0]name\</emphasis>
  at ___R$project$rome$$romejs$consume$Consumer_ts$default.unexpected (C:\Users\marei\AppData\Local\Temp\rome-dev\index.js:44983:18) generated source location
  at ___R$project$rome$$romejs$consume$Consumer_ts$default._asString (C:\Users\marei\AppData\Local\Temp\rome-dev\index.js:45378:13) generated source location
  at ___R$project$rome$$romejs$consume$Consumer_ts$default.asString (C:\Users\marei\AppData\Local\Temp\rome-dev\index.js:45372:18) generated source location
  at ___R$project$rome$$romejs$core$master$testing$TestRunner_ts$default._handleWorkerTimeout (C:\Users\marei\AppData\Local\Temp\rome-dev\index.js:63927:74) generated source location   
  at global.runMicrotasks
  at process.processTicksAndRejections (internal/process/task_queues.js:97:4)] {
  diagnostics: [
    {
      category: 'json',
      filename: undefined,
      message: 'Expected a string at <emphasis>params.callFrames[13]scopeChain[0]name</emphasis>',
      start: [Object],
      end: [Object],
      language: 'json',
      mtime: undefined,
      sourceText: undefined,
      advice: []
    }
  ],
  name: 'DiagnosticsError'
} Promise {
  <rejected> [___R$project$rome$$romejs$diagnostics$errors_ts$DiagnosticsError: Error occurred while consuming at undefined (1:23368): Expected a string at \<emphasis>params.callFrames[13]scopeChain[0]name\</emphasis>

   unknown:1:23368 json ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

    ✖ Expected a string at params.callFrames[13]scopeChain[0]name

  - Expected a string at \<emphasis>params.callFrames[13]scopeChain[0]name\</emphasis>
    at ___R$project$rome$$romejs$consume$Consumer_ts$default.unexpected (C:\Users\marei\AppData\Local\Temp\rome-dev\index.js:44983:18) generated source location
    at ___R$project$rome$$romejs$consume$Consumer_ts$default._asString (C:\Users\marei\AppData\Local\Temp\rome-dev\index.js:45378:13) generated source location
    at ___R$project$rome$$romejs$consume$Consumer_ts$default.asString (C:\Users\marei\AppData\Local\Temp\rome-dev\index.js:45372:18) generated source location
    at ___R$project$rome$$romejs$core$master$testing$TestRunner_ts$default._handleWorkerTimeout (C:\Users\marei\AppData\Local\Temp\rome-dev\index.js:63927:74) generated source location 
    at global.runMicrotasks
    at process.processTicksAndRejections (internal/process/task_queues.js:97:4)] {
    diagnostics: [ [Object] ],
    name: 'DiagnosticsError',
    [Symbol()]: [ [Object], [Object], [Object], [Object], [Object], [Object] ]
  }
}
✖ Fatal error occurred: DiagnosticsError: Error occurred while consuming at undefined (1:23368): Expected a string at <emphasis>params.callFrames[13]scopeChain[0]name</emphasis>        


  unknown:1:23368 json
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━


   ✖ Expected a string at params.callFrames[13]scopeChain[0]name

- Expected a string at <emphasis>params.callFrames[13]scopeChain[0]name</emphasis>
  at
  ___R$project$rome$$romejs$consume$Consumer_ts$default.unexpected (C:\Users\marei\AppData\Local\Temp\rome-dev\index.js:44983:18) generated source location
  at
  ___R$project$rome$$romejs$consume$Consumer_ts$default._asString (C:\Users\marei\AppData\Local\Temp\rome-dev\index.js:45378:13) generated source location
  at
  ___R$project$rome$$romejs$consume$Consumer_ts$default.asString (C:\Users\marei\AppData\Local\Temp\rome-dev\index.js:45372:18) generated source location
  at
  ___R$project$rome$$romejs$core$master$testing$TestRunner_ts$default._handleWorkerTimeout (C:\Users\marei\AppData\Local\Temp\rome-dev\index.js:63927:74) generated source location      
  at
  global.runMicrotasks
  at process.processTicksAndRejections (internal/process/task_queues.js:97:4)

Is there some kind of state I have to clear?

@sebmck
Copy link
Contributor

sebmck commented Mar 1, 2020

Yeah... For some reason the test worker is timing out. I haven't managed to repro in my Windows VM but it's failing via GitHub Actions too.

I've also converted all the bash scripts to Node in #86.

@sebmck
Copy link
Contributor

sebmck commented Mar 2, 2020

Looks like the test worker timeout was due to CRLF line endings. When we run the parser tests, we assert that the returned pretty formatted AST is identical to one we have on disk. However, the one on disk has CRLF line endings while the one we've produced as LF line endings. This then causes every single parser test to fail. This then causes a diff to be computed for every single test, which on such large input is quite expensive. This triggers the test timeout.

I've done a few things to improve this:

  • In the Rome testing framework, when we expected two values, we check if they would be identical of CRLF was converted to LF. If it does then we produce a special error message saying so.
  • In the Rome testing framework, when outputting a diff, we visualize \r with a special character so it's obvious what's causing the error. We already did this for \n, \t etc.
  • Strip CR in the js-parser tests

Combined with the conversion of the bash scripts to Node, I can confirm that I can run all the necessary scripts in my Windows VM and #86 is now (most likely) passing GitHub Actions which are now also enabled for Windows tests.

I'll leave this issue open until I get some confirmation but I suspect this is hopefully resolved.

@MareikeTaeubner
Copy link

Woah this sounds like it was hard to find, good work.

I can run the tests now in either git-bash and cmd!

success-tests-windows

Thank you very much :)

@tom-sherman
Copy link
Contributor Author

I can confirm too that running with git bash works on my machine too, great work!

It's a shame that git bash/WSL is required, but I suppose it's not too much of a leap - most Windows devs are going to have git bash installed at least. There should probably be something added to CONTRIBUTING.md too regarding developing on Windows right?

@MareikeTaeubner
Copy link

MareikeTaeubner commented Mar 2, 2020

@tom-sherman thanks to the node scripts, you can run it on the cmd too. I didn't check the powershell though.

@tom-sherman
Copy link
Contributor Author

Ah I missed that bit, cool! Just need to remember to prefix with node as cmd doesn't support shebangs.

@MareikeTaeubner
Copy link

yes. I agree, that documenting that detail for windows devs would take out an unecessary hurdle, when starting out with the project.

@sebmck
Copy link
Contributor

sebmck commented Mar 2, 2020

I'll close this now. Thanks for confirming! Feel free to open additional issues if anything breaks on Windows but now that we have CI and I have a working VM we should be able to fix potential issues quickly.

@sebmck sebmck closed this as completed Mar 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants