Two-Pass Compilation for Source Code Dependency Management

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Managing interdependencies between source code files and libraries becomes cumbersome and time-consuming as the number of files increases, leading to lengthy build times, complex branching and merging, and difficulties in testing and debugging, especially in team environments.

Innovation Solution

A two-pass compilation process that reviews code for dependencies and performs multithreaded compilation in an order determined by these dependencies, along with partitioning techniques to group files by similar dependencies, allowing only necessary files to be recompiled, reducing the build cycle and eliminating inconsistencies.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If a traditional compilation process is used to manage source code files, then all source files can be compiled, but the build time becomes extremely lengthy due to circular dependencies causing recompilation of every source code file

Engineering Contradiction:
Improvecompleteness of compilationVSAvoidbuild time
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The patent segments the source code base into modules with defined dependencies, establishing a hierarchical structure where master files depend on slave files. This segmentation allows the compilation system to process only necessary files rather than recompiling everything, thereby reducing build time while maintaining compilation completeness.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent performs preliminary dependency analysis before compilation to determine the compilation order. By pre-establishing which files depend on which others and creating a compilation hierarchy, the system avoids circular dependency issues and unnecessary recompilations, significantly reducing build time.

Inventive Principle:
Principle #10Preliminary action

2Adaptability or versatility

If source code files are frequently modified and recompiled to support development, then code updates can be implemented, but developer downtime increases due to lengthy build cycles

Engineering Contradiction:
Improvecode modification capabilityVSAvoiddeveloper downtime
Core Design Contradiction:
Adaptability or versatilityVSLoss of time

Solution Approach 1:

The patent implements partial compilation by identifying and recompiling only the specific modules that have changed or are affected by changes, rather than recompiling the entire code base. This partial action approach maintains adaptability for code modifications while significantly reducing the time developers wait for builds to complete.

Inventive Principle:
Principle #16Partial or excessive action

3Manufacturing precision

If dependency checking is performed on all source files to ensure correct compilation order, then compilation correctness is maintained, but the complexity of the build system increases

Engineering Contradiction:
Improvecompilation order accuracyVSAvoidbuild system complexity
Core Design Contradiction:
Manufacturing precisionVSDevice complexity

Solution Approach 1:

The patent segments the code base into master and slave file hierarchies with explicit dependency relationships. This segmentation simplifies dependency checking by establishing clear compilation rules (master files compile after their dependent slave files) rather than requiring complex analysis of all possible file relationships, thus maintaining precision while reducing system complexity.

Inventive Principle:
Principle #1Segmentation

4Reliability

If all source files are included in the build to ensure completeness, then no code is missed, but the build process becomes cumbersome and time-consuming with hundreds or thousands of files

Engineering Contradiction:
Improvebuild completenessVSAvoidbuild efficiency
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The patent performs preliminary analysis to identify the minimal set of source files that need to be compiled based on change detection and dependency relationships. By pre-determining the necessary compilation scope, the system ensures build completeness for affected code while dramatically improving productivity by excluding unnecessary files from the build process.

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentUS8201157B2Dependency checking and management of source code, generated source code files, and library files
Publication Date: 2012.06.12 ORACLE INT CORP
  • US8201157B2 patent drawing
  • US8201157B2 patent drawing
  • US8201157B2 patent drawing

AI summary

An Integrated Design Environment (IDE) includes an on-the-fly compiler. The IDE does a first compiler pass that review code for dependencies. In the first compiler pass, the IDE compiles source files, where files having any unresolved types or errors are marked for a second pass recompilation. The IDE does a second compiler pass that does a multithreaded compilation of the code in an order determined using the dependencies. In the second compiler pass, any file that uses the files compiled in the first pass are recompiled. Additionally, any files marked for unresolved types or errors are also recompiled.