Skip to content

Commit

Permalink
Merge branch 'master' into pkgconf-1.9
Browse files Browse the repository at this point in the history
  • Loading branch information
juhp authored Nov 6, 2023
2 parents bf8e6ff + 15b5b05 commit 2010184
Show file tree
Hide file tree
Showing 23 changed files with 374 additions and 447 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: haskell/actions/hlint-setup@v2
- uses: haskell-actions/hlint-setup@v2
with:
version: "3.5"
- uses: haskell/actions/hlint-run@v2
- uses: haskell-actions/hlint-run@v2
with:
path: "."
fail-on: suggestion
14 changes: 7 additions & 7 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ on:
env:
# We choose a stable ghc version across all os's
# which will be used to do the next release
GHC_FOR_RELEASE: '9.2.7'
GHC_FOR_RELEASE: '9.2.8'
# Ideally we should use the version about to be released for hackage tests and benchmarks
GHC_FOR_SOLVER_BENCHMARKS: '9.2.7'
GHC_FOR_COMPLETE_HACKAGE_TESTS: '9.2.7'
GHC_FOR_SOLVER_BENCHMARKS: '9.2.8'
GHC_FOR_COMPLETE_HACKAGE_TESTS: '9.2.8'
COMMON_FLAGS: '-j 2 -v'

jobs:
Expand All @@ -38,7 +38,7 @@ jobs:
strategy:
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
ghc: ["9.6.1", "9.4.4", "9.2.7", "9.0.2", "8.10.7", "8.8.4", "8.6.5", "8.4.4"]
ghc: ["9.6.3", "9.4.7", "9.2.8", "9.0.2", "8.10.7", "8.8.4", "8.6.5", "8.4.4"]
exclude:
# corrupts GHA cache or the fabric of reality itself, see https://github.com/haskell/cabal/issues/8356
- os: "windows-latest"
Expand Down Expand Up @@ -107,7 +107,7 @@ jobs:
echo "FLAGS=$FLAGS" >> $GITHUB_ENV
- name: Allow newer dependencies when built with latest GHC
if: ${{ matrix.ghc }} == '9.6.1'
if: ${{ matrix.ghc }} == '9.6.3'
run: |
echo "allow-newer: rere:base, rere:transformers" >> cabal.project.validate
Expand Down Expand Up @@ -161,15 +161,15 @@ jobs:
# Have to disable *-suite validation:
# - the [email protected] problem is tracked at https://github.com/haskell/cabal/issues/8858
# - but curently can't run it with GHC 9.6, tracking: https://github.com/haskell/cabal/issues/8883
if: (runner.os != 'Windows') || (matrix.ghc != '9.6.1')
if: (runner.os != 'Windows') || (matrix.ghc != '9.6.3')
run: sh validate.sh $FLAGS -s lib-suite

- name: Validate cli-tests
run: sh validate.sh $FLAGS -s cli-tests

- name: Validate cli-suite
# Have to disable *-suite validation, see above the comment for lib-suite
if: (runner.os != 'Windows') || (matrix.ghc != '9.6.1')
if: (runner.os != 'Windows') || (matrix.ghc != '9.6.3')
run: sh validate.sh $FLAGS -s cli-suite

validate-old-ghcs:
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ cabal-testsuite/**/haddocks
# python artifacts from documentation builds
*.pyc
.python-sphinx-virtualenv/
venv
.venv
/doc/.skjold_cache/

# macOS folder metadata
Expand Down
13 changes: 13 additions & 0 deletions Cabal-syntax/src/Distribution/Fields/Field.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{-# LANGUAGE DeriveFoldable #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE DeriveTraversable #-}
{-# LANGUAGE StandaloneDeriving #-}

-- | Cabal-like file AST types: 'Field', 'Section' etc
--
Expand Down Expand Up @@ -51,6 +52,9 @@ data Field ann
| Section !(Name ann) [SectionArg ann] [Field ann]
deriving (Eq, Show, Functor, Foldable, Traversable)

-- | @since 3.12.0.0
deriving instance Ord ann => Ord (Field ann)

-- | Section of field name
fieldName :: Field ann -> Name ann
fieldName (Field n _) = n
Expand All @@ -73,6 +77,9 @@ fieldUniverse f@(Field _ _) = [f]
data FieldLine ann = FieldLine !ann !ByteString
deriving (Eq, Show, Functor, Foldable, Traversable)

-- | @since 3.12.0.0
deriving instance Ord ann => Ord (FieldLine ann)

-- | @since 3.0.0.0
fieldLineAnn :: FieldLine ann -> ann
fieldLineAnn (FieldLine ann _) = ann
Expand All @@ -91,6 +98,9 @@ data SectionArg ann
SecArgOther !ann !ByteString
deriving (Eq, Show, Functor, Foldable, Traversable)

-- | @since 3.12.0.0
deriving instance Ord ann => Ord (SectionArg ann)

-- | Extract annotation from 'SectionArg'.
sectionArgAnn :: SectionArg ann -> ann
sectionArgAnn (SecArgName ann _) = ann
Expand All @@ -109,6 +119,9 @@ type FieldName = ByteString
data Name ann = Name !ann !FieldName
deriving (Eq, Show, Functor, Foldable, Traversable)

-- | @since 3.12.0.0
deriving instance Ord ann => Ord (Name ann)

mkName :: ann -> FieldName -> Name ann
mkName ann bs = Name ann (B.map Char.toLower bs)

Expand Down
10 changes: 1 addition & 9 deletions Cabal/src/Distribution/Simple/GHC.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2052,20 +2052,12 @@ libAbiHash verbosity _pkg_descr lbi lib clbi = do
libBi = libBuildInfo lib
comp = compiler lbi
platform = hostPlatform lbi
vanillaArgs0 =
vanillaArgs =
(componentGhcOptions verbosity lbi libBi clbi (componentBuildDir lbi clbi))
`mappend` mempty
{ ghcOptMode = toFlag GhcModeAbiHash
, ghcOptInputModules = toNubListR $ exposedModules lib
}
vanillaArgs =
-- Package DBs unnecessary, and break ghc-cabal. See #3633
-- BUT, put at least the global database so that 7.4 doesn't
-- break.
vanillaArgs0
{ ghcOptPackageDBs = [GlobalPackageDB]
, ghcOptPackages = mempty
}
sharedArgs =
vanillaArgs
`mappend` mempty
Expand Down
10 changes: 1 addition & 9 deletions Cabal/src/Distribution/Simple/GHCJS.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1739,20 +1739,12 @@ libAbiHash verbosity _pkg_descr lbi lib clbi = do
libBi = libBuildInfo lib
comp = compiler lbi
platform = hostPlatform lbi
vanillaArgs0 =
vanillaArgs =
(componentGhcOptions verbosity lbi libBi clbi (componentBuildDir lbi clbi))
`mappend` mempty
{ ghcOptMode = toFlag GhcModeAbiHash
, ghcOptInputModules = toNubListR $ exposedModules lib
}
vanillaArgs =
-- Package DBs unnecessary, and break ghc-cabal. See #3633
-- BUT, put at least the global database so that 7.4 doesn't
-- break.
vanillaArgs0
{ ghcOptPackageDBs = [GlobalPackageDB]
, ghcOptPackages = mempty
}
sharedArgs =
vanillaArgs
`mappend` mempty
Expand Down
5 changes: 2 additions & 3 deletions doc/_templates/layout.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{% extends "!layout.html" %}

{% block menu %}
{{ super() }}
<a href="cabal-projectindex.html">Reference</a>
{{ super() }}
<a href="cabal-syntax-quicklinks.html">Cabal Syntax Quicklinks</a>
<a href="genindex.html">Index</a>
{% endblock %}

6 changes: 0 additions & 6 deletions doc/bugs-and-stability.rst

This file was deleted.

6 changes: 3 additions & 3 deletions doc/intro.rst → doc/cabal-context.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ use Hackage_ which is Haskell's central
package archive that contains thousands of libraries and applications in
the Cabal package format.

Introduction
============
What Cabal does
===============

Cabal is a package system for Haskell software. The point of a package
system is to enable software developers and users to easily distribute,
Expand Down Expand Up @@ -122,7 +122,7 @@ the package depends on.

For full details on what goes in the ``.cabal`` and ``Setup.hs`` files,
and for all the other features provided by the build system, see the
section on :doc:`developing packages <developing-packages>`.
section on :doc:`How to package Haskell code <how-to-package-haskell-code>`.

Cabal featureset
----------------
Expand Down
10 changes: 0 additions & 10 deletions doc/misc.rst → doc/cabal-interface-stability.rst
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
Reporting bugs and deficiencies
===============================

Please report any flaws or feature requests in the `bug
tracker <https://github.com/haskell/cabal/issues>`__.

For general discussion or queries email the libraries mailing list
[email protected]. There is also a development mailing list
[email protected].

Stability of Cabal interfaces
=============================

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
Package Description
===================
Package Description — <package>.cabal File
==========================================

The package description file, commonly known as "the Cabal file",
describes the contents of a package.
The Cabal package is the unit of distribution. When installed, its
purpose is to make available:

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cabal.project Reference
=======================
Project Description — cabal.project File
========================================

``cabal.project`` files support a variety of options which configure the
details of your build. The general syntax of a ``cabal.project`` file is
Expand Down
6 changes: 3 additions & 3 deletions doc/cabaldomain.py
Original file line number Diff line number Diff line change
Expand Up @@ -598,9 +598,9 @@ class CabalConfigFieldXRef(CabalFieldXRef):
#

class ConfigFieldIndex(Index):
name = 'projectindex'
localname = "Cabal reference"
shortname = "Reference"
name = 'syntax-quicklinks'
localname = "Cabal Syntax Quicklinks"
shortname = "Quicklinks"

class Entry(object):
def __init__(self, typ, name, doc, anchor, meta):
Expand Down
7 changes: 0 additions & 7 deletions doc/concepts-and-development.rst

This file was deleted.

2 changes: 1 addition & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
templates_path = ['_templates']
source_suffix = '.rst'
source_encoding = 'utf-8-sig'
master_doc = 'index'
root_doc = 'index'

# extlinks -- see http://www.sphinx-doc.org/en/stable/ext/extlinks.html
extlinks = {
Expand Down
2 changes: 1 addition & 1 deletion doc/getting-started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -228,4 +228,4 @@ What Next?
Now that you know how to set up a simple Haskell package using Cabal, check out
some of the resources on the Haskell website's `documentation page
<https://www.haskell.org/documentation/>`__ or read more about packages and
Cabal on the :doc:`introduction <intro>` page.
Cabal on the :doc:`What Cabal does <cabal-context>` page.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.. _nix-style-builds:

Nix-style Local Builds
======================
How to build locally like in Nix
================================

Nix-style local builds are a new build system implementation inspired by Nix.
The Nix-style local build system is commonly called "v2-build" for short
Expand Down
Loading

0 comments on commit 2010184

Please sign in to comment.