Skip to content

Conversation

@Unisay
Copy link
Contributor

@Unisay Unisay commented Nov 7, 2025

Summary

Fixes #62 by consolidating build configuration and removing duplicate settings that were causing REPL issues.

Problem

The cabal repl command was failing with errors about PlutusTx.Prelude.check not being available. This was caused by inconsistent compiler flag management between the cabal file and source files, making interactive development impossible.

Solution

This PR refactors the build configuration to centralize all settings in the cabal file:

1. Centralized Plutus Dependencies

  • Created plutus-deps common stanza
  • Single version specification (^>=1.54.0.0) eliminating 12 duplicate declarations
  • Ensures consistent Plutus versions across all build targets

2. Consolidated GHC Options

  • Moved all compiler flags from source files to cabal stanzas
  • Removed all LANGUAGE and OPTIONS_GHC pragmas from source files (108 lines removed)
  • Created three common stanzas:
    • ghc-options: Base settings + 21 language extensions
    • ghc-only-options: GADTs extension (not supported by PlutusTx)
    • plinth-options: Plinth-specific compiler optimizations

3. Library Rename

  • Renamed library from scripts to plinth-validators for clarity
  • Updated all references in executables

4. CI Verification

  • Extended build workflow to verify REPL loads successfully
  • Ensures REPL functionality is tested on every PR

Testing

cabal clean
cabal repl lib:plinth-validators

The REPL now loads successfully without errors.

Benefits

  • ✅ REPL works for interactive development
  • ✅ Single source of truth for all configuration
  • ✅ Easier version updates (change once, affects all)
  • ✅ Cleaner, more maintainable source files
  • ✅ CI verification prevents regressions

Create plutus-deps common stanza with single version specification to eliminate duplicate declarations across library and executables.

Reduces maintenance burden and ensures consistent Plutus versions across all build targets.
Move all compiler flags and language extensions from source files to centralized cabal stanzas for easier maintenance and consistency.

Create three stanzas:
- ghc-options: Common settings and 21 language extensions
- ghc-only-options: GADTs (not supported by PlutusTx)
- plinth-options: Plinth-specific compiler optimizations

Rename library from 'scripts' to 'plinth-validators' for clarity.
Extend build-devcontainer workflow to test cabal REPL loads successfully for lib:plinth-validators after build completes.

Ensures REPL functionality is verified on every PR.
@Unisay Unisay self-assigned this Nov 7, 2025
@Unisay Unisay requested review from zeme-wana and zliu41 November 7, 2025 11:40
Copy link
Collaborator

@zeme-wana zeme-wana left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work. Thanks!

@Unisay Unisay enabled auto-merge (squash) November 7, 2025 14:03
@zeme-wana zeme-wana disabled auto-merge November 10, 2025 13:58
@zeme-wana zeme-wana merged commit 43632aa into main Nov 10, 2025
5 of 9 checks passed
@Unisay Unisay deleted the yura/issue-62-fix-cabal-repl branch November 10, 2025 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants