Skip to content

Conversation

angerman
Copy link

This commit restructures the Runtime System (RTS) components for better modularity and reusability across different build configurations. The changes enable cleaner separation of concerns and improved support for cross-compilation scenarios.

Key changes:

  • Extract RTS headers into standalone rts-headers package
    • Moved include/rts/Bytecodes.h to rts-headers
    • Moved include/rts/storage/ClosureTypes.h to rts-headers
    • Moved include/rts/storage/FunTypes.h to rts-headers
    • Moved include/stg/MachRegs/* to rts-headers
  • Create rts-fs package for filesystem utilities
    • Extracted filesystem code from utils/fs
    • Provides reusable filesystem operations for RTS
  • Rename utils/iserv to utils/ghc-iserv for consistency
    • Better naming alignment with other GHC utilities
    • Updated all references throughout the codebase
  • Update RTS configuration and build files
    • Modified rts/configure.ac for new structure
    • Updated rts.cabal with new dependencies
    • Adjusted .gitignore for new artifacts

Rationale:
The modularization allows different stages of the compiler build to share common RTS components without circular dependencies. This is particularly important for:

  • Cross-compilation where host and target RTS differ
  • JavaScript backend which needs selective RTS components
  • Stage1/Stage2 builds that require different RTS configurations

Contributors:

  • Moritz Angermann: RTS modularization architecture and implementation
  • Sylvain Henry: JavaScript backend RTS adjustments
  • Andrea Bedini: Build system integration

This refactoring maintains full backward compatibility while providing a cleaner foundation for multi-target support.

This commit restructures the Runtime System (RTS) components for better
modularity and reusability across different build configurations. The
changes enable cleaner separation of concerns and improved support for
cross-compilation scenarios.

Key changes:
- Extract RTS headers into standalone rts-headers package
  * Moved include/rts/Bytecodes.h to rts-headers
  * Moved include/rts/storage/ClosureTypes.h to rts-headers
  * Moved include/rts/storage/FunTypes.h to rts-headers
  * Moved include/stg/MachRegs/* to rts-headers
- Create rts-fs package for filesystem utilities
  * Extracted filesystem code from utils/fs
  * Provides reusable filesystem operations for RTS
- Rename utils/iserv to utils/ghc-iserv for consistency
  * Better naming alignment with other GHC utilities
  * Updated all references throughout the codebase
- Update RTS configuration and build files
  * Modified rts/configure.ac for new structure
  * Updated rts.cabal with new dependencies
  * Adjusted .gitignore for new artifacts

Rationale:
The modularization allows different stages of the compiler build to
share common RTS components without circular dependencies. This is
particularly important for:
- Cross-compilation where host and target RTS differ
- JavaScript backend which needs selective RTS components
- Stage1/Stage2 builds that require different RTS configurations

Contributors:
- Moritz Angermann: RTS modularization architecture and implementation
- Sylvain Henry: JavaScript backend RTS adjustments
- Andrea Bedini: Build system integration

This refactoring maintains full backward compatibility while providing
a cleaner foundation for multi-target support.
@angerman angerman mentioned this pull request Sep 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant