Comments (14)
Hm, just noticed there is always Recompiling xyz.frag
line before it errors out, maybe I should investigate that first.
from khamake.
Looks like the same issue is happening to \win32\Kha\Tools\khamake\out\ImageTool.js as well. When it reexports, it overwrites the file, and renameSync is running before the rewrite operation is completed, giving the following error:
Exporting asset 1 of 1 (spacestation-residential-unit-d06b018.png).
Reexporting spacestation-residential-unit-d06b018
fs.js:809
return binding.rename(pathModule._makeLong(oldPath),
^
Error: EBUSY: resource busy or locked, rename 'C:\Users\blake\Documents\blender\build\html5\spacestation-residential-unit-d06b018.png.temp' -> 'C:\Users\blake\Documents\blender\build\html5\spacestation-residential-unit-d06b018.png'
at Error (native)
at Object.fs.renameSync (fs.js:809:18)
at ChildProcess.process.on (C:\Users\blake\Downloads\Armory3D\Armory\armsdk\win32\Kha\Tools\khamake\out\ImageTool.js:63:16)
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
from khamake.
function fileready(file) {
var i = 0;
while ( i == 0 ) {
if (!fs.access(file, function(err){
return(err);
})) {
i = 1;
}
}
}
Im running the above function right before fs.renameSync on ImageTool.js and ShaderCompiler.js.. it seems to be working. Probably not the best solution lol Im not a programmer by trade.
from khamake.
Now I get it. This is running in --watch mode and happens while the program is running, right? Something like fileready might just be the right fix then.
from khamake.
I am still confused since there is no --watch used in armory but the Recompiling/Reexporting messages are signs of that. Can't get to reproduce on my machine for some reason. @fractalfederation does it error out even on the default scene with a single cube, or just more complex ones?
from khamake.
Yea it errors out on default scene. I just got the error again with nothing but a cube. I guess I did my function wrong and it was just a coincidence that it stopped getting the error after I added it yesterday.
from khamake.
function KhaRename(file) {
var i = 0;
while(i == 0) {
try {
fs.renameSync(file, file.slice(0,-5));
i++;
} catch (err) {
console.log(err);
}
}
}
I've been using the above code. It still errors and sometimes it errors forever. I looked at the build/html5/ directory for the image and it was already there without the .temp at the end of the file name. Adding the .temp at the end of the image allowed the script to finish. This was with a fresh build, I ran Clean Project which deleted the build directory.
So maybe it is renaming file and trying a second time? or the file is created initially without the .temp and a rename is unnecessary?
I am such a noob lol
Here is the error:
{ Error: ENOENT: no such file or directory, rename 'C:\Users\blake\Documents\blender\build\html5\spacestation-residential-unit-d06b018.png.temp' -> 'C:\Users\blake\Documents\blender\build\html5\spacestation-residential-unit-d06b018.png'
at Error (native)
at Object.fs.renameSync (fs.js:809:18)
at KhaRename (C:\Users\blake\Downloads\Armory3D\Armory\armsdk\win32\Kha\Tools\khamake\out\ImageTool.js:20:7)
at ChildProcess.process.on (C:\Users\blake\Downloads\Armory3D\Armory\armsdk\win32\Kha\Tools\khamake\out\ImageTool.js:74:13)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:852:16)
at Socket.<anonymous> (internal/child_process.js:323:11)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
errno: -4058,
code: 'ENOENT',
syscall: 'rename',
path: 'C:\\Users\\blake\\Documents\\blender\\build\\html5\\spacestation-residential-unit-d06b018.png.temp',
dest: 'C:\\Users\\blake\\Documents\\blender\\build\\html5\\spacestation-residential-unit-d06b018.png' }
from khamake.
I got somewhat similar(but not the same) trouble on Windows 10 machine today targeting html5.
Using --to
parameter to specify output dir in khamake and passing absolute path results in -webgl2
& -relaxed
shaders being left with .temp
extension. Passing relative path instead seems to fix the problem.
from khamake.
It seems to be two different issues, it happens with the shader files and image files. Sometimes it tries to rename a file that doesn't exist, but if you wait and try again, then it exists and renames successfully. Other times, the file is already renamed.
Here is the workaround I am currently using:
function KhaRename(file) {
var i = 0;
while(i == 0) {
try {
fs.renameSync(file, file.slice(0,-5));
i++;
} catch (err) {
console.log(err);
if (fs.existsSync(file.slice(0, -5))) {
i++;
}
}
}
}
Hope this helps. If you figure out a fix, I subscribed and get the message right away, so I'll hop on and test it.
from khamake.
Hi all :)
I encountered the problem on my project. After some tests, I discovered it was because of the dot in the folder name:
C:\Dames.chinoises
By changing the folder name to:
C:\Dames_chinoises
it was ok.
from khamake.
I checked mine, I didn't see any periods but I do have hyphens, ampersands, underscores and even cyrillic characters.
Sure it wasn't a coincidence? When I ran build multiple times, it would create the missing file on the last attempt and no longer error out on that particular file. If you run it enough times, it eventually gets through all the missing files.
from khamake.
There are probably several ways to get this error.
In my case, even if I run build multiple times and get the missing files, at the end I always get a black screen (html5 target).
I tried many times with different folder names, using Kode Studio or a batch file, and I still get the same result.
Unfortunately I don't know enough to analyze, I just hope it helps to understand and fix the problem.
from khamake.
(updated)
Running node Kha/make html5
on macOS High Sierra now also throws error when using .
in path.
Compiling shader 1 of 8 (painter-colored.frag.glsl).
fs.js:773
return binding.rename(pathModule._makeLong(oldPath),
^
Error: ENOENT: no such file or directory, rename 'build/html5-resources/painter-colored.frag.essl.temp' -> 'build/html5-resources/painter-colored.frag.essl'
from khamake.
The dot problem was a separate thing which is now also fixed.
from khamake.
Related Issues (20)
- Chokidar ignore assets and shaders when the path contains a "." HOT 7
- [addProject] assets exported to wrong path
- [addProject] nested addProject calls don't seem to work
- Resource busy or locked HOT 5
- Source code not recompiled on change HOT 11
- project.addAssets with absolute path fails
- --haxe3 doesn't work with --watch HOT 3
- Automate kha_version define HOT 5
- Texture atlas generation HOT 9
- Issues Building With Latest Khamake+Koremake HOT 13
- addAssets('../Assets/**') not including files HOT 3
- A library's addDefine gets ignored HOT 1
- Chokidar v3 request
- Shader compiler error writes to log.info() instead of log.error()?
- A library's full path is used for addDefine
- khafile.js -> await project.addProject("xyz") breaks code-completion (haxe doesn't build cache anymore) HOT 5
- CLI flag grep compat
- Should return non-success error code on compilation failure
- Store/query mapping from original asset filenames to renamed/converted asset filenames
- Khamake silently ignores khafile.js errors
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from khamake.