除非我先删除文件,否则 Compc(Actionscript 库编译器)不会失败?
场景如下:我在源目录上运行 compc,以在进行一些更改后重新编译已经存在的库,并成功完成。 然后我删除该库(.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.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
我想我已经找到了发生错误的原因,并且可以纠正它们,但我对第一次编译没有失败感到不安。
我有一个理论:
- pv3ddebug 所依赖的库 A 是正确的
- pv3ddebug 已成功编译(并且正确)
- 库 A 进入了无法使用 pv3ddebug 进行编译的状态
- pv3ddebug 已成功编译,但不正确,因为 compc 没有请注意,A 已更新为失败状态,
- 删除了 pv3ddebug,然后重新编译导致 compc 尝试使用新 A 进行编译,因此编译失败。
我的问题是:第 4 步是一个错误吗? 这是我应该预料到的缓存行为,还是可以通过编译器开关进行更改? 是否有什么事情是我的理论无法解释的?
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:
- Library A, which pv3ddebug depends on, was correct
- pv3ddebug was compiled successfully (and it correctly)
- Library A was brought into a state that would fail to compile with pv3ddebug
- pv3ddebug was compiled successfully, incorrectly, because compc didn't notice that A was updated to a failing state
- 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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以尝试-incremental = false。 这应该是命令行编译器的默认设置,但您所描述的听起来像是已启用。
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.