ascsh icon indicating copy to clipboard operation
ascsh copied to clipboard

win32: source file exclusive access locks

Open neolit123 opened this issue 11 years ago • 11 comments

hello,

i've just tried the current 'master' branch with 'ant install' on the latest AIR SDK / win32.

it works great, but one problem that i've noticed is that if you run 'compile 1' on the simplest of Main.as projects with a deliberate small error you will find that after MXMLC displays the error, java.exe locks the file (assuming LockFile() from the WINAPI) and the file cannot be changed until ASCSH is stopped (i.e. the jave.exe process is stopped) or the file is manually unlocked by another process.

this issue prevents fixing errors / warnings in any source file that was just compiled by MXMLC via ASCSH.

any possible solutions?

neolit123 avatar Nov 10 '14 12:11 neolit123

Fascinating. Since ascsh is a thin wrapper around MXMLC, it knows nothing about source files, and MXMLC provides very few public functions.

I wonder why FlashDevelop users (also win32) don't see this issue. Maybe FD unlocks source files manually? @elsassph - any idea about MXMLC locking source files?

Hmm, the solution may have to be some external script that manually unlocks the source files.

jcward avatar Nov 10 '14 15:11 jcward

We don't do anything special to unlock the files and never saw this behaviour - does that happen with previous versions of the AIR SDK?

elsassph avatar Nov 10 '14 20:11 elsassph

yes, just tried and it happens with AIR SDK 13 as well.

FD is not affected.

neolit123 avatar Nov 10 '14 20:11 neolit123

looking at TaskManager while FD compiles - it calls fdbuild.exe then it leaves a java.exe (some sort of IPC scheme here, i assume), while exiting fdbuild.exe. but unlike starting ASCSH and using the shell from console, the java.exe that FD instantiates does not lock the source files.

neolit123 avatar Nov 10 '14 20:11 neolit123

I notice FD's version isn't up to date: https://github.com/elsassph/ascsh

You possibly want to compare them.

elsassph avatar Nov 10 '14 20:11 elsassph

Yes that's IPC. The Java process is maintained by FlashDevelop.exe.

elsassph avatar Nov 10 '14 20:11 elsassph

I notice FD's version isn't up to date: https://github.com/elsassph/ascsh

You possibly want to compare them.

just tried it - the same issue occurs.

neolit123 avatar Nov 10 '14 20:11 neolit123

Then the difference may be the Java runtime, or the arguments...

elsassph avatar Nov 10 '14 21:11 elsassph

that java.exe process is versioned as follows for both ASCSH standalone and FD: java version "1.7.0_21" Java(TM) SE Runtime Environment (build 1.7.0_21-b11) Java HotSpot(TM) 64-Bit Server VM (build 23.21-b01, mixed mode)

also tried the exact same arguments that mxmlc-cli from FD uses in ASCSH and the issue still happens.

neolit123 avatar Nov 10 '14 21:11 neolit123

I have similar issue: files that have errors in them kept locked preventing me from deleting/renaming them. Though I still able to edit/save them. FlashDevelop 5.0.1.3 Java 1.8.0_45 ascsdk 17 Windows 8.1

id-ilych avatar Jul 20 '15 09:07 id-ilych

Hmm, as an aside, I don't have this problem using ascshd from the commandline in Linux, though that's a obviously different environment.

jcward avatar Jul 21 '15 14:07 jcward