CN113721916B - Compiling method, device and equipment of operating system and readable storage medium - Google Patents
Compiling method, device and equipment of operating system and readable storage medium Download PDFInfo
- Publication number
- CN113721916B CN113721916B CN202110864577.7A CN202110864577A CN113721916B CN 113721916 B CN113721916 B CN 113721916B CN 202110864577 A CN202110864577 A CN 202110864577A CN 113721916 B CN113721916 B CN 113721916B
- Authority
- CN
- China
- Prior art keywords
- compiled
- source code
- compiling
- code package
- current source
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 54
- 238000001514 detection method Methods 0.000 claims abstract description 6
- 230000001419 dependent effect Effects 0.000 claims description 16
- 230000007613 environmental effect Effects 0.000 claims description 9
- 238000004590 computer program Methods 0.000 claims description 8
- 238000007781 pre-processing Methods 0.000 claims description 4
- 230000008569 process Effects 0.000 abstract description 10
- 238000012545 processing Methods 0.000 description 9
- 238000004891 communication Methods 0.000 description 4
- 238000010586 diagram Methods 0.000 description 4
- 230000009471 action Effects 0.000 description 3
- 238000013473 artificial intelligence Methods 0.000 description 3
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 238000011161 development Methods 0.000 description 3
- 230000000694 effects Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000009877 rendering Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 125000004122 cyclic group Chemical group 0.000 description 1
- 230000001351 cycling effect Effects 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 230000005055 memory storage Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 230000001052 transient effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/41—Compilation
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Devices For Executing Special Programs (AREA)
- Stored Programmes (AREA)
Abstract
The application discloses a compiling method, a device, equipment and a readable storage medium of an operating system, which do not need to analyze the dependency relationship among all source code packages to be compiled in advance, but randomly select the source code packages to be compiled, firstly checking whether current environment parameters meet the compiling conditions of the source code packages to be compiled, if so, then skipping the current source code packages to be compiled, and entering the compiling condition detection and compiling process of the next source code packages to be compiled. Therefore, the compiling method of the operating system does not need to consume a great deal of time in the problem of analyzing the dependency relationship among all the source code packages to be compiled in advance, and can not cause compiling failure due to the fact that the compiling condition of the source code packages to be compiled is not met due to the uncertain dependency relationship, and the problem of compiling environment can be immediately eliminated when the compiling is failed, so that the overall compiling time can be effectively reduced, and the compiling efficiency of the operating system is improved.
Description
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a compiling method, device, equipment and readable storage medium for an operating system.
Background
With the development of information technology, especially the development of mobile internet, the problems caused by using foreign operating systems are increasing, especially the information security, and more people are realizing the importance of the development of domestic operating systems, and at present, china is also developing domestic operating systems. The compiling methods of the current operating system mainly comprise the following two methods: firstly, a minimizing compiling system relying on an open source constructs a minimizing compiling environment of the minimizing compiling system, and continuously and repeatedly compiles on the basis of the minimizing compiling environment of the minimizing compiling system until the operating system is completely compiled; and secondly, analyzing the dependency relationship of all the source code packages in the operating system, so that the compiling sequence is determined through the dependency relationship of all the source code packages, and the source code packages are compiled in sequence.
If the first cyclic compiling scheme is adopted, because the source code packets of the operating system have a dependency relationship, the compiling can be successfully completed by cycling for many times, and the compiling time may be extremely long; and compiling without knowing the dependency relationship will be highly likely to cause compiling failure, and the reasons for the compiling failure are many, and the problem of determining the compiling order is only possible after many times of construction failures without knowing the compiling order, which is very time-consuming. If the second scheme of compiling after analyzing the dependency relationship is adopted, in order to completely determine the compiling sequence, the dependency relationship between each source code packet needs to be analyzed, and the dependency relationship is complicated like a network, so that the analysis process becomes very complicated, and is time-consuming and labor-consuming.
The technical problem to be solved by the person skilled in the art is to provide an operating system compiling scheme for improving compiling efficiency.
Disclosure of Invention
The purpose of the application is to provide a compiling method, a compiling device, compiling equipment and a readable storage medium of an operating system, which are used for improving the compiling efficiency of the operating system.
In order to solve the above technical problems, the present application provides a compiling method of an operating system, including:
acquiring source code packages to be compiled of a target operating system, and randomly generating a task queue to be compiled according to each source code package to be compiled;
acquiring the current source code package to be compiled according to the sequence of the task queue to be compiled;
determining the current compiling condition of the source code package to be compiled;
detecting to obtain current environmental parameters;
if the current environment parameters meet the current compiling conditions of the source code package to be compiled, executing the compiling task of the current source code package to be compiled;
if the current environment parameters do not meet the current compiling conditions of the source code package to be compiled, skipping the current source code package to be compiled, and entering the step of determining the compiling conditions of the current source code package to be compiled after the next source code package to be compiled is the current source code package to be compiled.
Optionally, the generating a task queue to be compiled according to each source code packet to be compiled includes:
analyzing each source code packet to be compiled to obtain compiling information of each source code packet to be compiled;
randomly arranging compiling information of the source code package to be compiled to generate the task queue to be compiled;
correspondingly, the determining the current compiling condition of the source code package to be compiled specifically includes:
and identifying the compiling information of the source code package to be compiled to obtain the compiling condition of the source code package to be compiled.
Optionally, the compiling conditions of the source code package to be compiled specifically include compiling dependent conditions and compiling times;
correspondingly, if the current environment parameter meets the current compiling condition of the source code package to be compiled, executing the compiling task of the current source code package to be compiled, and specifically including:
if the current environment parameters meet the current compiling dependency conditions of the source code package to be compiled, executing the compiling task of the current source code package to be compiled;
judging whether the current source code package to be compiled is successfully compiled or not;
if the compiling is successful, the next source code package to be compiled is the current source code package to be compiled, and then the step of determining the compiling condition of the current source code package to be compiled is carried out;
if the compiling is unsuccessful, judging that the compiling times of the current source code package to be compiled reach the preset compiling times; if not, adding one to the compiling times of the current source code package to be compiled, and returning to the step of judging whether the current source code package to be compiled is successfully compiled after executing the compiling task of the current source code package to be compiled again; and if so, recording the compiling failure information of the current source code package to be compiled, and entering the step of determining the compiling conditions of the current source code package to be compiled after taking the next source code package to be compiled as the current source code package to be compiled.
Optionally, the determining the current compiling condition of the source code package to be compiled specifically includes:
judging whether the compiling times of the current source code package to be compiled are zero or not;
if yes, decompressing the current source code package to be compiled to obtain a spec file, and identifying compiling dependency fields in the spec file to obtain the current compiling condition of the source code package to be compiled;
if not, directly identifying the compiling dependency field in the spec file of the current source code package to be compiled to obtain the compiling condition of the current source code package to be compiled.
Optionally, the compiling conditions of the source code package to be compiled specifically include compiling dependent conditions and compiling times;
correspondingly, if the current environment parameter meets the current compiling condition of the source code package to be compiled, executing the compiling task of the current source code package to be compiled, and specifically including:
if the compiling times of the current source code package to be compiled do not reach the preset compiling times and the current environment parameters meet the compiling dependent conditions of the current source code package to be compiled, executing the compiling task of the current source code package to be compiled;
judging whether the current source code package to be compiled is successfully compiled or not;
if the compiling is successful, the next source code package to be compiled is the current source code package to be compiled, and then the step of determining the compiling condition of the current source code package to be compiled is carried out;
if the compiling is unsuccessful, adding one to the compiling times of the current source code package to be compiled, skipping the current source code package to be compiled, and entering the step of determining the compiling conditions of the current source code package to be compiled after the next source code package to be compiled is the current source code package to be compiled;
and if the current compiling times of the source code package to be compiled reach the preset compiling times, recording the compiling failure information of the current source code package to be compiled, and entering the step of determining the compiling conditions of the current source code package to be compiled after taking the next source code package to be compiled in the task queue to be the current source code package to be compiled.
Optionally, the executing the compiling task for the current source code package to be compiled specifically includes:
submitting the current source code package to be compiled to a koji server to execute a compiling task of the current source code package to be compiled;
inquiring through a koji client command to obtain a task identifier corresponding to the source code packet name of the current source code packet to be compiled;
inquiring according to the task identifier to obtain the task state of the corresponding koji compiling task;
judging whether the current source code package to be compiled is successfully compiled or not according to the task state;
if yes, the next source code package to be compiled is the current source code package to be compiled, and then the step of determining the compiling condition of the current source code package to be compiled is carried out;
if not, recording the single compiling failure information of the current source code package to be compiled.
Optionally, the detecting obtains a current environmental parameter, specifically:
and querying the current environment parameters through a koji client command.
In order to solve the above technical problem, the present application further provides a compiling device of an operating system, including:
the preprocessing unit is used for acquiring source code packages to be compiled of a target operating system and randomly generating a task queue to be compiled according to each source code package to be compiled;
the acquisition unit is used for acquiring the current source code package to be compiled according to the sequence of the task queue to be compiled;
the determining unit is used for determining the compiling condition of the current source code package to be compiled;
the detection unit is used for detecting and obtaining the current environmental parameters;
the compiling unit is used for executing the compiling task of the current source code package to be compiled if the current environment parameters meet the compiling conditions of the current source code package to be compiled; if the current environment parameters do not meet the current compiling conditions of the source code package to be compiled, skipping the current source code package to be compiled, and entering the determining unit after the next source code package to be compiled is the current source code package to be compiled.
In order to solve the above technical problem, the present application further provides a compiling device of an operating system, including:
a memory for storing instructions, the instructions comprising the steps of the compiling method of any one of the operating systems described above;
and the processor is used for executing the instructions.
To solve the above technical problem, the present application further provides a readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of the compiling method of an operating system according to any one of the above.
According to the compiling method of the operating system, the dependency relation among all source code packages to be compiled does not need to be analyzed in advance, after the source code packages to be compiled are randomly selected, whether the current environment parameters meet the compiling conditions of the source code packages to be compiled is checked, if yes, the compiling of the current source code packages to be compiled is conducted, if not, the current source code packages to be compiled are skipped, and the next compiling condition detection and compiling process of the source code packages to be compiled is conducted. Therefore, the compiling method of the operating system does not need to consume a great deal of time in the problem of analyzing the dependency relationship among all the source code packages to be compiled in advance, and can not cause compiling failure due to the fact that the compiling condition of the source code packages to be compiled is not met due to the uncertain dependency relationship, and the problem of compiling environment can be immediately eliminated when the compiling is failed, so that the overall compiling time can be effectively reduced, and the compiling efficiency of the operating system is improved.
The application further provides a compiling device, equipment and readable storage medium of the operating system, which have the beneficial effects and are not repeated here.
Drawings
For a clearer description of embodiments of the present application or of the prior art, the drawings that are used in the description of the embodiments or of the prior art will be briefly described, it being apparent that the drawings in the description that follow are only some embodiments of the present application, and that other drawings may be obtained from these drawings by a person of ordinary skill in the art without inventive effort.
FIG. 1 is a flowchart of a compiling method of an operating system according to an embodiment of the present application;
fig. 2 is a schematic structural diagram of a compiling apparatus of an operating system according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of a compiling device of an operating system according to an embodiment of the present application.
Detailed Description
The core of the application is to provide a compiling method, device and equipment of an operating system and a readable storage medium, which are used for improving the compiling efficiency of the operating system.
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
Example 1
Fig. 1 is a flowchart of a compiling method of an operating system according to an embodiment of the present application.
As shown in fig. 1, the compiling method of the operating system provided in the embodiment of the application includes:
s101: and acquiring source code packages to be compiled of the target operating system, and randomly generating a task queue to be compiled according to each source code package to be compiled.
S102: and acquiring the current source code package to be compiled according to the sequence of the task queues to be compiled.
S103: and determining the compiling condition of the current source code package to be compiled.
S104: and detecting to obtain the current environment parameters.
S105: and if the current environment parameters meet the compiling conditions of the current source code package to be compiled, executing the compiling task of the current source code package to be compiled.
S106: if the current environment parameter does not meet the compiling condition of the current source code package to be compiled, skipping the current source code package to be compiled, and entering step S103 after the next source code package to be compiled is the current source code package to be compiled.
In a specific implementation, for step S101, a task queue to be compiled is obtained by preprocessing a source code packet to be compiled. The task queue to be compiled is only used as a current compiling sequence for identifying the source code package to be compiled, and the compiling sequence is adjusted according to whether the current environment parameters meet the compiling conditions of the current source code package to be compiled or not in the compiling process.
For step S102, according to the current order of the task queues to be compiled, the source code packet to be compiled arranged at the forefront is obtained as the current source code packet to be compiled.
For step 103, the current source code package to be compiled is decompressed to obtain a spec file, and the compiling dependency (Build requirements) field in the spec file is identified to obtain the compiling condition of the current source code package to be compiled. The types of compiling conditions for the source code package to be compiled may include RPM name (RPM-name), source code package version information (version), and operating system architecture information (Arch, obtained by the parameter "Build Arch", default as noarch). It should be noted that, the source code package to be compiled does not necessarily have requirements for all the three foregoing compiling conditions, and other types of compiling conditions are not excluded. And determining the type of the compiling condition of the source code package to be compiled according to the type of the operating system, and then setting a compiling condition identification rule (particularly, keyword identification can be adopted).
The compiling dependency (Build requirements) parameter in the spec file is filtered to obtain the compiling condition and is filled into the current compiling task, and the format can be shown in the following table:
RPM-name | version | arch |
in order to facilitate checking the compiling condition of the source code package to be compiled, step S101 may include randomly generating a task queue to be compiled according to each source code package to be compiled, which may specifically include:
analyzing each source code package to be compiled to obtain compiling information of each source code package to be compiled;
and randomly arranging compiling information of the source code package to be compiled to generate a task queue to be compiled.
Correspondingly, in step S103, the compiling condition of the current source code packet to be compiled is determined, which specifically includes:
and identifying the compiling information of the source code package to be compiled to obtain the compiling condition of the source code package to be compiled.
The compiling information of the source code package to be compiled is analyzed in advance and put into the task queue to be compiled, so that the compiling condition can be conveniently determined in the compiling process.
For step S104, the current environment parameters may be looked up by means of a koji client (koji CLI) command line. Step S104 may specifically be to query the current environment parameters through a koji client command. The koji CLI command line for finding the current environmental parameters is specifically as follows:
koji search-r- -exact rpm condition 1|grep-E ". Times.condition 1-condition 2" |grep search.
Wherein, condition 1 is rpm-name. Condition 2 is organized according to the actual situation, condition 2 being empty if no version is required. If the required compiling conditions are met, the compiling environment is met, otherwise, if one compiling condition is not met, the compiling environment is not met, and if the current compiling condition of the source code package to be compiled is not met, the current source code package to be compiled is skipped to compile the next source code package to be compiled.
For the step S105 and the step S106, if the current environment parameter meets the compiling condition of the current source code package to be compiled, executing the compiling task of the current source code package to be compiled; if the current environment parameters do not meet the compiling conditions of the current source code package to be compiled, skipping the current source code package to be compiled, and compiling the next source code package to be compiled. The executing the compiling task of the current source code package to be compiled may specifically include:
submitting the current source code package to be compiled to a koji server to execute the compiling task of the current source code package to be compiled;
inquiring through a koji client command to obtain a task identifier corresponding to the source code packet name of the current source code packet to be compiled;
inquiring according to the task identification to obtain the task state of the corresponding koji compiling task;
judging whether the current source code package to be compiled is successfully compiled or not according to the task state;
if yes, the next source code package to be compiled is the current source code package to be compiled, and then the step of determining the compiling condition of the current source code package to be compiled is carried out;
if not, recording single compiling failure information of the current source code package to be compiled.
Specifically, the current source code package to be compiled is submitted to the koji server through a koji CLI command, and the command format is as follows:
koji add-pkg-owner kojiadmin tag packages;
wherein, the kojiadimin is a koji user. the tag is the tag of the current compiling task. The packages are the source code package names of the current source code packages to be compiled.
After the current source code package to be compiled is submitted to the koji server, the task identifier (namely task ID) corresponding to the source code package name of the current source code package to be compiled is obtained by inquiring the compiling task in the current system through a koji CLI command, and the command format is as follows:
koji list-tasks|grep–E“^build”。
the execution state of the current koji compiling task can be judged according to the task ID in the query result, and the command format is as follows:
koji taskinfo ID;
and a State field in the query result represents a task State, when the State is failed, confirming that the single compilation of the current source code package to be compiled fails, and recording the single compilation failure information of the current source code package to be compiled into a log.
According to the compiling method of the operating system, the dependency relation among all source code packages to be compiled does not need to be analyzed in advance, after the source code packages to be compiled are randomly selected, whether the current environment parameters meet the compiling conditions of the source code packages to be compiled is checked, if yes, the compiling of the current source code packages to be compiled is conducted, if not, the current source code packages to be compiled are skipped, and the next compiling condition detection and compiling process of the source code packages to be compiled is conducted. Therefore, the compiling method of the operating system provided by the embodiment of the application does not need to consume a great deal of time in the problem of analyzing the dependency relationship among all the source code packages to be compiled in advance, and can not cause compiling failure due to compiling of the source code packages to be compiled under the condition that the compiling condition is not satisfied because of the uncertain dependency relationship, and can immediately eliminate the problem of the compiling environment when the compiling is failed, so that the integral compiling time can be effectively reduced, and the compiling efficiency of the operating system is improved.
Example two
The foregoing embodiment provides a scheme for checking whether the compiling condition is satisfied before compiling the current source code package to be compiled, and on this basis, in the compiling method of the operating system provided in the embodiment of the present application, the compiling condition of the source code package to be compiled specifically includes a compiling dependent condition (Build requirement) and a compiling number (count).
Accordingly, step S105: if the current environment parameter meets the compiling condition of the current source code package to be compiled, executing the compiling task of the current source code package to be compiled, wherein the compiling task specifically comprises the following steps:
if the current environment parameters meet the compiling dependent conditions of the current source code package to be compiled, executing the compiling task of the current source code package to be compiled;
judging whether the current source code package to be compiled is successfully compiled or not;
if the compiling is successful, the next source code package to be compiled is taken as the current source code package to be compiled, and then step S103 is carried out;
if the compiling is unsuccessful, judging that the compiling times of the current source code package to be compiled reach the preset compiling times; if not, adding one to the compiling times of the current source code package to be compiled, and after executing the compiling task of the current source code package to be compiled again, returning to the step of judging whether the current source code package to be compiled is successfully compiled; if so, after the compiling failure information of the current source code package to be compiled is recorded, the next source code package to be compiled is taken as the current source code package to be compiled, and then step S103 is entered.
And restricting the compiling times of the source code package to be compiled by setting the preset compiling times, improving the fault tolerance of the compiling process of the operating system, and allowing the source code package to be compiled to be successfully compiled within the preset compiling times. If the preset compiling times are not yet compiled successfully, the source code package to be compiled is considered to have a problem, the current source code package to be compiled is dequeued at the moment, and the compiling failure information of the current source code package to be compiled is recorded into a log.
On this basis, step S103: the determining the compiling condition of the current source code package to be compiled may specifically be:
judging whether the compiling times of the current source code package to be compiled are zero or not;
if yes, decompressing the current source code package to be compiled to obtain a spec file, and identifying compiling dependent fields in the spec file to obtain compiling dependent conditions of the current source code package to be compiled;
if not, directly identifying the compiling dependent field in the spec file of the current source code package to be compiled to obtain the compiling dependent condition of the current source code package to be compiled.
Because the compiling dependency condition needs to be obtained after the source code package to be compiled is decompressed, the compiling times can be used for judging whether the current source code package to be compiled is decompressed or not on the basis of counting the compiling times. It can be understood that when the number of compilation times of the current source code package to be compiled is zero, the current source code package to be compiled is still in an undeployed state, the current source code package to be compiled is decompressed first, then the compiling dependent conditions are obtained, otherwise, the compiling dependent conditions are directly obtained.
Example III
On the basis of the above embodiment, the problem that the compiling condition of the current source code package to be compiled determined in step S103 is not all the compiling conditions of the current source code package to be compiled is not excluded, and then the cause of the compiling failure of the current source code package to be compiled may be caused by that the compiling environment is not satisfied. Therefore, in the compiling method of the operating system provided in the embodiment of the present application, the compiling conditions of the source code package to be compiled specifically include the compiling dependency conditions and the compiling times.
Accordingly, S105: if the current environment parameter meets the compiling condition of the current source code package to be compiled, executing the compiling task of the current source code package to be compiled, wherein the compiling task specifically comprises the following steps:
if the compiling times of the current source code package to be compiled do not reach the preset compiling times and the current environment parameters meet the compiling dependent conditions of the current source code package to be compiled, executing the compiling task of the current source code package to be compiled;
judging whether the current source code package to be compiled is successfully compiled or not;
if the compiling is successful, the next source code package to be compiled is taken as the current source code package to be compiled, and then step S103 is carried out;
if not, adding one to the compiling times of the current source code package to be compiled, skipping the current source code package to be compiled, and entering step S103 after the next source code package to be compiled is the current source code package to be compiled;
if the number of compilation times of the current source code package to be compiled reaches the preset number of compilation times, after the compilation failure information of the current source code package to be compiled is recorded, the next source code package to be compiled in the task queue to be compiled is taken as the current source code package to be compiled, and then step S103 is entered.
After the current source code Bao Yici to be compiled fails to be compiled, the compiling times of the current source code package to be compiled are added one, and then the current source code package to be compiled is skipped to carry out the compiling task of the next source code package to be compiled, so that the compiling failure problem caused by unsatisfied compiling environment is better eliminated. Optionally, when the current source code package to be compiled fails to be compiled for multiple times (the times are smaller than the preset compiling times), the current source code package to be compiled is skipped to carry out the compiling task of the next source code package to be compiled.
Various embodiments corresponding to the compiling method of the operating system are described in detail above, and on the basis of the embodiments, the application also discloses a compiling device, equipment and a readable storage medium of the operating system corresponding to the method.
Example III
Fig. 2 is a schematic structural diagram of a compiling apparatus of an operating system according to an embodiment of the present application.
As shown in fig. 2, the compiling apparatus for an operating system provided in the embodiment of the present application includes:
the preprocessing unit 201 is configured to obtain source code packets to be compiled of a target operating system, and randomly generate a task queue to be compiled according to each source code packet to be compiled;
an obtaining unit 202, configured to obtain a current source code packet to be compiled according to an order of a task queue to be compiled;
a determining unit 203, configured to determine a compiling condition of a current source code packet to be compiled;
a detection unit 204, configured to detect and obtain a current environmental parameter;
the compiling unit 205 is configured to execute a compiling task for the current source code package to be compiled if the current environmental parameter meets a compiling condition of the current source code package to be compiled; if the current environment parameter does not meet the compiling condition of the current source code package to be compiled, skipping the current source code package to be compiled, and entering the determining unit 203 after the next source code package to be compiled is the current source code package to be compiled.
Since the embodiments of the apparatus portion and the embodiments of the method portion correspond to each other, the embodiments of the apparatus portion are referred to the description of the embodiments of the method portion, and are not repeated herein.
Example IV
Fig. 3 is a schematic structural diagram of a compiling device of an operating system according to an embodiment of the present application.
As shown in fig. 3, a compiling apparatus for an operating system provided in an embodiment of the present application includes:
a memory 310 for storing instructions comprising the steps of the compiling method of the operating system according to any one of the embodiments;
and a processor 320 for executing the instructions.
Processor 320 may include one or more processing cores, such as a 3-core processor, an 8-core processor, etc. The processor 320 may be implemented in at least one hardware form of digital signal processing DSP (Digital Signal Processing), field programmable gate array FPGA (Field-Programmable Gate Array), programmable logic array PLA (Programmable Logic Array). Processor 320 may also include a main processor, which is a processor for processing data in an awake state, also referred to as a central processor CPU (Central Processing Unit), and a coprocessor; a coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 320 may be integrated with an image processor GPU (Graphics Processing Unit), a GPU for use in responsible for rendering and rendering of the content required to be displayed by the display screen. In some embodiments, the processor 320 may also include an artificial intelligence AI (Artificial Intelligence) processor for processing computing operations related to machine learning.
Memory 310 may include one or more readable storage media, which may be non-transitory. Memory 310 may also include high-speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In this embodiment, the memory 310 is at least used for storing a computer program 311, where the computer program 311, after being loaded and executed by the processor 320, can implement relevant steps in the compiling method of the operating system disclosed in any of the foregoing embodiments. In addition, the resources stored in the memory 310 may further include an operating system 312, data 313, and the like, where the storage may be transient storage or permanent storage. The operating system 312 may be Windows. The data 313 may include, but is not limited to, data related to the above-described method.
In some embodiments, the compiling device of the operating system may further include a display 330, a power supply 340, a communication interface 350, an input-output interface 360, a sensor 370, and a communication bus 380.
Those skilled in the art will appreciate that the architecture shown in FIG. 3 is not limiting of the compilation device of an operating system and may include more or fewer components than illustrated.
The compiling device of the operating system provided by the embodiment of the application comprises the memory and the processor, and the processor can realize the compiling method of the operating system when executing the program stored in the memory, and the effects are the same as the above.
Example five
It should be noted that the apparatus and device embodiments described above are merely exemplary, and for example, the division of modules is merely a logic function division, and there may be other division manners in actual implementation, for example, multiple modules or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or modules, which may be in electrical, mechanical, or other forms. The modules illustrated as separate components may or may not be physically separate, and components shown as modules may or may not be physical modules, i.e., may be located in one place, or may be distributed over a plurality of network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional module in each embodiment of the present application may be integrated into one processing module, or each module may exist alone physically, or two or more modules may be integrated into one module. The integrated modules may be implemented in hardware or in software functional modules.
The integrated modules, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a readable storage medium. With such understanding, the technical solution of the present application, or a part contributing to the prior art or all or part of the technical solution, may be embodied in the form of a software product stored in a storage medium, performing all or part of the steps of the method described in the various embodiments of the present application.
To this end, the embodiments of the present application also provide a readable storage medium having a computer program stored thereon, which when executed by a processor, implements steps of a compiling method such as an operating system.
The readable storage medium may include: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (ram) RAM (Random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The computer program included in the readable storage medium provided in this embodiment can implement the steps of the compiling method of the operating system as described above when executed by the processor, and the same effects are achieved.
The foregoing describes in detail a compiling method, device, apparatus and readable storage medium of an operating system provided in the present application. In the description, each embodiment is described in a progressive manner, and each embodiment is mainly described by the differences from other embodiments, so that the same similar parts among the embodiments are mutually referred. The apparatus, device and readable storage medium disclosed in the embodiments are relatively simple to describe, and the relevant points refer to the description of the method section since they correspond to the methods disclosed in the embodiments. It should be noted that it would be obvious to those skilled in the art that various improvements and modifications can be made to the present application without departing from the principles of the present application, and such improvements and modifications fall within the scope of the claims of the present application.
It should also be noted that in this specification, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
Claims (7)
1. A method for compiling an operating system, comprising:
acquiring source code packages to be compiled of a target operating system, and randomly generating a task queue to be compiled according to each source code package to be compiled;
acquiring the current source code package to be compiled according to the sequence of the task queue to be compiled;
determining the current compiling condition of the source code package to be compiled;
detecting to obtain current environmental parameters;
if the current environment parameters meet the current compiling conditions of the source code package to be compiled, executing the compiling task of the current source code package to be compiled;
if the current environment parameters do not meet the current compiling conditions of the source code package to be compiled, skipping the current source code package to be compiled, and entering the step of determining the compiling conditions of the current source code package to be compiled after the next source code package to be compiled is the current source code package to be compiled;
the compiling conditions of the source code package to be compiled specifically comprise compiling dependent conditions and compiling times;
correspondingly, if the current environment parameter meets the current compiling condition of the source code package to be compiled, executing the compiling task of the current source code package to be compiled, and specifically including:
if the compiling times of the current source code package to be compiled do not reach the preset compiling times and the current environment parameters meet the compiling dependent conditions of the current source code package to be compiled, executing the compiling task of the current source code package to be compiled;
judging whether the current source code package to be compiled is successfully compiled or not;
if the compiling is successful, the next source code package to be compiled is the current source code package to be compiled, and then the step of determining the compiling condition of the current source code package to be compiled is carried out;
if the compiling is unsuccessful, adding one to the compiling times of the current source code package to be compiled, skipping the current source code package to be compiled, and entering the step of determining the compiling conditions of the current source code package to be compiled after the next source code package to be compiled is the current source code package to be compiled;
if the current compiling times of the source code package to be compiled reach the preset compiling times, recording compiling failure information of the current source code package to be compiled, and entering the step of determining the compiling conditions of the current source code package to be compiled after taking the next source code package to be compiled in the task queue to be the current source code package to be compiled;
the determining the current compiling condition of the source code package to be compiled specifically includes:
judging whether the compiling times of the current source code package to be compiled are zero or not;
if yes, decompressing the current source code package to be compiled to obtain a spec file, and identifying compiling dependency fields in the spec file to obtain the current compiling condition of the source code package to be compiled;
if not, directly identifying the compiling dependency field in the spec file of the current source code package to be compiled to obtain the compiling condition of the current source code package to be compiled.
2. The compiling method according to claim 1, wherein the generating the task queue to be compiled at random according to each source code packet to be compiled specifically comprises:
analyzing each source code packet to be compiled to obtain compiling information of each source code packet to be compiled;
randomly arranging compiling information of the source code package to be compiled to generate the task queue to be compiled;
correspondingly, the determining the current compiling condition of the source code package to be compiled specifically includes:
and identifying the compiling information of the source code package to be compiled to obtain the compiling condition of the source code package to be compiled.
3. The compiling method according to claim 1, wherein the performing the compiling task for the current source code package to be compiled specifically includes:
submitting the current source code package to be compiled to a koji server to execute a compiling task of the current source code package to be compiled;
inquiring through a koji client command to obtain a task identifier corresponding to the source code packet name of the current source code packet to be compiled;
inquiring according to the task identifier to obtain the task state of the corresponding koji compiling task;
judging whether the current source code package to be compiled is successfully compiled or not according to the task state;
if yes, the next source code package to be compiled is the current source code package to be compiled, and then the step of determining the compiling condition of the current source code package to be compiled is carried out;
if not, recording the single compiling failure information of the current source code package to be compiled.
4. The compiling method according to claim 1, wherein the detecting obtains a current environmental parameter, specifically:
and querying the current environment parameters through a koji client command.
5. A compiling apparatus for an operating system, comprising:
the preprocessing unit is used for acquiring source code packages to be compiled of a target operating system and randomly generating a task queue to be compiled according to each source code package to be compiled;
the acquisition unit is used for acquiring the current source code package to be compiled according to the sequence of the task queue to be compiled;
the determining unit is used for determining the compiling condition of the current source code package to be compiled;
the detection unit is used for detecting and obtaining the current environmental parameters;
the compiling unit is used for executing the compiling task of the current source code package to be compiled if the current environment parameters meet the compiling conditions of the current source code package to be compiled; if the current environment parameters do not meet the compiling conditions of the current source code package to be compiled, skipping the current source code package to be compiled, and entering the determining unit after the next source code package to be compiled is the current source code package to be compiled;
the compiling conditions of the source code package to be compiled specifically comprise compiling dependent conditions and compiling times;
correspondingly, if the current environment parameter meets the current compiling condition of the source code package to be compiled, executing the compiling task of the current source code package to be compiled, and specifically including:
if the compiling times of the current source code package to be compiled do not reach the preset compiling times and the current environment parameters meet the compiling dependent conditions of the current source code package to be compiled, executing the compiling task of the current source code package to be compiled;
judging whether the current source code package to be compiled is successfully compiled or not;
if the compiling is successful, the next source code package to be compiled is the current source code package to be compiled, and then the step of determining the compiling condition of the current source code package to be compiled is carried out;
if the compiling is unsuccessful, adding one to the compiling times of the current source code package to be compiled, skipping the current source code package to be compiled, and entering the step of determining the compiling conditions of the current source code package to be compiled after the next source code package to be compiled is the current source code package to be compiled;
if the current compiling times of the source code package to be compiled reach the preset compiling times, recording compiling failure information of the current source code package to be compiled, and entering the step of determining the compiling conditions of the current source code package to be compiled after taking the next source code package to be compiled in the task queue to be the current source code package to be compiled;
the determining the current compiling condition of the source code package to be compiled specifically includes:
judging whether the compiling times of the current source code package to be compiled are zero or not;
if yes, decompressing the current source code package to be compiled to obtain a spec file, and identifying compiling dependency fields in the spec file to obtain the current compiling condition of the source code package to be compiled;
if not, directly identifying the compiling dependency field in the spec file of the current source code package to be compiled to obtain the compiling condition of the current source code package to be compiled.
6. A compiling device for an operating system, comprising:
a memory for storing instructions comprising the steps of the compilation method of an operating system according to any one of claims 1 to 4;
and the processor is used for executing the instructions.
7. A readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the compiling method of an operating system according to any one of claims 1 to 4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110864577.7A CN113721916B (en) | 2021-07-29 | 2021-07-29 | Compiling method, device and equipment of operating system and readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110864577.7A CN113721916B (en) | 2021-07-29 | 2021-07-29 | Compiling method, device and equipment of operating system and readable storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113721916A CN113721916A (en) | 2021-11-30 |
CN113721916B true CN113721916B (en) | 2023-07-14 |
Family
ID=78674293
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110864577.7A Active CN113721916B (en) | 2021-07-29 | 2021-07-29 | Compiling method, device and equipment of operating system and readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113721916B (en) |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105955794A (en) * | 2016-04-27 | 2016-09-21 | 国网辽宁省电力有限公司信息通信分公司 | Construction method and system of desktop operating system |
CN106325965A (en) * | 2015-06-24 | 2017-01-11 | 龙芯中科技术有限公司 | Method and device for compiling of operating system |
CN109766099A (en) * | 2018-12-11 | 2019-05-17 | 浙江口碑网络技术有限公司 | Front end source code Compilation Method, device, storage medium and computer equipment |
CN111857730A (en) * | 2020-07-24 | 2020-10-30 | 苏州浪潮智能科技有限公司 | Method and equipment for compiling operating system |
CN111880802A (en) * | 2020-07-03 | 2020-11-03 | 深圳市欢太科技有限公司 | Compiling method, electronic equipment and computer readable storage medium |
CN111966357A (en) * | 2019-05-20 | 2020-11-20 | 北京车和家信息技术有限公司 | Operating system application compiling method and device and electronic equipment |
CN112214221A (en) * | 2020-10-10 | 2021-01-12 | 上海上讯信息技术股份有限公司 | Method and equipment for constructing Linux system |
-
2021
- 2021-07-29 CN CN202110864577.7A patent/CN113721916B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106325965A (en) * | 2015-06-24 | 2017-01-11 | 龙芯中科技术有限公司 | Method and device for compiling of operating system |
CN105955794A (en) * | 2016-04-27 | 2016-09-21 | 国网辽宁省电力有限公司信息通信分公司 | Construction method and system of desktop operating system |
CN109766099A (en) * | 2018-12-11 | 2019-05-17 | 浙江口碑网络技术有限公司 | Front end source code Compilation Method, device, storage medium and computer equipment |
CN111966357A (en) * | 2019-05-20 | 2020-11-20 | 北京车和家信息技术有限公司 | Operating system application compiling method and device and electronic equipment |
CN111880802A (en) * | 2020-07-03 | 2020-11-03 | 深圳市欢太科技有限公司 | Compiling method, electronic equipment and computer readable storage medium |
CN111857730A (en) * | 2020-07-24 | 2020-10-30 | 苏州浪潮智能科技有限公司 | Method and equipment for compiling operating system |
CN112214221A (en) * | 2020-10-10 | 2021-01-12 | 上海上讯信息技术股份有限公司 | Method and equipment for constructing Linux system |
Also Published As
Publication number | Publication date |
---|---|
CN113721916A (en) | 2021-11-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7774404B2 (en) | Managing software component versions within a service oriented architecture | |
US8949799B2 (en) | Program log record optimization | |
US10318595B2 (en) | Analytics based on pipes programming model | |
US20100023798A1 (en) | Error recovery and diagnosis for pushdown automata | |
US20130326478A1 (en) | Version labeling in a version control system | |
CN106897072A (en) | Traffic engineered call method, device and electronic equipment | |
CN104168250B (en) | Business Process Control method and device based on CGI frames | |
US20210200740A1 (en) | System and method for processing logs | |
CN107391528B (en) | Front-end component dependent information searching method and equipment | |
US11294740B2 (en) | Event to serverless function workflow instance mapping mechanism | |
US20140075415A1 (en) | Automatic use case generation from a parsed configuration file | |
CN111124872A (en) | Branch detection method and device based on difference code analysis and storage medium | |
CN110716866A (en) | Code quality scanning method and device, computer equipment and storage medium | |
CN111767217A (en) | JS unit test case generation method and device | |
CN111240772B (en) | Block chain-based data processing method, device and storage medium | |
WO2024152665A1 (en) | Code construction method and apparatus, and computer device and storage medium | |
CN113901083A (en) | Heterogeneous data source operation resource analysis positioning method and equipment based on multiple analyzers | |
CN110928941B (en) | Data fragment extraction method and device | |
CN113076084A (en) | Resource file processing method, device, equipment and storage medium | |
CN113721916B (en) | Compiling method, device and equipment of operating system and readable storage medium | |
US10061681B2 (en) | System for discovering bugs using interval algebra query language | |
CN110244954A (en) | A kind of Compilation Method and equipment of application program | |
CN111400245B (en) | Art resource migration method and device | |
CN114518885A (en) | Information collection method and device, electronic equipment and storage medium | |
CN113419738A (en) | Interface document generation method and device and interface management equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |