Cabal Logo
3.14.2.0

Getting Started

  • 1. Getting Started
    • 1.1. Installing Cabal
    • 1.2. Creating a new application
      • 1.2.1. Initializing an application
      • 1.2.2. Adding dependencies
    • 1.3. Running a single-file Haskell script
    • 1.4. What Next?

Cabal Guide

  • 1. How to package Haskell code
    • 1.1. Introduction
    • 1.2. Using cabal init
    • 1.3. Running the program
    • 1.4. About the Cabal package structure
    • 1.5. Editing the .cabal file
    • 1.6. Modules included in the package
    • 1.7. Modules imported from other packages
    • 1.8. Building the package
  • 2. How to deal with package source code
    • 2.1. Getting package source code without Cabal
    • 2.2. Fields pointing to source code repositories
    • 2.3. Source code when taking a package dependency
      • 2.3.1. Setting up a source code dependency
    • 2.4. Source code when dependency vendoring
      • 2.4.1. Vendoring a source code archive
      • 2.4.2. Vendoring unpacked source code
      • 2.4.3. Fork, don’t vendor
    • 2.5. Source code as a package author or maintainer
    • 2.6. Source code as a package publisher
  • 3. How to build locally like in Nix
    • 3.1. Quickstart
      • 3.1.1. Developing multiple packages
    • 3.2. Cookbook
      • 3.2.1. How can I profile my library/application?
      • 3.2.2. How can I have a reproducible set of versions for my dependencies?
    • 3.3. How it works
      • 3.3.1. Local versus external packages
      • 3.3.2. Where are my build products?
      • 3.3.3. Caching
  • 4. How to use Cabal in Windows
    • 4.1. Install the Haskell environment
    • 4.2. MSYS2 environments and packages
    • 4.3. Ensure that Cabal can call the tools it needs
    • 4.4. Ensure that Cabal can use system libraries
    • 4.5. Ensure that Cabal can call Haskell tools
    • 4.6. Complete configuration
    • 4.7. Further reading
      • 4.7.1. Outdated links
  • 5. How to use Backpack modules
  • 6. How to report Cabal bugs and feature requests

Cabal Reference

  • 1. Package Description — <package>.cabal File
    • 1.1. Creating a package
      • 1.1.1. Example: A package containing a simple library
      • 1.1.2. Example: A package containing executable programs
      • 1.1.3. Example: A package containing a library and executable programs
    • 1.2. Package descriptions
      • 1.2.1. Modules and preprocessors
      • 1.2.2. Package properties
      • 1.2.3. Library
      • 1.2.4. Executables
      • 1.2.5. Test suites
        • 1.2.5.1. Example: Package using exitcode-stdio-1.0 interface
        • 1.2.5.2. Example: Package using detailed-0.9 interface
      • 1.2.6. Benchmarks
        • 1.2.6.1. Example:
      • 1.2.7. Build information
      • 1.2.8. Foreign libraries
      • 1.2.9. Configurations
        • 1.2.9.1. Example: A package containing a library and executable programs
        • 1.2.9.2. Layout
        • 1.2.9.3. Example: Using explicit braces rather than indentation for layout
        • 1.2.9.4. Configuration Flags
      • 1.2.10. Conditional Blocks
        • 1.2.10.1. Conditions
        • 1.2.10.2. Resolution of Conditions and Flags
      • 1.2.11. Meaning of field values when using conditionals
      • 1.2.12. Common stanzas
    • 1.3. Source code repository marker
    • 1.4. Hooks
    • 1.5. Custom setup scripts
      • 1.5.1. Backward compatibility and custom-setup
    • 1.6. Autogenerated modules and includes
    • 1.7. Accessing data files from package code
      • 1.7.1. Accessing the package version
      • 1.7.2. Accessing package-related informations
    • 1.8. System-dependent parameters
      • 1.8.1. Example: Using autoconf
    • 1.9. Conditional compilation
    • 1.10. More complex packages
  • 2. Project Description — cabal.project File
    • 2.1. Conditionals and imports
    • 2.2. Specifying the local packages
    • 2.3. Taking a dependency from a source code repository
    • 2.4. Global configuration options
    • 2.5. Phase control
    • 2.6. Solver configuration options
    • 2.7. Package configuration options
      • 2.7.1. Object code options
      • 2.7.2. Executable options
      • 2.7.3. Dynamic linking options
      • 2.7.4. Static linking options
      • 2.7.5. Foreign function interface options
      • 2.7.6. Profiling options
      • 2.7.7. Coverage options
      • 2.7.8. Haddock options
      • 2.7.9. Program options
    • 2.8. Advanced global configuration options
      • 2.8.1. Advanced solver options
  • 3. Version Control System Fields
    • 3.1. VCS kind
    • 3.2. VCS location
    • 3.3. VCS branch
    • 3.4. VCS tag
    • 3.5. VCS subdirectory
  • 4. cabal-install Configuration and Commands
    • 4.1. Configuration
      • 4.1.1. Overview
      • 4.1.2. Environment variables
        • 4.1.2.1. Configuration file discovery
      • 4.1.3. Directories
      • 4.1.4. Repository specification
        • 4.1.4.1. Using secure repositories
        • 4.1.4.2. Local no-index repositories
        • 4.1.4.3. Legacy repositories
        • 4.1.4.4. Secure local repositories
      • 4.1.5. Program options
    • 4.2. Commands
      • 4.2.1. Common Arguments and Flags
      • 4.2.2. Target Forms
      • 4.2.3. Global commands
        • 4.2.3.1. cabal user-config
      • 4.2.4. Package database commands
        • 4.2.4.1. cabal update
        • 4.2.4.2. cabal list
        • 4.2.4.3. cabal info
      • 4.2.5. Initialization and download
        • 4.2.5.1. cabal init
        • 4.2.5.2. cabal fetch
        • 4.2.5.3. cabal get
      • 4.2.6. Project configuration
        • 4.2.6.1. cabal configure
        • 4.2.6.2. cabal freeze
        • 4.2.6.3. cabal gen-bounds
        • 4.2.6.4. cabal outdated
        • 4.2.6.5. cabal path
      • 4.2.7. Project building and installing
        • 4.2.7.1. cabal build
        • 4.2.7.2. cabal install
        • 4.2.7.3. cabal haddock
        • 4.2.7.4. cabal haddock-project
        • 4.2.7.5. cabal clean
      • 4.2.8. Running and testing
        • 4.2.8.1. cabal list-bin
        • 4.2.8.2. cabal repl
        • 4.2.8.3. cabal run
        • 4.2.8.4. cabal bench
        • 4.2.8.5. cabal test
        • 4.2.8.6. cabal exec
      • 4.2.9. Sanity checks and shipping
        • 4.2.9.1. cabal check
        • 4.2.9.2. cabal sdist
        • 4.2.9.3. cabal upload
        • 4.2.9.4. cabal report
  • 5. External Commands
  • 6. Setup.hs Commands
    • 6.1. Building and installing a system package
    • 6.2. Creating a binary package
    • 6.3. runhaskell Setup.hs configure
      • 6.3.1. Programs used for building
      • 6.3.2. Installation paths
        • 6.3.2.1. Path variables in the simple build system
        • 6.3.2.2. Paths in the simple build system
        • 6.3.2.3. Prefix independence
      • 6.3.3. Controlling Flag Assignments
      • 6.3.4. Building Test Suites
      • 6.3.5. Miscellaneous options
    • 6.4. runhaskell Setup.hs build
    • 6.5. runhaskell Setup.hs haddock
    • 6.6. runhaskell Setup.hs hscolour
    • 6.7. runhaskell Setup.hs install
    • 6.8. runhaskell Setup.hs copy
    • 6.9. runhaskell Setup.hs register
    • 6.10. runhaskell Setup.hs unregister
    • 6.11. runhaskell Setup.hs clean
    • 6.12. runhaskell Setup.hs test
    • 6.13. runhaskell Setup.hs bench
    • 6.14. runhaskell Setup.hs sdist
  • 7. Package Description Format Specification History
    • 7.1. cabal-version: 3.14
    • 7.2. cabal-version: 3.12
    • 7.3. cabal-version: 3.8
    • 7.4. cabal-version: 3.6
    • 7.5. cabal-version: 3.4
    • 7.6. cabal-version: 3.0
    • 7.7. cabal-version: 2.4
    • 7.8. cabal-version: 2.2
    • 7.9. cabal-version: 2.0
    • 7.10. cabal-version: 1.24
    • 7.11. cabal-version: 1.22
    • 7.12. cabal-version: 1.20
    • 7.13. cabal-version: 1.18
    • 7.14. cabal-version: 1.16
    • 7.15. cabal-version: 1.12
  • 8. Field Syntax Reference
    • 8.1. Notation
    • 8.2. Lists
    • 8.3. Non-terminals
    • 8.4. Build info fields
    • 8.5. Package description fields
    • 8.6. Test-suite fields

Cabal Explanation

  • 1. What Cabal does
    • 1.1. A tool for working with packages
    • 1.2. What’s in a package
    • 1.3. Cabal featureset
    • 1.4. Similar systems
  • 2. Package concepts
    • 2.1. The point of packages
    • 2.2. Package names and versions
    • 2.3. Kinds of package: Cabal vs GHC vs system
    • 2.4. Unit of distribution
    • 2.5. Explicit dependencies and automatic package management
    • 2.6. Portability
  • 3. Stability of Cabal interfaces
    • 3.1. Cabal file format
    • 3.2. Command-line interface
      • 3.2.1. Very Stable Command-line interfaces
      • 3.2.2. Stable Command-line interfaces
      • 3.2.3. Unstable command-line
    • 3.3. Functions and Types
      • 3.3.1. Very Stable API
      • 3.3.2. Semi-stable API
      • 3.3.3. Unstable API
    • 3.4. Hackage
Cabal Syntax Quicklinks Index
Cabal
  • 4. cabal-install Configuration and Commands
  • Edit on GitHub

4. cabal-install Configuration and Commands

  • 4.1. Configuration
    • 4.1.1. Overview
    • 4.1.2. Environment variables
      • 4.1.2.1. Configuration file discovery
    • 4.1.3. Directories
    • 4.1.4. Repository specification
      • 4.1.4.1. Using secure repositories
      • 4.1.4.2. Local no-index repositories
      • 4.1.4.3. Legacy repositories
      • 4.1.4.4. Secure local repositories
    • 4.1.5. Program options
  • 4.2. Commands
    • 4.2.1. Common Arguments and Flags
    • 4.2.2. Target Forms
    • 4.2.3. Global commands
      • 4.2.3.1. cabal user-config
    • 4.2.4. Package database commands
      • 4.2.4.1. cabal update
      • 4.2.4.2. cabal list
      • 4.2.4.3. cabal info
    • 4.2.5. Initialization and download
      • 4.2.5.1. cabal init
      • 4.2.5.2. cabal fetch
      • 4.2.5.3. cabal get
    • 4.2.6. Project configuration
      • 4.2.6.1. cabal configure
      • 4.2.6.2. cabal freeze
      • 4.2.6.3. cabal gen-bounds
      • 4.2.6.4. cabal outdated
      • 4.2.6.5. cabal path
    • 4.2.7. Project building and installing
      • 4.2.7.1. cabal build
      • 4.2.7.2. cabal install
        • 4.2.7.2.1. Adding libraries to GHC package environments
      • 4.2.7.3. cabal haddock
      • 4.2.7.4. cabal haddock-project
      • 4.2.7.5. cabal clean
    • 4.2.8. Running and testing
      • 4.2.8.1. cabal list-bin
      • 4.2.8.2. cabal repl
      • 4.2.8.3. cabal run
      • 4.2.8.4. cabal bench
      • 4.2.8.5. cabal test
      • 4.2.8.6. cabal exec
    • 4.2.9. Sanity checks and shipping
      • 4.2.9.1. cabal check
      • 4.2.9.2. cabal sdist
      • 4.2.9.3. cabal upload
      • 4.2.9.4. cabal report
Previous Next

© Copyright 2003-2024, Cabal Team.

Built with Sphinx using a theme provided by Read the Docs.