Open frabert opened 7 years ago
I have worked around the problem by editing the offending line:
- return (new FileStream(Path.Combine(DocumentPath, localPath), FileMode.Open, FileAccess.Read));
+ return null;
Just cloned and run BindingsGen in Release and Debug. Everything is fine on my machine (TM).
The patch won't prevent the documentation generation? Alternatively, you can get rid of GL2 and GLES1 reference pages: it will improve memory footprint and performance.
Still wonder why your instance is failing. Are you sure to be in sync with master/head? I've already seen that exception in the past (static readonly string BasePath = "../../.."
).
I have just deleted my local repository and starting from scratch to eliminate all possible factors. Anyway, I saw quite a large consumption of memory while generating the bindings (> 4GB), it went down to about 200MB after bypassing the whole GetEntity
method). What is this method supposed to do? I could only understand that it obtains the DTDs necessary for validation of the XMLs' file schemas, but I might be mistaken...
EDIT: I will report when the process is done
GL2 and GLES1 reference pages have MathML (mml) namespaces that are not recognized if DTD parsing is not enabled. If you find a way to load documentation without DTD processing you'll make me a big favor (it consume so much memory).
Everything can be optimized, since the GL2 and GLES1 XML documents are cached (infact they are occupying all that memory): it will be sufficient to cache only the required documentation.
About GetEntity
... I don't remember exactly, but essentially allows DTD processing from XmlDocument, using local DTDs. If you disable it (by returning null), no XML documentation is loaded.
(In the meanwhile, your exception has gone?)
The exception remains, unfortunately... Anyway, I will just disable the entity management for now since I do not need the docs to test the thing I am working on. I have found this though: AngleSharp. It looks like it may do the trick, since it supports XML loading without validation. I will look into it when I am done the other thing I am working on.
I've been recently trying to generate bindings without success, as BindingsGen tries to load DTDs from the wrong paths apparently:
The DTD in question is
{file:///D:/Documenti/GitHub/OpenGL.Net/BindingsGen/bin/Debug/-/OASIS/DTD DocBook V4.2/EN}
according to the debugger.