Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

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
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

RedBeach

[GLOBAL: userInfoPane.html]
RedBeach
  • 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',
escape( CORONA_TARGET_EXECUTABLE_DIR ),
'-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

 

or

 

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 ' ..
escape( CORONA_TARGET_EXECUTABLE_DIR ) ..
' -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.


  • roaminggamer likes this

[TOPIC: post.html]
#2

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 23,695 posts
  • Corona Staff

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

 

Thanks

Rob



[TOPIC: post.html]
#3

vlads

[GLOBAL: userInfoPane.html]
vlads
  • Contributor

  • 488 posts
  • Corona Staff

Good Catch! Thanks!

 

EDIT: this will be fixed in next daily build


  • roaminggamer likes this


[topic_controls]
[/topic_controls]

Also tagged with one or more of these keywords: enterprise, build, issue, bug, compile.lua