Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]

Compile.lua script not removing .lu files on path with spaces
Started by RedBeach Jan 04 2018 11:23 PM

- - - - -
2 replies to this topic
enterprise build issue bug compile.lua
This topic has been archived. This means that you cannot reply to this topic.
[TOPIC: post.html]


[GLOBAL: userInfoPane.html]
  • Corona Geek

  • 1,132 posts
  • Corona SDK

I noticed that on some Android projects I could see the (compiled) .lu files inside the assets folders.


I was pretty sure that they are not needed since they are all combined in the resources.car file during building.


After some digging, I found out that the issue is that the command do remove the .lu files is not properly escaping paths that have spaces.


The current command for non-windows machine is:


Compile.lua (line 378)

print( 'Removing: ' .. CORONA_TARGET_EXECUTABLE_DIR .. '/*.lu' )
local result = os_execute( 
    'find -H',
'-maxdepth 1 -name "*.lu" -print', -- avoid cmd line length issues with "*.lu" 
'xargs rm -f')

but when you do a FIND, the paths will be printed to the console without the proper escaping.


So, if you do not want to have several unused files in your app, you have 2 options:


a ) Make sure that your project path does not have spaces




b ) Change the code above of compile.lua file (../Corona Enterprise/Corona/shared/bin/Compile.lua) to escape the files path for you.  A modified version working version could be:

print( 'Removing: ' .. escape(CORONA_TARGET_EXECUTABLE_DIR) .. '/*.lu' )
local result = os.execute(
    'find -H ' ..
' -maxdepth 1 -name "*.lu" -print' .. -- avoid cmd line length issues with "*.lu"
' |' ..
" sed 's/ /\\\\ /g'" ..
' |' ..
' xargs rm -f')

Be aware that any change to the compile.lua file would be lost when you upgrade your Corona to a new version. Hopefully Corona folks will see this post and fix that issue on a future daily build.

UPDATE: This was fixed on Corona 2018.3194 daily build.

[TOPIC: post.html]

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,649 posts
  • Enterprise

Can you file a bug report on this please to make sure we get it into our tracking system?




[TOPIC: post.html]


[GLOBAL: userInfoPane.html]
  • Contributor

  • 669 posts
  • Corona Staff

Good Catch! Thanks!


EDIT: this will be fixed in next daily build