On Wed, 29 Mar 2023 08:46:53 GMT, Lukasz Kostyra <lkost...@openjdk.org> wrote:

>> Issue: Error copying file (if different) from 
>> Source/JavaScriptCore/Scripts/wkbuiltins/builtins_generate_separate_header.py"
>>  to 
>> "modules/javafx.web/build/mac/Release/JavaScriptCcripts/builtins_generate_separate_header.py".
>> 
>> Root cause: The number of build threads more than 8, causing a 
>> synchronization issue for builtins_generate_separate_header.py, the file 
>> needs to be copied before use at build dir
>> 
>> Solution: Use the sleep of 1 second and retry 10 times to copy in 
>> CMakeList.txt and execute using the execute_process cmake command
>
> modules/javafx.web/src/main/native/Source/JavaScriptCore/CMakeLists.txt line 
> 198:
> 
>> 196:         )
>> 197:         if(copy_result)
>> 198:             message(WARNING "Failed to copy ${_file} to 
>> ${JavaScriptCore_SCRIPTS_DIR}/${_script}: ${copy_output}")
> 
> Shouldn't `${copy_output}` at the end of this message be `${copy_result}`?
> 
> If not, I think it would be worth to print the `${copy_result}` variable 
> regardless, in case there are any issues with the copy process.

do you mean as 
if(copy_result)
            message(WARNING "Failed to copy ${_file} to 
${JavaScriptCore_SCRIPTS_DIR}/${_script}: ${copy_output}")
should be as

if(copy_result)
            message(WARNING "${copy_result")

> modules/javafx.web/src/main/native/Source/JavaScriptCore/CMakeLists.txt line 
> 210:
> 
>> 208:     endif()
>> 209:     endif() # end for port "Java"
>> 210:     add_custom_command(
> 
> Suggestion: I feel this add_custom_command doesn't have to be called anymore 
> because our loop did that job already. Maybe this old behavior should be 
> fallen back to only when we're not fulfilling the PORT "Java" condition, or 
> it should be removed completely.
> 
> So, in short:
> 
> if(PORT STREQUAL "Java")
>   # code for 10-try loop
> else() # else for port "Java"
>   # old add_custom_command call
> endif() # end for port "Java"
> 
> 
> Or keep the code as is and remove this add_custom_command call. What do you 
> think?

I intentionally left the previous code unchanged. 
    add_custom_command(
        OUTPUT ${JavaScriptCore_SCRIPTS_DIR}/${_script}
        MAIN_DEPENDENCY ${_file}
        WORKING_DIRECTORY ${JavaScriptCore_DERIVED_SOURCES_DIR}
        COMMAND ${CMAKE_COMMAND} -E copy_if_different ${_file} 
${JavaScriptCore_SCRIPTS_DIR}/${_script}
        VERBATIM)
copy_if_different  will do nothing , if the changed code already did copy

incase of our changed code fail , the remaining add_custom_comand would prevent 
build issue.

-------------

PR Review Comment: https://git.openjdk.org/jfx/pull/1073#discussion_r1151744460
PR Review Comment: https://git.openjdk.org/jfx/pull/1073#discussion_r1151744625

Reply via email to