Creating a Porting Task
The porting tool performs in-depth analysis of source code to pinpoint modification points. It provides three core working modes: cross-architecture source code porting, SQL migration, and configuration migration, and outputs a porting solution with row-level precision.
- Source code can be ported from the x86 architecture to the Kunpeng architecture or from a Kunpeng machine of an earlier version to a Kunpeng machine of a later version.
- Scanning the source code by project can improve the accuracy of scan results.
- The files imported to the filter list will be ignored during task execution and will not be displayed in the report. The filter list includes SO dependency libraries, JAR packages, and other dependency binary files. For details about how to filter dependencies, see Importing the Dependency Filter List.
Prerequisites
- You have logged in to the Kunpeng DevKit.
- To include the porting workload in the porting report, click
in the upper right corner of the page and set the Display Workload Estimation Result parameter in Scan Parameter Settings to Yes. - If the glibc version is earlier than 2.28, the automatic translation of assembly files cannot be used. If you want to use this function, click View Installation Guide on the page and perform operations as prompted.
Important Notes
- The build command in the build file in the uploaded source package is executed during the task running. Make sure that the content uploaded is the content to be analyzed and that there are no security issues to ensure normal operation of the server.
- If an architecture source code porting task is in progress, you can select Architecture Source Code Porting only after the task is complete.
Procedure
- Choose Source Code Porting from the navigation pane on the left and click
to create a task. - In the task creation area, set task parameters.Figure 1 Source code porting
Table 1 Source code porting parameters Parameter
Description
Basic Settings
Task Name
A task name is automatically generated by default, which can be modified as required.
- It can contain only letters, digits, periods (.), hyphens (-), and underscores (_).
- It consists of 1 to 64 characters.
Source Code Type
Type of the source code to be scanned. The options are:
- C/C++/ASM
- Fortran
- Go
- Python
- Java
- Scala
Source Code Porting
Select the Source Code Porting options for a scan. The options are:
- Architecture source code porting: Checks and analyzes source files in C/C++/ASM/Fortran/Go/interpreted languages, identifies the code to be ported, and provides porting suggestions. It also supports source code editing and one-click code replacement.
- SQL migration: Extracts SQL statements and associated statements from the source code, annotations, MyBatis Mapper XML files, and SQL files, assesses SQL compatibility and convert SQL statements, and generates patches. This function is available only for the Kunpeng platform.
- Configuration migration: Scans the configuration file for configuration items such as paths and drivers, and provides modification suggestions. This function is available only for the Kunpeng platform.
NOTE:If Source Code Type is set to Java, you can select SQL migration and configuration migration. Only the Kunpeng platform is supported.
- Only Java and .NET source packages are supported.
- For Dockerfile and Docker Compose files, the tool identifies the statements that do not support the Arm architecture and provides modification suggestions. For details about the file matching rules, see Dockerfile and Docker Compose Trustlist and Replacement List.
- The tool detects the drivers, dependencies, Druid, and JPA configurations in the source code, and provides Quick Fix suggestions.
- SQL statement separators can be customized using the CustomSeparator field in the /opt/DevKit/devkitplugins/porting/config/sysmig/sql_analysis/sqlSeparatorConfig.json file. Replace the example installation directory /opt with your actual directory.
- The time needed to load scan suggestions and generate the report depends on the size of the SQL file. For instance, a file containing 10,000 lines takes about 10 seconds to load.
Source File Path
Path for storing the local project or source file.
Set this parameter using either of the following methods:
- Enter the relative path to the source file.
If you upload the file to the path specified by the tool (if the path does not exist, manually create it), grant the read, write, and execute permissions to the devkit user, and then click the text box to select the corresponding source file or folder from the drop-down list.
- Click Upload on the right and select a compressed package or folder.
- If you upload a compressed package, the tool automatically decompresses it to a folder with the same name as the package. For example, if the uploaded package is test.zip, the tool automatically decompresses the package to the test folder.
- Only TAR, TAR.BZ, TAR.BZ2, TAR.GZ, TAR.XZ, TBZ, TBZ2, TGZ, TXZ, and ZIP packages can be uploaded. Only one package can be uploaded at a time. The source package size must be less than or equal to the upper limit (1,024 MB by default). The decompressed file size must be less than or equal to half of the remaining drive space.
- The compressed package must contain only one directory after decompression. If it contains more than one first-level directories after decompression, place these directories in the same directory and choose to upload a folder.
- If you upload a decompressed source code folder, only one folder can be uploaded at a time, and its size must be less than or equal to half of the remaining drive space.
NOTICE:To upload a large number of files, compress them into a single package. This helps prevent the page from becoming unresponsive or the browser from crashing due to performance limitations.
Target OS
This parameter is displayed when Source Code Porting is set to Architecture source code porting. The options are:
- BC-Linux 7.6/7.7
- CentOS 7.4/7.5/7.6/7.7/8.0/8.1/8.2
- CTyunOS 22.06
- Deepin V15.2
- Debian 10
- EulerOS 2.8
- iSoft 5.1
- Kylin V10 SP1/SP2/SP3
- KylinSecOS 3.4/3.5.2
- LinxOS 6.0.90/6.0.100
- LinxOS-EL 6.0.99
- NeoKylin V7U5/V7U6
- openEuler 20.03
- openEuler 20.03 SP1/SP2/SP3
- openEuler 22.03
- openEuler 22.03 SP1/SP2/SP3/SP4
- openEuler 24.03 LTS/SP1
- SUSE SLES 15.1
- Ubuntu 18.04.x/20.04.x
- UOS 20 SP1
- uosEuler 20
- uos20-1020e
- uos20-1050e
- uos20-1060e
- More
NOTE:Click More, upgrade the dependency dictionary according to the steps on the page, and view the updated OS list.
Target OS Kernel Version
This parameter is displayed when Source Code Porting is set to Architecture source code porting.
- BC-Linux 7.6: 4.19.25
- BC-Linux 7.7: 4.19.25
- CentOS 7.4: 4.11.0
- CentOS 7.5: 4.14.0
- CentOS 7.6: 4.14.0
- CentOS 7.7: 4.18.0
- CentOS 8.0: 4.18.0
- CentOS 8.1: 4.18.0
- CentOS 8.2: 4.18.0
- CTyunOS 22.06: 4.19.90
- Deepin V15.2: 4.19.34
- Debian 10: 4.14.0
- EulerOS 2.8: 4.19.36
- iSoft 5.1: 4.19.90
- Kylin V10 SP1: 4.19.90
- Kylin V10 SP2: 4.19.90
- Kylin V10 SP3: 4.19.90
- KylinSecOS 3.4: 4.19.90
- KylinSecOS 3.5.2: 5.10.0
- LinxOS 6.0.90: 4.19.0
- LinxOS-EL 6.0.99: 4.19.90
- LinxOS 6.0.100: 4.19.90
- NeoKylin V7U5: 4.14.0
- NeoKylin V7U6: 4.14.0
- openEuler 20.03: 4.19.90
- openEuler 20.03 SP1: 4.19.90
- openEuler 20.03 SP2: 4.19.90
- openEuler 20.03 SP3: 4.19.90
- openEuler 22.03: 5.10.0
- openEuler 22.03 SP1: 5.10.0
- openEuler 22.03 SP2: 5.10.0
- openEuler 22.03 SP3: 5.10.0
- openEuler 22.03 SP4: 5.10.0
- openEuler 24.03 LTS: 6.6.0
- openEuler 24.03 SP1: 6.6.0
- SUSE SLES 15.1: 4.12.14
- Ubuntu 18.04.x: 4.15.0
- Ubuntu 20.04.x: 5.4.0
- UOS 20 SP1: 4.19.0
- UOS 20 Euler: 4.19.90
- UOS 20-1020e: 4.19.90
- UOS 20-1050e: 4.19.90
- UOS 20-1060e: 4.19.90
Compiler Version
This parameter is displayed when Source Code Porting is set to Architecture source code porting.
The default compiler versions of the target OSs are as follows:
- BC-Linux 7.6: GCC 4.8.5
- BC-Linux 7.7: GCC 4.8.5
- CentOS 7.4: GCC 4.8.5
- CentOS 7.5: GCC 4.8.5
- CentOS 7.6: GCC 4.8.5
- CentOS 7.7: GCC 4.8.5
- CentOS 8.0: GCC 8.2.0
- CentOS 8.1: GCC 8.3.0
- CentOS 8.2: GCC 8.3.0
- CTyunOS 22.06: GCC 7.3.0
- Deepin 15.2: GCC 6.3.0
- Debian 10: GCC 8.3.0
- EulerOS 2.8: GCC 7.3.0
- iSoft 5.1: GCC 7.3.0
- Kylin V10 SP1: GCC 7.3.0
- Kylin V10 SP2: GCC 7.3.0
- Kylin V10 SP3: GCC 7.3.0
- KylinSecOS 3.4: GCC 7.3.0
- KylinSecOS 3.5.2: GCC 10.3.0
- LinxOS 6.0.90: GCC 6.3.0
- LinxOS-EL 6.0.99: GCC 7.3.0
- LinxOS 6.0.100: GCC 8.3.0
- NeoKylin V7U5: GCC 4.8.5
- NeoKylin V7U6: GCC 4.8.5
- openEuler 20.03: BiSheng Compiler 2.5.0.1
- openEuler 20.03 SP1: GCC 7.3.0
- openEuler 20.03 SP2: GCC 7.3.0
- openEuler 20.03 SP3: GCC 7.3.0
- openEuler 22.03: BiSheng Compiler 2.5.0.1
- openEuler 22.03 SP1: GCC 10.3.0
- openEuler 22.03 SP2: GCC 10.3.0
- openEuler 22.03 SP3: GCC 10.3.0
- openEuler 22.03 SP4: GCC 10.3.0
- openEuler 24.03 LTS: GCC 12.3.0
- openEuler 24.03 SP1: GCC 12.3.0
- SUSE SLES 15.1: GCC 7.4.0
- Ubuntu 18.04.x: GCC 7.3.0
- Ubuntu 20.04.x: GCC 9.3.0
- UOS 20 SP1: GCC 8.3.0
- UOS 20 Euler: GCC 7.3.0
- UOS 20-1020e: GCC 7.3.0
- UOS 20-1050e: GCC 7.3.0
- UOS 20-1060e: GCC 7.3.0
For C, C++, ASM, and Go source code, you can select from:
- BiSheng Compiler 2.1.0/2.3.0/2.4.0/2.5.0/2.5.0.1/3.0.0/3.1.0/3.2.0/4.0.0/4.1.0/4.2.0/5.0.0
- GCC 4.8.5/4.9.3/5.1.0/5.2.0/5.3.0/5.4.0/5.5.0/6.1.0/6.2.0/6.3.0/6.4.0/6.5.0/7.1.0/7.2.0/7.3.0/7.4.0/8.1.0/8.2.0/8.3.0/9.1.0/9.2.0/9.3.0/10.1.0/10.2.0/10.3.0/10.3.1/12.3.0
- GCC for openEuler 2.3.7/2.3.8/3.0.1/3.0.2/3.0.3
NOTE:- The C, C++, and ASM languages share the same compiler version with the Go language.
- If both C/C++/ASM and Fortran source code types are selected, the same BiSheng Compiler and Flang versions are used.
For Fortran source code, you can select from:
- GFortran 7/8/9
- FLANG 2.1.0/2.3.0/2.4.0/2.5.0/2.5.0.1/3.0.0/3.1.0/3.2.0/4.0.0/4.1.0/4.2.0/5.0.0
Build Tool
This parameter is displayed when Source Code Porting is set to Architecture source code porting. The options are:
- make
- CMake
- automake
- go
- bazel
- blade
- other
NOTE:- The go option is available only when Source Code Type is Go and Fortran is not selected.
- The bazel and blade options are available only when Source Code Type is C/C++/ASM, either alone or in combination with Java, Python, and/or Scala.
- The Bazel build tool can identify only the compilation options in the BUILD and BUILD.bazel build files and the CPU options in the BUILD, BUILD.bazel, and MODULE.bazel build files.
- The Blade tool can identify only the compilation options in the *.conf, BLADE_ROOT, BLADE_ROOT.local and BUILD build files.
- When both C/C++/ASM and Go are selected for Source Code Type:
- If Build Tool is set to make, the tool scans the source code and Makefile for C/C++ (build-based scan), and scans the source code for Go.
- If Build Tool is set to go, the tool scans the source code and Makefile for C/C++ (full scan), and scans the source code for Go.
- other indicates a build tool that is not supported. If you select this option, a full scan will be performed, which may cause false positives. Exercise caution when selecting other.
Compile Command
Source code build command. The build tools Bazel and Blade do not support this parameter.
The compile command varies according to the build tool configuration file. For details, see Identifying Compile Commands Using the Build Tool Configuration File.
Advanced Settings
Custom x86 Macro
Custom x86 macros.
Use semicolons (;) to separate multiple macros.
Migration Source Database
Select the source database to improve the accuracy of migrating source code SQL statements.
NOTE:- During migration from MySQL to Vastbase, if Vastbase-transform.jar is not deployed in the current environment, you need to configure the related download information. SQL statement compatibility assessment and conversion will not be performed.
- If no source or target database is selected, SQL statements in the source file will not be parsed.
Migration Target Database
Select the target database to improve the accuracy of migrating source code SQL statements.
Origin of Tool Package
Where the tool package comes.
- Download from URL: Vastbase-transform.jar is automatically downloaded from the Kunpeng mirror site to the DevKit node.
- Upload tool package: Copy the tool package download link in the information below and obtain Vastbase-transform.jar.
Upload Tool Package
Click Upload to upload the downloaded Vastbase-transform.jar.
NOTE:This parameter is displayed when Origin of Tool Package is set to Upload tool package.
DDL
You are advised to configure a DDL for each of the SQL source packages to be scanned. A DDL file records complete information about database tables and fields. DDL statements can improve the accuracy of SQL statement parsing. For details about how to obtain a DDL file, see Exporting a DDL File.
Middleware Type
- N/A
- BES migration strategy: The uploaded source package contains the built-in Tomcat configuration files and you need to migrate to the built-in BES files.
- TongTech migration strategy: The uploaded source package contains the built-in Tomcat configuration files and you need to migrate to the built-in TongTech files.
- Click Start to generate a migration report.
The task progress is displayed. After the task is complete, the porting report is displayed.
- To cancel an ongoing task, click the close button on the progress bar and click OK.
- Multiple users can create analysis tasks concurrently. However, if the number of users exceeds 9, subsequent users may be placed in a queue.
- If the task analysis fails or the evaluation result indicates that porting is not required, an empty report is generated.
- The tool considers that a file does not need to be ported and thus does not scan the file by default if the path to the decompressed source code file contains the following keywords, or the keywords prefixed with an underscore (_), followed by an underscore (_), or followed by a file name extension. You can view the files that are not scanned in the porting.log file.
Keywords: PPC, PPC64, s390, s390x, powerpc, alpha, MIPS, itanium, WIN64, WIN32, BOOST_COMP_MSVC, arm, aarch64, sparc, sparc64
- The analysis result may vary according to the environment, which is normal.
- If the system displays a message indicating that the task times out, rectify the fault by following instructions in Task Timeout.