VS2015 Cordova MDAVSCLI : error : EBUSY, resource busy or locked symlink

白昼怎懂夜的黑 提交于 2020-01-07 05:38:08

问题


I have a solution structure in which I´m using some projects with symbolic links to allow an easy reuse of code among different solutions.

It was working flawlessly on VS2013 CTP3.1, but on VS2015 I keep getting ,intermittently, the following:

MDAVSCLI : error : EBUSY, resource busy or locked 'F:\Github\softwrench\softwrench.sw4.pae\offline_content\pae'
1>      at Error (native)
1>      at Object.fs.symlinkSync (fs.js:848:18)
1>      at cpdirSyncRecursive (C:\Users\rolim\AppData\Roaming\npm\node_modules\vs-tac\node_modules\cordova\5.1.1\node_modules\cordova\node_modules\cordova-lib\node_modules\shelljs\src\cp.js:76:10)
1>      at cpdirSyncRecursive (C:\Users\rolim\AppData\Roaming\npm\node_modules\vs-tac\node_modules\cordova\5.1.1\node_modules\cordova\node_modules\cordova-lib\node_modules\shelljs\src\cp.js:73:7)
1>      at C:\Users\rolim\AppData\Roaming\npm\node_modules\vs-tac\node_modules\cordova\5.1.1\node_modules\cordova\node_modules\cordova-lib\node_modules\shelljs\src\cp.js:180:9
1>      at Array.forEach (native)
1>      at Object._cp (C:\Users\rolim\AppData\Roaming\npm\node_modules\vs-tac\node_modules\cordova\5.1.1\node_modules\cordova\node_modules\cordova-lib\node_modules\shelljs\src\cp.js:157:11)
1>      at Object.cp (C:\Users\rolim\AppData\Roaming\npm\node_modules\vs-tac\node_modules\cordova\5.1.1\node_modules\cordova\node_modules\cordova-lib\node_modules\shelljs\src\common.js:186:23)
1>      at android_parser.update_www (C:\Users\rolim\AppData\Roaming\npm\node_modules\vs-tac\node_modules\cordova\5.1.1\node_modules\cordova\node_modules\cordova-lib\src\cordova\metadata\android_parser.js:316:11)
1>      at C:\Users\rolim\AppData\Roaming\npm\node_modules\vs-tac\node_modules\cordova\5.1.1\node_modules\cordova\node_modules\cordova-lib\src\cordova\prepare.js:96:20

I looked at the code and it seems to try to handle symlinks, so It seems like a bug:

 if (srcFileStat.isDirectory()) {
  /* recursion this thing right on back. */
  cpdirSyncRecursive(srcFile, destFile, opts);
} else if (srcFileStat.isSymbolicLink()) {
  var symlinkFull = fs.readlinkSync(srcFile);
 76: fs.symlinkSync(symlinkFull, destFile, os.platform() === "win32" ? "junction" : null);
} else {
  /* At this point, we've hit a file actually worth copying... so copy it on over. */
  if (fs.existsSync(destFile) && !opts.force) {
    common.log('skipping existing file: ' + files[i]);
  } else {
    copyFileSync(srcFile, destFile);
  }
}

Anyone would know what´s going on here?

tks


回答1:


In the end the only solution I could come up with was to edit the cp.js file of the cordova-lib project, for line 71, so that symlinks got the same handling as ordinary directories:

So:

if (srcFileStat.isDirectory()) {

Became:

if (srcFileStat.isDirectory() || srcFileStat.isSymbolicLink()) {

Not sure if any implications, not that I´ve noticed so far.

Hope it helps anyone else



来源:https://stackoverflow.com/questions/31813938/vs2015-cordova-mdavscli-error-ebusy-resource-busy-or-locked-symlink

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!