Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build error, ENOENT no such file or directory rename .essl.temp to .essl #176

Closed
3blake7 opened this issue May 14, 2017 · 11 comments
Closed

Comments

@3blake7
Copy link

3blake7 commented May 14, 2017

`Compiling shader 1 of 1 (ChairFabric_shadowmap.frag.glsl).
Compiling shader 1 of 1 (ChairFabric_shadowmap.vert.glsl).
Compiling shader 1 of 1 (Coffee_mesh.frag.glsl).
Recompiling Coffee_mesh.frag
Compiling shader 1 of 1 (Coffee_mesh.vert.glsl).
fs.js:809
return binding.rename(pathModule._makeLong(oldPath),
^

Error: ENOENT: no such file or directory, rename 'C:\Users\blake\Documents\blender\build\html5-resources\Coffee_mesh.frag.essl.temp' -> 'C:\Users\blake\Documents\blender\build\html5-resources\Coffee_mesh.frag.essl'
at Error (native)
at Object.fs.renameSync (fs.js:809:18)
at ChildProcess.child.on (C:\Users\blake\Downloads\Armory3D\Armory\armsdk\win32\Kha\Tools\khamake\out\ShaderCompiler.js:356:44)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:852:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5)
Build failed, check console

I did a git pull origin master for armory and attempted a compile, nothing changed in my scene since yesterday so guessing it's one of the changes I downloaded just now.

@luboslenco
Copy link
Member

It looks like shaders got deleted during build process. Changing materials/render settings in Armory while building could cause this, but if you just tried to build then I am not sure yet. If you can somehow reproduce it that would be gold. Having to clean bigger project sucks since those take longer to build from scratch.

@3blake7
Copy link
Author

3blake7 commented May 14, 2017

I didn't change any settings during build. I forgot, I did change something in my scene, I flipped the normals for the ceiling and floor like you suggested in the other issue. I don't think that could cause the problem.

I cleaned project and cache and hit Run again, got the same error but this time for a different shader.

`Compiling shader 1 of 1 (world_Irr_EnvTex_EnvLDR_Rad_Cycles_SSAO_SMAA_Veloc.vert.glsl).
Compiling shader 1 of 8 (painter-image.frag.glsl).
Recompiling painter-image.frag
Compiling shader 2 of 8 (painter-colored.frag.glsl).
fs.js:809
return binding.rename(pathModule._makeLong(oldPath),
^

Error: ENOENT: no such file or directory, rename 'C:\Users\blake\Documents\blender\build\html5-resources\painter-image.frag.essl.temp' -> 'C:\Users\blake\Documents\blender\build\html5-resources\painter-image.frag.essl'
at Error (native)
at Object.fs.renameSync (fs.js:809:18)
at ChildProcess.child.on (C:\Users\blake\Downloads\Armory3D\Armory\armsdk\win32\Kha\Tools\khamake\out\ShaderCompiler.js:356:44)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:852:16)
at Socket. (internal/child_process.js:323:11)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at Pipe._handle.close [as _onclose] (net.js:492:12)
Build failed, check console`

I am trying it again after deleting the Sources directory.

@luboslenco
Copy link
Member

I will check on my Windows machine later today. Sources dir will likely have no effect, something is busting your shaders located in C:\Users\blake\Documents\blender\build\html5-resources\.

@3blake7
Copy link
Author

3blake7 commented May 14, 2017

I looked in that directory, fresh build directory, and there is a painter-image.frag.essl there. Not a single .temp in the directory. I guess that means the .temp gets created right before it's renamed?

@3blake7
Copy link
Author

3blake7 commented May 14, 2017

I attempted to rebuild and it errored out on the next shader. I rebuilt 3 more times and it finished. Browser runtime wasn't downloading all the files in the console window. I did project and cache clean again and this time no errors and Browser runtime downloaded everything and started working. Weird.

@3blake7
Copy link
Author

3blake7 commented May 15, 2017

This issue keeps popping up, with different .blend files, .blend files that haven't changed, etc. It seems pretty random. Usually just building it again will get past the shader it previously errored on and then error on the next one. If I build it several times, it eventually completes a build without erroring.

Compiling shader 1 of 8 (painter-colored.frag.glsl).
Compiling shader 2 of 8 (painter-colored.vert.glsl).
Compiling shader 3 of 8 (painter-image.frag.glsl).
Compiling shader 4 of 8 (painter-image.vert.glsl).
Compiling shader 5 of 8 (painter-text.frag.glsl).
Compiling shader 6 of 8 (painter-text.vert.glsl).
Recompiling painter-text.vert
Compiling shader 7 of 8 (painter-video.frag.glsl).
fs.js:809
return binding.rename(pathModule._makeLong(oldPath),
^

Error: ENOENT: no such file or directory, rename 'C:\Users\blake\Documents\blender\build\html5-resources\painter-text.vert.essl.temp' -> 'C:\Users\blake\Documents\blender\build\html5-resources\painter-text.vert.essl'
at Error (native)
at Object.fs.renameSync (fs.js:809:18)
at ChildProcess.child.on (C:\Users\blake\Downloads\Armory3D\Armory\armsdk\win32\Kha\Tools\khamake\out\ShaderCompiler.js:356:44)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:852:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5)
Build failed, check console

It's always on these last 8 shaders. Like this last time it errored on 4 of them. Since it happens near the end I can keep rebuilding until it gets through all the errors. Once it successfully builds using the Browser runtime, it opens a tab in my browser, displays a black screen and nothing happens in the console. Usually, it starts downloading all the arms, and ~2 minutes later, when it's done, it displays the scene. When I do this little "workaround", the console doesn't show it downloading anything, even after a refresh.

@3blake7
Copy link
Author

3blake7 commented May 16, 2017

I was investigating this issue, my hunch was that it is asynchronous and the writing of the .temp is sometimes slow, depending on what's going on on my computer, which gives it the intermittent appearance. I found that the writing and renaming was done by the node.js plugin fs.js. I found the functions writefilesync and renamesync.

According to: https://nodejs.org/api/fs.html#fs_fs_writefilesync_file_data_options
Both writefilesync and renamesync are the synchronous versions of the functions.

Then I found this article:
http://www.daveeddy.com/2013/03/26/synchronous-file-io-in-nodejs/
Which did a little experiment and comes to the conclusion that the writefilesync and renamesync are synchronous within the node.js context but they tell the operating system to do asynchronous write and rename.
I guess maybe me or you should open a case with Khamake and use something else to write and rename files.

@luboslenco
Copy link
Member

Interesting. Please do open issue at Khamake if you get a spare minute, probably the best to get input from Robert. I guess we must ensure the file already exists at https://github.com/Kode/khamake/blob/master/src/ShaderCompiler.ts#L384.

@3blake7
Copy link
Author

3blake7 commented May 16, 2017

Kode/Khamake #102

@3blake7
Copy link
Author

3blake7 commented Aug 11, 2017

Just wanted to say, still having this issue after switching to 11b and git pull all the latest versions of the modules/submodules. I guess I'll apply the workaround I mentioned in the Kode/Khamake ticket.

@luboslenco
Copy link
Member

Continuing at Kode/khamake#102.

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

No branches or pull requests

2 participants