views:

460

answers:

1

Here's the scenario: I run compc on a source directory to recompile an already existing library after some changes, which completes successfully. Then I remove the library (the .swc file) and re-compile, which causes many errors to be thrown.

Nothing changed in the interim - clearly this should have either succeeded both times or failed both times.

libs/pv3ddebug $ compc -library-path+=.. -source-path=./src -compiler.optimize -include-sources+=./src -output ../pv3ddebug.swc
Loading configuration file /Users/bill/flex_sdk_3/frameworks/flex-config.xml
/Users/bill/lg/vision/libs/pv3ddebug.swc (152944 bytes)

/libs/pv3ddebug $ rm ../pv3ddebug.swc 

/libs/pv3ddebug $ compc -library-path+=.. -source-path=./src -compiler.optimize -include-sources+=./src -output ../pv3ddebug.swc
Loading configuration file /Users/bill/flex_sdk_3/frameworks/flex-config.xml
/Users/bill/lg/vision/libs/pv3ddebug/src/com/phenomblue/pv3ddebug/PV3DDebug.as(45): col: 34 Error: Type was not found or was not a compile-time constant: AdvancedView.

                public function PV3DDebug(view:AdvancedView)
                                               ^
... more errors follow

I think I've found out why the errors are happening, and can correct them, but I'm disturbed that the first compile didn't fail.

I have a theory:

  1. Library A, which pv3ddebug depends on, was correct
  2. pv3ddebug was compiled successfully (and it correctly)
  3. Library A was brought into a state that would fail to compile with pv3ddebug
  4. pv3ddebug was compiled successfully, incorrectly, because compc didn't notice that A was updated to a failing state
  5. deleting pv3ddebug and then recompiling caused compc to try and compile with the new A, and so the compilation failed.

My questions to you: is step 4 a bug? Is this caching behavior I should have expected, or can change with a compiler switch? Is there something going on that my theory doesn't explain?

+1  A: 

You could try -incremental=false. This is supposed to be the default for the command line compiler, but what you're describing sounds like it's enabled.

The bug has since been fixed, but a bit of experimenting shows this should to work like a charm! Kudos, and thank you very much. I looked over that argument list a dozen times without really seeing that switch.
llimllib
I've also noticed similar weird issues with incremental compilation. I think the compc compiler is just buggy.
weiji