Skip to content

Conversation

Zemogiter
Copy link
Contributor

Ready for review.

Update the fork with changes from master fork.
Merging changes to the fork
Merging updates from master fork
Merging changes from master
Rewrote the script to download the latest version of vulkan SDK and reworked how the json file is handled.
Copy link
Collaborator

@plata plata left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This breaks the ability to install the Verb from JavaFX. Please change only the content of

Wine.prototype.vulkanSDK = function () {

Restored verb implementation.
var contentVulkanJSON = this.prefixDirectory() + "drive_c/windows/winevulkan.json";
touch(contentVulkanJSON);
writeToFile(contentVulkanJSON, "{\n ""file_format_version"": "1.0.0",\n ""ICD"": {\n ""library_path"": ""c:\windows\system32\winevulkan.dll"",\n ""api_version"": ""1.1.92.1""\n }\n}");
this.run("reg", ["add", "HKLM\Software\Khronos\Vulkan\Drivers", "/v", "C:\Windows\winevulkan.json", "/t", "REG_DWORD", "/d", "00000000", "/f"], null, false, true);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be possible to use the regedit plugin. If you explicitly want to use add instead of regedit.patch, you should add an according method to the plugin.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can create a ticket to fix this later

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok.

Changed variable name.
@plata
Copy link
Collaborator

plata commented Jan 10, 2019

@Zemogiter anything you want to do or shall we merge?

@Zemogiter
Copy link
Contributor Author

Zemogiter commented Jan 10, 2019

I've retested this verb just now and got this error:

org.phoenicis.scripts.interpreter.ScriptException: javax.script.ScriptException: <eval>:27:40 Expected , but found file_format_version
    writeToFile(patchVulkanJSON, "{\n	""file_format_version"": "1.0.0",\n	""ICD"": {\n		""library_path"": ""c:\windows\system32\winevulkan.dll"",\n		""api_version"": ""1.1.92.1""\n	}\n}");
                                     	  ^ in <eval> at line number 27 at column number 40
	at org.phoenicis.scripts.nashorn.builtins.EngineInjector.throwException(EngineInjector.java:22)
	at org.phoenicis.scripts.nashorn.NashornEngine.handleError(NashornEngine.java:74)
	at org.phoenicis.scripts.nashorn.NashornEngine.eval(NashornEngine.java:53)
	at org.phoenicis.scripts.nashorn.NashornEngine.eval(NashornEngine.java:44)
	at org.phoenicis.scripts.nashorn.builtins.IncludeInjector.lambda$injectInto$0(IncludeInjector.java:36)
	at jdk.scripting.nashorn.scripts/jdk.nashorn.internal.scripts.Script$Recompilation$166$\^eval\_/0x0000000800932840.:program(<eval>:1)
	at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:655)
	at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:513)
	at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:527)
	at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:456)
	at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:413)
	at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:409)
	at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.eval(NashornScriptEngine.java:162)
	at java.scripting/javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:264)
	at org.phoenicis.scripts.nashorn.NashornEngine.evalAndReturn(NashornEngine.java:59)
	at org.phoenicis.scripts.nashorn.NashornInteractiveSession.eval(NashornInteractiveSession.java:34)
	at org.phoenicis.scripts.interpreter.BackgroundScriptInterpreter.lambda$createInteractiveSession$1(BackgroundScriptInterpreter.java:43)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: javax.script.ScriptException: <eval>:27:40 Expected , but found file_format_version
    writeToFile(patchVulkanJSON, "{\n	""file_format_version"": "1.0.0",\n	""ICD"": {\n		""library_path"": ""c:\windows\system32\winevulkan.dll"",\n		""api_version"": ""1.1.92.1""\n	}\n}");
                                     	  ^ in <eval> at line number 27 at column number 40
	at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.throwAsScriptException(NashornScriptEngine.java:477)
	at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.compileImpl(NashornScriptEngine.java:544)
	at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.compileImpl(NashornScriptEngine.java:531)
	at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:409)
	at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.eval(NashornScriptEngine.java:162)
	at java.scripting/javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:264)
	at org.phoenicis.scripts.nashorn.NashornEngine.eval(NashornEngine.java:50)
	... 17 more
Caused by: jdk.nashorn.internal.runtime.ParserException: <eval>:27:40 Expected , but found file_format_version
    writeToFile(patchVulkanJSON, "{\n	""file_format_version"": "1.0.0",\n	""ICD"": {\n		""library_path"": ""c:\windows\system32\winevulkan.dll"",\n		""api_version"": ""1.1.92.1""\n	}\n}");
                                     	  ^
	at jdk.scripting.nashorn/jdk.nashorn.internal.parser.AbstractParser.error(AbstractParser.java:297)
	at jdk.scripting.nashorn/jdk.nashorn.internal.parser.AbstractParser.error(AbstractParser.java:282)
	at jdk.scripting.nashorn/jdk.nashorn.internal.parser.AbstractParser.expectDontAdvance(AbstractParser.java:353)
	at jdk.scripting.nashorn/jdk.nashorn.internal.parser.AbstractParser.expect(AbstractParser.java:340)
	at jdk.scripting.nashorn/jdk.nashorn.internal.parser.Parser.argumentList(Parser.java:3716)
	at jdk.scripting.nashorn/jdk.nashorn.internal.parser.Parser.leftHandSideExpression(Parser.java:3410)
	at jdk.scripting.nashorn/jdk.nashorn.internal.parser.Parser.unaryExpression(Parser.java:4440)
	at jdk.scripting.nashorn/jdk.nashorn.internal.parser.Parser.expression(Parser.java:4620)
	at jdk.scripting.nashorn/jdk.nashorn.internal.parser.Parser.conditionalExpression(Parser.java:4772)
	at jdk.scripting.nashorn/jdk.nashorn.internal.parser.Parser.assignmentExpression(Parser.java:4711)
	at jdk.scripting.nashorn/jdk.nashorn.internal.parser.Parser.expression(Parser.java:4589)
	at jdk.scripting.nashorn/jdk.nashorn.internal.parser.Parser.expression(Parser.java:4585)
	at jdk.scripting.nashorn/jdk.nashorn.internal.parser.Parser.expressionStatement(Parser.java:1854)
	at jdk.scripting.nashorn/jdk.nashorn.internal.parser.Parser.statement(Parser.java:1155)
	at jdk.scripting.nashorn/jdk.nashorn.internal.parser.Parser.sourceElements(Parser.java:909)
	at jdk.scripting.nashorn/jdk.nashorn.internal.parser.Parser.functionBody(Parser.java:4206)
	at jdk.scripting.nashorn/jdk.nashorn.internal.parser.Parser.functionExpression(Parser.java:3831)
	at jdk.scripting.nashorn/jdk.nashorn.internal.parser.Parser.memberExpression(Parser.java:3578)
	at jdk.scripting.nashorn/jdk.nashorn.internal.parser.Parser.leftHandSideExpression(Parser.java:3407)
	at jdk.scripting.nashorn/jdk.nashorn.internal.parser.Parser.unaryExpression(Parser.java:4440)
	at jdk.scripting.nashorn/jdk.nashorn.internal.parser.Parser.expression(Parser.java:4620)
	at jdk.scripting.nashorn/jdk.nashorn.internal.parser.Parser.conditionalExpression(Parser.java:4772)
	at jdk.scripting.nashorn/jdk.nashorn.internal.parser.Parser.assignmentExpression(Parser.java:4711)
	at jdk.scripting.nashorn/jdk.nashorn.internal.parser.Parser.assignmentExpression(Parser.java:4734)
	at jdk.scripting.nashorn/jdk.nashorn.internal.parser.Parser.expression(Parser.java:4589)
	at jdk.scripting.nashorn/jdk.nashorn.internal.parser.Parser.expression(Parser.java:4585)
	at jdk.scripting.nashorn/jdk.nashorn.internal.parser.Parser.expressionStatement(Parser.java:1854)
	at jdk.scripting.nashorn/jdk.nashorn.internal.parser.Parser.statement(Parser.java:1155)
	at jdk.scripting.nashorn/jdk.nashorn.internal.parser.Parser.sourceElements(Parser.java:909)
	at jdk.scripting.nashorn/jdk.nashorn.internal.parser.Parser.program(Parser.java:844)
	at jdk.scripting.nashorn/jdk.nashorn.internal.parser.Parser.parse(Parser.java:325)
	at jdk.scripting.nashorn/jdk.nashorn.internal.parser.Parser.parse(Parser.java:285)
	at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.Context.compile(Context.java:1500)
	at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.Context.compileScript(Context.java:1467)
	at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.Context.compileScript(Context.java:750)
	at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.compileImpl(NashornScriptEngine.java:542)
	... 22 more

What's strange is that the writeToFile line works in other scripts.

@plata
Copy link
Collaborator

plata commented Jan 10, 2019

You have " inside the string. Probably must be escaped with \.

@Zemogiter
Copy link
Contributor Author

But these " inside the string must be inside the file or else vulkanSDK wont work propetly.

@plata
Copy link
Collaborator

plata commented Jan 10, 2019

That's why I said: they must be escaped with \. So instead of

writeToFile(patchVulkanJSON, "{\n	""file_format_version"": "1.0.0"...

do

writeToFile(patchVulkanJSON, "{\n	\"file_format_version\": \"1.0.0\"...

@Zemogiter
Copy link
Contributor Author

Oh okey I didn't understand you before. The script is now operational and ready to be merged.

Fixed the extra `"` inside the 2nd parm of `writeToFile` crashing the installer.
@plata
Copy link
Collaborator

plata commented Jan 10, 2019

Don't you need to push something?

@plata
Copy link
Collaborator

plata commented Jan 10, 2019

Ah ok.

@Zemogiter
Copy link
Contributor Author

Codacy complains about those escape characters. But they are needed or else installation of vulkanSDK will fail.

@plata
Copy link
Collaborator

plata commented Jan 14, 2019

Yes, I've seen this before. I don't think you can fix it.

@plata plata merged commit 58ce925 into PhoenicisOrg:master Jan 14, 2019
@Zemogiter Zemogiter deleted the vulkansdk-fix branch January 15, 2019 09:36
@Kreyren Kreyren mentioned this pull request Mar 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants