docascode / ECMA2Yaml

Apache License 2.0
9 stars 4 forks source link

Process aborts with little information #17

Closed migueldeicaza closed 5 years ago

migueldeicaza commented 5 years ago

I am trying to convert some ECMA XML docs to YAML, and I am getting this:

$ mono /cvs/ecma2yaml2/ECMA2Yaml/ECMA2Yaml/bin/Release/ECMA2Yaml.exe --source=/cvs/TorchSharp/ecmadocs/en --output=/cvs/TorchSharp/docfx/api --log=/cvs/TorchSharp/log
[7/5/2019 2:16:09 PM]Loading ECMAXML files...
[7/5/2019 2:16:09 PM]System.ArgumentException: path is not sub directory from rootPath.
  at Microsoft.OpenPublishing.FileAbstractLayer.Utility.RelativePath (System.String path, System.String relativeTo) [0x00033] in <3574d7efefb04d3bbcc8f30e9272ff06>:0 
  at Microsoft.OpenPublishing.FileAbstractLayer.RealFileAbstractLayer+<>c__DisplayClass9_0.<ListFiles>b__0 (System.String f) [0x00012] in <3574d7efefb04d3bbcc8f30e9272ff06>:0 
  at System.Linq.Enumerable+SelectEnumerableIterator`2[TSource,TResult].MoveNext () [0x00048] in <43147c58ba0f43bb82ae7d4a423b6d37>:0 
  at System.Linq.Enumerable+WhereSelectEnumerableIterator`2[TSource,TResult].MoveNext () [0x00059] in <43147c58ba0f43bb82ae7d4a423b6d37>:0 
  at System.Collections.Generic.HashSet`1[T].UnionWith (System.Collections.Generic.IEnumerable`1[T] other) [0x00026] in <43147c58ba0f43bb82ae7d4a423b6d37>:0 
  at System.Collections.Generic.HashSet`1[T]..ctor (System.Collections.Generic.IEnumerable`1[T] collection, System.Collections.Generic.IEqualityComparer`1[T] comparer) [0x0004c] in <43147c58ba0f
  at System.Collections.Generic.HashSet`1[T]..ctor (System.Collections.Generic.IEnumerable`1[T] collection) [0x00007] in <43147c58ba0f43bb82ae7d4a423b6d37>:0 
  at Microsoft.OpenPublishing.FileAbstractLayer.FileAccessor.ListFiles (System.Func`2[T,TResult] propertyFilter, System.String subFolder) [0x00052] in <3574d7efefb04d3bbcc8f30e9272ff06>:0 
  at Microsoft.OpenPublishing.FileAbstractLayer.FileAbstractLayerExtensions.ListFiles (Microsoft.OpenPublishing.FileAbstractLayer.IFileAbstractLayer fal, System.String[] globPatterns, System.Fun
  at Microsoft.OpenPublishing.FileAbstractLayer.FileAbstractLayerExtensions.ListFiles (Microsoft.OpenPublishing.FileAbstractLayer.IFileAbstractLayer fal, System.String[] globPatterns, System.Boo
  at ECMA2Yaml.ECMALoader.ListFiles (System.String subFolder, System.String glob) [0x00000] in <7f3132b585f845c88cb76401764b6fc7>:0 
  at ECMA2Yaml.ECMALoader.LoadFolder (System.String sourcePath) [0x0007d] in <7f3132b585f845c88cb76401764b6fc7>:0 
  at ECMA2Yaml.Program.LoadAndConvert (ECMA2Yaml.CommandLineOptions opt) [0x00077] in <24c3ba30f9554de5881046ec1a3f8146>:0 
  at ECMA2Yaml.Program.Main (System.String[] args) [0x00037] in <24c3ba30f9554de5881046ec1a3f8146>:0 
{"message":"System.ArgumentException: path is not sub directory from rootPath.\n  at Microsoft.OpenPublishing.FileAbstractLayer.Utility.RelativePath (System.String path, System.String relativeTo

The parameters being passed to the RelativePath method are path=/cvs/TorchSharp/ecmadocs/en/index.xml and relativeTo=/cvs/TorchSharp/ecmadocs/en

This is a regression from an older version of the tool, that still works.

To repro:

First Git Clone this: https://github.com/xamarin/TorchSharp

Then:

cd TorchSharp
git reset --hard 08e61cb625c605bce70cd96e4825a27af0385cbf
mono ecma2yaml2/ECMA2Yaml/ECMA2Yaml/bin/Release/ECMA2Yaml.exe --source=`pwd`/ecmadocs/en --output=apidocs
daxianji007 commented 5 years ago

@migueldeicaza I have figured out the root cause and will work on the fix. The root cause is the different directory separator between Windows and Mac OS. This happens in 2 places and they are very old code. Just out of curiosity, you mentioned it used to work, does it used to work on Mac? What is the last version (or an estimated date) that the tool could work?

TianqiZhang commented 5 years ago

This issue has been fixed by c6922c4f4924fbb4885b0d327a864b64bf091a89 and 893a3b7d317aca9532b45faf8eac148eeb697e58.