Skip to content

How to sync rexompiler with ROSE official

Yonghong Yan edited this page Feb 1, 2023 · 12 revisions

Cherry-pick (2023/02/01).

Need to check each commit from https://github.com/rose-compiler/rose/commits/develop till 2022/09/01 to see which one makes sense and manually merge in

Sync and merge methods:

The approach is by merging a latest rexompiler branch to the ROSE/develop branch, then manually fix files that have conflicts. This is normally done in two steps of two commits: the first commit deletes those files that we do not use for creating REX compiler, and adds new files for REX. The second commit modify the files that are conflict and need to be resolved.

Steps (09/01/2022)

Fetch both rexompiler/dev and rose-compiler/rose/develop branch, and checkout rose-compiler/rose/develop branch as develop branch

  1. git rm those folders that are obviously deleted for rexompiler:

      git rm -rf projects python solaris-includes winspecific install-staging scripts/lc scripts/spack scripts/tup tutorial/binaryAnalysis tutorial/intelPin/ tests/CompileTests/x10_tests tests/smoke/specimens/binary tests/nonsmoke/specimens/binary tests/smoke/specimens/java tests/nonsmoke/specimens/java tests/nonsmoke/functional/CompileTests/experimental_ada_tests tests/nonsmoke/functional/CompileTests/UPC_tests tests/nonsmoke/functional/CompileTests/experimental_jovial_tests tests/nonsmoke/functional/CompileTests/vxworks_tests tests/nonsmoke/functional/CompileTests/x10_tests tests/nonsmoke/functional/roseTests/roseHPCToolkitTests tutorial/TAU_INCLUDE_DIR tutorial/roseHPCT tests/nonsmoke/functional/CompileTests/FailSafe_tests tests/nonsmoke/functional/CompileTests/experimental_cobol_tests tests/nonsmoke/functional/CompileTests/experimental_csharp_tests tests/nonsmoke/functional/CompileTests/experimental_matlab_tests
    
      git rm -rf src/frontend/ECJ_ROSE_Connection src/frontend/DLX src/frontend/BinaryFormats src/frontend/Disassemblers src/midend/KLT/ src/midend/MDCG src/midend/MFB src/backend/asmUnparser src/frontend/Experimental_OpenFortranParser_ROSE_Connection src/midend/programAnalysis/annotationLanguageParser src/frontend/Experimental_Flang_ROSE_Connection src/ROSETTA/src/java
    
      git rm -rf src/3rdPartyLibraries/aterm-bundle-2.2.tar.gz src/3rdPartyLibraries/experimental-cobol-parser src/3rdPartyLibraries/experimental-cplusplus-parser src/3rdPartyLibraries/experimental-fortran-parser src/3rdPartyLibraries/experimental-jovial-parser src/3rdPartyLibraries/qrose src/3rdPartyLibraries/POET src/3rdPartyLibraries/java-parser  src/roseIndependentSupport src/roseExtensions/highLevelGrammar src/3rdPartyLibraries/flang-parser
    
      git rm -rf src/ROSETTA/src/x10 src/roseAPI src/roseExtensions/failSafe src/roseExtensions/qtWidgets src/roseExtensions/roseHPCToolkit src/roseExtensions/dataStructureTraversal
    
      find . -name BinaryAnalysis -exec git rm -rf {} \;
      find . -name "*Java*" -type d -exec git rm -rf {} \;
      find . -name "*Python*" -type d -exec git rm -rf {} \;
      find . -name "*PHP*" -type d -exec git rm -rf {} \;
      find . -name "*Ada*" -type d -exec git rm -rf {} \;
      find . -name "*Jovial*" -type d -exec git rm -rf {} \;
      find . -name "*X10*" -type d -exec git rm -rf {} \;
      find . -name "*Cobol*" -type d -exec git rm -rf {} \;
      find . -name "*Csharp*" -type d -exec git rm -rf {} \;
      find . -name "*Matlab*" -type d -exec git rm -rf {} \;
    
  2. git rm files that are not needed based on file name relevance. This step needs to be careful. You have to first use find command to list the file with specific string in the file name, and then check to make sure they are the files that need to be removed. If you are not sure whether a file should be removed or not, do not remove. The following find git rm command pair need to be executed with care, and you must check to make sure you are remove the right files.

      find . -name *Binary* -ls
      git rm -rf src/Rose/BinaryAnalysis.h src/ROSETTA/Grammar/BinaryInstruction.code
    
      find . -name *binary* -ls
      git rm -rf tutorial/binary* config/support-binary.m4 .gitlab-binary-analysis.yml src/ROSETTA/src/binaryInstruction.C
    
      find . -name *Ada* -ls
      git rm -rf src/frontend/SageIII/sageInterface/sageInterfaceAda.C src/frontend/SageIII/sageInterface/sageInterfaceAda.h 
    
      find . -name "*Tup*" -exec git rm -rf {} \;
    
  3. git rm files that are manually deleted one by one by rexompiler. The list file is generated by creating a merge first from rexompiler/dev--> rose/develop, then inspecting those files that should be deleted, and then git rm to delete. The way that works better is to paste the git status output to a file, inspect the file, leave the lines with deleted: ... or deleted by them: ... that have files you want to delete, remove all other lines, and then using vim replacing command to modify those lines to have git rm -rf . E.g. the vim command is :%s/deleted:/git rm -rf/g and :%s/deleted by them:/git rm -rf /g. Below is the list of files that are deleted in 09/01/2022 merging:

     git rm -rf     .gitlab-fullrelease.yaml
     git rm -rf     config/ax_boost_serialization.m4
     git rm -rf     config/ax_python_devel.m4
     git rm -rf     config/bupc_extensions.h
     git rm -rf     config/mdl_have_opengl.m4
     git rm -rf     config/mdl_have_opengl_2014.m4
     git rm -rf     config/qrose_indigo_1.m4
     git rm -rf     config/qrose_indigo_1_windows.m4
     git rm -rf     config/support-IntelPin.m4
     git rm -rf     config/support-aterm.m4
     git rm -rf     config/support-backend-x10.m4
     git rm -rf     config/support-backstroke.m4
     git rm -rf     config/support-bddbddb.m4
     git rm -rf     config/support-cobol.m4
     git rm -rf     config/support-compass2.m4
     git rm -rf     config/support-flang.m4
     git rm -rf     config/support-frontend-x10.m4
     git rm -rf     config/support-gnat.m4
     git rm -rf     config/support-haskell.m4
     git rm -rf     config/support-ida.m4
     git rm -rf     config/support-magic.m4
     git rm -rf     config/support-maple.m4
     git rm -rf     config/support-mpi.m4
     git rm -rf     config/support-octave.m4
     git rm -rf     config/support-php.m4
     git rm -rf     config/support-python-api.m4
     git rm -rf     config/support-python.m4
     git rm -rf     config/support-readline.m4
     git rm -rf     config/support-rted.m4
     git rm -rf     config/support-rtedupc.m4
     git rm -rf     config/support-sat.m4
     git rm -rf     config/support-stratego.m4
     git rm -rf     config/support-windows.m4
     git rm -rf     config/support-x10.m4
     git rm -rf     config/support-z3.m4
     git rm -rf     config/support_POET.m4
     git rm -rf     config/upc.h
     git rm -rf     config/upc_collective.h
     git rm -rf     config/upc_io.h
     git rm -rf     config/upc_relaxed.h
     git rm -rf     config/upc_strict.h
     git rm -rf     cuda-headers.tgz
     git rm -rf     src/ROSETTA/Grammar/grammarAtermConstructorDefinitionMacros.macro
     git rm -rf     src/ROSETTA/src/java/terminals.cpp
     git rm -rf     src/frontend/Experimental_General_Language_Support/ModuleBuilder.h
     git rm -rf     src/frontend/SageIII/atermSupport.C
     git rm -rf     src/frontend/SageIII/atermSupport.h
     git rm -rf     src/frontend/SageIII/dwarfSupport.h
     git rm -rf     src/frontend/SageIII/omplexer.ll
     git rm -rf     src/frontend/SageIII/ompparser.yy
     git rm -rf     src/frontend/SageIII/sageInterface/sageInterfaceAsm.C
     git rm -rf     src/frontend/SageIII/sageInterface/sageInterfaceAsm.h
     git rm -rf     src/frontend/SageIII/sageInterface/sageInterface_asm.C
     git rm -rf     src/frontend/SageIII/virtualCFG/virtualBinCFG.C
     git rm -rf     src/frontend/SageIII/virtualCFG/virtualBinCFG.h
     git rm -rf     tutorial/dwarfAnalysis.C
     git rm -rf     tutorial/dwarfInstructionAddressToSourceLineAnalysis.C
     git rm -rf     tutorial/inputCode_binaryAST_1.c
     git rm -rf     tutorial/inputCode_tauInstrumenter.C
    
     git rm -rf config/support-dwarf.m4
     git rm -rf config/support-elf.m4
     git rm -rf config/support-i386.m4
     git rm -rf config/support-yamlcpp.m4
     git rm -rf src/ROSETTA/src/buildAtermSupport.C
     git rm -rf src/frontend/Experimental_General_Language_Support/SageTreeBuilder.C
     git rm -rf src/frontend/Experimental_General_Language_Support/SageTreeBuilder.h
     git rm -rf src/frontend/SageIII/dwarfSupport.C
     git rm -rf src/frontend/SageIII/nodeBuildFunctionsForAterms.C
     git rm -rf src/frontend/SageIII/sageInterface/SageBuilderAsm.C
     git rm -rf src/frontend/SageIII/sageInterface/SageBuilderAsm.h
    
  4. At this point, all the files that should be deleted directly are removed. We will do the manual merge in this step by fixing those conflict that cannot be solved by git merge. The tool used is CLion git interface that allows to resolve each conflicted files one by one. For each hunk in the conflict file, It allows you to select which change to use or edit by yourself. This is the most time-consuming step

  5. Build the new merged repo and fix error one by one. This involve running build, configure and make to build the merge source tree, fixing/deleting/recovering code, and do it again. During this long process, some files might be directly deleted or recovered.

  6. Run test and fix bugs that are introduced and trigged at this execute/test step. Some stupid bugs might be introduced in previous steps that have to be fixed in this steps.

The above five steps involved for about 20 commits starting from https://github.com/passlab/rexompiler/commit/8c1713f846266f45e8f6a3dab434782771e6479e

Sync Logs:

2021, October 28: https://github.com/passlab/rexompiler/commit/c63cdfe79ab762c1b8a2ac572fba404bc4df843f

Clone this wiki locally