diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000000..bfe127253e2 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,12 @@ +# See: https://editorconfig.org +root = true + +[*] +charset = utf-8 + +[*.hs] +indent_style = space +indent_size = 2 + +[Makefile] +indent_style = tab diff --git a/.github/dependabot.yml b/.github/dependabot.yml index b3b2315d909..b1c8bd9d9d8 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -13,3 +13,4 @@ updates: schedule: # Check for updates to GitHub Actions every week interval: "weekly" + diff --git a/.github/mergify.yml b/.github/mergify.yml index 4a1efe926a8..c56a0c01ad7 100644 --- a/.github/mergify.yml +++ b/.github/mergify.yml @@ -1,3 +1,22 @@ +# Note: We do not use the rebase strategy to merge PRs, because that +# loses information needed by changelog-d to associate commits with PRs. + +priority_rules: + + - name: high priority + conditions: + - 'label=priority: high :fire:' + priority: high + + # The idea is we slightly prioritize those PRs because we're in + # a release cycle if a PR matches. + - name: release branch + conditions: + - 'base~=^3\.' + - 'label!=backport' + # 'normal' is 2000, 'high' is 3000 + priority: 2500 + pull_request_rules: # implementing PR delay logic: apply a label after 2 days of inactivity @@ -8,42 +27,68 @@ pull_request_rules: - merge delay passed name: Wait for 2 days before validating merge conditions: - - updated-at<2 days ago + - or: + - 'label=priority: high :fire:' + - updated-at<2 days ago + - or: + - label=merge me + - label=squash+merge me + - label=merge+no rebase + - '#approved-reviews-by>=2' + + # label when Mergify is ready but waiting for the above + - actions: + label: + add: + - ready and waiting + name: Waiting out merge delay (used by bot) + conditions: + - base=master + - -draft + - -closed - or: - label=merge me - label=squash+merge me - label=merge+no rebase - '#approved-reviews-by>=2' + - '#changes-requested-reviews-by=0' + # oy + # lifted these from branch protection imports + - check-success=fourmolu + - check-success=hlint + - check-success=Meta checks + - check-success=Doctest Cabal + - check-success=Validate post job + - check-success=Bootstrap post job + - 'check-success=docs/readthedocs.org:cabal' # rebase+merge strategy - actions: queue: name: default - # Merge into master with a merge commit - method: merge - # Update the pr branch with rebase, so the history is clean - update_method: rebase name: Put pull requests in the rebase+merge queue conditions: - base=master - label=merge me - label=merge delay passed - '#approved-reviews-by>=2' + - '-label~=^blocked:' # merge+squash strategy - actions: queue: - name: default - method: squash - # both update methods get absorbed by the squash, so we use the most - # reliable - update_method: merge + name: squash-merge name: Put pull requests in the squash+merge queue conditions: - base=master - label=squash+merge me - label=merge delay passed - '#approved-reviews-by>=2' + - '-label~=^blocked:' + # unlike the others, we need to force this one to be up to date + # because it's intended for when Mergify doesn't have permission + # to rebase + - '#commits-behind=0' # merge+no rebase strategy - actions: @@ -55,36 +100,55 @@ pull_request_rules: - label=merge+no rebase - label=merge delay passed - '#approved-reviews-by>=2' + - '-label~=^blocked:' - # rebase+merge strategy for backports: require 1 approver instead of 2 + # merge strategy for release branches + - actions: + queue: + name: default + name: Put release branch pull requests in the rebase+merge queue + conditions: + - label=merge me + - base!=master + - -body~=backport + - '#approved-reviews-by>=2' + - '-label~=^blocked:' + + # merge+squash strategy for release branches + - actions: + queue: + name: squash-merge + name: Put release branch pull requests in the squash+merge queue + conditions: + - base!=master + - label=squash+merge me + - -body~=backport + - '#approved-reviews-by>=2' + - '-label~=^blocked:' + + # merge strategy for backports: require 1 approver instead of 2 - actions: queue: name: default - # Merge with a merge commit - method: merge - # Update the pr branch with rebase, so the history is clean - update_method: rebase name: Put backports in the rebase+merge queue conditions: - label=merge me - base!=master - body~=backport - '#approved-reviews-by>=1' + - '-label~=^blocked:' # merge+squash strategy for backports: require 1 approver instead of 2 - actions: queue: - name: default - method: squash - # both update methods get absorbed by the squash, so we use the most - # reliable - update_method: merge + name: squash-merge name: Put backports in the squash+merge queue conditions: - label=squash+merge me - base!=master - body~=backport - '#approved-reviews-by>=1' + - '-label~=^blocked:' # backports should be labeled as such - actions: @@ -96,5 +160,18 @@ pull_request_rules: - body~=automatic backport queue_rules: + # Mergify now requires different queues for different strategies - name: default update_bot_account: Mikolaj + merge_method: merge + update_method: rebase + + - name: squash-merge + update_bot_account: Mikolaj + merge_method: squash + update_method: merge + +defaults: + actions: + backport: + title: "Backport #{{ number }}: {{ title }}" diff --git a/.github/workflows/bootstrap.skip.yml b/.github/workflows/bootstrap.skip.yml index 3a47870b533..40ccb0ae9bc 100644 --- a/.github/workflows/bootstrap.skip.yml +++ b/.github/workflows/bootstrap.skip.yml @@ -19,6 +19,11 @@ on: - 'doc/**' - '**/README.md' - 'CONTRIBUTING.md' + - "changelog.d/**" + # only top level for these, because various test packages have them too + - "*/ChangeLog.md" + - "*/changelog.md" + - "release-notes/**" branches: - master pull_request: @@ -26,6 +31,10 @@ on: - 'doc/**' - '**/README.md' - 'CONTRIBUTING.md' + - "changelog.d/**" + - "*/ChangeLog.md" + - "*/changelog.md" + - "release-notes/**" release: types: - created diff --git a/.github/workflows/bootstrap.yml b/.github/workflows/bootstrap.yml index 56970448239..d85b2ae4f12 100644 --- a/.github/workflows/bootstrap.yml +++ b/.github/workflows/bootstrap.yml @@ -14,6 +14,11 @@ on: - 'doc/**' - '**/README.md' - 'CONTRIBUTING.md' + - "changelog.d/**" + # only top level for these, because various test packages have them too + - "*/ChangeLog.md" + - "*/changelog.md" + - "release-notes/**" branches: - master pull_request: @@ -21,6 +26,10 @@ on: - 'doc/**' - '**/README.md' - 'CONTRIBUTING.md' + - "changelog.d/**" + - "*/ChangeLog.md" + - "*/changelog.md" + - "release-notes/**" release: types: - created @@ -30,7 +39,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - ghc: ["8.10.7", "9.0.2", "9.2.8", "9.4.8", "9.6.4", "9.8.2"] + ghc: ["9.0.2", "9.2.8", "9.4.8", "9.6.6", "9.8.2"] include: - os: macos-latest ghc: "9.2.8" @@ -43,7 +52,7 @@ jobs: rm -rf ~/.config/cabal rm -rf ~/.cache/cabal - - uses: actions/cache@v3 + - uses: actions/cache@v4 name: Cache the downloads id: bootstrap-cache with: @@ -69,7 +78,7 @@ jobs: run: | _build/bin/cabal --version - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: cabal-${{ matrix.os }}-${{ matrix.ghc }}-bootstrapped path: _build/artifacts/* diff --git a/.github/workflows/changelogs.yml b/.github/workflows/changelogs.yml index 85bd169b221..388739dfb19 100644 --- a/.github/workflows/changelogs.yml +++ b/.github/workflows/changelogs.yml @@ -28,7 +28,8 @@ jobs: - name: Install changelog-d run: | - curl --create-dirs -o "$HOME/.local/bin/changelog-d" "https://codeberg.org/fgaz/changelog-d/releases/download/v1.0/changelog-d-v1.0-x86_64-linux" + curl --create-dirs -o "$HOME/.local/bin/changelog-d" -sS --fail \ + "https://codeberg.org/fgaz/changelog-d/releases/download/v1.0.1/changelog-d-v1.0.1-x86_64-linux" chmod +x "$HOME/.local/bin/changelog-d" # https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#adding-a-system-path echo "$HOME/.local/bin" >> $GITHUB_PATH diff --git a/.github/workflows/check-sdist.skip.yml b/.github/workflows/check-sdist.skip.yml new file mode 100644 index 00000000000..522c9896f0d --- /dev/null +++ b/.github/workflows/check-sdist.skip.yml @@ -0,0 +1,48 @@ +name: Check sdist Skip + +# This Workflow is special and contains a workaround for a known limitation of GitHub CI. +# +# The problem: We don't want to run the "check sdist" jobs on PRs which contain only changes +# to the docs, since these jobs take a long time to complete without providing any benefit. +# We therefore use path-filtering in the workflow triggers for the check sdist jobs, namely +# "paths-ignore: doc/**". But the "Check sdist post job" is a required job, therefore a PR cannot +# be merged unless the "Bootstrap post job" completes succesfully, which it doesn't do if we +# filter it out. +# +# The solution: We use a second job with the same name which always returns the exit code 0. +# The logic implemented for "required" workflows accepts if 1) at least one job with that name +# runs through, AND 2) If multiple jobs of that name exist, then all jobs of that name have to +# finish successfully. +on: + push: + paths: + - 'doc/**' + - '**/README.md' + - 'CONTRIBUTING.md' + - "changelog.d/**" + # only top level for these, because various test packages have them too + - "*/ChangeLog.md" + - "*/changelog.md" + - "release-notes/**" + branches: + - master + pull_request: + paths: + - 'doc/**' + - '**/README.md' + - 'CONTRIBUTING.md' + - "changelog.d/**" + - "*/ChangeLog.md" + - "*/changelog.md" + - "release-notes/**" + release: + types: + - created + +jobs: + check-sdist-post-job: + if: always() + name: Check sdist post job + runs-on: ubuntu-latest + steps: + - run: exit 0 diff --git a/.github/workflows/check-sdist.yml b/.github/workflows/check-sdist.yml new file mode 100644 index 00000000000..f8cce8d41a9 --- /dev/null +++ b/.github/workflows/check-sdist.yml @@ -0,0 +1,105 @@ +name: Check sdist + +# See: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#concurrency. +concurrency: + group: ${{ github.ref }}-${{ github.workflow }} + cancel-in-progress: true + +on: + push: + paths-ignore: + - "doc/**" + - "**/README.md" + - "CONTRIBUTING.md" + - "changelog.d/**" + # only top level for these, because various test packages have them too + - "*/ChangeLog.md" + - "*/changelog.md" + - "release-notes/**" + branches: + - master + pull_request: + paths-ignore: + - "doc/**" + - "**/README.md" + - "CONTRIBUTING.md" + - "changelog.d/**" + - "*/ChangeLog.md" + - "*/changelog.md" + - "release-notes/**" + release: + types: + - created + +jobs: + + # Dogfood the generated sdist, to avoid bugs like https://github.com/haskell/cabal/issues/9833 + # No caching, since the point is to verify they can be installed "from scratch" + # Don't run on master or a PR targeting master, because there's never an installable Cabal + dogfood-sdists: + name: Dogfood sdist on ${{ matrix.os }} ghc-${{ matrix.ghc }} + if: github.ref != 'refs/heads/master' && github.base_ref != 'master' + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest] + # this should be kept up to date with the list in validate.yml, but should be the + # *first* compiler release so we validate against what is hopefully the first + # release of a corresponding Cabal and friends. it can also be short since it's + # highly unlikely that we are releasing really old branches. + ghc: + [ + "9.10.1", + "9.8.1", + "9.6.1", + "9.4.1", + ] + + steps: + + - uses: haskell-actions/setup@v2 + id: setup-haskell + with: + ghc-version: ${{ matrix.ghc }} + cabal-version: latest + + - uses: actions/checkout@v4 + + - name: Make sdist + run: cabal sdist cabal-install + + - name: Install from sdist + run: | + # skip if a suitable Cabal isn't in this ghc's bootlibs, since that's the case + # that causes failures for users (otherwise cabal-install will install a matching + # version itself) + # we only want to test cabal-install, to ensure that it works with existing Cabals + # (don't look at this too closely) + sdist="$(ls dist-newstyle/sdist/cabal-install-*.tar.gz | sed -n '\,^dist-newstyle/sdist/cabal-install-[0-9.]*\.tar\.gz$,{;p;q;}')" + # extract the cabal-install major version + ver="$(echo "$sdist" | sed -n 's,^dist-newstyle/sdist/cabal-install-\([0-9][0-9]*\.[0-9][0-9]*\)\.[0-9.]*$,\1,p')" + # dunno if this will ever be extended to freebsd, but grep -q is a gnu-ism + if ghc-pkg --global --simple-output list Cabal | grep "^Cabal-$cbl\\." >/dev/null; then + # sigh, someone broke installing from tarballs + rm -rf cabal*.project Cabal Cabal-syntax cabal-install-solver cabal-install + tar xfz "$sdist" + cd "cabal-install-$cbl"* + cabal install + else + echo No matching bootlib Cabal version to test against. + exit 0 + fi + + check-sdist-post-job: + if: always() + name: Check sdist post job + runs-on: ubuntu-latest + # IMPORTANT! Any job added to the workflow should be added here too + needs: [dogfood-sdists] + + steps: + - run: | + echo "jobs info: ${{ toJSON(needs) }}" + - if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') + run: exit 1 + diff --git a/.github/workflows/dependabot.yml b/.github/workflows/dependabot.yml new file mode 100644 index 00000000000..6219653e4fe --- /dev/null +++ b/.github/workflows/dependabot.yml @@ -0,0 +1,17 @@ +# copied from https://github.com/ubuntu/authd/commit/3f9df8f21d952cd33fd44d3834d0edeec1f5766f + +name: Dependabot rules validation + +on: + pull_request: + paths: + - '.github/dependabot.yml' + +jobs: + validate: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: marocchino/validate-dependabot@v3 + id: validate diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index d54310be613..116537cf2ea 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -17,3 +17,4 @@ jobs: Cabal/**/*.hs Cabal-syntax/**/*.hs cabal-install/**/*.hs + cabal-validate/**/*.hs diff --git a/.github/workflows/quick-jobs.yml b/.github/workflows/quick-jobs.yml index 87e553176a1..82c3fbd1244 100644 --- a/.github/workflows/quick-jobs.yml +++ b/.github/workflows/quick-jobs.yml @@ -29,12 +29,12 @@ jobs: gen-spdx gen-spdx-exc steps: - - name: ghcup - run: | - ghcup --version - ghcup config set cache true - ghcup install ghc $GHC_FOR_QUICK_JOBS - ghcup set ghc $GHC_FOR_QUICK_JOBS + - name: Install primary compiler + uses: haskell-actions/setup@v2 + id: setup-haskell + with: + ghc-version: ${{ env.GHC_FOR_QUICK_JOBS }} + cabal-version: latest - name: Haskell versions run: | ghc --version @@ -72,12 +72,12 @@ jobs: name: Doctest Cabal runs-on: ubuntu-latest steps: - - name: ghcup - run: | - ghcup --version - ghcup config set cache true - ghcup install ghc $GHC_FOR_QUICK_JOBS - ghcup set ghc $GHC_FOR_QUICK_JOBS + - name: Install primary compiler + uses: haskell-actions/setup@v2 + id: setup-haskell + with: + ghc-version: ${{ env.GHC_FOR_QUICK_JOBS }} + cabal-version: latest - name: Haskell versions run: | ghc --version @@ -117,12 +117,12 @@ jobs: env: cabal_build: cabal build buildinfo-reference-generator steps: - - name: ghcup - run: | - ghcup --version - ghcup config set cache true - ghcup install ghc $GHC_FOR_QUICK_JOBS - ghcup set ghc $GHC_FOR_QUICK_JOBS + - name: Install primary compiler + uses: haskell-actions/setup@v2 + id: setup-haskell + with: + ghc-version: ${{ env.GHC_FOR_QUICK_JOBS }} + cabal-version: latest - name: Haskell versions run: | ghc --version @@ -154,12 +154,12 @@ jobs: name: Check Release Project runs-on: ubuntu-latest steps: - - name: ghcup - run: | - ghcup --version - ghcup config set cache true - ghcup install ghc $GHC_FOR_QUICK_JOBS - ghcup set ghc $GHC_FOR_QUICK_JOBS + - name: Install primary compiler + uses: haskell-actions/setup@v2 + id: setup-haskell + with: + ghc-version: ${{ env.GHC_FOR_QUICK_JOBS }} + cabal-version: latest - name: Haskell versions run: | ghc --version diff --git a/.github/workflows/users-guide.yml b/.github/workflows/users-guide.yml index 8442b39c2f4..64969e427c4 100644 --- a/.github/workflows/users-guide.yml +++ b/.github/workflows/users-guide.yml @@ -73,7 +73,7 @@ jobs: run: | make SPHINX_HTML_OUTDIR=html users-guide - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: users-guide-html path: html/ diff --git a/.github/workflows/validate.skip.yml b/.github/workflows/validate.skip.yml index af608e92d49..f4aa50ae191 100644 --- a/.github/workflows/validate.skip.yml +++ b/.github/workflows/validate.skip.yml @@ -19,6 +19,11 @@ on: - 'doc/**' - '**/README.md' - 'CONTRIBUTING.md' + - "changelog.d/**" + # only top level for these, because various test packages have them too + - "*/ChangeLog.md" + - "*/changelog.md" + - "release-notes/**" branches: - master pull_request: @@ -26,6 +31,10 @@ on: - 'doc/**' - '**/README.md' - 'CONTRIBUTING.md' + - "changelog.d/**" + - "*/ChangeLog.md" + - "*/changelog.md" + - "release-notes/**" release: types: - created diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 71c0246b6fc..9395720b417 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -1,11 +1,5 @@ name: Validate -# We use bash as default even in windows -# to try keep the workflow as uniform as possible -defaults: - run: - shell: bash - # See: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#concurrency. concurrency: group: ${{ github.ref }}-${{ github.workflow }} @@ -17,16 +11,27 @@ concurrency: on: push: paths-ignore: - - 'doc/**' - - '**/README.md' - - 'CONTRIBUTING.md' + - "doc/**" + - "**/README.md" + - "CONTRIBUTING.md" + - "changelog.d/**" + # only top level for these, because various test packages have them too + - "*/ChangeLog.md" + - "*/changelog.md" + - "release-notes/**" branches: - master + # hardcoded LTS branch, change when new LTS released! + - '3.12' pull_request: paths-ignore: - - 'doc/**' - - '**/README.md' - - 'CONTRIBUTING.md' + - "doc/**" + - "**/README.md" + - "CONTRIBUTING.md" + - "changelog.d/**" + - "*/ChangeLog.md" + - "*/changelog.md" + - "release-notes/**" release: types: - created @@ -37,73 +42,113 @@ on: inputs: allow-newer: description: allow-newer line - required: true + required: false type: string constraints: description: constraints line - required: true + required: false type: string env: # We choose a stable ghc version across all os's # which will be used to do the next release - GHC_FOR_RELEASE: '9.4.8' + GHC_FOR_RELEASE: "9.4.8" # Ideally we should use the version about to be released for hackage tests and benchmarks - GHC_FOR_SOLVER_BENCHMARKS: '9.4.8' - GHC_FOR_COMPLETE_HACKAGE_TESTS: '9.4.8' - COMMON_FLAGS: '-j 2 -v' + GHC_FOR_SOLVER_BENCHMARKS: "9.4.8" + GHC_FOR_COMPLETE_HACKAGE_TESTS: "9.4.8" + COMMON_FLAGS: "-j 2 -v" # See https://github.com/haskell/cabal/blob/master/CONTRIBUTING.md#hackage-revisions ALLOWNEWER: ${{ github.event.inputs.allow-newer }} CONSTRAINTS: ${{ github.event.inputs.constraints }} - jobs: validate: - name: Validate ${{ matrix.os }} ghc-${{ matrix.ghc }} - runs-on: ${{ matrix.os }} + name: Validate ${{ matrix.sys.os }} ghc-${{ matrix.ghc }} + runs-on: ${{ matrix.sys.os }} outputs: GHC_FOR_RELEASE: ${{ format('["{0}"]', env.GHC_FOR_RELEASE) }} strategy: + fail-fast: false matrix: - os: [ubuntu-latest, macos-13, windows-latest] + sys: + - { os: windows-latest, shell: "C:/msys64/usr/bin/bash.exe -e {0}" } + - { os: ubuntu-22.04, shell: bash } + - { os: macos-latest, shell: bash } # If you remove something from here, then add it to the old-ghcs job. # Also a removed GHC from here means that we are actually dropping # support, so the PR *must* have a changelog entry. - ghc: ['9.10.1', '9.8.2', '9.6.4', '9.4.8', '9.2.8', '9.0.2', '8.10.7', '8.8.4', '8.6.5'] + ghc: + [ + "9.10.1", + "9.8.2", + "9.6.6", + "9.4.8", + "9.2.8", + "9.0.2", + "8.10.7", + "8.8.4", + ] exclude: + # Throws fatal "cabal-tests.exe: fd:8: hGetLine: end of file" exception + # even with --io-manager=native + - sys: + { os: windows-latest, shell: "C:/msys64/usr/bin/bash.exe -e {0}" } + ghc: "9.0.2" # corrupts GHA cache or the fabric of reality itself, see https://github.com/haskell/cabal/issues/8356 - - os: windows-latest - ghc: '8.10.7' + - sys: + { os: windows-latest, shell: "C:/msys64/usr/bin/bash.exe -e {0}" } + ghc: "8.10.7" # lot of segfaults caused by ghc bugs - - os: windows-latest - ghc: '8.8.4' - # it often randomly does "C:\Users\RUNNER~1\AppData\Local\Temp\ghcFEDE.c: DeleteFile "\\\\?\\C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\ghcFEDE.c": permission denied (Access is denied.)" - - os: windows-latest - ghc: '8.6.5' - + - sys: + { os: windows-latest, shell: "C:/msys64/usr/bin/bash.exe -e {0}" } + ghc: "8.8.4" + # ghc before 8.10.5 doesn't run on AArch64 + # 9.0.2 suffers from https://gitlab.haskell.org/ghc/ghc/-/issues/20592 + # 8.10.7 throws asm errors in hashable's cbits suggesting the runner doesn't + # support a CPU extension for hardware SHA; may be fixable with flags + - sys: + { os: macos-latest, shell: bash } + ghc: "9.0.2" + - sys: + { os: macos-latest, shell: bash } + ghc: "8.10.7" + - sys: + { os: macos-latest, shell: bash } + ghc: "8.8.4" + defaults: + run: + shell: ${{ matrix.sys.shell }} steps: - - name: Work around XDG directories existence (haskell-actions/setup#62) if: runner.os == 'macOS' run: | rm -rf ~/.config/cabal rm -rf ~/.cache/cabal + - name: "WIN: Setup TMP environment variable" + if: runner.os == 'Windows' + run: | + echo "TMP=${{ runner.temp }}" >> "$GITHUB_ENV" + - uses: actions/checkout@v4 # See https://github.com/haskell/cabal/blob/master/CONTRIBUTING.md#hackage-revisions - - name: Manually supplied constraints/allow-newer - if: github.event_name == 'workflow_dispatch' + - name: Add manually supplied allow-newer + if: github.event_name == 'workflow_dispatch' && github.event.inputs.allow-newer != '' run: | - echo "allow-newer: ${ALLOWNEWER}" >> cabal.validate.project - echo "constraints: ${CONSTRAINTS}" >> cabal.validate.project + echo "allow-newer: ${{ github.event.inputs.allow-newer }}" >> cabal.validate.project + + - name: Add manually supplied constraints + if: github.event_name == 'workflow_dispatch' && github.event.inputs.constraints != '' + run: | + echo "constraints: ${{ github.event.inputs.constraints }}" >> cabal.validate.project - uses: haskell-actions/setup@v2 id: setup-haskell with: ghc-version: ${{ matrix.ghc }} - cabal-version: latest # latest is mandatory for cabal-testsuite, see https://github.com/haskell/cabal/issues/8133 + cabal-version: 3.12.1.0 # see https://github.com/haskell/cabal/pull/10251 ghcup-release-channel: https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.8.yaml # See the following link for a breakdown of the following step @@ -117,9 +162,6 @@ jobs: key: ${{ runner.os }}-${{ matrix.ghc }}-${{ github.sha }} restore-keys: ${{ runner.os }}-${{ matrix.ghc }}- - - name: Work around git problem https://bugs.launchpad.net/ubuntu/+source/git/+bug/1993586 (cabal PR #8546) - run: git config --global protocol.file.allow always - # The tool is not essential to the rest of the test suite. If # hackage-repo-tool is not present, any test that requires it will # be skipped. @@ -130,10 +172,15 @@ jobs: run: cabal install --ignore-project hackage-repo-tool # Needed by cabal-testsuite/PackageTests/Configure/setup.test.hs - - name: Install Autotools + - name: "MAC: Install Autotools" if: runner.os == 'macOS' run: brew install automake + # Needed by cabal-testsuite/PackageTests/Configure/setup.test.hs + - name: "WIN: Install Autotools" + if: runner.os == 'Windows' + run: /usr/bin/pacman --noconfirm -S autotools + - name: Set validate inputs run: | FLAGS="${{ env.COMMON_FLAGS }}" @@ -154,6 +201,16 @@ jobs: - name: Validate build run: sh validate.sh $FLAGS -s build + - name: Canonicalize architecture + run: | + case ${{ runner.arch }} in + X86) arch=i386 ;; + X64) arch=x86_64 ;; + ARM64) arch=aarch64 ;; + *) echo "Unsupported architecture, please fix validate.yaml" 2>/dev/null; exit 1 ;; + esac + echo "CABAL_ARCH=$arch" >> "$GITHUB_ENV" + - name: Tar cabal head executable if: matrix.ghc == env.GHC_FOR_RELEASE run: | @@ -172,7 +229,7 @@ jobs: fi DIR=$(dirname "$CABAL_EXEC") FILE=$(basename "$CABAL_EXEC") - CABAL_EXEC_TAR="cabal-head-${{ runner.os }}-x86_64.tar.gz" + CABAL_EXEC_TAR="cabal-head-${{ runner.os }}-$CABAL_ARCH.tar.gz" tar -czvf "$CABAL_EXEC_TAR" -C "$DIR" "$FILE" echo "CABAL_EXEC_TAR=$CABAL_EXEC_TAR" >> "$GITHUB_ENV" @@ -181,50 +238,50 @@ jobs: # - Make it available in the workflow to make easier testing it locally - name: Upload cabal-install executable to workflow artifacts if: matrix.ghc == env.GHC_FOR_RELEASE - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: cabal-${{ runner.os }}-x86_64 + name: cabal-${{ runner.os }}-${{ env.CABAL_ARCH }} path: ${{ env.CABAL_EXEC_TAR }} - - name: Validate lib-tests + - name: Validate tests env: # `rawSystemStdInOut reports text decoding errors` # test does not find ghc without the full path in windows GHCPATH: ${{ steps.setup-haskell.outputs.ghc-exe }} - run: sh validate.sh $FLAGS -s lib-tests - - - name: Validate lib-suite - run: sh validate.sh $FLAGS -s lib-suite - - - name: Validate cli-tests - run: sh validate.sh $FLAGS -s cli-tests - - - name: Validate cli-suite - run: sh validate.sh $FLAGS -s cli-suite - - - name: Validate solver-benchmarks-tests - if: matrix.ghc == env.GHC_FOR_SOLVER_BENCHMARKS - run: sh validate.sh $FLAGS -s solver-benchmarks-tests - - - name: Validate solver-benchmarks-run - if: matrix.ghc == env.GHC_FOR_SOLVER_BENCHMARKS - run: sh validate.sh $FLAGS -s solver-benchmarks-run - + run: | + set +e + rc=0 + tests="lib-tests lib-suite cli-tests cli-suite" + if [ "${{ matrix.ghc }}" = "${{ env.GHC_FOR_SOLVER_BENCHMARKS }}" ]; then + tests="$tests solver-benchmarks-tests solver-benchmarks-run" + fi + for test in $tests; do + echo Validate "$test" + sh validate.sh $FLAGS -s "$test" || rc=1 + echo End "$test" + done + exit $rc + # The above ensures all the tests get run, for a single platform+ghc. + # Trying to ensure they run for *all* combinations but still fail + # at the end seems to be extremely difficult at best. It's doable, + # but it requires a continuously growing stack of conditions and + # one possibly nightmarish final conditional. 'fail-fast' gets us + # partway there, at least, but is still imperfect. validate-old-ghcs: name: Validate old ghcs ${{ matrix.extra-ghc }} - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 needs: validate strategy: matrix: - extra-ghc: ['8.4.4', '8.2.2', '8.0.2'] + extra-ghc: + ["8.4.4", "8.2.2", "8.0.2"] ## GHC 7.10.3 does not install on ubuntu-22.04 with ghcup. ## Older GHCs are not supported by ghcup in the first place. fail-fast: false steps: - - uses: actions/checkout@v4 - name: Install prerequisites for old GHCs @@ -263,17 +320,20 @@ jobs: restore-keys: ${{ runner.os }}-${{ env.GHC_FOR_RELEASE }}- - name: Validate build + id: build run: sh validate.sh ${{ env.COMMON_FLAGS }} -s build - name: "Validate lib-suite-extras --extra-hc ghc-${{ matrix.extra-ghc }}" env: EXTRA_GHC: ghc-${{ matrix.extra-ghc }} run: sh validate.sh ${{ env.COMMON_FLAGS }} --lib-only -s lib-suite-extras --extra-hc "${{ env.EXTRA_GHC }}" + # See the comment above about running all tests but still failing if one + # of them does; it also applies here. build-alpine: name: Build statically linked using alpine runs-on: ubuntu-latest - container: 'alpine:3.19' + container: "alpine:3.19" steps: - name: Install extra dependencies shell: sh @@ -328,34 +388,55 @@ jobs: echo "CABAL_EXEC_TAR=$CABAL_EXEC_TAR" >> "$GITHUB_ENV" - name: Upload cabal-install executable to workflow artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: cabal-${{ runner.os }}-static-x86_64 path: ${{ env.CABAL_EXEC_TAR }} - # The previous jobs use a released version of cabal to build cabal HEAD itself # This one uses the cabal HEAD generated executable in the previous step # to build itself again, as sanity check dogfooding: - name: Dogfooding ${{ matrix.os }} ghc-${{ matrix.ghc }} - runs-on: ${{ matrix.os }} + name: Dogfooding ${{ matrix.sys.os }} ghc-${{ matrix.ghc }} + runs-on: ${{ matrix.sys.os }} needs: validate strategy: matrix: - os: [ubuntu-latest, macos-latest, windows-latest] + sys: + - { os: windows-latest, shell: "C:/msys64/usr/bin/bash.exe -e {0}" } + - { os: ubuntu-22.04, shell: bash } + - { os: macos-latest, shell: bash } # We only use one ghc version the used one for the next release (defined at top of the workflow) # We need to build an array dynamically to inject the appropiate env var in a previous job, # see https://docs.github.com/en/actions/learn-github-actions/expressions#fromjson ghc: ${{ fromJSON (needs.validate.outputs.GHC_FOR_RELEASE) }} + defaults: + run: + shell: ${{ matrix.sys.shell }} steps: - - name: Work around XDG directories existence (haskell-actions/setup#62) + # TODO: make a reusable action for this + - name: Canonicalize architecture + run: | + case ${{ runner.arch }} in + X86) arch=i386 ;; + X64) arch=x86_64 ;; + ARM64) arch=aarch64 ;; + *) echo "Unsupported architecture" 2>/dev/null; exit 1 ;; + esac + echo "CABAL_ARCH=$arch" >> "$GITHUB_ENV" + + - name: "MAC: Work around XDG directories existence (haskell-actions/setup#62)" if: runner.os == 'macOS' run: | rm -rf ~/.config/cabal rm -rf ~/.cache/cabal + - name: "WIN: Setup TMP environment variable" + if: runner.os == 'Windows' + run: | + echo "TMP=${{ runner.temp }}" >> "$GITHUB_ENV" + - uses: actions/checkout@v4 - uses: haskell-actions/setup@v2 @@ -365,13 +446,13 @@ jobs: cabal-version: latest # default, we are not using it in this job - name: Download cabal executable from workflow artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: - name: cabal-${{ runner.os }}-x86_64 + name: cabal-${{ runner.os }}-${{ env.CABAL_ARCH }} path: cabal-head - name: Untar the cabal executable - run: tar -xzf "./cabal-head/cabal-head-${{ runner.os }}-x86_64.tar.gz" -C cabal-head + run: tar -xzf "./cabal-head/cabal-head-${{ runner.os }}-$CABAL_ARCH.tar.gz" -C cabal-head - name: print-config using cabal HEAD run: sh validate.sh ${{ env.COMMON_FLAGS }} --with-cabal ./cabal-head/cabal -s print-config @@ -385,42 +466,62 @@ jobs: name: Create a GitHub prerelease with the binary artifacts runs-on: ubuntu-latest if: github.ref == 'refs/heads/master' + permissions: + contents: write # IMPORTANT! Any job added to the workflow should be added here too needs: [validate, validate-old-ghcs, build-alpine, dogfooding] steps: - - uses: actions/download-artifact@v3 - with: - name: cabal-Windows-x86_64 + # for now this is hardcoded. is there a better way? + - uses: actions/download-artifact@v4 + with: + pattern: cabal-* + path: binaries - - uses: actions/download-artifact@v3 - with: - name: cabal-Linux-x86_64 + - name: Create GitHub prerelease + uses: softprops/action-gh-release@v2 + with: + tag_name: cabal-head + prerelease: true + files: binaries/cabal-* - - uses: actions/download-artifact@v3 - with: - name: cabal-Linux-static-x86_64 + prerelease-lts: + name: Create a GitHub LTS prerelease with the binary artifacts + runs-on: ubuntu-latest + # The LTS branch is hardcoded for now, update it on a new LTS! + # if: github.ref == 'refs/heads/3.12' + permissions: + contents: write - - uses: actions/download-artifact@v3 + # IMPORTANT! Any job added to the workflow should be added here too + needs: [validate, validate-old-ghcs, build-alpine, dogfooding] + + steps: + - uses: actions/download-artifact@v4 with: - name: cabal-macOS-x86_64 + pattern: cabal-* + path: binaries + + - run: | + # bash-ism, but we forced bash above + cd binaries + for f in cabal-*; do + mv "$f" "cabal-lts-${f##cabal-}" + done + + - run: echo ${{ github.ref }} - name: Create GitHub prerelease - uses: marvinpinto/action-automatic-releases@v1.2.1 + if: github.ref == 'refs/heads/3.12' + uses: softprops/action-gh-release@v2 with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - automatic_release_tag: cabal-head + tag_name: cabal-lts-head prerelease: true - title: cabal-head - files: | - cabal-head-Windows-x86_64.tar.gz - cabal-head-Linux-x86_64.tar.gz - cabal-head-Linux-static-x86_64.tar.gz - cabal-head-macOS-x86_64.tar.gz + files: binaries/cabal-* # We use this job as a summary of the workflow - # It will fail if any of the previous jobs does it + # It will fail if any of the previous jobs does # This way we can use it exclusively in branch protection rules # and abstract away the concrete jobs of the workflow, including their names validate-post-job: diff --git a/.github/workflows/whitespace.yml b/.github/workflows/whitespace.yml index 46088d3d351..a6869a59e3f 100644 --- a/.github/workflows/whitespace.yml +++ b/.github/workflows/whitespace.yml @@ -7,8 +7,21 @@ on: jobs: whitespace: + defaults: + run: + shell: bash runs-on: ubuntu-latest steps: + - uses: actions/checkout@v4 - - uses: andreasabel/fix-whitespace-action@v1 + + - run: | + # no longer using the action because apparently we're supposed to use the Makefile here + wget -q https://github.com/agda/fix-whitespace/releases/download/v0.1/fix-whitespace-0.1-linux.binary + mkdir -p "$HOME/.local/bin" + mv fix-whitespace-0.1-linux.binary "$HOME/.local/bin/fix-whitespace" + chmod +x "$HOME/.local/bin/fix-whitespace" + echo "$HOME/.local/bin" >> $GITHUB_PATH + + - run: make whitespace diff --git a/.gitignore b/.gitignore index 957786d7055..8adb6aee95f 100644 --- a/.gitignore +++ b/.gitignore @@ -24,6 +24,7 @@ bootstrap/*.plan.json /cabal-install/dist/ /cabal-install/Setup /cabal-install/source-file-list +/cabal-install/tests/IntegrationTests2/config/cabal-config .stylish-haskell.yaml .stylish-haskell.yml @@ -40,6 +41,7 @@ _build *~ .*.swp *.bak +.vscode # GHC build @@ -68,17 +70,18 @@ register.sh # listed explicitly to show which files are generated but ignored testdb/intree/cabal.project-test testdb/intree/store/**/bin/alex +testdb/intree/store/**/bin/alex.exe testdb/intree/store/**/cabal-hash.txt testdb/intree/store/**/share/AlexTemplate.hs testdb/intree/store/**/share/AlexWrappers.hs testdb/intree/store/**/share/doc/LICENSE testdb/intree/store/*/incoming/alex-*.lock +testdb/intree/store/*/incoming/lx-*.lock testdb/intree/store/*/package.db/package.cache testdb/intree/store/*/package.db/package.cache.lock # windows test artifacts cabal-testsuite/**/*.exe -cabal-testsuite/**/*.bat cabal-testsuite/**/haddocks # python artifacts from documentation builds diff --git a/.hlint.yaml b/.hlint.yaml index 6266b76964f..0170ee22ebd 100644 --- a/.hlint.yaml +++ b/.hlint.yaml @@ -92,6 +92,7 @@ - ignore: {name: "Use unwords"} # 8 hints - ignore: {name: "Use void"} # 22 hints - ignore: {name: "Use when"} # 1 hint +- ignore: {name: "Use uncurry"} # 1 hint - arguments: - --ignore-glob=Cabal-syntax/src/Distribution/Fields/Lexer.hs diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index fa1d5385d68..f2e28f2e069 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,7 +1,6 @@ # Contributing to Cabal -Building Cabal for hacking --------------------------- +## Building Cabal for hacking If you use the `cabal` executable from the latest version of the [cabal-install](https://hackage.haskell.org/package/cabal-install) package @@ -38,10 +37,11 @@ $ cabal run cabal -- build --help ``` > [!NOTE] -> If you're using Nix, you might find it convenient to work within a shell that has all the `Cabal` development dependencies: -> ``` -> $ nix-shell -p cabal-install ghc ghcid haskellPackages.fourmolu_0_12_0_0 pkgconfig zlib.dev +> If you're using Nix, you might find it convenient to work within a shell that has the following `Cabal` development dependencies: +> ```bash +> $ nix-shell -p cabal-install ghc ghcid pkg-config zlib.dev # incomplete > ``` +> One dependency that we left out in the above command is `haskellPackages.fourmolu_0_12_0_0` which would need to be installed manually. > A Nix flake developer shell with these dependencies is also available, supported solely by the community, through the command `nix develop github:yvan-sraka/cabal.nix`. The location of your build products will vary depending on which version of @@ -57,10 +57,13 @@ $ cabal build Cabal-tests:unit-tests # build Cabal's unit test suite $ cabal build cabal-tests # etc... ``` -Running tests -------------- +## Running tests + +There are two ways to run tests: in CI with GitHub actions and locally with +`./validate.sh`. + +### Using GitHub Actions. -**Using GitHub Actions.** If you are not in a hurry, the most convenient way to run tests on Cabal is to make a branch on GitHub and then open a pull request; our continuous integration service on GitHub Actions builds and @@ -84,7 +87,8 @@ Some tips for using GitHub Actions effectively: already failed), be nice to others and cancel the rest of the jobs, so that other commits on the build queue can be processed. -**How to debug a failing CI test.** +### How to debug a failing CI test. + One of the annoying things about running tests on CI is when they fail, there is often no easy way to further troubleshoot the broken build. Here are some guidelines for debugging continuous integration @@ -112,7 +116,11 @@ failures: If none of these let you reproduce, there might be some race condition or continuous integration breakage; please file a bug. -**Running tests locally.** +### Running tests locally. + +The [`./validate.sh`](./validate.sh) script runs all the test suites. It takes +various options to restrict the test suites it runs; use `--help` to list them. + To run tests locally with `cabal`, you will need to know the name of the test suite you want. Cabal and cabal-install have several. Also, you'll want to read [Where are my build products?](http://cabal.readthedocs.io/en/latest/nix-local-build.html#where-are-my-build-products) @@ -149,8 +157,14 @@ For these test executables, `-p` which applies a regex filter to the test names. When running `cabal-install` test suites, one need only use `cabal test` or `cabal run ` in order to test locally. -QA Notes --------- +## Running other checks locally + +Various other checks done by CI can be run locally to make sure your code doesn't +fail annoyingly once you push it. `make checks` will do these checks. The list of +checks is expected to grow over time, to make it easier to avoid CI turnaround on +simple problems. + +## QA Notes Manual Quality Assurance (QA) is performed to ensure that the changes impacting the command-line interface, whether adding or modifying a behaviour, @@ -161,20 +175,20 @@ Contributions that touch `cabal-install` are expected to include notes for the Q They are a description of an expected result upon calling `cabal-install` with certain parameters, and should be written in the body of the ticket or PR under their own heading, like this: -For instance: +```markdown +## QA Notes -> \#\# QA Notes -> -> Calling `cabal haddock-project` should produce documentation for the whole cabal project with the following defaults enabled: -> * Documentation lives in ./haddocks -> * The file `./haddocks/index.html` should exist +Calling `cabal haddock-project` should produce documentation for the whole +cabal project with the following defaults enabled: +* Documentation lives in ./haddocks +* The file `./haddocks/index.html` should exist +``` Manual QA is not expected to find every possible bug, but to really challenge the assumptions of the contributor, and to verify that their own testing of their patch is not influenced by their setup or implicit knowledge of the system. -Code Style ---------------- +## Code Style We use automated formatting with Fourmolu to enforce a unified style across the code bases. It is checked in the CI process. After installing Fourmolu 0.12, there are some makefile targets to help formatting @@ -185,15 +199,15 @@ the code base. * `make style-modified` - Format files modified in the current tree. * `make style-commit COMMIT=` - Format files modified between HEAD and the given reference. -Whitespace Conventions ----------------------- +## Whitespace Conventions We use automated whitespace convention checking. Violations can be fixed by running [fix-whitespace](https://hackage.haskell.org/package/fix-whitespace). If -you push a fix of a whitespace violation, please do so in a _separate commit_. +you push a fix of a whitespace violation, please do so in a _separate commit_. For convenience, +`make whitespace` will show violations and `make fix-whitespace` will fix them, if the +`fix-whitespace` utility is installed. -Other Conventions ------------------ +## Other Conventions * Format your commit messages [in the standard way](https://chris.beams.io/posts/git-commit/#seven-rules). @@ -253,8 +267,7 @@ Other Conventions #endif ``` -GitHub Ticket Conventions -------------------- +## GitHub Ticket Conventions Each major `Cabal`/`cabal-install` release (e.g. 3.4, 3.6, etc.) has a corresponding GitHub Project and milestone. A ticket is included in a release's @@ -267,8 +280,7 @@ accepting a fix in that release, i.e. we would very much appreciate someone working on it, but are not committing to actively sourcing someone to work on it. -GitHub Pull Request Conventions -------------------- +## GitHub Pull Request Conventions Every (non-backport) pull request has to go through a review and get 2 approvals. After this is done, the author of the pull request is expected to add @@ -309,8 +321,7 @@ think it does not warrant an issue). Feel free to open a new issue (or new issues) when appropriate. -Changelog ---------- +## Changelog Anything that changes `cabal-install:exe:cabal` or changes exports from library modules or changes behaviour of functions exported from packages published to @@ -344,13 +355,37 @@ description: { } ``` -Only the `synopsis` field is actually required, but you should also set the others where applicable. +Changelogs may also be written in "markdown-frontmatter" format. This is useful if your +description contains braces, which must be escaped with backslashes in `.cabal` file +format. The front matter is in YAML syntax, not `.cabal` file syntax, and the file +_must_ begin with a line containing only hyphens. + +```markdown +--- +synopsis: Add feature xyz +packages: [cabal-install] +prs: 0000 +issues: [0000, 0000] +significance: significant +--- + +- Detail number 1 +- Detail number 2 + +``` +The package list must be enclosed in square brackets and comma-separated, but this +isn't needed for `prs` or `issues`; those are free-form and any YAML syntax will +be accepted. Note that the number signs on PR and issue numbers are required in +`.cabal` file syntax, but won't work in markdown-frontmatter syntax because they +signify comments in YAML. + +Only the `synopsis` and `prs` fields are required, but you should also set the others where applicable. | Field | Description | | ----- | ----------- | | `synopsis` | Brief description of the change. Often just the pr title. | | `description` | Longer description, with a list of sub-changes. Not needed for small/atomic changes. | -| `packages` | Packages affected by the change (`cabal-install`, `Cabal`...). Omit if it's an overarching or non-package change. | +| `packages` | Packages affected by the change (`cabal-install`, `Cabal`...). Omit if it's a non-package change. | | `prs` | Space-separated hash-prefixed pull request numbers containing the change (usually just one). | | `issues` | Space-separated hash-prefixed issue numbers that the change fixes/closes/affects. | | `significance` | Set to `significant` if the change is significant, that is if it warrants being put near the top of the changelog. | @@ -364,8 +399,7 @@ At release time, the entries will be merged with In addition, if you're changing the `.cabal` file format specification you should add an entry in `doc/file-format-changelog.rst`. -Communicating -------------- +## Communicating There are a few main venues of communication: @@ -376,10 +410,9 @@ There are a few main venues of communication: * Many developers idle on `#hackage` on [`irc.libera.chat`](https://libera.chat). The `#ghc` channel is also a decently good bet. * You can join the channel using a web client, even anonymously: https://web.libera.chat/#hackage - * Alternatively you can join it using [matrix](https://matrix.org/): https://matrix.to/#/#hackage:libera.chat + * Alternatively you can join it using [matrix](https://matrix.org/): https://matrix.to/#/#hackage:matrix.org -Releases --------- +## Releases Notes for how to make a release are at the wiki page ["Making a release"](https://github.com/haskell/cabal/wiki/Making-a-release). @@ -387,8 +420,7 @@ Currently, [@emilypi](https://github.com/emilypi), [@fgaz](https://github.com/fg `haskell.org/cabal`, and [@Mikolaj](https://github.com/Mikolaj) is the point of contact for getting permissions. -Preview Releases ----------------- +## Preview Releases We make preview releases available to facilitate testing of development builds. @@ -406,8 +438,7 @@ To reproduce these locally, set up an Alpine build environment using GHCup, and then build by calling `cabal build cabal-install --enable-executable-static`. -API Documentation ------------------ +## API Documentation Auto-generated API documentation for the `master` branch of Cabal is automatically uploaded here: http://haskell.github.io/cabal-website/doc/html/Cabal/. @@ -415,8 +446,7 @@ Auto-generated API documentation for the `master` branch of Cabal is automatical You can contribute by triaging issues which may include reproducing bug reports or asking for vital information, such as version numbers or reproduction instructions. If you would like to start triaging issues, one easy way to get started is to [subscribe to cabal on CodeTriage](https://www.codetriage.com/haskell/cabal). -Hackage Revisions ------------------ +## Hackage Revisions We are reactive rather than proactive with revising bounds on our dependencies for code already released on Hackage. If you would benefit from a version bump, @@ -429,7 +459,7 @@ it, someone with enough permissions needs to go on the [Validate workflow page](https://github.com/haskell/cabal/actions/workflows/validate.yml) and dispatch it manually by clicking "Run workflow". -Running workflow manually as discussed above requires you to supply two inputs: +Running workflow manually as discussed above allows you to supply two inputs: > allow-newer line > constraints line diff --git a/Cabal-QuickCheck/Cabal-QuickCheck.cabal b/Cabal-QuickCheck/Cabal-QuickCheck.cabal index 37c0f88fc4e..0fbccd53d91 100644 --- a/Cabal-QuickCheck/Cabal-QuickCheck.cabal +++ b/Cabal-QuickCheck/Cabal-QuickCheck.cabal @@ -1,6 +1,6 @@ cabal-version: 2.2 name: Cabal-QuickCheck -version: 3.13.0.0 +version: 3.15.0.0 synopsis: QuickCheck instances for types in Cabal category: Testing build-type: Simple @@ -14,8 +14,8 @@ library build-depends: , base , bytestring - , Cabal ^>=3.13.0.0 - , Cabal-syntax ^>=3.13.0.0 + , Cabal ^>=3.15.0.0 + , Cabal-syntax ^>=3.15.0.0 , QuickCheck ^>=2.13.2 || ^>=2.14 exposed-modules: diff --git a/Cabal-QuickCheck/src/Test/QuickCheck/GenericArbitrary.hs b/Cabal-QuickCheck/src/Test/QuickCheck/GenericArbitrary.hs index 00f32bc0d70..29f0b5d85e9 100644 --- a/Cabal-QuickCheck/src/Test/QuickCheck/GenericArbitrary.hs +++ b/Cabal-QuickCheck/src/Test/QuickCheck/GenericArbitrary.hs @@ -10,10 +10,6 @@ module Test.QuickCheck.GenericArbitrary ( import GHC.Generics import Test.QuickCheck -#if !MIN_VERSION_base(4,8,0) -import Control.Applicative (pure, (<$>), (<*>)) -#endif - -- Generic arbitrary for non-recursive types genericArbitrary :: (Generic a, GArbitrary (Rep a)) => Gen a genericArbitrary = fmap to garbitrary diff --git a/Cabal-QuickCheck/src/Test/QuickCheck/Instances/Cabal.hs b/Cabal-QuickCheck/src/Test/QuickCheck/Instances/Cabal.hs index e5b5077d414..b99d0223b04 100644 --- a/Cabal-QuickCheck/src/Test/QuickCheck/Instances/Cabal.hs +++ b/Cabal-QuickCheck/src/Test/QuickCheck/Instances/Cabal.hs @@ -1,30 +1,25 @@ {-# LANGUAGE CPP #-} {-# LANGUAGE TypeOperators #-} +{-# LANGUAGE FlexibleInstances #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Test.QuickCheck.Instances.Cabal () where #if !MIN_VERSION_base(4,18,0) import Control.Applicative (liftA2) #endif -import Data.Bits (shiftR) +import Data.Bits (countLeadingZeros, finiteBitSize, shiftL, shiftR) import Data.Char (isAlphaNum, isDigit, toLower) import Data.List (intercalate, (\\)) import Data.List.NonEmpty (NonEmpty (..)) import Distribution.Utils.Generic (lowercase) import Test.QuickCheck -#if MIN_VERSION_base(4,8,0) -import Data.Bits (countLeadingZeros, finiteBitSize, shiftL) -#else -import Data.Bits (popCount) -#endif - import Distribution.CabalSpecVersion import Distribution.Compat.NonEmptySet (NonEmptySet) import Distribution.Compiler import Distribution.FieldGrammar.Newtypes import Distribution.ModuleName -import Distribution.Simple.Compiler (DebugInfoLevel (..), OptimisationLevel (..), PackageDB (..), ProfDetailLevel (..), knownProfDetailLevels) +import Distribution.Simple.Compiler import Distribution.Simple.Flag (Flag (..)) import Distribution.Simple.InstallDirs import Distribution.Simple.Setup (HaddockTarget (..), TestShowDetails (..), DumpBuildInfo) @@ -54,10 +49,6 @@ import Test.QuickCheck.GenericArbitrary import qualified Data.ByteString.Char8 as BS8 import qualified Distribution.Compat.NonEmptySet as NES -#if !MIN_VERSION_base(4,8,0) -import Control.Applicative (pure, (<$>), (<*>)) -#endif - ------------------------------------------------------------------------------- -- CabalSpecVersion ------------------------------------------------------------------------------- @@ -486,7 +477,7 @@ instance Arbitrary TestShowDetails where -- PackageDB ------------------------------------------------------------------------------- -instance Arbitrary PackageDB where +instance Arbitrary (PackageDBX FilePath) where arbitrary = oneof [ pure GlobalPackageDB , pure UserPackageDB , SpecificPackageDB <$> arbitraryShortPath @@ -541,8 +532,4 @@ intSqrt n = case compare n 0 of iter x = shiftR (x + n `div` x) 1 guess :: Int -#if MIN_VERSION_base(4,8,0) guess = shiftR n (shiftL (finiteBitSize n - countLeadingZeros n) 1) -#else - guess = shiftR n (shiftR (popCount n) 1) -#endif diff --git a/Cabal-described/Cabal-described.cabal b/Cabal-described/Cabal-described.cabal index 8f7f9c66750..e8fd71a49fa 100644 --- a/Cabal-described/Cabal-described.cabal +++ b/Cabal-described/Cabal-described.cabal @@ -1,6 +1,6 @@ cabal-version: 2.2 name: Cabal-described -version: 3.13.0.0 +version: 3.15.0.0 synopsis: Described functionality for types in Cabal category: Testing, Parsec description: Provides rere bindings @@ -12,14 +12,14 @@ library ghc-options: -Wall build-depends: , base - , Cabal ^>=3.13.0.0 - , Cabal-syntax ^>=3.13.0.0 + , Cabal ^>=3.15.0.0 + , Cabal-syntax ^>=3.15.0.0 , containers , pretty , QuickCheck , rere >=0.1 && <0.3 - , tasty - , tasty-quickcheck + , tasty <1.6 + , tasty-quickcheck <0.12 exposed-modules: Distribution.Described diff --git a/Cabal-hooks/Cabal-hooks.cabal b/Cabal-hooks/Cabal-hooks.cabal index 367ef185610..57abca7726d 100644 --- a/Cabal-hooks/Cabal-hooks.cabal +++ b/Cabal-hooks/Cabal-hooks.cabal @@ -27,9 +27,9 @@ library hs-source-dirs: src build-depends: - Cabal-syntax >= 3.13 && < 3.15, - Cabal >= 3.13 && < 3.15, - base >= 4.11 && < 5, + Cabal-syntax >= 3.15 && < 3.17, + Cabal >= 3.15 && < 3.17, + base >= 4.13 && < 5, containers >= 0.5.0.0 && < 0.8, transformers >= 0.5.6.0 && < 0.7 diff --git a/Cabal-syntax/Cabal-syntax.cabal b/Cabal-syntax/Cabal-syntax.cabal index a1873228428..42fb7f7d51e 100644 --- a/Cabal-syntax/Cabal-syntax.cabal +++ b/Cabal-syntax/Cabal-syntax.cabal @@ -1,6 +1,6 @@ cabal-version: 2.2 name: Cabal-syntax -version: 3.13.0.0 +version: 3.15.0.0 copyright: 2003-2024, Cabal Development Team (see AUTHORS file) license: BSD-3-Clause license-file: LICENSE @@ -29,11 +29,11 @@ library build-depends: array >= 0.4.0.1 && < 0.6, - base >= 4.11 && < 5, + base >= 4.13 && < 5, binary >= 0.7 && < 0.9, bytestring >= 0.10.0.0 && < 0.13, containers >= 0.5.0.0 && < 0.8, - deepseq >= 1.3.0.1 && < 1.6, + deepseq >= 1.3.0.1 && < 1.7, directory >= 1.2 && < 1.4, filepath >= 1.3.0.1 && < 1.6, mtl >= 2.1 && < 2.4, @@ -76,7 +76,6 @@ library Distribution.Compat.Parsing Distribution.Compat.Prelude Distribution.Compat.Semigroup - Distribution.Compat.Typeable Distribution.Compiler Distribution.FieldGrammar Distribution.FieldGrammar.Class @@ -136,6 +135,7 @@ library Distribution.Types.ConfVar Distribution.Types.Dependency Distribution.Types.DependencyMap + Distribution.Types.DependencySatisfaction Distribution.Types.ExeDependency Distribution.Types.Executable Distribution.Types.Executable.Lens @@ -159,6 +159,8 @@ library Distribution.Types.Library.Lens Distribution.Types.LibraryName Distribution.Types.LibraryVisibility + Distribution.Types.MissingDependency + Distribution.Types.MissingDependencyReason Distribution.Types.Mixin Distribution.Types.Module Distribution.Types.ModuleReexport diff --git a/Cabal-syntax/ChangeLog.md b/Cabal-syntax/ChangeLog.md index 7554aaf4980..cbba98a3cc4 100644 --- a/Cabal-syntax/ChangeLog.md +++ b/Cabal-syntax/ChangeLog.md @@ -1 +1 @@ -Please see https://github.com/haskell/cabal/blob/master/release-notes/Cabal-3.12.0.0.md +Please see https://github.com/haskell/cabal/blob/master/release-notes/Cabal-3.14.0.0.md diff --git a/Cabal-syntax/src/Distribution/Compat/Binary.hs b/Cabal-syntax/src/Distribution/Compat/Binary.hs index 8849fc13b10..4927ec1e69b 100644 --- a/Cabal-syntax/src/Distribution/Compat/Binary.hs +++ b/Cabal-syntax/src/Distribution/Compat/Binary.hs @@ -20,4 +20,4 @@ decodeOrFailIO :: Binary a => ByteString -> IO (Either String a) decodeOrFailIO bs = catch (evaluate (decode bs) >>= return . Right) handler where - handler (ErrorCallWithLocation str _) = return $ Left str + handler (ErrorCall str) = return $ Left str diff --git a/Cabal-syntax/src/Distribution/Compat/Graph.hs b/Cabal-syntax/src/Distribution/Compat/Graph.hs index c01f3162b2d..1a6de3a571b 100644 --- a/Cabal-syntax/src/Distribution/Compat/Graph.hs +++ b/Cabal-syntax/src/Distribution/Compat/Graph.hs @@ -148,24 +148,20 @@ instance (Eq (Key a), Eq a) => Eq (Graph a) where g1 == g2 = graphMap g1 == graphMap g2 instance Foldable.Foldable Graph where + elem x = Foldable.elem x . graphMap fold = Foldable.fold . graphMap - foldr f z = Foldable.foldr f z . graphMap foldl f z = Foldable.foldl f z . graphMap - foldMap f = Foldable.foldMap f . graphMap foldl' f z = Foldable.foldl' f z . graphMap + foldr f z = Foldable.foldr f z . graphMap foldr' f z = Foldable.foldr' f z . graphMap -#ifdef MIN_VERSION_base -#if MIN_VERSION_base(4,8,0) + foldMap f = Foldable.foldMap f . graphMap length = Foldable.length . graphMap - null = Foldable.null . graphMap - toList = Foldable.toList . graphMap - elem x = Foldable.elem x . graphMap maximum = Foldable.maximum . graphMap minimum = Foldable.minimum . graphMap - sum = Foldable.sum . graphMap + null = Foldable.null . graphMap product = Foldable.product . graphMap -#endif -#endif + sum = Foldable.sum . graphMap + toList = Foldable.toList . graphMap instance (NFData a, NFData (Key a)) => NFData (Graph a) where rnf diff --git a/Cabal-syntax/src/Distribution/Compat/Newtype.hs b/Cabal-syntax/src/Distribution/Compat/Newtype.hs index 00da1e83542..56f55a9282b 100644 --- a/Cabal-syntax/src/Distribution/Compat/Newtype.hs +++ b/Cabal-syntax/src/Distribution/Compat/Newtype.hs @@ -14,15 +14,10 @@ module Distribution.Compat.Newtype , unpack' ) where +import Data.Coerce (Coercible, coerce) import Data.Functor.Identity (Identity (..)) import Data.Monoid (Endo (..), Product (..), Sum (..)) -#if MIN_VERSION_base(4,7,0) -import Data.Coerce (coerce, Coercible) -#else -import Unsafe.Coerce (unsafeCoerce) -#endif - -- | The @FunctionalDependencies@ version of 'Newtype' type-class. -- -- Since Cabal-3.0 class arguments are in a different order than in @newtype@ package. @@ -40,22 +35,12 @@ import Unsafe.Coerce (unsafeCoerce) {- FOURMOLU_DISABLE -} class Newtype o n | n -> o where pack :: o -> n -#if MIN_VERSION_base(4,7,0) default pack :: Coercible o n => o -> n pack = coerce -#else - default pack :: o -> n - pack = unsafeCoerce -#endif unpack :: n -> o -#if MIN_VERSION_base(4,7,0) default unpack :: Coercible n o => n -> o unpack = coerce -#else - default unpack :: n -> o - unpack = unsafeCoerce -#endif {- FOURMOLU_ENABLE -} instance Newtype a (Identity a) diff --git a/Cabal-syntax/src/Distribution/Compat/NonEmptySet.hs b/Cabal-syntax/src/Distribution/Compat/NonEmptySet.hs index 034da7ee90c..9e227459e84 100644 --- a/Cabal-syntax/src/Distribution/Compat/NonEmptySet.hs +++ b/Cabal-syntax/src/Distribution/Compat/NonEmptySet.hs @@ -12,6 +12,7 @@ module Distribution.Compat.NonEmptySet -- * Deletion , delete + , filter -- * Conversions , toNonEmpty @@ -87,12 +88,9 @@ instance Ord a => Semigroup (NonEmptySet a) where instance F.Foldable NonEmptySet where foldMap f (NES s) = F.foldMap f s foldr f z (NES s) = F.foldr f z s - -#if MIN_VERSION_base(4,8,0) - toList = toList - null _ = False + toList = toList + null _ = False length (NES s) = F.length s -#endif ------------------------------------------------------------------------------- -- Constructors @@ -119,6 +117,9 @@ delete x (NES xs) where res = Set.delete x xs +filter :: (a -> Bool) -> NonEmptySet a -> Set.Set a +filter predicate (NES set) = Set.filter predicate set + ------------------------------------------------------------------------------- -- Conversions ------------------------------------------------------------------------------- diff --git a/Cabal-syntax/src/Distribution/Compat/Prelude.hs b/Cabal-syntax/src/Distribution/Compat/Prelude.hs index 3cbf3c17a8a..2d6f92b5da6 100644 --- a/Cabal-syntax/src/Distribution/Compat/Prelude.hs +++ b/Cabal-syntax/src/Distribution/Compat/Prelude.hs @@ -4,14 +4,6 @@ {-# LANGUAGE Trustworthy #-} {-# LANGUAGE TypeOperators #-} -{- FOURMOLU_DISABLE -} -#ifdef MIN_VERSION_base -#define MINVER_base_411 MIN_VERSION_base(4,11,0) -#else -#define MINVER_base_411 (__GLASGOW_HASKELL__ >= 804) -#endif -{- FOURMOLU_ENABLE -} - -- | This module does two things: -- -- * Acts as a compatibility layer, like @base-compat@. @@ -194,11 +186,10 @@ import Prelude as BasePrelude hiding ( mapM, mapM_, sequence, any, all, head, tail, last, init -- partial functions , read -#if MINVER_base_411 + , foldr1, foldl1 -- As of base 4.11.0.0 Prelude exports part of Semigroup(..). -- Hide this so we instead rely on Distribution.Compat.Semigroup. , Semigroup(..) -#endif , Word -- We hide them, as we import only some members , Traversable, traverse, sequenceA @@ -243,11 +234,11 @@ import Data.Ord (comparing) import Data.Proxy (Proxy (..)) import Data.Set (Set) import Data.String (IsString (..)) +import Data.Typeable (TypeRep, Typeable, typeRep) import Data.Void (Void, absurd, vacuous) import Data.Word (Word, Word16, Word32, Word64, Word8) import Distribution.Compat.Binary (Binary (..)) import Distribution.Compat.Semigroup (Semigroup (..), gmappend, gmempty) -import Distribution.Compat.Typeable (TypeRep, Typeable, typeRep) import GHC.Generics (Generic (..), K1 (unK1), M1 (unM1), U1 (U1), V1, (:*:) ((:*:)), (:+:) (L1, R1)) import System.Exit (ExitCode (..), exitFailure, exitSuccess, exitWith) import Text.Read (readMaybe) diff --git a/Cabal-syntax/src/Distribution/Compat/Typeable.hs b/Cabal-syntax/src/Distribution/Compat/Typeable.hs deleted file mode 100644 index 161f868a823..00000000000 --- a/Cabal-syntax/src/Distribution/Compat/Typeable.hs +++ /dev/null @@ -1,19 +0,0 @@ -{-# LANGUAGE CPP #-} -{-# LANGUAGE ScopedTypeVariables #-} - -module Distribution.Compat.Typeable - ( Typeable - , TypeRep - , typeRep - ) where - -#if MIN_VERSION_base(4,7,0) -import Data.Typeable (Typeable, TypeRep, typeRep) -#else -import Data.Typeable (Typeable, TypeRep, typeOf) -#endif - -#if !MIN_VERSION_base(4,7,0) -typeRep :: forall a proxy. Typeable a => proxy a -> TypeRep -typeRep _ = typeOf (undefined :: a) -#endif diff --git a/Cabal-syntax/src/Distribution/Compiler.hs b/Cabal-syntax/src/Distribution/Compiler.hs index 8fb3f88851e..d715efbf951 100644 --- a/Cabal-syntax/src/Distribution/Compiler.hs +++ b/Cabal-syntax/src/Distribution/Compiler.hs @@ -75,6 +75,7 @@ data CompilerFlavor | LHC | UHC | Eta + | MHS -- MicroHS, see https://github.com/augustss/MicroHs | HaskellSuite String -- string is the id of the actual compiler | OtherCompiler String deriving (Generic, Show, Read, Eq, Ord, Typeable, Data) @@ -85,7 +86,7 @@ instance NFData CompilerFlavor where rnf = genericRnf knownCompilerFlavors :: [CompilerFlavor] knownCompilerFlavors = - [GHC, GHCJS, NHC, YHC, Hugs, HBC, Helium, JHC, LHC, UHC, Eta] + [GHC, GHCJS, NHC, YHC, Hugs, HBC, Helium, JHC, LHC, UHC, Eta, MHS] instance Pretty CompilerFlavor where pretty (OtherCompiler name) = Disp.text name diff --git a/Cabal-syntax/src/Distribution/Fields/ParseResult.hs b/Cabal-syntax/src/Distribution/Fields/ParseResult.hs index 7174aaa99bf..aad7de2737a 100644 --- a/Cabal-syntax/src/Distribution/Fields/ParseResult.hs +++ b/Cabal-syntax/src/Distribution/Fields/ParseResult.hs @@ -18,22 +18,11 @@ module Distribution.Fields.ParseResult , withoutWarnings ) where +import Distribution.Compat.Prelude import Distribution.Parsec.Error (PError (..)) import Distribution.Parsec.Position (Position (..), zeroPos) import Distribution.Parsec.Warning (PWarnType (..), PWarning (..)) import Distribution.Version (Version) -import Prelude () - --- liftA2 is not in base <4.10, hence we need to only import it explicitly when we're on >=4.10 --- --- Additionally, since liftA2 will be exported from Prelude starting with ~4.18, we should hide --- it from Prelude and get it from Control.Applicative to be backwards compatible and avoid warnings -#if MIN_VERSION_base(4,10,0) -import Distribution.Compat.Prelude hiding (Applicative(..)) -import Control.Applicative (Applicative (..)) -#else -import Distribution.Compat.Prelude -#endif -- | A monad with failure and accumulating errors and warnings. newtype ParseResult a = PR @@ -100,14 +89,6 @@ instance Applicative ParseResult where success s2 x' {-# INLINE (<*) #-} -#if MIN_VERSION_base(4,10,0) - liftA2 f x y = PR $ \ !s0 failure success -> - unPR x s0 failure $ \ !s1 x' -> - unPR y s1 failure $ \ !s2 y' -> - success s2 (f x' y') - {-# INLINE liftA2 #-} -#endif - instance Monad ParseResult where return = pure (>>) = (*>) diff --git a/Cabal-syntax/src/Distribution/PackageDescription/Configuration.hs b/Cabal-syntax/src/Distribution/PackageDescription/Configuration.hs index e811c361221..eebf760094d 100644 --- a/Cabal-syntax/src/Distribution/PackageDescription/Configuration.hs +++ b/Cabal-syntax/src/Distribution/PackageDescription/Configuration.hs @@ -56,12 +56,13 @@ import Distribution.System import Distribution.Types.Component import Distribution.Types.ComponentRequestedSpec import Distribution.Types.DependencyMap +import Distribution.Types.DependencySatisfaction (DependencySatisfaction (..)) +import Distribution.Types.MissingDependency (MissingDependency (..)) import Distribution.Types.PackageVersionConstraint import Distribution.Utils.Generic import Distribution.Utils.Path (sameDirectory) import Distribution.Version -import qualified Data.Map.Lazy as Map import Data.Tree (Tree (Node)) ------------------------------------------------------------------------------ @@ -144,15 +145,17 @@ parseCondition = condOr ------------------------------------------------------------------------------ --- | Result of dependency test. Isomorphic to @Maybe d@ but renamed for +-- | Result of dependency test. Isomorphic to @Maybe@ but renamed for -- clarity. -data DepTestRslt d = DepOk | MissingDeps d +data DepTestRslt + = DepOk + | MissingDeps [MissingDependency] -instance Semigroup d => Monoid (DepTestRslt d) where +instance Monoid DepTestRslt where mempty = DepOk mappend = (<>) -instance Semigroup d => Semigroup (DepTestRslt d) where +instance Semigroup DepTestRslt where DepOk <> x = x x <> DepOk = x (MissingDeps d) <> (MissingDeps d') = MissingDeps (d <> d') @@ -190,13 +193,13 @@ resolveWithFlags -> [PackageVersionConstraint] -- ^ Additional constraints -> [CondTree ConfVar [Dependency] PDTagged] - -> ([Dependency] -> DepTestRslt [Dependency]) + -> ([Dependency] -> DepTestRslt) -- ^ Dependency test function. - -> Either [Dependency] (TargetSet PDTagged, FlagAssignment) + -> Either [MissingDependency] (TargetSet PDTagged, FlagAssignment) -- ^ Either the missing dependencies (error case), or a pair of -- (set of build targets with dependencies, chosen flag assignments) resolveWithFlags dom enabled os arch impl constrs trees checkDeps = - either (Left . fromDepMapUnion) Right $ explore (build mempty dom) + explore (build mempty dom) where -- simplify trees by (partially) evaluating all conditions and converting -- dependencies to dependency maps. @@ -216,7 +219,7 @@ resolveWithFlags dom enabled os arch impl constrs trees checkDeps = -- computation overhead in the successful case. explore :: Tree FlagAssignment - -> Either DepMapUnion (TargetSet PDTagged, FlagAssignment) + -> Either [MissingDependency] (TargetSet PDTagged, FlagAssignment) explore (Node flags ts) = let targetSet = TargetSet $ @@ -229,7 +232,7 @@ resolveWithFlags dom enabled os arch impl constrs trees checkDeps = DepOk | null ts -> Right (targetSet, flags) | otherwise -> tryAll $ map explore ts - MissingDeps mds -> Left (toDepMapUnion mds) + MissingDeps mds -> Left mds -- Builds a tree of all possible flag assignments. Internal nodes -- have only partial assignments. @@ -238,18 +241,18 @@ resolveWithFlags dom enabled os arch impl constrs trees checkDeps = build assigned ((fn, vals) : unassigned) = Node assigned $ map (\v -> build (insertFlagAssignment fn v assigned) unassigned) vals - tryAll :: [Either DepMapUnion a] -> Either DepMapUnion a + tryAll :: Monoid a => [Either a b] -> Either a b tryAll = foldr mp mz -- special version of `mplus' for our local purposes - mp :: Either DepMapUnion a -> Either DepMapUnion a -> Either DepMapUnion a + mp :: Monoid a => Either a b -> Either a b -> Either a b mp m@(Right _) _ = m mp _ m@(Right _) = m mp (Left xs) (Left ys) = Left (xs <> ys) -- `mzero' - mz :: Either DepMapUnion a - mz = Left (DepMapUnion Map.empty) + mz :: Monoid a => Either a b + mz = Left mempty env :: FlagAssignment -> FlagName -> Either FlagName Bool env flags flag = (maybe (Left flag) Right . lookupFlagAssignment flag) flags @@ -323,27 +326,6 @@ extractConditions f gpkg = , extractCondition (f . benchmarkBuildInfo) . snd <$> condBenchmarks gpkg ] --- | A map of package constraints that combines version ranges using 'unionVersionRanges'. -newtype DepMapUnion = DepMapUnion {unDepMapUnion :: Map PackageName (VersionRange, NonEmptySet LibraryName)} - -instance Semigroup DepMapUnion where - DepMapUnion x <> DepMapUnion y = - DepMapUnion $ - Map.unionWith unionVersionRanges' x y - -unionVersionRanges' - :: (VersionRange, NonEmptySet LibraryName) - -> (VersionRange, NonEmptySet LibraryName) - -> (VersionRange, NonEmptySet LibraryName) -unionVersionRanges' (vr, cs) (vr', cs') = (unionVersionRanges vr vr', cs <> cs') - -toDepMapUnion :: [Dependency] -> DepMapUnion -toDepMapUnion ds = - DepMapUnion $ Map.fromListWith unionVersionRanges' [(p, (vr, cs)) | Dependency p vr cs <- ds] - -fromDepMapUnion :: DepMapUnion -> [Dependency] -fromDepMapUnion m = [Dependency p vr cs | (p, (vr, cs)) <- Map.toList (unDepMapUnion m)] - freeVars :: CondTree ConfVar c a -> [FlagName] freeVars t = [f | PackageFlag f <- freeVars' t] where @@ -453,7 +435,7 @@ finalizePD :: FlagAssignment -- ^ Explicitly specified flag assignments -> ComponentRequestedSpec - -> (Dependency -> Bool) + -> (Dependency -> DependencySatisfaction) -- ^ Is a given dependency satisfiable from the set of -- available packages? If this is unknown then use -- True. @@ -465,7 +447,7 @@ finalizePD -- ^ Additional constraints -> GenericPackageDescription -> Either - [Dependency] + [MissingDependency] (PackageDescription, FlagAssignment) -- ^ Either missing dependencies or the resolved package -- description along with the flag assignments chosen. @@ -526,7 +508,11 @@ finalizePD | otherwise -> [b, not b] -- flagDefaults = map (\(n,x:_) -> (n,x)) flagChoices check ds = - let missingDeps = filter (not . satisfyDep) ds + let missingDeps = + [ MissingDependency dependency reason + | (dependency, Unsatisfied reason) <- + map (\dependency -> (dependency, satisfyDep dependency)) ds + ] in if null missingDeps then DepOk else MissingDeps missingDeps diff --git a/Cabal-syntax/src/Distribution/PackageDescription/FieldGrammar.hs b/Cabal-syntax/src/Distribution/PackageDescription/FieldGrammar.hs index db6b7f7607b..49db03ee3c1 100644 --- a/Cabal-syntax/src/Distribution/PackageDescription/FieldGrammar.hs +++ b/Cabal-syntax/src/Distribution/PackageDescription/FieldGrammar.hs @@ -143,6 +143,8 @@ packageDescriptionFieldGrammar = <*> monoidalFieldAla "extra-source-files" formatExtraSourceFiles L.extraSrcFiles <*> monoidalFieldAla "extra-tmp-files" (alaList' VCat RelativePathNT) L.extraTmpFiles <*> monoidalFieldAla "extra-doc-files" formatExtraSourceFiles L.extraDocFiles + <*> monoidalFieldAla "extra-files" formatExtraSourceFiles L.extraFiles + ^^^ availableSince CabalSpecV3_14 [] where packageIdentifierGrammar = PackageIdentifier @@ -673,6 +675,7 @@ buildInfoFieldGrammar = <*> optionsFieldGrammar <*> profOptionsFieldGrammar <*> sharedOptionsFieldGrammar + <*> profSharedOptionsFieldGrammar <*> pure mempty -- static-options ??? <*> prefixedFields "x-" L.customFieldsBI <*> monoidalFieldAla "build-depends" formatDependencyList L.targetBuildDepends @@ -738,6 +741,19 @@ sharedOptionsFieldGrammar = extract :: CompilerFlavor -> ALens' BuildInfo [String] extract flavor = L.sharedOptions . lookupLens flavor +profSharedOptionsFieldGrammar + :: (FieldGrammar c g, Applicative (g BuildInfo), c (List NoCommaFSep Token' String)) + => g BuildInfo (PerCompilerFlavor [String]) +profSharedOptionsFieldGrammar = + PerCompilerFlavor + <$> monoidalFieldAla "ghc-prof-shared-options" (alaList' NoCommaFSep Token') (extract GHC) + ^^^ availableSince CabalSpecV3_14 [] + <*> monoidalFieldAla "ghcjs-prof-shared-options" (alaList' NoCommaFSep Token') (extract GHCJS) + ^^^ availableSince CabalSpecV3_14 [] + where + extract :: CompilerFlavor -> ALens' BuildInfo [String] + extract flavor = L.profSharedOptions . lookupLens flavor + lookupLens :: (Functor f, Monoid v) => CompilerFlavor -> LensLike' f (PerCompilerFlavor v) v lookupLens k f p@(PerCompilerFlavor ghc ghcjs) | k == GHC = (\n -> PerCompilerFlavor n ghcjs) <$> f ghc diff --git a/Cabal-syntax/src/Distribution/Parsec.hs b/Cabal-syntax/src/Distribution/Parsec.hs index 4c6e31e5aaa..3bf62597222 100644 --- a/Cabal-syntax/src/Distribution/Parsec.hs +++ b/Cabal-syntax/src/Distribution/Parsec.hs @@ -145,10 +145,6 @@ instance Monad ParsecParser where (>>) = (*>) {-# INLINE (>>) #-} -#if !(MIN_VERSION_base(4,13,0)) - fail = Fail.fail -#endif - instance MonadPlus ParsecParser where mzero = empty mplus = (<|>) diff --git a/Cabal-syntax/src/Distribution/Pretty.hs b/Cabal-syntax/src/Distribution/Pretty.hs index 3ddb806d81b..fcb0a7f0d0b 100644 --- a/Cabal-syntax/src/Distribution/Pretty.hs +++ b/Cabal-syntax/src/Distribution/Pretty.hs @@ -10,6 +10,8 @@ module Distribution.Pretty , showTokenStr , showFreeText , showFreeTextV3 + , commaSpaceSep + , commaSep -- * Deprecated , Separator @@ -118,3 +120,11 @@ lines_ s = in l : case s' of [] -> [] (_ : s'') -> lines_ s'' + +-- | Separate a list of documents by commas and spaces. +commaSpaceSep :: Pretty a => [a] -> PP.Doc +commaSpaceSep = PP.hsep . PP.punctuate PP.comma . map pretty + +-- | Separate a list of documents by commas. +commaSep :: Pretty a => [a] -> PP.Doc +commaSep = PP.hcat . PP.punctuate PP.comma . map pretty diff --git a/Cabal-syntax/src/Distribution/SPDX/LicenseExceptionId.hs b/Cabal-syntax/src/Distribution/SPDX/LicenseExceptionId.hs index 6246d8df41d..6d0bb37caba 100644 --- a/Cabal-syntax/src/Distribution/SPDX/LicenseExceptionId.hs +++ b/Cabal-syntax/src/Distribution/SPDX/LicenseExceptionId.hs @@ -30,75 +30,80 @@ import qualified Text.PrettyPrint as Disp -- LicenseExceptionId ------------------------------------------------------------------------------- --- | SPDX License Exceptions identifiers list v3.23 +-- | SPDX License Exceptions identifiers list v3.25 data LicenseExceptionId - = DS389_exception -- ^ @389-exception@, 389 Directory Server Exception - | Asterisk_exception -- ^ @Asterisk-exception@, Asterisk exception, SPDX License List 3.23 + = N_389_exception -- ^ @389-exception@, 389 Directory Server Exception + | Asterisk_exception -- ^ @Asterisk-exception@, Asterisk exception, SPDX License List 3.23, SPDX License List 3.25 + | Asterisk_linking_protocols_exception -- ^ @Asterisk-linking-protocols-exception@, Asterisk linking protocols exception, SPDX License List 3.25 | Autoconf_exception_2_0 -- ^ @Autoconf-exception-2.0@, Autoconf exception 2.0 | Autoconf_exception_3_0 -- ^ @Autoconf-exception-3.0@, Autoconf exception 3.0 - | Autoconf_exception_generic_3_0 -- ^ @Autoconf-exception-generic-3.0@, Autoconf generic exception for GPL-3.0, SPDX License List 3.23 - | Autoconf_exception_generic -- ^ @Autoconf-exception-generic@, Autoconf generic exception, SPDX License List 3.23 - | Autoconf_exception_macro -- ^ @Autoconf-exception-macro@, Autoconf macro exception, SPDX License List 3.23 - | Bison_exception_1_24 -- ^ @Bison-exception-1.24@, Bison exception 1.24, SPDX License List 3.23 + | Autoconf_exception_generic_3_0 -- ^ @Autoconf-exception-generic-3.0@, Autoconf generic exception for GPL-3.0, SPDX License List 3.23, SPDX License List 3.25 + | Autoconf_exception_generic -- ^ @Autoconf-exception-generic@, Autoconf generic exception, SPDX License List 3.23, SPDX License List 3.25 + | Autoconf_exception_macro -- ^ @Autoconf-exception-macro@, Autoconf macro exception, SPDX License List 3.23, SPDX License List 3.25 + | Bison_exception_1_24 -- ^ @Bison-exception-1.24@, Bison exception 1.24, SPDX License List 3.23, SPDX License List 3.25 | Bison_exception_2_2 -- ^ @Bison-exception-2.2@, Bison exception 2.2 | Bootloader_exception -- ^ @Bootloader-exception@, Bootloader Distribution Exception | Classpath_exception_2_0 -- ^ @Classpath-exception-2.0@, Classpath exception 2.0 | CLISP_exception_2_0 -- ^ @CLISP-exception-2.0@, CLISP exception 2.0 - | Cryptsetup_OpenSSL_exception -- ^ @cryptsetup-OpenSSL-exception@, cryptsetup OpenSSL exception, SPDX License List 3.23 + | Cryptsetup_OpenSSL_exception -- ^ @cryptsetup-OpenSSL-exception@, cryptsetup OpenSSL exception, SPDX License List 3.23, SPDX License List 3.25 | DigiRule_FOSS_exception -- ^ @DigiRule-FOSS-exception@, DigiRule FOSS License Exception | ECos_exception_2_0 -- ^ @eCos-exception-2.0@, eCos exception 2.0 + | Erlang_otp_linking_exception -- ^ @erlang-otp-linking-exception@, Erlang/OTP Linking Exception, SPDX License List 3.25 | Fawkes_Runtime_exception -- ^ @Fawkes-Runtime-exception@, Fawkes Runtime Exception | FLTK_exception -- ^ @FLTK-exception@, FLTK exception - | Fmt_exception -- ^ @fmt-exception@, fmt exception, SPDX License List 3.23 + | Fmt_exception -- ^ @fmt-exception@, fmt exception, SPDX License List 3.23, SPDX License List 3.25 | Font_exception_2_0 -- ^ @Font-exception-2.0@, Font exception 2.0 | Freertos_exception_2_0 -- ^ @freertos-exception-2.0@, FreeRTOS Exception 2.0 - | GCC_exception_2_0_note -- ^ @GCC-exception-2.0-note@, GCC Runtime Library exception 2.0 - note variant, SPDX License List 3.23 + | GCC_exception_2_0_note -- ^ @GCC-exception-2.0-note@, GCC Runtime Library exception 2.0 - note variant, SPDX License List 3.23, SPDX License List 3.25 | GCC_exception_2_0 -- ^ @GCC-exception-2.0@, GCC Runtime Library exception 2.0 | GCC_exception_3_1 -- ^ @GCC-exception-3.1@, GCC Runtime Library exception 3.1 - | Gmsh_exception -- ^ @Gmsh-exception@, Gmsh exception>, SPDX License List 3.23 - | GNAT_exception -- ^ @GNAT-exception@, GNAT exception, SPDX License List 3.23 - | GNOME_examples_exception -- ^ @GNOME-examples-exception@, GNOME examples exception, SPDX License List 3.23 - | GNU_compiler_exception -- ^ @GNU-compiler-exception@, GNU Compiler Exception, SPDX License List 3.23 + | Gmsh_exception -- ^ @Gmsh-exception@, Gmsh exception>, SPDX License List 3.23, SPDX License List 3.25 + | GNAT_exception -- ^ @GNAT-exception@, GNAT exception, SPDX License List 3.23, SPDX License List 3.25 + | GNOME_examples_exception -- ^ @GNOME-examples-exception@, GNOME examples exception, SPDX License List 3.23, SPDX License List 3.25 + | GNU_compiler_exception -- ^ @GNU-compiler-exception@, GNU Compiler Exception, SPDX License List 3.23, SPDX License List 3.25 | Gnu_javamail_exception -- ^ @gnu-javamail-exception@, GNU JavaMail exception - | GPL_3_0_interface_exception -- ^ @GPL-3.0-interface-exception@, GPL-3.0 Interface Exception, SPDX License List 3.23 - | GPL_3_0_linking_exception -- ^ @GPL-3.0-linking-exception@, GPL-3.0 Linking Exception, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 - | GPL_3_0_linking_source_exception -- ^ @GPL-3.0-linking-source-exception@, GPL-3.0 Linking Exception (with Corresponding Source), SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 - | GPL_CC_1_0 -- ^ @GPL-CC-1.0@, GPL Cooperation Commitment 1.0, SPDX License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 - | GStreamer_exception_2005 -- ^ @GStreamer-exception-2005@, GStreamer Exception (2005), SPDX License List 3.23 - | GStreamer_exception_2008 -- ^ @GStreamer-exception-2008@, GStreamer Exception (2008), SPDX License List 3.23 + | GPL_3_0_interface_exception -- ^ @GPL-3.0-interface-exception@, GPL-3.0 Interface Exception, SPDX License List 3.23, SPDX License List 3.25 + | GPL_3_0_linking_exception -- ^ @GPL-3.0-linking-exception@, GPL-3.0 Linking Exception, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 + | GPL_3_0_linking_source_exception -- ^ @GPL-3.0-linking-source-exception@, GPL-3.0 Linking Exception (with Corresponding Source), SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 + | GPL_CC_1_0 -- ^ @GPL-CC-1.0@, GPL Cooperation Commitment 1.0, SPDX License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 + | GStreamer_exception_2005 -- ^ @GStreamer-exception-2005@, GStreamer Exception (2005), SPDX License List 3.23, SPDX License List 3.25 + | GStreamer_exception_2008 -- ^ @GStreamer-exception-2008@, GStreamer Exception (2008), SPDX License List 3.23, SPDX License List 3.25 | I2p_gpl_java_exception -- ^ @i2p-gpl-java-exception@, i2p GPL+Java Exception - | KiCad_libraries_exception -- ^ @KiCad-libraries-exception@, KiCad Libraries Exception, SPDX License List 3.23 - | LGPL_3_0_linking_exception -- ^ @LGPL-3.0-linking-exception@, LGPL-3.0 Linking Exception, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 - | Libpri_OpenH323_exception -- ^ @libpri-OpenH323-exception@, libpri OpenH323 exception, SPDX License List 3.23 + | KiCad_libraries_exception -- ^ @KiCad-libraries-exception@, KiCad Libraries Exception, SPDX License List 3.23, SPDX License List 3.25 + | LGPL_3_0_linking_exception -- ^ @LGPL-3.0-linking-exception@, LGPL-3.0 Linking Exception, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 + | Libpri_OpenH323_exception -- ^ @libpri-OpenH323-exception@, libpri OpenH323 exception, SPDX License List 3.23, SPDX License List 3.25 | Libtool_exception -- ^ @Libtool-exception@, Libtool Exception | Linux_syscall_note -- ^ @Linux-syscall-note@, Linux Syscall Note - | LLGPL -- ^ @LLGPL@, LLGPL Preamble, SPDX License List 3.23 - | LLVM_exception -- ^ @LLVM-exception@, LLVM Exception, SPDX License List 3.2, SPDX License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 + | LLGPL -- ^ @LLGPL@, LLGPL Preamble, SPDX License List 3.23, SPDX License List 3.25 + | LLVM_exception -- ^ @LLVM-exception@, LLVM Exception, SPDX License List 3.2, SPDX License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 | LZMA_exception -- ^ @LZMA-exception@, LZMA exception | Mif_exception -- ^ @mif-exception@, Macros and Inline Functions Exception | Nokia_Qt_exception_1_1 -- ^ @Nokia-Qt-exception-1.1@, Nokia Qt LGPL exception 1.1, SPDX License List 3.0, SPDX License List 3.2 - | OCaml_LGPL_linking_exception -- ^ @OCaml-LGPL-linking-exception@, OCaml LGPL Linking Exception, SPDX License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 + | OCaml_LGPL_linking_exception -- ^ @OCaml-LGPL-linking-exception@, OCaml LGPL Linking Exception, SPDX License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 | OCCT_exception_1_0 -- ^ @OCCT-exception-1.0@, Open CASCADE Exception 1.0 - | OpenJDK_assembly_exception_1_0 -- ^ @OpenJDK-assembly-exception-1.0@, OpenJDK Assembly exception 1.0, SPDX License List 3.2, SPDX License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 + | OpenJDK_assembly_exception_1_0 -- ^ @OpenJDK-assembly-exception-1.0@, OpenJDK Assembly exception 1.0, SPDX License List 3.2, SPDX License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 | Openvpn_openssl_exception -- ^ @openvpn-openssl-exception@, OpenVPN OpenSSL Exception - | PS_or_PDF_font_exception_20170817 -- ^ @PS-or-PDF-font-exception-20170817@, PS/PDF font exception (2017-08-17), SPDX License List 3.2, SPDX License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 - | QPL_1_0_INRIA_2004_exception -- ^ @QPL-1.0-INRIA-2004-exception@, INRIA QPL 1.0 2004 variant exception, SPDX License List 3.23 - | Qt_GPL_exception_1_0 -- ^ @Qt-GPL-exception-1.0@, Qt GPL exception 1.0, SPDX License List 3.2, SPDX License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 - | Qt_LGPL_exception_1_1 -- ^ @Qt-LGPL-exception-1.1@, Qt LGPL exception 1.1, SPDX License List 3.2, SPDX License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 + | PCRE2_exception -- ^ @PCRE2-exception@, PCRE2 exception, SPDX License List 3.25 + | PS_or_PDF_font_exception_20170817 -- ^ @PS-or-PDF-font-exception-20170817@, PS/PDF font exception (2017-08-17), SPDX License List 3.2, SPDX License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 + | QPL_1_0_INRIA_2004_exception -- ^ @QPL-1.0-INRIA-2004-exception@, INRIA QPL 1.0 2004 variant exception, SPDX License List 3.23, SPDX License List 3.25 + | Qt_GPL_exception_1_0 -- ^ @Qt-GPL-exception-1.0@, Qt GPL exception 1.0, SPDX License List 3.2, SPDX License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 + | Qt_LGPL_exception_1_1 -- ^ @Qt-LGPL-exception-1.1@, Qt LGPL exception 1.1, SPDX License List 3.2, SPDX License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 | Qwt_exception_1_0 -- ^ @Qwt-exception-1.0@, Qwt exception 1.0 - | SANE_exception -- ^ @SANE-exception@, SANE Exception, SPDX License List 3.23 - | SHL_2_0 -- ^ @SHL-2.0@, Solderpad Hardware License v2.0, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 - | SHL_2_1 -- ^ @SHL-2.1@, Solderpad Hardware License v2.1, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 - | Stunnel_exception -- ^ @stunnel-exception@, stunnel Exception, SPDX License List 3.23 - | SWI_exception -- ^ @SWI-exception@, SWI exception, SPDX License List 3.23 - | Swift_exception -- ^ @Swift-exception@, Swift Exception, SPDX License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 - | Texinfo_exception -- ^ @Texinfo-exception@, Texinfo exception, SPDX License List 3.23 + | Romic_exception -- ^ @romic-exception@, Romic Exception, SPDX License List 3.25 + | RRDtool_FLOSS_exception_2_0 -- ^ @RRDtool-FLOSS-exception-2.0@, RRDtool FLOSS exception 2.0, SPDX License List 3.25 + | SANE_exception -- ^ @SANE-exception@, SANE Exception, SPDX License List 3.23, SPDX License List 3.25 + | SHL_2_0 -- ^ @SHL-2.0@, Solderpad Hardware License v2.0, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 + | SHL_2_1 -- ^ @SHL-2.1@, Solderpad Hardware License v2.1, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 + | Stunnel_exception -- ^ @stunnel-exception@, stunnel Exception, SPDX License List 3.23, SPDX License List 3.25 + | SWI_exception -- ^ @SWI-exception@, SWI exception, SPDX License List 3.23, SPDX License List 3.25 + | Swift_exception -- ^ @Swift-exception@, Swift Exception, SPDX License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 + | Texinfo_exception -- ^ @Texinfo-exception@, Texinfo exception, SPDX License List 3.23, SPDX License List 3.25 | U_boot_exception_2_0 -- ^ @u-boot-exception-2.0@, U-Boot exception 2.0 - | UBDL_exception -- ^ @UBDL-exception@, Unmodified Binary Distribution exception, SPDX License List 3.23 - | Universal_FOSS_exception_1_0 -- ^ @Universal-FOSS-exception-1.0@, Universal FOSS Exception, Version 1.0, SPDX License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 - | Vsftpd_openssl_exception -- ^ @vsftpd-openssl-exception@, vsftpd OpenSSL exception, SPDX License List 3.23 + | UBDL_exception -- ^ @UBDL-exception@, Unmodified Binary Distribution exception, SPDX License List 3.23, SPDX License List 3.25 + | Universal_FOSS_exception_1_0 -- ^ @Universal-FOSS-exception-1.0@, Universal FOSS Exception, Version 1.0, SPDX License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 + | Vsftpd_openssl_exception -- ^ @vsftpd-openssl-exception@, vsftpd OpenSSL exception, SPDX License List 3.23, SPDX License List 3.25 | WxWindows_exception_3_1 -- ^ @WxWindows-exception-3.1@, WxWindows Library Exception 3.1 - | X11vnc_openssl_exception -- ^ @x11vnc-openssl-exception@, x11vnc OpenSSL Exception, SPDX License List 3.23 + | X11vnc_openssl_exception -- ^ @x11vnc-openssl-exception@, x11vnc OpenSSL Exception, SPDX License List 3.23, SPDX License List 3.25 deriving (Eq, Ord, Enum, Bounded, Show, Read, Typeable, Data, Generic) instance Binary LicenseExceptionId where @@ -132,8 +137,9 @@ instance NFData LicenseExceptionId where -- | License SPDX identifier, e.g. @"BSD-3-Clause"@. licenseExceptionId :: LicenseExceptionId -> String -licenseExceptionId DS389_exception = "389-exception" +licenseExceptionId N_389_exception = "389-exception" licenseExceptionId Asterisk_exception = "Asterisk-exception" +licenseExceptionId Asterisk_linking_protocols_exception = "Asterisk-linking-protocols-exception" licenseExceptionId Autoconf_exception_2_0 = "Autoconf-exception-2.0" licenseExceptionId Autoconf_exception_3_0 = "Autoconf-exception-3.0" licenseExceptionId Autoconf_exception_generic_3_0 = "Autoconf-exception-generic-3.0" @@ -147,6 +153,7 @@ licenseExceptionId CLISP_exception_2_0 = "CLISP-exception-2.0" licenseExceptionId Cryptsetup_OpenSSL_exception = "cryptsetup-OpenSSL-exception" licenseExceptionId DigiRule_FOSS_exception = "DigiRule-FOSS-exception" licenseExceptionId ECos_exception_2_0 = "eCos-exception-2.0" +licenseExceptionId Erlang_otp_linking_exception = "erlang-otp-linking-exception" licenseExceptionId Fawkes_Runtime_exception = "Fawkes-Runtime-exception" licenseExceptionId FLTK_exception = "FLTK-exception" licenseExceptionId Fmt_exception = "fmt-exception" @@ -181,11 +188,14 @@ licenseExceptionId OCaml_LGPL_linking_exception = "OCaml-LGPL-linking-exception" licenseExceptionId OCCT_exception_1_0 = "OCCT-exception-1.0" licenseExceptionId OpenJDK_assembly_exception_1_0 = "OpenJDK-assembly-exception-1.0" licenseExceptionId Openvpn_openssl_exception = "openvpn-openssl-exception" +licenseExceptionId PCRE2_exception = "PCRE2-exception" licenseExceptionId PS_or_PDF_font_exception_20170817 = "PS-or-PDF-font-exception-20170817" licenseExceptionId QPL_1_0_INRIA_2004_exception = "QPL-1.0-INRIA-2004-exception" licenseExceptionId Qt_GPL_exception_1_0 = "Qt-GPL-exception-1.0" licenseExceptionId Qt_LGPL_exception_1_1 = "Qt-LGPL-exception-1.1" licenseExceptionId Qwt_exception_1_0 = "Qwt-exception-1.0" +licenseExceptionId Romic_exception = "romic-exception" +licenseExceptionId RRDtool_FLOSS_exception_2_0 = "RRDtool-FLOSS-exception-2.0" licenseExceptionId SANE_exception = "SANE-exception" licenseExceptionId SHL_2_0 = "SHL-2.0" licenseExceptionId SHL_2_1 = "SHL-2.1" @@ -202,8 +212,9 @@ licenseExceptionId X11vnc_openssl_exception = "x11vnc-openssl-exception" -- | License name, e.g. @"GNU General Public License v2.0 only"@ licenseExceptionName :: LicenseExceptionId -> String -licenseExceptionName DS389_exception = "389 Directory Server Exception" +licenseExceptionName N_389_exception = "389 Directory Server Exception" licenseExceptionName Asterisk_exception = "Asterisk exception" +licenseExceptionName Asterisk_linking_protocols_exception = "Asterisk linking protocols exception" licenseExceptionName Autoconf_exception_2_0 = "Autoconf exception 2.0" licenseExceptionName Autoconf_exception_3_0 = "Autoconf exception 3.0" licenseExceptionName Autoconf_exception_generic_3_0 = "Autoconf generic exception for GPL-3.0" @@ -217,6 +228,7 @@ licenseExceptionName CLISP_exception_2_0 = "CLISP exception 2.0" licenseExceptionName Cryptsetup_OpenSSL_exception = "cryptsetup OpenSSL exception" licenseExceptionName DigiRule_FOSS_exception = "DigiRule FOSS License Exception" licenseExceptionName ECos_exception_2_0 = "eCos exception 2.0" +licenseExceptionName Erlang_otp_linking_exception = "Erlang/OTP Linking Exception" licenseExceptionName Fawkes_Runtime_exception = "Fawkes Runtime Exception" licenseExceptionName FLTK_exception = "FLTK exception" licenseExceptionName Fmt_exception = "fmt exception" @@ -251,11 +263,14 @@ licenseExceptionName OCaml_LGPL_linking_exception = "OCaml LGPL Linking Exceptio licenseExceptionName OCCT_exception_1_0 = "Open CASCADE Exception 1.0" licenseExceptionName OpenJDK_assembly_exception_1_0 = "OpenJDK Assembly exception 1.0" licenseExceptionName Openvpn_openssl_exception = "OpenVPN OpenSSL Exception" +licenseExceptionName PCRE2_exception = "PCRE2 exception" licenseExceptionName PS_or_PDF_font_exception_20170817 = "PS/PDF font exception (2017-08-17)" licenseExceptionName QPL_1_0_INRIA_2004_exception = "INRIA QPL 1.0 2004 variant exception" licenseExceptionName Qt_GPL_exception_1_0 = "Qt GPL exception 1.0" licenseExceptionName Qt_LGPL_exception_1_1 = "Qt LGPL exception 1.1" licenseExceptionName Qwt_exception_1_0 = "Qwt exception 1.0" +licenseExceptionName Romic_exception = "Romic Exception" +licenseExceptionName RRDtool_FLOSS_exception_2_0 = "RRDtool FLOSS exception 2.0" licenseExceptionName SANE_exception = "SANE Exception" licenseExceptionName SHL_2_0 = "Solderpad Hardware License v2.0" licenseExceptionName SHL_2_1 = "Solderpad Hardware License v2.1" @@ -394,6 +409,54 @@ licenseExceptionIdList LicenseListVersion_3_23 = , X11vnc_openssl_exception ] ++ bulkOfLicenses +licenseExceptionIdList LicenseListVersion_3_25 = + [ Asterisk_exception + , Asterisk_linking_protocols_exception + , Autoconf_exception_generic_3_0 + , Autoconf_exception_generic + , Autoconf_exception_macro + , Bison_exception_1_24 + , Cryptsetup_OpenSSL_exception + , Erlang_otp_linking_exception + , Fmt_exception + , GCC_exception_2_0_note + , Gmsh_exception + , GNAT_exception + , GNOME_examples_exception + , GNU_compiler_exception + , GPL_3_0_interface_exception + , GPL_3_0_linking_exception + , GPL_3_0_linking_source_exception + , GPL_CC_1_0 + , GStreamer_exception_2005 + , GStreamer_exception_2008 + , KiCad_libraries_exception + , LGPL_3_0_linking_exception + , Libpri_OpenH323_exception + , LLGPL + , LLVM_exception + , OCaml_LGPL_linking_exception + , OpenJDK_assembly_exception_1_0 + , PCRE2_exception + , PS_or_PDF_font_exception_20170817 + , QPL_1_0_INRIA_2004_exception + , Qt_GPL_exception_1_0 + , Qt_LGPL_exception_1_1 + , Romic_exception + , RRDtool_FLOSS_exception_2_0 + , SANE_exception + , SHL_2_0 + , SHL_2_1 + , Stunnel_exception + , SWI_exception + , Swift_exception + , Texinfo_exception + , UBDL_exception + , Universal_FOSS_exception_1_0 + , Vsftpd_openssl_exception + , X11vnc_openssl_exception + ] + ++ bulkOfLicenses -- | Create a 'LicenseExceptionId' from a 'String'. mkLicenseExceptionId :: LicenseListVersion -> String -> Maybe LicenseExceptionId @@ -404,6 +467,7 @@ mkLicenseExceptionId LicenseListVersion_3_9 s = Map.lookup s stringLookup_3_9 mkLicenseExceptionId LicenseListVersion_3_10 s = Map.lookup s stringLookup_3_10 mkLicenseExceptionId LicenseListVersion_3_16 s = Map.lookup s stringLookup_3_16 mkLicenseExceptionId LicenseListVersion_3_23 s = Map.lookup s stringLookup_3_23 +mkLicenseExceptionId LicenseListVersion_3_25 s = Map.lookup s stringLookup_3_25 stringLookup_3_0 :: Map String LicenseExceptionId stringLookup_3_0 = Map.fromList $ map (\i -> (licenseExceptionId i, i)) $ @@ -433,10 +497,14 @@ stringLookup_3_23 :: Map String LicenseExceptionId stringLookup_3_23 = Map.fromList $ map (\i -> (licenseExceptionId i, i)) $ licenseExceptionIdList LicenseListVersion_3_23 +stringLookup_3_25 :: Map String LicenseExceptionId +stringLookup_3_25 = Map.fromList $ map (\i -> (licenseExceptionId i, i)) $ + licenseExceptionIdList LicenseListVersion_3_25 + -- | License exceptions in all SPDX License lists bulkOfLicenses :: [LicenseExceptionId] bulkOfLicenses = - [ DS389_exception + [ N_389_exception , Autoconf_exception_2_0 , Autoconf_exception_3_0 , Bison_exception_2_2 diff --git a/Cabal-syntax/src/Distribution/SPDX/LicenseId.hs b/Cabal-syntax/src/Distribution/SPDX/LicenseId.hs index 5af7fd86e8b..95d315906c7 100644 --- a/Cabal-syntax/src/Distribution/SPDX/LicenseId.hs +++ b/Cabal-syntax/src/Distribution/SPDX/LicenseId.hs @@ -33,16 +33,17 @@ import qualified Text.PrettyPrint as Disp -- LicenseId ------------------------------------------------------------------------------- --- | SPDX License identifiers list v3.23 +-- | SPDX License identifiers list v3.25 data LicenseId - = NullBSD -- ^ @0BSD@, BSD Zero Clause License + = N_0BSD -- ^ @0BSD@, BSD Zero Clause License + | N_3D_Slicer_1_0 -- ^ @3D-Slicer-1.0@, 3D Slicer License v1.0, SPDX License List 3.25 | AAL -- ^ @AAL@, Attribution Assurance License | Abstyles -- ^ @Abstyles@, Abstyles License - | AdaCore_doc -- ^ @AdaCore-doc@, AdaCore Doc License, SPDX License List 3.23 + | AdaCore_doc -- ^ @AdaCore-doc@, AdaCore Doc License, SPDX License List 3.23, SPDX License List 3.25 | Adobe_2006 -- ^ @Adobe-2006@, Adobe Systems Incorporated Source Code License Agreement - | Adobe_Display_PostScript -- ^ @Adobe-Display-PostScript@, Adobe Display PostScript License, SPDX License List 3.23 + | Adobe_Display_PostScript -- ^ @Adobe-Display-PostScript@, Adobe Display PostScript License, SPDX License List 3.23, SPDX License List 3.25 | Adobe_Glyph -- ^ @Adobe-Glyph@, Adobe Glyph List License - | Adobe_Utopia -- ^ @Adobe-Utopia@, Adobe Utopia Font License, SPDX License List 3.23 + | Adobe_Utopia -- ^ @Adobe-Utopia@, Adobe Utopia Font License, SPDX License List 3.23, SPDX License List 3.25 | ADSL -- ^ @ADSL@, Amazon Digital Services License | AFL_1_1 -- ^ @AFL-1.1@, Academic Free License v1.1 | AFL_1_2 -- ^ @AFL-1.2@, Academic Free License v1.2 @@ -51,151 +52,155 @@ data LicenseId | AFL_3_0 -- ^ @AFL-3.0@, Academic Free License v3.0 | Afmparse -- ^ @Afmparse@, Afmparse License | AGPL_1_0 -- ^ @AGPL-1.0@, Affero General Public License v1.0, SPDX License List 3.0 - | AGPL_1_0_only -- ^ @AGPL-1.0-only@, Affero General Public License v1.0 only, SPDX License List 3.2, SPDX License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 - | AGPL_1_0_or_later -- ^ @AGPL-1.0-or-later@, Affero General Public License v1.0 or later, SPDX License List 3.2, SPDX License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 + | AGPL_1_0_only -- ^ @AGPL-1.0-only@, Affero General Public License v1.0 only, SPDX License List 3.2, SPDX License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 + | AGPL_1_0_or_later -- ^ @AGPL-1.0-or-later@, Affero General Public License v1.0 or later, SPDX License List 3.2, SPDX License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 | AGPL_3_0_only -- ^ @AGPL-3.0-only@, GNU Affero General Public License v3.0 only | AGPL_3_0_or_later -- ^ @AGPL-3.0-or-later@, GNU Affero General Public License v3.0 or later | Aladdin -- ^ @Aladdin@, Aladdin Free Public License + | AMD_newlib -- ^ @AMD-newlib@, AMD newlib License, SPDX License List 3.25 | AMDPLPA -- ^ @AMDPLPA@, AMD's plpa_map.c License - | AML_glslang -- ^ @AML-glslang@, AML glslang variant License, SPDX License List 3.23 + | AML_glslang -- ^ @AML-glslang@, AML glslang variant License, SPDX License List 3.23, SPDX License List 3.25 | AML -- ^ @AML@, Apple MIT License | AMPAS -- ^ @AMPAS@, Academy of Motion Picture Arts and Sciences BSD - | ANTLR_PD_fallback -- ^ @ANTLR-PD-fallback@, ANTLR Software Rights Notice with license fallback, SPDX License List 3.16, SPDX License List 3.23 + | ANTLR_PD_fallback -- ^ @ANTLR-PD-fallback@, ANTLR Software Rights Notice with license fallback, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 | ANTLR_PD -- ^ @ANTLR-PD@, ANTLR Software Rights Notice + | Any_OSI -- ^ @any-OSI@, Any OSI License, SPDX License List 3.25 | Apache_1_0 -- ^ @Apache-1.0@, Apache License 1.0 | Apache_1_1 -- ^ @Apache-1.1@, Apache License 1.1 | Apache_2_0 -- ^ @Apache-2.0@, Apache License 2.0 | APAFML -- ^ @APAFML@, Adobe Postscript AFM License | APL_1_0 -- ^ @APL-1.0@, Adaptive Public License 1.0 - | App_s2p -- ^ @App-s2p@, App::s2p License, SPDX License List 3.16, SPDX License List 3.23 + | App_s2p -- ^ @App-s2p@, App::s2p License, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 | APSL_1_0 -- ^ @APSL-1.0@, Apple Public Source License 1.0 | APSL_1_1 -- ^ @APSL-1.1@, Apple Public Source License 1.1 | APSL_1_2 -- ^ @APSL-1.2@, Apple Public Source License 1.2 | APSL_2_0 -- ^ @APSL-2.0@, Apple Public Source License 2.0 - | Arphic_1999 -- ^ @Arphic-1999@, Arphic Public License, SPDX License List 3.23 + | Arphic_1999 -- ^ @Arphic-1999@, Arphic Public License, SPDX License List 3.23, SPDX License List 3.25 | Artistic_1_0_cl8 -- ^ @Artistic-1.0-cl8@, Artistic License 1.0 w/clause 8 | Artistic_1_0_Perl -- ^ @Artistic-1.0-Perl@, Artistic License 1.0 (Perl) | Artistic_1_0 -- ^ @Artistic-1.0@, Artistic License 1.0 | Artistic_2_0 -- ^ @Artistic-2.0@, Artistic License 2.0 - | ASWF_Digital_Assets_1_0 -- ^ @ASWF-Digital-Assets-1.0@, ASWF Digital Assets License version 1.0, SPDX License List 3.23 - | ASWF_Digital_Assets_1_1 -- ^ @ASWF-Digital-Assets-1.1@, ASWF Digital Assets License 1.1, SPDX License List 3.23 - | Baekmuk -- ^ @Baekmuk@, Baekmuk License, SPDX License List 3.23 + | ASWF_Digital_Assets_1_0 -- ^ @ASWF-Digital-Assets-1.0@, ASWF Digital Assets License version 1.0, SPDX License List 3.23, SPDX License List 3.25 + | ASWF_Digital_Assets_1_1 -- ^ @ASWF-Digital-Assets-1.1@, ASWF Digital Assets License 1.1, SPDX License List 3.23, SPDX License List 3.25 + | Baekmuk -- ^ @Baekmuk@, Baekmuk License, SPDX License List 3.23, SPDX License List 3.25 | Bahyph -- ^ @Bahyph@, Bahyph License | Barr -- ^ @Barr@, Barr License - | Bcrypt_Solar_Designer -- ^ @bcrypt-Solar-Designer@, bcrypt Solar Designer License, SPDX License List 3.23 + | Bcrypt_Solar_Designer -- ^ @bcrypt-Solar-Designer@, bcrypt Solar Designer License, SPDX License List 3.23, SPDX License List 3.25 | Beerware -- ^ @Beerware@, Beerware License - | Bitstream_Charter -- ^ @Bitstream-Charter@, Bitstream Charter Font License, SPDX License List 3.23 - | Bitstream_Vera -- ^ @Bitstream-Vera@, Bitstream Vera Font License, SPDX License List 3.23 + | Bitstream_Charter -- ^ @Bitstream-Charter@, Bitstream Charter Font License, SPDX License List 3.23, SPDX License List 3.25 + | Bitstream_Vera -- ^ @Bitstream-Vera@, Bitstream Vera Font License, SPDX License List 3.23, SPDX License List 3.25 | BitTorrent_1_0 -- ^ @BitTorrent-1.0@, BitTorrent Open Source License v1.0 | BitTorrent_1_1 -- ^ @BitTorrent-1.1@, BitTorrent Open Source License v1.1 - | Blessing -- ^ @blessing@, SQLite Blessing, SPDX License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 - | BlueOak_1_0_0 -- ^ @BlueOak-1.0.0@, Blue Oak Model License 1.0.0, SPDX License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 - | Boehm_GC -- ^ @Boehm-GC@, Boehm-Demers-Weiser GC License, SPDX License List 3.23 + | Blessing -- ^ @blessing@, SQLite Blessing, SPDX License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 + | BlueOak_1_0_0 -- ^ @BlueOak-1.0.0@, Blue Oak Model License 1.0.0, SPDX License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 + | Boehm_GC -- ^ @Boehm-GC@, Boehm-Demers-Weiser GC License, SPDX License List 3.23, SPDX License List 3.25 | Borceux -- ^ @Borceux@, Borceux license - | Brian_Gladman_2_Clause -- ^ @Brian-Gladman-2-Clause@, Brian Gladman 2-Clause License, SPDX License List 3.23 - | Brian_Gladman_3_Clause -- ^ @Brian-Gladman-3-Clause@, Brian Gladman 3-Clause License, SPDX License List 3.23 + | Brian_Gladman_2_Clause -- ^ @Brian-Gladman-2-Clause@, Brian Gladman 2-Clause License, SPDX License List 3.23, SPDX License List 3.25 + | Brian_Gladman_3_Clause -- ^ @Brian-Gladman-3-Clause@, Brian Gladman 3-Clause License, SPDX License List 3.23, SPDX License List 3.25 | BSD_1_Clause -- ^ @BSD-1-Clause@, BSD 1-Clause License | BSD_2_Clause_FreeBSD -- ^ @BSD-2-Clause-FreeBSD@, BSD 2-Clause FreeBSD License, SPDX License List 3.0, SPDX License List 3.2, SPDX License List 3.6, SPDX License List 3.9 | BSD_2_Clause_NetBSD -- ^ @BSD-2-Clause-NetBSD@, BSD 2-Clause NetBSD License, SPDX License List 3.0, SPDX License List 3.2, SPDX License List 3.6 - | BSD_2_Clause_Darwin -- ^ @BSD-2-Clause-Darwin@, BSD 2-Clause - Ian Darwin variant, SPDX License List 3.23 + | BSD_2_Clause_Darwin -- ^ @BSD-2-Clause-Darwin@, BSD 2-Clause - Ian Darwin variant, SPDX License List 3.23, SPDX License List 3.25 + | BSD_2_Clause_first_lines -- ^ @BSD-2-Clause-first-lines@, BSD 2-Clause - first lines requirement, SPDX License List 3.25 | BSD_2_Clause_Patent -- ^ @BSD-2-Clause-Patent@, BSD-2-Clause Plus Patent License - | BSD_2_Clause_Views -- ^ @BSD-2-Clause-Views@, BSD 2-Clause with views sentence, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 + | BSD_2_Clause_Views -- ^ @BSD-2-Clause-Views@, BSD 2-Clause with views sentence, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 | BSD_2_Clause -- ^ @BSD-2-Clause@, BSD 2-Clause "Simplified" License - | BSD_3_Clause_acpica -- ^ @BSD-3-Clause-acpica@, BSD 3-Clause acpica variant, SPDX License List 3.23 + | BSD_3_Clause_acpica -- ^ @BSD-3-Clause-acpica@, BSD 3-Clause acpica variant, SPDX License List 3.23, SPDX License List 3.25 | BSD_3_Clause_Attribution -- ^ @BSD-3-Clause-Attribution@, BSD with attribution | BSD_3_Clause_Clear -- ^ @BSD-3-Clause-Clear@, BSD 3-Clause Clear License - | BSD_3_Clause_flex -- ^ @BSD-3-Clause-flex@, BSD 3-Clause Flex variant, SPDX License List 3.23 - | BSD_3_Clause_HP -- ^ @BSD-3-Clause-HP@, Hewlett-Packard BSD variant license, SPDX License List 3.23 + | BSD_3_Clause_flex -- ^ @BSD-3-Clause-flex@, BSD 3-Clause Flex variant, SPDX License List 3.23, SPDX License List 3.25 + | BSD_3_Clause_HP -- ^ @BSD-3-Clause-HP@, Hewlett-Packard BSD variant license, SPDX License List 3.23, SPDX License List 3.25 | BSD_3_Clause_LBNL -- ^ @BSD-3-Clause-LBNL@, Lawrence Berkeley National Labs BSD variant license - | BSD_3_Clause_Modification -- ^ @BSD-3-Clause-Modification@, BSD 3-Clause Modification, SPDX License List 3.16, SPDX License List 3.23 - | BSD_3_Clause_No_Military_License -- ^ @BSD-3-Clause-No-Military-License@, BSD 3-Clause No Military License, SPDX License List 3.16, SPDX License List 3.23 + | BSD_3_Clause_Modification -- ^ @BSD-3-Clause-Modification@, BSD 3-Clause Modification, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 + | BSD_3_Clause_No_Military_License -- ^ @BSD-3-Clause-No-Military-License@, BSD 3-Clause No Military License, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 | BSD_3_Clause_No_Nuclear_License_2014 -- ^ @BSD-3-Clause-No-Nuclear-License-2014@, BSD 3-Clause No Nuclear License 2014 | BSD_3_Clause_No_Nuclear_License -- ^ @BSD-3-Clause-No-Nuclear-License@, BSD 3-Clause No Nuclear License | BSD_3_Clause_No_Nuclear_Warranty -- ^ @BSD-3-Clause-No-Nuclear-Warranty@, BSD 3-Clause No Nuclear Warranty - | BSD_3_Clause_Open_MPI -- ^ @BSD-3-Clause-Open-MPI@, BSD 3-Clause Open MPI variant, SPDX License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 - | BSD_3_Clause_Sun -- ^ @BSD-3-Clause-Sun@, BSD 3-Clause Sun Microsystems, SPDX License List 3.23 + | BSD_3_Clause_Open_MPI -- ^ @BSD-3-Clause-Open-MPI@, BSD 3-Clause Open MPI variant, SPDX License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 + | BSD_3_Clause_Sun -- ^ @BSD-3-Clause-Sun@, BSD 3-Clause Sun Microsystems, SPDX License List 3.23, SPDX License List 3.25 | BSD_3_Clause -- ^ @BSD-3-Clause@, BSD 3-Clause "New" or "Revised" License - | BSD_4_Clause_Shortened -- ^ @BSD-4-Clause-Shortened@, BSD 4 Clause Shortened, SPDX License List 3.16, SPDX License List 3.23 + | BSD_4_Clause_Shortened -- ^ @BSD-4-Clause-Shortened@, BSD 4 Clause Shortened, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 | BSD_4_Clause_UC -- ^ @BSD-4-Clause-UC@, BSD-4-Clause (University of California-Specific) | BSD_4_Clause -- ^ @BSD-4-Clause@, BSD 4-Clause "Original" or "Old" License - | BSD_4_3RENO -- ^ @BSD-4.3RENO@, BSD 4.3 RENO License, SPDX License List 3.23 - | BSD_4_3TAHOE -- ^ @BSD-4.3TAHOE@, BSD 4.3 TAHOE License, SPDX License List 3.23 - | BSD_Advertising_Acknowledgement -- ^ @BSD-Advertising-Acknowledgement@, BSD Advertising Acknowledgement License, SPDX License List 3.23 - | BSD_Attribution_HPND_disclaimer -- ^ @BSD-Attribution-HPND-disclaimer@, BSD with Attribution and HPND disclaimer, SPDX License List 3.23 - | BSD_Inferno_Nettverk -- ^ @BSD-Inferno-Nettverk@, BSD-Inferno-Nettverk, SPDX License List 3.23 + | BSD_4_3RENO -- ^ @BSD-4.3RENO@, BSD 4.3 RENO License, SPDX License List 3.23, SPDX License List 3.25 + | BSD_4_3TAHOE -- ^ @BSD-4.3TAHOE@, BSD 4.3 TAHOE License, SPDX License List 3.23, SPDX License List 3.25 + | BSD_Advertising_Acknowledgement -- ^ @BSD-Advertising-Acknowledgement@, BSD Advertising Acknowledgement License, SPDX License List 3.23, SPDX License List 3.25 + | BSD_Attribution_HPND_disclaimer -- ^ @BSD-Attribution-HPND-disclaimer@, BSD with Attribution and HPND disclaimer, SPDX License List 3.23, SPDX License List 3.25 + | BSD_Inferno_Nettverk -- ^ @BSD-Inferno-Nettverk@, BSD-Inferno-Nettverk, SPDX License List 3.23, SPDX License List 3.25 | BSD_Protection -- ^ @BSD-Protection@, BSD Protection License - | BSD_Source_beginning_file -- ^ @BSD-Source-beginning-file@, BSD Source Code Attribution - beginning of file variant, SPDX License List 3.23 + | BSD_Source_beginning_file -- ^ @BSD-Source-beginning-file@, BSD Source Code Attribution - beginning of file variant, SPDX License List 3.23, SPDX License List 3.25 | BSD_Source_Code -- ^ @BSD-Source-Code@, BSD Source Code Attribution - | BSD_Systemics_W3Works -- ^ @BSD-Systemics-W3Works@, Systemics W3Works BSD variant license, SPDX License List 3.23 - | BSD_Systemics -- ^ @BSD-Systemics@, Systemics BSD variant license, SPDX License List 3.23 + | BSD_Systemics_W3Works -- ^ @BSD-Systemics-W3Works@, Systemics W3Works BSD variant license, SPDX License List 3.23, SPDX License List 3.25 + | BSD_Systemics -- ^ @BSD-Systemics@, Systemics BSD variant license, SPDX License List 3.23, SPDX License List 3.25 | BSL_1_0 -- ^ @BSL-1.0@, Boost Software License 1.0 | Bzip2_1_0_5 -- ^ @bzip2-1.0.5@, bzip2 and libbzip2 License v1.0.5, SPDX License List 3.0, SPDX License List 3.2, SPDX License List 3.6, SPDX License List 3.9, SPDX License List 3.10 - | BUSL_1_1 -- ^ @BUSL-1.1@, Business Source License 1.1, SPDX License List 3.16, SPDX License List 3.23 + | BUSL_1_1 -- ^ @BUSL-1.1@, Business Source License 1.1, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 | Bzip2_1_0_6 -- ^ @bzip2-1.0.6@, bzip2 and libbzip2 License v1.0.6 - | C_UDA_1_0 -- ^ @C-UDA-1.0@, Computational Use of Data Agreement v1.0, SPDX License List 3.16, SPDX License List 3.23 - | CAL_1_0_Combined_Work_Exception -- ^ @CAL-1.0-Combined-Work-Exception@, Cryptographic Autonomy License 1.0 (Combined Work Exception), SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 - | CAL_1_0 -- ^ @CAL-1.0@, Cryptographic Autonomy License 1.0, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 - | Caldera_no_preamble -- ^ @Caldera-no-preamble@, Caldera License (without preamble), SPDX License List 3.23 + | C_UDA_1_0 -- ^ @C-UDA-1.0@, Computational Use of Data Agreement v1.0, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 + | CAL_1_0_Combined_Work_Exception -- ^ @CAL-1.0-Combined-Work-Exception@, Cryptographic Autonomy License 1.0 (Combined Work Exception), SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 + | CAL_1_0 -- ^ @CAL-1.0@, Cryptographic Autonomy License 1.0, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 + | Caldera_no_preamble -- ^ @Caldera-no-preamble@, Caldera License (without preamble), SPDX License List 3.23, SPDX License List 3.25 | Caldera -- ^ @Caldera@, Caldera License + | Catharon -- ^ @Catharon@, Catharon License, SPDX License List 3.25 | CATOSL_1_1 -- ^ @CATOSL-1.1@, Computer Associates Trusted Open Source License 1.1 | CC_BY_1_0 -- ^ @CC-BY-1.0@, Creative Commons Attribution 1.0 Generic | CC_BY_2_0 -- ^ @CC-BY-2.0@, Creative Commons Attribution 2.0 Generic - | CC_BY_2_5_AU -- ^ @CC-BY-2.5-AU@, Creative Commons Attribution 2.5 Australia, SPDX License List 3.16, SPDX License List 3.23 + | CC_BY_2_5_AU -- ^ @CC-BY-2.5-AU@, Creative Commons Attribution 2.5 Australia, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 | CC_BY_2_5 -- ^ @CC-BY-2.5@, Creative Commons Attribution 2.5 Generic - | CC_BY_3_0_AT -- ^ @CC-BY-3.0-AT@, Creative Commons Attribution 3.0 Austria, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 - | CC_BY_3_0_AU -- ^ @CC-BY-3.0-AU@, Creative Commons Attribution 3.0 Australia, SPDX License List 3.23 - | CC_BY_3_0_DE -- ^ @CC-BY-3.0-DE@, Creative Commons Attribution 3.0 Germany, SPDX License List 3.16, SPDX License List 3.23 - | CC_BY_3_0_IGO -- ^ @CC-BY-3.0-IGO@, Creative Commons Attribution 3.0 IGO, SPDX License List 3.23 - | CC_BY_3_0_NL -- ^ @CC-BY-3.0-NL@, Creative Commons Attribution 3.0 Netherlands, SPDX License List 3.16, SPDX License List 3.23 - | CC_BY_3_0_US -- ^ @CC-BY-3.0-US@, Creative Commons Attribution 3.0 United States, SPDX License List 3.16, SPDX License List 3.23 + | CC_BY_3_0_AT -- ^ @CC-BY-3.0-AT@, Creative Commons Attribution 3.0 Austria, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 + | CC_BY_3_0_AU -- ^ @CC-BY-3.0-AU@, Creative Commons Attribution 3.0 Australia, SPDX License List 3.23, SPDX License List 3.25 + | CC_BY_3_0_DE -- ^ @CC-BY-3.0-DE@, Creative Commons Attribution 3.0 Germany, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 + | CC_BY_3_0_IGO -- ^ @CC-BY-3.0-IGO@, Creative Commons Attribution 3.0 IGO, SPDX License List 3.23, SPDX License List 3.25 + | CC_BY_3_0_NL -- ^ @CC-BY-3.0-NL@, Creative Commons Attribution 3.0 Netherlands, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 + | CC_BY_3_0_US -- ^ @CC-BY-3.0-US@, Creative Commons Attribution 3.0 United States, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 | CC_BY_3_0 -- ^ @CC-BY-3.0@, Creative Commons Attribution 3.0 Unported | CC_BY_4_0 -- ^ @CC-BY-4.0@, Creative Commons Attribution 4.0 International | CC_BY_NC_1_0 -- ^ @CC-BY-NC-1.0@, Creative Commons Attribution Non Commercial 1.0 Generic | CC_BY_NC_2_0 -- ^ @CC-BY-NC-2.0@, Creative Commons Attribution Non Commercial 2.0 Generic | CC_BY_NC_2_5 -- ^ @CC-BY-NC-2.5@, Creative Commons Attribution Non Commercial 2.5 Generic - | CC_BY_NC_3_0_DE -- ^ @CC-BY-NC-3.0-DE@, Creative Commons Attribution Non Commercial 3.0 Germany, SPDX License List 3.16, SPDX License List 3.23 + | CC_BY_NC_3_0_DE -- ^ @CC-BY-NC-3.0-DE@, Creative Commons Attribution Non Commercial 3.0 Germany, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 | CC_BY_NC_3_0 -- ^ @CC-BY-NC-3.0@, Creative Commons Attribution Non Commercial 3.0 Unported | CC_BY_NC_4_0 -- ^ @CC-BY-NC-4.0@, Creative Commons Attribution Non Commercial 4.0 International | CC_BY_NC_ND_1_0 -- ^ @CC-BY-NC-ND-1.0@, Creative Commons Attribution Non Commercial No Derivatives 1.0 Generic | CC_BY_NC_ND_2_0 -- ^ @CC-BY-NC-ND-2.0@, Creative Commons Attribution Non Commercial No Derivatives 2.0 Generic | CC_BY_NC_ND_2_5 -- ^ @CC-BY-NC-ND-2.5@, Creative Commons Attribution Non Commercial No Derivatives 2.5 Generic - | CC_BY_NC_ND_3_0_DE -- ^ @CC-BY-NC-ND-3.0-DE@, Creative Commons Attribution Non Commercial No Derivatives 3.0 Germany, SPDX License List 3.16, SPDX License List 3.23 - | CC_BY_NC_ND_3_0_IGO -- ^ @CC-BY-NC-ND-3.0-IGO@, Creative Commons Attribution Non Commercial No Derivatives 3.0 IGO, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 + | CC_BY_NC_ND_3_0_DE -- ^ @CC-BY-NC-ND-3.0-DE@, Creative Commons Attribution Non Commercial No Derivatives 3.0 Germany, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 + | CC_BY_NC_ND_3_0_IGO -- ^ @CC-BY-NC-ND-3.0-IGO@, Creative Commons Attribution Non Commercial No Derivatives 3.0 IGO, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 | CC_BY_NC_ND_3_0 -- ^ @CC-BY-NC-ND-3.0@, Creative Commons Attribution Non Commercial No Derivatives 3.0 Unported | CC_BY_NC_ND_4_0 -- ^ @CC-BY-NC-ND-4.0@, Creative Commons Attribution Non Commercial No Derivatives 4.0 International | CC_BY_NC_SA_1_0 -- ^ @CC-BY-NC-SA-1.0@, Creative Commons Attribution Non Commercial Share Alike 1.0 Generic - | CC_BY_NC_SA_2_0_DE -- ^ @CC-BY-NC-SA-2.0-DE@, Creative Commons Attribution Non Commercial Share Alike 2.0 Germany, SPDX License List 3.23 - | CC_BY_NC_SA_2_0_FR -- ^ @CC-BY-NC-SA-2.0-FR@, Creative Commons Attribution-NonCommercial-ShareAlike 2.0 France, SPDX License List 3.16, SPDX License List 3.23 - | CC_BY_NC_SA_2_0_UK -- ^ @CC-BY-NC-SA-2.0-UK@, Creative Commons Attribution Non Commercial Share Alike 2.0 England and Wales, SPDX License List 3.16, SPDX License List 3.23 + | CC_BY_NC_SA_2_0_DE -- ^ @CC-BY-NC-SA-2.0-DE@, Creative Commons Attribution Non Commercial Share Alike 2.0 Germany, SPDX License List 3.23, SPDX License List 3.25 + | CC_BY_NC_SA_2_0_FR -- ^ @CC-BY-NC-SA-2.0-FR@, Creative Commons Attribution-NonCommercial-ShareAlike 2.0 France, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 + | CC_BY_NC_SA_2_0_UK -- ^ @CC-BY-NC-SA-2.0-UK@, Creative Commons Attribution Non Commercial Share Alike 2.0 England and Wales, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 | CC_BY_NC_SA_2_0 -- ^ @CC-BY-NC-SA-2.0@, Creative Commons Attribution Non Commercial Share Alike 2.0 Generic | CC_BY_NC_SA_2_5 -- ^ @CC-BY-NC-SA-2.5@, Creative Commons Attribution Non Commercial Share Alike 2.5 Generic - | CC_BY_NC_SA_3_0_DE -- ^ @CC-BY-NC-SA-3.0-DE@, Creative Commons Attribution Non Commercial Share Alike 3.0 Germany, SPDX License List 3.16, SPDX License List 3.23 - | CC_BY_NC_SA_3_0_IGO -- ^ @CC-BY-NC-SA-3.0-IGO@, Creative Commons Attribution Non Commercial Share Alike 3.0 IGO, SPDX License List 3.16, SPDX License List 3.23 + | CC_BY_NC_SA_3_0_DE -- ^ @CC-BY-NC-SA-3.0-DE@, Creative Commons Attribution Non Commercial Share Alike 3.0 Germany, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 + | CC_BY_NC_SA_3_0_IGO -- ^ @CC-BY-NC-SA-3.0-IGO@, Creative Commons Attribution Non Commercial Share Alike 3.0 IGO, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 | CC_BY_NC_SA_3_0 -- ^ @CC-BY-NC-SA-3.0@, Creative Commons Attribution Non Commercial Share Alike 3.0 Unported | CC_BY_NC_SA_4_0 -- ^ @CC-BY-NC-SA-4.0@, Creative Commons Attribution Non Commercial Share Alike 4.0 International | CC_BY_ND_1_0 -- ^ @CC-BY-ND-1.0@, Creative Commons Attribution No Derivatives 1.0 Generic | CC_BY_ND_2_0 -- ^ @CC-BY-ND-2.0@, Creative Commons Attribution No Derivatives 2.0 Generic | CC_BY_ND_2_5 -- ^ @CC-BY-ND-2.5@, Creative Commons Attribution No Derivatives 2.5 Generic - | CC_BY_ND_3_0_DE -- ^ @CC-BY-ND-3.0-DE@, Creative Commons Attribution No Derivatives 3.0 Germany, SPDX License List 3.16, SPDX License List 3.23 + | CC_BY_ND_3_0_DE -- ^ @CC-BY-ND-3.0-DE@, Creative Commons Attribution No Derivatives 3.0 Germany, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 | CC_BY_ND_3_0 -- ^ @CC-BY-ND-3.0@, Creative Commons Attribution No Derivatives 3.0 Unported | CC_BY_ND_4_0 -- ^ @CC-BY-ND-4.0@, Creative Commons Attribution No Derivatives 4.0 International | CC_BY_SA_1_0 -- ^ @CC-BY-SA-1.0@, Creative Commons Attribution Share Alike 1.0 Generic - | CC_BY_SA_2_0_UK -- ^ @CC-BY-SA-2.0-UK@, Creative Commons Attribution Share Alike 2.0 England and Wales, SPDX License List 3.16, SPDX License List 3.23 + | CC_BY_SA_2_0_UK -- ^ @CC-BY-SA-2.0-UK@, Creative Commons Attribution Share Alike 2.0 England and Wales, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 | CC_BY_SA_2_0 -- ^ @CC-BY-SA-2.0@, Creative Commons Attribution Share Alike 2.0 Generic - | CC_BY_SA_2_1_JP -- ^ @CC-BY-SA-2.1-JP@, Creative Commons Attribution Share Alike 2.1 Japan, SPDX License List 3.16, SPDX License List 3.23 + | CC_BY_SA_2_1_JP -- ^ @CC-BY-SA-2.1-JP@, Creative Commons Attribution Share Alike 2.1 Japan, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 | CC_BY_SA_2_5 -- ^ @CC-BY-SA-2.5@, Creative Commons Attribution Share Alike 2.5 Generic - | CC_BY_SA_3_0_AT -- ^ @CC-BY-SA-3.0-AT@, Creative Commons Attribution Share Alike 3.0 Austria, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 - | CC_BY_SA_3_0_DE -- ^ @CC-BY-SA-3.0-DE@, Creative Commons Attribution Share Alike 3.0 Germany, SPDX License List 3.16, SPDX License List 3.23 - | CC_BY_SA_3_0_IGO -- ^ @CC-BY-SA-3.0-IGO@, Creative Commons Attribution-ShareAlike 3.0 IGO, SPDX License List 3.23 + | CC_BY_SA_3_0_AT -- ^ @CC-BY-SA-3.0-AT@, Creative Commons Attribution Share Alike 3.0 Austria, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 + | CC_BY_SA_3_0_DE -- ^ @CC-BY-SA-3.0-DE@, Creative Commons Attribution Share Alike 3.0 Germany, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 + | CC_BY_SA_3_0_IGO -- ^ @CC-BY-SA-3.0-IGO@, Creative Commons Attribution-ShareAlike 3.0 IGO, SPDX License List 3.23, SPDX License List 3.25 | CC_BY_SA_3_0 -- ^ @CC-BY-SA-3.0@, Creative Commons Attribution Share Alike 3.0 Unported | CC_BY_SA_4_0 -- ^ @CC-BY-SA-4.0@, Creative Commons Attribution Share Alike 4.0 International - | CC_PDDC -- ^ @CC-PDDC@, Creative Commons Public Domain Dedication and Certification, SPDX License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 + | CC_PDDC -- ^ @CC-PDDC@, Creative Commons Public Domain Dedication and Certification, SPDX License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 | CC0_1_0 -- ^ @CC0-1.0@, Creative Commons Zero v1.0 Universal | CDDL_1_0 -- ^ @CDDL-1.0@, Common Development and Distribution License 1.0 | CDDL_1_1 -- ^ @CDDL-1.1@, Common Development and Distribution License 1.1 - | CDL_1_0 -- ^ @CDL-1.0@, Common Documentation License 1.0, SPDX License List 3.16, SPDX License List 3.23 + | CDL_1_0 -- ^ @CDL-1.0@, Common Documentation License 1.0, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 | CDLA_Permissive_1_0 -- ^ @CDLA-Permissive-1.0@, Community Data License Agreement Permissive 1.0 - | CDLA_Permissive_2_0 -- ^ @CDLA-Permissive-2.0@, Community Data License Agreement Permissive 2.0, SPDX License List 3.16, SPDX License List 3.23 + | CDLA_Permissive_2_0 -- ^ @CDLA-Permissive-2.0@, Community Data License Agreement Permissive 2.0, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 | CDLA_Sharing_1_0 -- ^ @CDLA-Sharing-1.0@, Community Data License Agreement Sharing 1.0 | CECILL_1_0 -- ^ @CECILL-1.0@, CeCILL Free Software License Agreement v1.0 | CECILL_1_1 -- ^ @CECILL-1.1@, CeCILL Free Software License Agreement v1.1 @@ -203,105 +208,108 @@ data LicenseId | CECILL_2_1 -- ^ @CECILL-2.1@, CeCILL Free Software License Agreement v2.1 | CECILL_B -- ^ @CECILL-B@, CeCILL-B Free Software License Agreement | CECILL_C -- ^ @CECILL-C@, CeCILL-C Free Software License Agreement - | CERN_OHL_1_1 -- ^ @CERN-OHL-1.1@, CERN Open Hardware Licence v1.1, SPDX License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 - | CERN_OHL_1_2 -- ^ @CERN-OHL-1.2@, CERN Open Hardware Licence v1.2, SPDX License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 - | CERN_OHL_P_2_0 -- ^ @CERN-OHL-P-2.0@, CERN Open Hardware Licence Version 2 - Permissive, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 - | CERN_OHL_S_2_0 -- ^ @CERN-OHL-S-2.0@, CERN Open Hardware Licence Version 2 - Strongly Reciprocal, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 - | CERN_OHL_W_2_0 -- ^ @CERN-OHL-W-2.0@, CERN Open Hardware Licence Version 2 - Weakly Reciprocal, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 - | CFITSIO -- ^ @CFITSIO@, CFITSIO License, SPDX License List 3.23 - | Check_cvs -- ^ @check-cvs@, check-cvs License, SPDX License List 3.23 - | Checkmk -- ^ @checkmk@, Checkmk License, SPDX License List 3.23 + | CERN_OHL_1_1 -- ^ @CERN-OHL-1.1@, CERN Open Hardware Licence v1.1, SPDX License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 + | CERN_OHL_1_2 -- ^ @CERN-OHL-1.2@, CERN Open Hardware Licence v1.2, SPDX License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 + | CERN_OHL_P_2_0 -- ^ @CERN-OHL-P-2.0@, CERN Open Hardware Licence Version 2 - Permissive, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 + | CERN_OHL_S_2_0 -- ^ @CERN-OHL-S-2.0@, CERN Open Hardware Licence Version 2 - Strongly Reciprocal, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 + | CERN_OHL_W_2_0 -- ^ @CERN-OHL-W-2.0@, CERN Open Hardware Licence Version 2 - Weakly Reciprocal, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 + | CFITSIO -- ^ @CFITSIO@, CFITSIO License, SPDX License List 3.23, SPDX License List 3.25 + | Check_cvs -- ^ @check-cvs@, check-cvs License, SPDX License List 3.23, SPDX License List 3.25 + | Checkmk -- ^ @checkmk@, Checkmk License, SPDX License List 3.23, SPDX License List 3.25 | ClArtistic -- ^ @ClArtistic@, Clarified Artistic License - | Clips -- ^ @Clips@, Clips License, SPDX License List 3.23 - | CMU_Mach_nodoc -- ^ @CMU-Mach-nodoc@, CMU Mach - no notices-in-documentation variant, SPDX License List 3.23 - | CMU_Mach -- ^ @CMU-Mach@, CMU Mach License, SPDX License List 3.23 + | Clips -- ^ @Clips@, Clips License, SPDX License List 3.23, SPDX License List 3.25 + | CMU_Mach_nodoc -- ^ @CMU-Mach-nodoc@, CMU Mach - no notices-in-documentation variant, SPDX License List 3.23, SPDX License List 3.25 + | CMU_Mach -- ^ @CMU-Mach@, CMU Mach License, SPDX License List 3.23, SPDX License List 3.25 | CNRI_Jython -- ^ @CNRI-Jython@, CNRI Jython License | CNRI_Python_GPL_Compatible -- ^ @CNRI-Python-GPL-Compatible@, CNRI Python Open Source GPL Compatible License Agreement | CNRI_Python -- ^ @CNRI-Python@, CNRI Python License - | COIL_1_0 -- ^ @COIL-1.0@, Copyfree Open Innovation License, SPDX License List 3.16, SPDX License List 3.23 - | Community_Spec_1_0 -- ^ @Community-Spec-1.0@, Community Specification License 1.0, SPDX License List 3.16, SPDX License List 3.23 + | COIL_1_0 -- ^ @COIL-1.0@, Copyfree Open Innovation License, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 + | Community_Spec_1_0 -- ^ @Community-Spec-1.0@, Community Specification License 1.0, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 | Condor_1_1 -- ^ @Condor-1.1@, Condor Public License v1.1 - | Copyleft_next_0_3_0 -- ^ @copyleft-next-0.3.0@, copyleft-next 0.3.0, SPDX License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 - | Copyleft_next_0_3_1 -- ^ @copyleft-next-0.3.1@, copyleft-next 0.3.1, SPDX License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 - | Cornell_Lossless_JPEG -- ^ @Cornell-Lossless-JPEG@, Cornell Lossless JPEG License, SPDX License List 3.23 + | Copyleft_next_0_3_0 -- ^ @copyleft-next-0.3.0@, copyleft-next 0.3.0, SPDX License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 + | Copyleft_next_0_3_1 -- ^ @copyleft-next-0.3.1@, copyleft-next 0.3.1, SPDX License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 + | Cornell_Lossless_JPEG -- ^ @Cornell-Lossless-JPEG@, Cornell Lossless JPEG License, SPDX License List 3.23, SPDX License List 3.25 | CPAL_1_0 -- ^ @CPAL-1.0@, Common Public Attribution License 1.0 | CPL_1_0 -- ^ @CPL-1.0@, Common Public License 1.0 | CPOL_1_02 -- ^ @CPOL-1.02@, Code Project Open License 1.02 - | Cronyx -- ^ @Cronyx@, Cronyx License, SPDX License List 3.23 + | Cronyx -- ^ @Cronyx@, Cronyx License, SPDX License List 3.23, SPDX License List 3.25 | Crossword -- ^ @Crossword@, Crossword License | CrystalStacker -- ^ @CrystalStacker@, CrystalStacker License | CUA_OPL_1_0 -- ^ @CUA-OPL-1.0@, CUA Office Public License v1.0 | Cube -- ^ @Cube@, Cube License | Curl -- ^ @curl@, curl License + | Cve_tou -- ^ @cve-tou@, Common Vulnerability Enumeration ToU License, SPDX License List 3.25 | D_FSL_1_0 -- ^ @D-FSL-1.0@, Deutsche Freie Software Lizenz - | DEC_3_Clause -- ^ @DEC-3-Clause@, DEC 3-Clause License, SPDX License List 3.23 + | DEC_3_Clause -- ^ @DEC-3-Clause@, DEC 3-Clause License, SPDX License List 3.23, SPDX License List 3.25 | Diffmark -- ^ @diffmark@, diffmark license - | DL_DE_BY_2_0 -- ^ @DL-DE-BY-2.0@, Data licence Germany – attribution – version 2.0, SPDX License List 3.16, SPDX License List 3.23 - | DL_DE_ZERO_2_0 -- ^ @DL-DE-ZERO-2.0@, Data licence Germany – zero – version 2.0, SPDX License List 3.23 + | DL_DE_BY_2_0 -- ^ @DL-DE-BY-2.0@, Data licence Germany – attribution – version 2.0, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 + | DL_DE_ZERO_2_0 -- ^ @DL-DE-ZERO-2.0@, Data licence Germany – zero – version 2.0, SPDX License List 3.23, SPDX License List 3.25 + | DocBook_Schema -- ^ @DocBook-Schema@, DocBook Schema License, SPDX License List 3.25 + | DocBook_XML -- ^ @DocBook-XML@, DocBook XML License, SPDX License List 3.25 | DOC -- ^ @DOC@, DOC License | Dotseqn -- ^ @Dotseqn@, Dotseqn License - | DRL_1_0 -- ^ @DRL-1.0@, Detection Rule License 1.0, SPDX License List 3.16, SPDX License List 3.23 - | DRL_1_1 -- ^ @DRL-1.1@, Detection Rule License 1.1, SPDX License List 3.23 + | DRL_1_0 -- ^ @DRL-1.0@, Detection Rule License 1.0, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 + | DRL_1_1 -- ^ @DRL-1.1@, Detection Rule License 1.1, SPDX License List 3.23, SPDX License List 3.25 | DSDP -- ^ @DSDP@, DSDP License - | Dtoa -- ^ @dtoa@, David M. Gay dtoa License, SPDX License List 3.23 + | Dtoa -- ^ @dtoa@, David M. Gay dtoa License, SPDX License List 3.23, SPDX License List 3.25 | Dvipdfm -- ^ @dvipdfm@, dvipdfm License | ECL_1_0 -- ^ @ECL-1.0@, Educational Community License v1.0 | ECL_2_0 -- ^ @ECL-2.0@, Educational Community License v2.0 | EFL_1_0 -- ^ @EFL-1.0@, Eiffel Forum License v1.0 | EFL_2_0 -- ^ @EFL-2.0@, Eiffel Forum License v2.0 | EGenix -- ^ @eGenix@, eGenix.com Public License 1.1.0 - | Elastic_2_0 -- ^ @Elastic-2.0@, Elastic License 2.0, SPDX License List 3.16, SPDX License List 3.23 + | Elastic_2_0 -- ^ @Elastic-2.0@, Elastic License 2.0, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 | Entessa -- ^ @Entessa@, Entessa Public License v1.0 - | EPICS -- ^ @EPICS@, EPICS Open License, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 + | EPICS -- ^ @EPICS@, EPICS Open License, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 | EPL_1_0 -- ^ @EPL-1.0@, Eclipse Public License 1.0 | EPL_2_0 -- ^ @EPL-2.0@, Eclipse Public License 2.0 | ErlPL_1_1 -- ^ @ErlPL-1.1@, Erlang Public License v1.1 - | Etalab_2_0 -- ^ @etalab-2.0@, Etalab Open License 2.0, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 + | Etalab_2_0 -- ^ @etalab-2.0@, Etalab Open License 2.0, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 | EUDatagrid -- ^ @EUDatagrid@, EU DataGrid Software License | EUPL_1_0 -- ^ @EUPL-1.0@, European Union Public License 1.0 | EUPL_1_1 -- ^ @EUPL-1.1@, European Union Public License 1.1 | EUPL_1_2 -- ^ @EUPL-1.2@, European Union Public License 1.2 | Eurosym -- ^ @Eurosym@, Eurosym License | Fair -- ^ @Fair@, Fair License - | FBM -- ^ @FBM@, Fuzzy Bitmap License, SPDX License List 3.23 - | FDK_AAC -- ^ @FDK-AAC@, Fraunhofer FDK AAC Codec Library, SPDX License List 3.16, SPDX License List 3.23 - | Ferguson_Twofish -- ^ @Ferguson-Twofish@, Ferguson Twofish License, SPDX License List 3.23 + | FBM -- ^ @FBM@, Fuzzy Bitmap License, SPDX License List 3.23, SPDX License List 3.25 + | FDK_AAC -- ^ @FDK-AAC@, Fraunhofer FDK AAC Codec Library, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 + | Ferguson_Twofish -- ^ @Ferguson-Twofish@, Ferguson Twofish License, SPDX License List 3.23, SPDX License List 3.25 | Frameworx_1_0 -- ^ @Frameworx-1.0@, Frameworx Open License 1.0 - | FreeBSD_DOC -- ^ @FreeBSD-DOC@, FreeBSD Documentation License, SPDX License List 3.16, SPDX License List 3.23 + | FreeBSD_DOC -- ^ @FreeBSD-DOC@, FreeBSD Documentation License, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 | FreeImage -- ^ @FreeImage@, FreeImage Public License v1.0 - | FSFAP_no_warranty_disclaimer -- ^ @FSFAP-no-warranty-disclaimer@, FSF All Permissive License (without Warranty), SPDX License List 3.23 + | FSFAP_no_warranty_disclaimer -- ^ @FSFAP-no-warranty-disclaimer@, FSF All Permissive License (without Warranty), SPDX License List 3.23, SPDX License List 3.25 | FSFAP -- ^ @FSFAP@, FSF All Permissive License - | FSFULLRWD -- ^ @FSFULLRWD@, FSF Unlimited License (With License Retention and Warranty Disclaimer), SPDX License List 3.23 + | FSFULLRWD -- ^ @FSFULLRWD@, FSF Unlimited License (With License Retention and Warranty Disclaimer), SPDX License List 3.23, SPDX License List 3.25 | FSFULLR -- ^ @FSFULLR@, FSF Unlimited License (with License Retention) | FSFUL -- ^ @FSFUL@, FSF Unlimited License | FTL -- ^ @FTL@, Freetype Project License - | Furuseth -- ^ @Furuseth@, Furuseth License, SPDX License List 3.23 - | Fwlw -- ^ @fwlw@, fwlw License, SPDX License List 3.23 - | GCR_docs -- ^ @GCR-docs@, Gnome GCR Documentation License, SPDX License List 3.23 - | GD -- ^ @GD@, GD License, SPDX License List 3.16, SPDX License List 3.23 - | GFDL_1_1_invariants_only -- ^ @GFDL-1.1-invariants-only@, GNU Free Documentation License v1.1 only - invariants, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 - | GFDL_1_1_invariants_or_later -- ^ @GFDL-1.1-invariants-or-later@, GNU Free Documentation License v1.1 or later - invariants, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 - | GFDL_1_1_no_invariants_only -- ^ @GFDL-1.1-no-invariants-only@, GNU Free Documentation License v1.1 only - no invariants, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 - | GFDL_1_1_no_invariants_or_later -- ^ @GFDL-1.1-no-invariants-or-later@, GNU Free Documentation License v1.1 or later - no invariants, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 + | Furuseth -- ^ @Furuseth@, Furuseth License, SPDX License List 3.23, SPDX License List 3.25 + | Fwlw -- ^ @fwlw@, fwlw License, SPDX License List 3.23, SPDX License List 3.25 + | GCR_docs -- ^ @GCR-docs@, Gnome GCR Documentation License, SPDX License List 3.23, SPDX License List 3.25 + | GD -- ^ @GD@, GD License, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 + | GFDL_1_1_invariants_only -- ^ @GFDL-1.1-invariants-only@, GNU Free Documentation License v1.1 only - invariants, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 + | GFDL_1_1_invariants_or_later -- ^ @GFDL-1.1-invariants-or-later@, GNU Free Documentation License v1.1 or later - invariants, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 + | GFDL_1_1_no_invariants_only -- ^ @GFDL-1.1-no-invariants-only@, GNU Free Documentation License v1.1 only - no invariants, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 + | GFDL_1_1_no_invariants_or_later -- ^ @GFDL-1.1-no-invariants-or-later@, GNU Free Documentation License v1.1 or later - no invariants, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 | GFDL_1_1_only -- ^ @GFDL-1.1-only@, GNU Free Documentation License v1.1 only | GFDL_1_1_or_later -- ^ @GFDL-1.1-or-later@, GNU Free Documentation License v1.1 or later - | GFDL_1_2_invariants_only -- ^ @GFDL-1.2-invariants-only@, GNU Free Documentation License v1.2 only - invariants, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 - | GFDL_1_2_invariants_or_later -- ^ @GFDL-1.2-invariants-or-later@, GNU Free Documentation License v1.2 or later - invariants, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 - | GFDL_1_2_no_invariants_only -- ^ @GFDL-1.2-no-invariants-only@, GNU Free Documentation License v1.2 only - no invariants, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 - | GFDL_1_2_no_invariants_or_later -- ^ @GFDL-1.2-no-invariants-or-later@, GNU Free Documentation License v1.2 or later - no invariants, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 + | GFDL_1_2_invariants_only -- ^ @GFDL-1.2-invariants-only@, GNU Free Documentation License v1.2 only - invariants, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 + | GFDL_1_2_invariants_or_later -- ^ @GFDL-1.2-invariants-or-later@, GNU Free Documentation License v1.2 or later - invariants, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 + | GFDL_1_2_no_invariants_only -- ^ @GFDL-1.2-no-invariants-only@, GNU Free Documentation License v1.2 only - no invariants, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 + | GFDL_1_2_no_invariants_or_later -- ^ @GFDL-1.2-no-invariants-or-later@, GNU Free Documentation License v1.2 or later - no invariants, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 | GFDL_1_2_only -- ^ @GFDL-1.2-only@, GNU Free Documentation License v1.2 only | GFDL_1_2_or_later -- ^ @GFDL-1.2-or-later@, GNU Free Documentation License v1.2 or later - | GFDL_1_3_invariants_only -- ^ @GFDL-1.3-invariants-only@, GNU Free Documentation License v1.3 only - invariants, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 - | GFDL_1_3_invariants_or_later -- ^ @GFDL-1.3-invariants-or-later@, GNU Free Documentation License v1.3 or later - invariants, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 - | GFDL_1_3_no_invariants_only -- ^ @GFDL-1.3-no-invariants-only@, GNU Free Documentation License v1.3 only - no invariants, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 - | GFDL_1_3_no_invariants_or_later -- ^ @GFDL-1.3-no-invariants-or-later@, GNU Free Documentation License v1.3 or later - no invariants, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 + | GFDL_1_3_invariants_only -- ^ @GFDL-1.3-invariants-only@, GNU Free Documentation License v1.3 only - invariants, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 + | GFDL_1_3_invariants_or_later -- ^ @GFDL-1.3-invariants-or-later@, GNU Free Documentation License v1.3 or later - invariants, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 + | GFDL_1_3_no_invariants_only -- ^ @GFDL-1.3-no-invariants-only@, GNU Free Documentation License v1.3 only - no invariants, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 + | GFDL_1_3_no_invariants_or_later -- ^ @GFDL-1.3-no-invariants-or-later@, GNU Free Documentation License v1.3 or later - no invariants, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 | GFDL_1_3_only -- ^ @GFDL-1.3-only@, GNU Free Documentation License v1.3 only | GFDL_1_3_or_later -- ^ @GFDL-1.3-or-later@, GNU Free Documentation License v1.3 or later | Giftware -- ^ @Giftware@, Giftware License | GL2PS -- ^ @GL2PS@, GL2PS License | Glide -- ^ @Glide@, 3dfx Glide License | Glulxe -- ^ @Glulxe@, Glulxe License - | GLWTPL -- ^ @GLWTPL@, Good Luck With That Public License, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 + | GLWTPL -- ^ @GLWTPL@, Good Luck With That Public License, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 | Gnuplot -- ^ @gnuplot@, gnuplot License | GPL_1_0_only -- ^ @GPL-1.0-only@, GNU General Public License v1.0 only | GPL_1_0_or_later -- ^ @GPL-1.0-or-later@, GNU General Public License v1.0 or later @@ -309,60 +317,69 @@ data LicenseId | GPL_2_0_or_later -- ^ @GPL-2.0-or-later@, GNU General Public License v2.0 or later | GPL_3_0_only -- ^ @GPL-3.0-only@, GNU General Public License v3.0 only | GPL_3_0_or_later -- ^ @GPL-3.0-or-later@, GNU General Public License v3.0 or later - | Graphics_Gems -- ^ @Graphics-Gems@, Graphics Gems License, SPDX License List 3.23 + | Graphics_Gems -- ^ @Graphics-Gems@, Graphics Gems License, SPDX License List 3.23, SPDX License List 3.25 | GSOAP_1_3b -- ^ @gSOAP-1.3b@, gSOAP Public License v1.3b - | Gtkbook -- ^ @gtkbook@, gtkbook License, SPDX License List 3.23 + | Gtkbook -- ^ @gtkbook@, gtkbook License, SPDX License List 3.23, SPDX License List 3.25 + | Gutmann -- ^ @Gutmann@, Gutmann License, SPDX License List 3.25 | HaskellReport -- ^ @HaskellReport@, Haskell Language Report License - | Hdparm -- ^ @hdparm@, hdparm License, SPDX License List 3.23 - | Hippocratic_2_1 -- ^ @Hippocratic-2.1@, Hippocratic License 2.1, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 - | HP_1986 -- ^ @HP-1986@, Hewlett-Packard 1986 License, SPDX License List 3.23 - | HP_1989 -- ^ @HP-1989@, Hewlett-Packard 1989 License, SPDX License List 3.23 - | HPND_DEC -- ^ @HPND-DEC@, Historical Permission Notice and Disclaimer - DEC variant, SPDX License List 3.23 - | HPND_doc_sell -- ^ @HPND-doc-sell@, Historical Permission Notice and Disclaimer - documentation sell variant, SPDX License List 3.23 - | HPND_doc -- ^ @HPND-doc@, Historical Permission Notice and Disclaimer - documentation variant, SPDX License List 3.23 - | HPND_export_US_modify -- ^ @HPND-export-US-modify@, HPND with US Government export control warning and modification rqmt, SPDX License List 3.23 - | HPND_export_US -- ^ @HPND-export-US@, HPND with US Government export control warning, SPDX License List 3.23 - | HPND_Fenneberg_Livingston -- ^ @HPND-Fenneberg-Livingston@, Historical Permission Notice and Disclaimer - Fenneberg-Livingston variant, SPDX License List 3.23 - | HPND_INRIA_IMAG -- ^ @HPND-INRIA-IMAG@, Historical Permission Notice and Disclaimer - INRIA-IMAG variant, SPDX License List 3.23 - | HPND_Kevlin_Henney -- ^ @HPND-Kevlin-Henney@, Historical Permission Notice and Disclaimer - Kevlin Henney variant, SPDX License List 3.23 - | HPND_Markus_Kuhn -- ^ @HPND-Markus-Kuhn@, Historical Permission Notice and Disclaimer - Markus Kuhn variant, SPDX License List 3.23 - | HPND_MIT_disclaimer -- ^ @HPND-MIT-disclaimer@, Historical Permission Notice and Disclaimer with MIT disclaimer, SPDX License List 3.23 - | HPND_Pbmplus -- ^ @HPND-Pbmplus@, Historical Permission Notice and Disclaimer - Pbmplus variant, SPDX License List 3.23 - | HPND_sell_MIT_disclaimer_xserver -- ^ @HPND-sell-MIT-disclaimer-xserver@, Historical Permission Notice and Disclaimer - sell xserver variant with MIT disclaimer, SPDX License List 3.23 - | HPND_sell_regexpr -- ^ @HPND-sell-regexpr@, Historical Permission Notice and Disclaimer - sell regexpr variant, SPDX License List 3.23 - | HPND_sell_variant_MIT_disclaimer -- ^ @HPND-sell-variant-MIT-disclaimer@, HPND sell variant with MIT disclaimer, SPDX License List 3.23 - | HPND_sell_variant -- ^ @HPND-sell-variant@, Historical Permission Notice and Disclaimer - sell variant, SPDX License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 - | HPND_UC -- ^ @HPND-UC@, Historical Permission Notice and Disclaimer - University of California variant, SPDX License List 3.23 + | Hdparm -- ^ @hdparm@, hdparm License, SPDX License List 3.23, SPDX License List 3.25 + | HIDAPI -- ^ @HIDAPI@, HIDAPI License, SPDX License List 3.25 + | Hippocratic_2_1 -- ^ @Hippocratic-2.1@, Hippocratic License 2.1, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 + | HP_1986 -- ^ @HP-1986@, Hewlett-Packard 1986 License, SPDX License List 3.23, SPDX License List 3.25 + | HP_1989 -- ^ @HP-1989@, Hewlett-Packard 1989 License, SPDX License List 3.23, SPDX License List 3.25 + | HPND_DEC -- ^ @HPND-DEC@, Historical Permission Notice and Disclaimer - DEC variant, SPDX License List 3.23, SPDX License List 3.25 + | HPND_doc_sell -- ^ @HPND-doc-sell@, Historical Permission Notice and Disclaimer - documentation sell variant, SPDX License List 3.23, SPDX License List 3.25 + | HPND_doc -- ^ @HPND-doc@, Historical Permission Notice and Disclaimer - documentation variant, SPDX License List 3.23, SPDX License List 3.25 + | HPND_export_US_acknowledgement -- ^ @HPND-export-US-acknowledgement@, HPND with US Government export control warning and acknowledgment, SPDX License List 3.25 + | HPND_export_US_modify -- ^ @HPND-export-US-modify@, HPND with US Government export control warning and modification rqmt, SPDX License List 3.23, SPDX License List 3.25 + | HPND_export_US -- ^ @HPND-export-US@, HPND with US Government export control warning, SPDX License List 3.23, SPDX License List 3.25 + | HPND_export2_US -- ^ @HPND-export2-US@, HPND with US Government export control and 2 disclaimers, SPDX License List 3.25 + | HPND_Fenneberg_Livingston -- ^ @HPND-Fenneberg-Livingston@, Historical Permission Notice and Disclaimer - Fenneberg-Livingston variant, SPDX License List 3.23, SPDX License List 3.25 + | HPND_INRIA_IMAG -- ^ @HPND-INRIA-IMAG@, Historical Permission Notice and Disclaimer - INRIA-IMAG variant, SPDX License List 3.23, SPDX License List 3.25 + | HPND_Intel -- ^ @HPND-Intel@, Historical Permission Notice and Disclaimer - Intel variant, SPDX License List 3.25 + | HPND_Kevlin_Henney -- ^ @HPND-Kevlin-Henney@, Historical Permission Notice and Disclaimer - Kevlin Henney variant, SPDX License List 3.23, SPDX License List 3.25 + | HPND_Markus_Kuhn -- ^ @HPND-Markus-Kuhn@, Historical Permission Notice and Disclaimer - Markus Kuhn variant, SPDX License List 3.23, SPDX License List 3.25 + | HPND_merchantability_variant -- ^ @HPND-merchantability-variant@, Historical Permission Notice and Disclaimer - merchantability variant, SPDX License List 3.25 + | HPND_MIT_disclaimer -- ^ @HPND-MIT-disclaimer@, Historical Permission Notice and Disclaimer with MIT disclaimer, SPDX License List 3.23, SPDX License List 3.25 + | HPND_Netrek -- ^ @HPND-Netrek@, Historical Permission Notice and Disclaimer - Netrek variant, SPDX License List 3.25 + | HPND_Pbmplus -- ^ @HPND-Pbmplus@, Historical Permission Notice and Disclaimer - Pbmplus variant, SPDX License List 3.23, SPDX License List 3.25 + | HPND_sell_MIT_disclaimer_xserver -- ^ @HPND-sell-MIT-disclaimer-xserver@, Historical Permission Notice and Disclaimer - sell xserver variant with MIT disclaimer, SPDX License List 3.23, SPDX License List 3.25 + | HPND_sell_regexpr -- ^ @HPND-sell-regexpr@, Historical Permission Notice and Disclaimer - sell regexpr variant, SPDX License List 3.23, SPDX License List 3.25 + | HPND_sell_variant_MIT_disclaimer_rev -- ^ @HPND-sell-variant-MIT-disclaimer-rev@, HPND sell variant with MIT disclaimer - reverse, SPDX License List 3.25 + | HPND_sell_variant_MIT_disclaimer -- ^ @HPND-sell-variant-MIT-disclaimer@, HPND sell variant with MIT disclaimer, SPDX License List 3.23, SPDX License List 3.25 + | HPND_sell_variant -- ^ @HPND-sell-variant@, Historical Permission Notice and Disclaimer - sell variant, SPDX License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 + | HPND_UC_export_US -- ^ @HPND-UC-export-US@, Historical Permission Notice and Disclaimer - University of California, US export warning, SPDX License List 3.25 + | HPND_UC -- ^ @HPND-UC@, Historical Permission Notice and Disclaimer - University of California variant, SPDX License List 3.23, SPDX License List 3.25 | HPND -- ^ @HPND@, Historical Permission Notice and Disclaimer - | HTMLTIDY -- ^ @HTMLTIDY@, HTML Tidy License, SPDX License List 3.16, SPDX License List 3.23 + | HTMLTIDY -- ^ @HTMLTIDY@, HTML Tidy License, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 | IBM_pibs -- ^ @IBM-pibs@, IBM PowerPC Initialization and Boot Software | ICU -- ^ @ICU@, ICU License - | IEC_Code_Components_EULA -- ^ @IEC-Code-Components-EULA@, IEC Code Components End-user licence agreement, SPDX License List 3.23 - | IJG_short -- ^ @IJG-short@, Independent JPEG Group License - short, SPDX License List 3.23 + | IEC_Code_Components_EULA -- ^ @IEC-Code-Components-EULA@, IEC Code Components End-user licence agreement, SPDX License List 3.23, SPDX License List 3.25 + | IJG_short -- ^ @IJG-short@, Independent JPEG Group License - short, SPDX License List 3.23, SPDX License List 3.25 | IJG -- ^ @IJG@, Independent JPEG Group License | ImageMagick -- ^ @ImageMagick@, ImageMagick License | IMatix -- ^ @iMatix@, iMatix Standard Function Library Agreement | Imlib2 -- ^ @Imlib2@, Imlib2 License | Info_ZIP -- ^ @Info-ZIP@, Info-ZIP License - | Inner_Net_2_0 -- ^ @Inner-Net-2.0@, Inner Net License v2.0, SPDX License List 3.23 + | Inner_Net_2_0 -- ^ @Inner-Net-2.0@, Inner Net License v2.0, SPDX License List 3.23, SPDX License List 3.25 | Intel_ACPI -- ^ @Intel-ACPI@, Intel ACPI Software License Agreement | Intel -- ^ @Intel@, Intel Open Source License | Interbase_1_0 -- ^ @Interbase-1.0@, Interbase Public License v1.0 | IPA -- ^ @IPA@, IPA Font License | IPL_1_0 -- ^ @IPL-1.0@, IBM Public License v1.0 - | ISC_Veillard -- ^ @ISC-Veillard@, ISC Veillard variant, SPDX License List 3.23 + | ISC_Veillard -- ^ @ISC-Veillard@, ISC Veillard variant, SPDX License List 3.23, SPDX License List 3.25 | ISC -- ^ @ISC@, ISC License - | Jam -- ^ @Jam@, Jam License, SPDX License List 3.16, SPDX License List 3.23 + | Jam -- ^ @Jam@, Jam License, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 | JasPer_2_0 -- ^ @JasPer-2.0@, JasPer License - | JPL_image -- ^ @JPL-image@, JPL Image Use Policy, SPDX License List 3.23 - | JPNIC -- ^ @JPNIC@, Japan Network Information Center License, SPDX License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 + | JPL_image -- ^ @JPL-image@, JPL Image Use Policy, SPDX License List 3.23, SPDX License List 3.25 + | JPNIC -- ^ @JPNIC@, Japan Network Information Center License, SPDX License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 | JSON -- ^ @JSON@, JSON License - | Kastrup -- ^ @Kastrup@, Kastrup License, SPDX License List 3.23 - | Kazlib -- ^ @Kazlib@, Kazlib License, SPDX License List 3.23 - | Knuth_CTAN -- ^ @Knuth-CTAN@, Knuth CTAN License, SPDX License List 3.23 + | Kastrup -- ^ @Kastrup@, Kastrup License, SPDX License List 3.23, SPDX License List 3.25 + | Kazlib -- ^ @Kazlib@, Kazlib License, SPDX License List 3.23, SPDX License List 3.25 + | Knuth_CTAN -- ^ @Knuth-CTAN@, Knuth CTAN License, SPDX License List 3.23, SPDX License List 3.25 | LAL_1_2 -- ^ @LAL-1.2@, Licence Art Libre 1.2 | LAL_1_3 -- ^ @LAL-1.3@, Licence Art Libre 1.3 - | Latex2e_translated_notice -- ^ @Latex2e-translated-notice@, Latex2e with translated notice permission, SPDX License List 3.23 + | Latex2e_translated_notice -- ^ @Latex2e-translated-notice@, Latex2e with translated notice permission, SPDX License List 3.23, SPDX License List 3.25 | Latex2e -- ^ @Latex2e@, Latex2e License | Leptonica -- ^ @Leptonica@, Leptonica License | LGPL_2_0_only -- ^ @LGPL-2.0-only@, GNU Library General Public License v2 only @@ -372,21 +389,21 @@ data LicenseId | LGPL_3_0_only -- ^ @LGPL-3.0-only@, GNU Lesser General Public License v3.0 only | LGPL_3_0_or_later -- ^ @LGPL-3.0-or-later@, GNU Lesser General Public License v3.0 or later | LGPLLR -- ^ @LGPLLR@, Lesser General Public License For Linguistic Resources - | Libpng_2_0 -- ^ @libpng-2.0@, PNG Reference Library version 2, SPDX License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 + | Libpng_2_0 -- ^ @libpng-2.0@, PNG Reference Library version 2, SPDX License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 | Libpng -- ^ @Libpng@, libpng License - | Libselinux_1_0 -- ^ @libselinux-1.0@, libselinux public domain notice, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 + | Libselinux_1_0 -- ^ @libselinux-1.0@, libselinux public domain notice, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 | Libtiff -- ^ @libtiff@, libtiff License - | Libutil_David_Nugent -- ^ @libutil-David-Nugent@, libutil David Nugent License, SPDX License List 3.23 + | Libutil_David_Nugent -- ^ @libutil-David-Nugent@, libutil David Nugent License, SPDX License List 3.23, SPDX License List 3.25 | LiLiQ_P_1_1 -- ^ @LiLiQ-P-1.1@, Licence Libre du Québec – Permissive version 1.1 | LiLiQ_R_1_1 -- ^ @LiLiQ-R-1.1@, Licence Libre du Québec – Réciprocité version 1.1 | LiLiQ_Rplus_1_1 -- ^ @LiLiQ-Rplus-1.1@, Licence Libre du Québec – Réciprocité forte version 1.1 - | Linux_man_pages_1_para -- ^ @Linux-man-pages-1-para@, Linux man-pages - 1 paragraph, SPDX License List 3.23 - | Linux_man_pages_copyleft_2_para -- ^ @Linux-man-pages-copyleft-2-para@, Linux man-pages Copyleft - 2 paragraphs, SPDX License List 3.23 - | Linux_man_pages_copyleft_var -- ^ @Linux-man-pages-copyleft-var@, Linux man-pages Copyleft Variant, SPDX License List 3.23 - | Linux_man_pages_copyleft -- ^ @Linux-man-pages-copyleft@, Linux man-pages Copyleft, SPDX License List 3.16, SPDX License List 3.23 - | Linux_OpenIB -- ^ @Linux-OpenIB@, Linux Kernel Variant of OpenIB.org license, SPDX License List 3.2, SPDX License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 - | LOOP -- ^ @LOOP@, Common Lisp LOOP License, SPDX License List 3.23 - | LPD_document -- ^ @LPD-document@, LPD Documentation License, SPDX License List 3.23 + | Linux_man_pages_1_para -- ^ @Linux-man-pages-1-para@, Linux man-pages - 1 paragraph, SPDX License List 3.23, SPDX License List 3.25 + | Linux_man_pages_copyleft_2_para -- ^ @Linux-man-pages-copyleft-2-para@, Linux man-pages Copyleft - 2 paragraphs, SPDX License List 3.23, SPDX License List 3.25 + | Linux_man_pages_copyleft_var -- ^ @Linux-man-pages-copyleft-var@, Linux man-pages Copyleft Variant, SPDX License List 3.23, SPDX License List 3.25 + | Linux_man_pages_copyleft -- ^ @Linux-man-pages-copyleft@, Linux man-pages Copyleft, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 + | Linux_OpenIB -- ^ @Linux-OpenIB@, Linux Kernel Variant of OpenIB.org license, SPDX License List 3.2, SPDX License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 + | LOOP -- ^ @LOOP@, Common Lisp LOOP License, SPDX License List 3.23, SPDX License List 3.25 + | LPD_document -- ^ @LPD-document@, LPD Documentation License, SPDX License List 3.23, SPDX License List 3.25 | LPL_1_02 -- ^ @LPL-1.02@, Lucent Public License v1.02 | LPL_1_0 -- ^ @LPL-1.0@, Lucent Public License Version 1.0 | LPPL_1_0 -- ^ @LPPL-1.0@, LaTeX Project Public License v1.0 @@ -394,66 +411,69 @@ data LicenseId | LPPL_1_2 -- ^ @LPPL-1.2@, LaTeX Project Public License v1.2 | LPPL_1_3a -- ^ @LPPL-1.3a@, LaTeX Project Public License v1.3a | LPPL_1_3c -- ^ @LPPL-1.3c@, LaTeX Project Public License v1.3c - | Lsof -- ^ @lsof@, lsof License, SPDX License List 3.23 - | Lucida_Bitmap_Fonts -- ^ @Lucida-Bitmap-Fonts@, Lucida Bitmap Fonts License, SPDX License List 3.23 - | LZMA_SDK_9_11_to_9_20 -- ^ @LZMA-SDK-9.11-to-9.20@, LZMA SDK License (versions 9.11 to 9.20), SPDX License List 3.23 - | LZMA_SDK_9_22 -- ^ @LZMA-SDK-9.22@, LZMA SDK License (versions 9.22 and beyond), SPDX License List 3.23 - | Mackerras_3_Clause_acknowledgment -- ^ @Mackerras-3-Clause-acknowledgment@, Mackerras 3-Clause - acknowledgment variant, SPDX License List 3.23 - | Mackerras_3_Clause -- ^ @Mackerras-3-Clause@, Mackerras 3-Clause License, SPDX License List 3.23 - | Magaz -- ^ @magaz@, magaz License, SPDX License List 3.23 - | Mailprio -- ^ @mailprio@, mailprio License, SPDX License List 3.23 + | Lsof -- ^ @lsof@, lsof License, SPDX License List 3.23, SPDX License List 3.25 + | Lucida_Bitmap_Fonts -- ^ @Lucida-Bitmap-Fonts@, Lucida Bitmap Fonts License, SPDX License List 3.23, SPDX License List 3.25 + | LZMA_SDK_9_11_to_9_20 -- ^ @LZMA-SDK-9.11-to-9.20@, LZMA SDK License (versions 9.11 to 9.20), SPDX License List 3.23, SPDX License List 3.25 + | LZMA_SDK_9_22 -- ^ @LZMA-SDK-9.22@, LZMA SDK License (versions 9.22 and beyond), SPDX License List 3.23, SPDX License List 3.25 + | Mackerras_3_Clause_acknowledgment -- ^ @Mackerras-3-Clause-acknowledgment@, Mackerras 3-Clause - acknowledgment variant, SPDX License List 3.23, SPDX License List 3.25 + | Mackerras_3_Clause -- ^ @Mackerras-3-Clause@, Mackerras 3-Clause License, SPDX License List 3.23, SPDX License List 3.25 + | Magaz -- ^ @magaz@, magaz License, SPDX License List 3.23, SPDX License List 3.25 + | Mailprio -- ^ @mailprio@, mailprio License, SPDX License List 3.23, SPDX License List 3.25 | MakeIndex -- ^ @MakeIndex@, MakeIndex License - | Martin_Birgmeier -- ^ @Martin-Birgmeier@, Martin Birgmeier License, SPDX License List 3.23 - | McPhee_slideshow -- ^ @McPhee-slideshow@, McPhee Slideshow License, SPDX License List 3.23 - | Metamail -- ^ @metamail@, metamail License, SPDX License List 3.23 - | Minpack -- ^ @Minpack@, Minpack License, SPDX License List 3.23 + | Martin_Birgmeier -- ^ @Martin-Birgmeier@, Martin Birgmeier License, SPDX License List 3.23, SPDX License List 3.25 + | McPhee_slideshow -- ^ @McPhee-slideshow@, McPhee Slideshow License, SPDX License List 3.23, SPDX License List 3.25 + | Metamail -- ^ @metamail@, metamail License, SPDX License List 3.23, SPDX License List 3.25 + | Minpack -- ^ @Minpack@, Minpack License, SPDX License List 3.23, SPDX License List 3.25 | MirOS -- ^ @MirOS@, The MirOS Licence - | MIT_0 -- ^ @MIT-0@, MIT No Attribution, SPDX License List 3.2, SPDX License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 + | MIT_0 -- ^ @MIT-0@, MIT No Attribution, SPDX License List 3.2, SPDX License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 | MIT_advertising -- ^ @MIT-advertising@, Enlightenment License (e16) | MIT_CMU -- ^ @MIT-CMU@, CMU License | MIT_enna -- ^ @MIT-enna@, enna License | MIT_feh -- ^ @MIT-feh@, feh License - | MIT_Festival -- ^ @MIT-Festival@, MIT Festival Variant, SPDX License List 3.23 - | MIT_Modern_Variant -- ^ @MIT-Modern-Variant@, MIT License Modern Variant, SPDX License List 3.16, SPDX License List 3.23 - | MIT_open_group -- ^ @MIT-open-group@, MIT Open Group variant, SPDX License List 3.16, SPDX License List 3.23 - | MIT_testregex -- ^ @MIT-testregex@, MIT testregex Variant, SPDX License List 3.23 - | MIT_Wu -- ^ @MIT-Wu@, MIT Tom Wu Variant, SPDX License List 3.23 + | MIT_Festival -- ^ @MIT-Festival@, MIT Festival Variant, SPDX License List 3.23, SPDX License List 3.25 + | MIT_Khronos_old -- ^ @MIT-Khronos-old@, MIT Khronos - old variant, SPDX License List 3.25 + | MIT_Modern_Variant -- ^ @MIT-Modern-Variant@, MIT License Modern Variant, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 + | MIT_open_group -- ^ @MIT-open-group@, MIT Open Group variant, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 + | MIT_testregex -- ^ @MIT-testregex@, MIT testregex Variant, SPDX License List 3.23, SPDX License List 3.25 + | MIT_Wu -- ^ @MIT-Wu@, MIT Tom Wu Variant, SPDX License List 3.23, SPDX License List 3.25 | MITNFA -- ^ @MITNFA@, MIT +no-false-attribs license | MIT -- ^ @MIT@, MIT License - | MMIXware -- ^ @MMIXware@, MMIXware License, SPDX License List 3.23 + | MMIXware -- ^ @MMIXware@, MMIXware License, SPDX License List 3.23, SPDX License List 3.25 | Motosoto -- ^ @Motosoto@, Motosoto License - | MPEG_SSG -- ^ @MPEG-SSG@, MPEG Software Simulation, SPDX License List 3.23 - | Mpi_permissive -- ^ @mpi-permissive@, mpi Permissive License, SPDX License List 3.23 + | MPEG_SSG -- ^ @MPEG-SSG@, MPEG Software Simulation, SPDX License List 3.23, SPDX License List 3.25 + | Mpi_permissive -- ^ @mpi-permissive@, mpi Permissive License, SPDX License List 3.23, SPDX License List 3.25 | Mpich2 -- ^ @mpich2@, mpich2 License | MPL_1_0 -- ^ @MPL-1.0@, Mozilla Public License 1.0 | MPL_1_1 -- ^ @MPL-1.1@, Mozilla Public License 1.1 | MPL_2_0_no_copyleft_exception -- ^ @MPL-2.0-no-copyleft-exception@, Mozilla Public License 2.0 (no copyleft exception) | MPL_2_0 -- ^ @MPL-2.0@, Mozilla Public License 2.0 - | Mplus -- ^ @mplus@, mplus Font License, SPDX License List 3.23 - | MS_LPL -- ^ @MS-LPL@, Microsoft Limited Public License, SPDX License List 3.23 + | Mplus -- ^ @mplus@, mplus Font License, SPDX License List 3.23, SPDX License List 3.25 + | MS_LPL -- ^ @MS-LPL@, Microsoft Limited Public License, SPDX License List 3.23, SPDX License List 3.25 | MS_PL -- ^ @MS-PL@, Microsoft Public License | MS_RL -- ^ @MS-RL@, Microsoft Reciprocal License | MTLL -- ^ @MTLL@, Matrix Template Library License - | MulanPSL_1_0 -- ^ @MulanPSL-1.0@, Mulan Permissive Software License, Version 1, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 - | MulanPSL_2_0 -- ^ @MulanPSL-2.0@, Mulan Permissive Software License, Version 2, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 + | MulanPSL_1_0 -- ^ @MulanPSL-1.0@, Mulan Permissive Software License, Version 1, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 + | MulanPSL_2_0 -- ^ @MulanPSL-2.0@, Mulan Permissive Software License, Version 2, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 | Multics -- ^ @Multics@, Multics License | Mup -- ^ @Mup@, Mup License - | NAIST_2003 -- ^ @NAIST-2003@, Nara Institute of Science and Technology License (2003), SPDX License List 3.16, SPDX License List 3.23 + | NAIST_2003 -- ^ @NAIST-2003@, Nara Institute of Science and Technology License (2003), SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 | NASA_1_3 -- ^ @NASA-1.3@, NASA Open Source Agreement 1.3 | Naumen -- ^ @Naumen@, Naumen Public License | NBPL_1_0 -- ^ @NBPL-1.0@, Net Boolean Public License v1 - | NCGL_UK_2_0 -- ^ @NCGL-UK-2.0@, Non-Commercial Government Licence, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 + | NCBI_PD -- ^ @NCBI-PD@, NCBI Public Domain Notice, SPDX License List 3.25 + | NCGL_UK_2_0 -- ^ @NCGL-UK-2.0@, Non-Commercial Government Licence, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 + | NCL -- ^ @NCL@, NCL Source Code License, SPDX License List 3.25 | NCSA -- ^ @NCSA@, University of Illinois/NCSA Open Source License - | Net_SNMP -- ^ @Net-SNMP@, Net-SNMP License + | Net_SNMP -- ^ @Net-SNMP@, Net-SNMP License, SPDX License List 3.0, SPDX License List 3.2, SPDX License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 | NetCDF -- ^ @NetCDF@, NetCDF license | Newsletr -- ^ @Newsletr@, Newsletr License | NGPL -- ^ @NGPL@, Nethack General Public License - | NICTA_1_0 -- ^ @NICTA-1.0@, NICTA Public Software License, Version 1.0, SPDX License List 3.23 - | NIST_PD_fallback -- ^ @NIST-PD-fallback@, NIST Public Domain Notice with license fallback, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 - | NIST_PD -- ^ @NIST-PD@, NIST Public Domain Notice, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 - | NIST_Software -- ^ @NIST-Software@, NIST Software License, SPDX License List 3.23 + | NICTA_1_0 -- ^ @NICTA-1.0@, NICTA Public Software License, Version 1.0, SPDX License List 3.23, SPDX License List 3.25 + | NIST_PD_fallback -- ^ @NIST-PD-fallback@, NIST Public Domain Notice with license fallback, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 + | NIST_PD -- ^ @NIST-PD@, NIST Public Domain Notice, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 + | NIST_Software -- ^ @NIST-Software@, NIST Software License, SPDX License List 3.23, SPDX License List 3.25 | NLOD_1_0 -- ^ @NLOD-1.0@, Norwegian Licence for Open Government Data (NLOD) 1.0 - | NLOD_2_0 -- ^ @NLOD-2.0@, Norwegian Licence for Open Government Data (NLOD) 2.0, SPDX License List 3.16, SPDX License List 3.23 + | NLOD_2_0 -- ^ @NLOD-2.0@, Norwegian Licence for Open Government Data (NLOD) 2.0, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 | NLPL -- ^ @NLPL@, No Limit Public License | Nokia -- ^ @Nokia@, Nokia Open Source License | NOSL -- ^ @NOSL@, Netizen Open Source License @@ -462,26 +482,27 @@ data LicenseId | NPL_1_1 -- ^ @NPL-1.1@, Netscape Public License v1.1 | NPOSL_3_0 -- ^ @NPOSL-3.0@, Non-Profit Open Software License 3.0 | NRL -- ^ @NRL@, NRL License - | NTP_0 -- ^ @NTP-0@, NTP No Attribution, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 + | NTP_0 -- ^ @NTP-0@, NTP No Attribution, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 | NTP -- ^ @NTP@, NTP License - | O_UDA_1_0 -- ^ @O-UDA-1.0@, Open Use of Data Agreement v1.0, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 + | O_UDA_1_0 -- ^ @O-UDA-1.0@, Open Use of Data Agreement v1.0, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 + | OAR -- ^ @OAR@, OAR License, SPDX License List 3.25 | OCCT_PL -- ^ @OCCT-PL@, Open CASCADE Technology Public License | OCLC_2_0 -- ^ @OCLC-2.0@, OCLC Research Public License 2.0 | ODbL_1_0 -- ^ @ODbL-1.0@, Open Data Commons Open Database License v1.0 - | ODC_By_1_0 -- ^ @ODC-By-1.0@, Open Data Commons Attribution License v1.0, SPDX License List 3.2, SPDX License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 - | OFFIS -- ^ @OFFIS@, OFFIS License, SPDX License List 3.23 - | OFL_1_0_no_RFN -- ^ @OFL-1.0-no-RFN@, SIL Open Font License 1.0 with no Reserved Font Name, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 - | OFL_1_0_RFN -- ^ @OFL-1.0-RFN@, SIL Open Font License 1.0 with Reserved Font Name, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 + | ODC_By_1_0 -- ^ @ODC-By-1.0@, Open Data Commons Attribution License v1.0, SPDX License List 3.2, SPDX License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 + | OFFIS -- ^ @OFFIS@, OFFIS License, SPDX License List 3.23, SPDX License List 3.25 + | OFL_1_0_no_RFN -- ^ @OFL-1.0-no-RFN@, SIL Open Font License 1.0 with no Reserved Font Name, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 + | OFL_1_0_RFN -- ^ @OFL-1.0-RFN@, SIL Open Font License 1.0 with Reserved Font Name, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 | OFL_1_0 -- ^ @OFL-1.0@, SIL Open Font License 1.0 - | OFL_1_1_no_RFN -- ^ @OFL-1.1-no-RFN@, SIL Open Font License 1.1 with no Reserved Font Name, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 - | OFL_1_1_RFN -- ^ @OFL-1.1-RFN@, SIL Open Font License 1.1 with Reserved Font Name, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 + | OFL_1_1_no_RFN -- ^ @OFL-1.1-no-RFN@, SIL Open Font License 1.1 with no Reserved Font Name, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 + | OFL_1_1_RFN -- ^ @OFL-1.1-RFN@, SIL Open Font License 1.1 with Reserved Font Name, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 | OFL_1_1 -- ^ @OFL-1.1@, SIL Open Font License 1.1 - | OGC_1_0 -- ^ @OGC-1.0@, OGC Software License, Version 1.0, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 - | OGDL_Taiwan_1_0 -- ^ @OGDL-Taiwan-1.0@, Taiwan Open Government Data License, version 1.0, SPDX License List 3.16, SPDX License List 3.23 - | OGL_Canada_2_0 -- ^ @OGL-Canada-2.0@, Open Government Licence - Canada, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 - | OGL_UK_1_0 -- ^ @OGL-UK-1.0@, Open Government Licence v1.0, SPDX License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 - | OGL_UK_2_0 -- ^ @OGL-UK-2.0@, Open Government Licence v2.0, SPDX License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 - | OGL_UK_3_0 -- ^ @OGL-UK-3.0@, Open Government Licence v3.0, SPDX License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 + | OGC_1_0 -- ^ @OGC-1.0@, OGC Software License, Version 1.0, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 + | OGDL_Taiwan_1_0 -- ^ @OGDL-Taiwan-1.0@, Taiwan Open Government Data License, version 1.0, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 + | OGL_Canada_2_0 -- ^ @OGL-Canada-2.0@, Open Government Licence - Canada, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 + | OGL_UK_1_0 -- ^ @OGL-UK-1.0@, Open Government Licence v1.0, SPDX License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 + | OGL_UK_2_0 -- ^ @OGL-UK-2.0@, Open Government Licence v2.0, SPDX License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 + | OGL_UK_3_0 -- ^ @OGL-UK-3.0@, Open Government Licence v3.0, SPDX License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 | OGTSL -- ^ @OGTSL@, Open Group Test Suite License | OLDAP_1_1 -- ^ @OLDAP-1.1@, Open LDAP Public License v1.1 | OLDAP_1_2 -- ^ @OLDAP-1.2@, Open LDAP Public License v1.2 @@ -499,43 +520,45 @@ data LicenseId | OLDAP_2_6 -- ^ @OLDAP-2.6@, Open LDAP Public License v2.6 | OLDAP_2_7 -- ^ @OLDAP-2.7@, Open LDAP Public License v2.7 | OLDAP_2_8 -- ^ @OLDAP-2.8@, Open LDAP Public License v2.8 - | OLFL_1_3 -- ^ @OLFL-1.3@, Open Logistics Foundation License Version 1.3, SPDX License List 3.23 + | OLFL_1_3 -- ^ @OLFL-1.3@, Open Logistics Foundation License Version 1.3, SPDX License List 3.23, SPDX License List 3.25 | OML -- ^ @OML@, Open Market License - | OpenPBS_2_3 -- ^ @OpenPBS-2.3@, OpenPBS v2.3 Software License, SPDX License List 3.23 - | OpenSSL_standalone -- ^ @OpenSSL-standalone@, OpenSSL License - standalone, SPDX License List 3.23 + | OpenPBS_2_3 -- ^ @OpenPBS-2.3@, OpenPBS v2.3 Software License, SPDX License List 3.23, SPDX License List 3.25 + | OpenSSL_standalone -- ^ @OpenSSL-standalone@, OpenSSL License - standalone, SPDX License List 3.23, SPDX License List 3.25 | OpenSSL -- ^ @OpenSSL@, OpenSSL License - | OpenVision -- ^ @OpenVision@, OpenVision License, SPDX License List 3.23 + | OpenVision -- ^ @OpenVision@, OpenVision License, SPDX License List 3.23, SPDX License List 3.25 | OPL_1_0 -- ^ @OPL-1.0@, Open Public License v1.0 - | OPL_UK_3_0 -- ^ @OPL-UK-3.0@, United Kingdom Open Parliament Licence v3.0, SPDX License List 3.23 - | OPUBL_1_0 -- ^ @OPUBL-1.0@, Open Publication License v1.0, SPDX License List 3.16, SPDX License List 3.23 + | OPL_UK_3_0 -- ^ @OPL-UK-3.0@, United Kingdom Open Parliament Licence v3.0, SPDX License List 3.23, SPDX License List 3.25 + | OPUBL_1_0 -- ^ @OPUBL-1.0@, Open Publication License v1.0, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 | OSET_PL_2_1 -- ^ @OSET-PL-2.1@, OSET Public License version 2.1 | OSL_1_0 -- ^ @OSL-1.0@, Open Software License 1.0 | OSL_1_1 -- ^ @OSL-1.1@, Open Software License 1.1 | OSL_2_0 -- ^ @OSL-2.0@, Open Software License 2.0 | OSL_2_1 -- ^ @OSL-2.1@, Open Software License 2.1 | OSL_3_0 -- ^ @OSL-3.0@, Open Software License 3.0 - | PADL -- ^ @PADL@, PADL License, SPDX License List 3.23 - | Parity_6_0_0 -- ^ @Parity-6.0.0@, The Parity Public License 6.0.0, SPDX License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 - | Parity_7_0_0 -- ^ @Parity-7.0.0@, The Parity Public License 7.0.0, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 + | PADL -- ^ @PADL@, PADL License, SPDX License List 3.23, SPDX License List 3.25 + | Parity_6_0_0 -- ^ @Parity-6.0.0@, The Parity Public License 6.0.0, SPDX License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 + | Parity_7_0_0 -- ^ @Parity-7.0.0@, The Parity Public License 7.0.0, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 | PDDL_1_0 -- ^ @PDDL-1.0@, Open Data Commons Public Domain Dedication & License 1.0 | PHP_3_01 -- ^ @PHP-3.01@, PHP License v3.01 | PHP_3_0 -- ^ @PHP-3.0@, PHP License v3.0 - | Pixar -- ^ @Pixar@, Pixar License, SPDX License List 3.23 + | Pixar -- ^ @Pixar@, Pixar License, SPDX License List 3.23, SPDX License List 3.25 + | Pkgconf -- ^ @pkgconf@, pkgconf License, SPDX License List 3.25 | Plexus -- ^ @Plexus@, Plexus Classworlds License - | Pnmstitch -- ^ @pnmstitch@, pnmstitch License, SPDX License List 3.23 - | PolyForm_Noncommercial_1_0_0 -- ^ @PolyForm-Noncommercial-1.0.0@, PolyForm Noncommercial License 1.0.0, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 - | PolyForm_Small_Business_1_0_0 -- ^ @PolyForm-Small-Business-1.0.0@, PolyForm Small Business License 1.0.0, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 + | Pnmstitch -- ^ @pnmstitch@, pnmstitch License, SPDX License List 3.23, SPDX License List 3.25 + | PolyForm_Noncommercial_1_0_0 -- ^ @PolyForm-Noncommercial-1.0.0@, PolyForm Noncommercial License 1.0.0, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 + | PolyForm_Small_Business_1_0_0 -- ^ @PolyForm-Small-Business-1.0.0@, PolyForm Small Business License 1.0.0, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 | PostgreSQL -- ^ @PostgreSQL@, PostgreSQL License - | PSF_2_0 -- ^ @PSF-2.0@, Python Software Foundation License 2.0, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 + | PPL -- ^ @PPL@, Peer Production License, SPDX License List 3.25 + | PSF_2_0 -- ^ @PSF-2.0@, Python Software Foundation License 2.0, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 | Psfrag -- ^ @psfrag@, psfrag License | Psutils -- ^ @psutils@, psutils License - | Python_2_0_1 -- ^ @Python-2.0.1@, Python License 2.0.1, SPDX License List 3.23 + | Python_2_0_1 -- ^ @Python-2.0.1@, Python License 2.0.1, SPDX License List 3.23, SPDX License List 3.25 | Python_2_0 -- ^ @Python-2.0@, Python License 2.0 - | Python_ldap -- ^ @python-ldap@, Python ldap License, SPDX License List 3.23 + | Python_ldap -- ^ @python-ldap@, Python ldap License, SPDX License List 3.23, SPDX License List 3.25 | Qhull -- ^ @Qhull@, Qhull License - | QPL_1_0_INRIA_2004 -- ^ @QPL-1.0-INRIA-2004@, Q Public License 1.0 - INRIA 2004 variant, SPDX License List 3.23 + | QPL_1_0_INRIA_2004 -- ^ @QPL-1.0-INRIA-2004@, Q Public License 1.0 - INRIA 2004 variant, SPDX License List 3.23, SPDX License List 3.25 | QPL_1_0 -- ^ @QPL-1.0@, Q Public License 1.0 - | Radvd -- ^ @radvd@, radvd License, SPDX License List 3.23 + | Radvd -- ^ @radvd@, radvd License, SPDX License List 3.23, SPDX License List 3.25 | Rdisc -- ^ @Rdisc@, Rdisc License | RHeCos_1_1 -- ^ @RHeCos-1.1@, Red Hat eCos Public License v1.1 | RPL_1_1 -- ^ @RPL-1.1@, Reciprocal Public License 1.1 @@ -543,100 +566,106 @@ data LicenseId | RPSL_1_0 -- ^ @RPSL-1.0@, RealNetworks Public Source License v1.0 | RSA_MD -- ^ @RSA-MD@, RSA Message-Digest License | RSCPL -- ^ @RSCPL@, Ricoh Source Code Public License + | Ruby_pty -- ^ @Ruby-pty@, Ruby pty extension license, SPDX License List 3.25 | Ruby -- ^ @Ruby@, Ruby License - | SAX_PD_2_0 -- ^ @SAX-PD-2.0@, Sax Public Domain Notice 2.0, SPDX License List 3.23 + | SAX_PD_2_0 -- ^ @SAX-PD-2.0@, Sax Public Domain Notice 2.0, SPDX License List 3.23, SPDX License List 3.25 | SAX_PD -- ^ @SAX-PD@, Sax Public Domain Notice | Saxpath -- ^ @Saxpath@, Saxpath License | SCEA -- ^ @SCEA@, SCEA Shared Source License - | SchemeReport -- ^ @SchemeReport@, Scheme Language Report License, SPDX License List 3.16, SPDX License List 3.23 - | Sendmail_8_23 -- ^ @Sendmail-8.23@, Sendmail License 8.23, SPDX License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 + | SchemeReport -- ^ @SchemeReport@, Scheme Language Report License, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 + | Sendmail_8_23 -- ^ @Sendmail-8.23@, Sendmail License 8.23, SPDX License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 | Sendmail -- ^ @Sendmail@, Sendmail License | SGI_B_1_0 -- ^ @SGI-B-1.0@, SGI Free Software License B v1.0 | SGI_B_1_1 -- ^ @SGI-B-1.1@, SGI Free Software License B v1.1 | SGI_B_2_0 -- ^ @SGI-B-2.0@, SGI Free Software License B v2.0 - | SGI_OpenGL -- ^ @SGI-OpenGL@, SGI OpenGL License, SPDX License List 3.23 - | SGP4 -- ^ @SGP4@, SGP4 Permission Notice, SPDX License List 3.23 - | SHL_0_51 -- ^ @SHL-0.51@, Solderpad Hardware License, Version 0.51, SPDX License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 - | SHL_0_5 -- ^ @SHL-0.5@, Solderpad Hardware License v0.5, SPDX License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 + | SGI_OpenGL -- ^ @SGI-OpenGL@, SGI OpenGL License, SPDX License List 3.23, SPDX License List 3.25 + | SGP4 -- ^ @SGP4@, SGP4 Permission Notice, SPDX License List 3.23, SPDX License List 3.25 + | SHL_0_51 -- ^ @SHL-0.51@, Solderpad Hardware License, Version 0.51, SPDX License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 + | SHL_0_5 -- ^ @SHL-0.5@, Solderpad Hardware License v0.5, SPDX License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 | SimPL_2_0 -- ^ @SimPL-2.0@, Simple Public License 2.0 | SISSL_1_2 -- ^ @SISSL-1.2@, Sun Industry Standards Source License v1.2 | SISSL -- ^ @SISSL@, Sun Industry Standards Source License v1.1 | Sleepycat -- ^ @Sleepycat@, Sleepycat License - | SL -- ^ @SL@, SL License, SPDX License List 3.23 + | SL -- ^ @SL@, SL License, SPDX License List 3.23, SPDX License List 3.25 | SMLNJ -- ^ @SMLNJ@, Standard ML of New Jersey License | SMPPL -- ^ @SMPPL@, Secure Messaging Protocol Public License | SNIA -- ^ @SNIA@, SNIA Public License 1.1 - | Snprintf -- ^ @snprintf@, snprintf License, SPDX License List 3.23 - | SoftSurfer -- ^ @softSurfer@, softSurfer License, SPDX License List 3.23 - | Soundex -- ^ @Soundex@, Soundex License, SPDX License List 3.23 + | Snprintf -- ^ @snprintf@, snprintf License, SPDX License List 3.23, SPDX License List 3.25 + | SoftSurfer -- ^ @softSurfer@, softSurfer License, SPDX License List 3.23, SPDX License List 3.25 + | Soundex -- ^ @Soundex@, Soundex License, SPDX License List 3.23, SPDX License List 3.25 | Spencer_86 -- ^ @Spencer-86@, Spencer License 86 | Spencer_94 -- ^ @Spencer-94@, Spencer License 94 | Spencer_99 -- ^ @Spencer-99@, Spencer License 99 | SPL_1_0 -- ^ @SPL-1.0@, Sun Public License v1.0 - | Ssh_keyscan -- ^ @ssh-keyscan@, ssh-keyscan License, SPDX License List 3.23 - | SSH_OpenSSH -- ^ @SSH-OpenSSH@, SSH OpenSSH license, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 - | SSH_short -- ^ @SSH-short@, SSH short notice, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 - | SSLeay_standalone -- ^ @SSLeay-standalone@, SSLeay License - standalone, SPDX License List 3.23 - | SSPL_1_0 -- ^ @SSPL-1.0@, Server Side Public License, v 1, SPDX License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 + | Ssh_keyscan -- ^ @ssh-keyscan@, ssh-keyscan License, SPDX License List 3.23, SPDX License List 3.25 + | SSH_OpenSSH -- ^ @SSH-OpenSSH@, SSH OpenSSH license, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 + | SSH_short -- ^ @SSH-short@, SSH short notice, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 + | SSLeay_standalone -- ^ @SSLeay-standalone@, SSLeay License - standalone, SPDX License List 3.23, SPDX License List 3.25 + | SSPL_1_0 -- ^ @SSPL-1.0@, Server Side Public License, v 1, SPDX License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 | SugarCRM_1_1_3 -- ^ @SugarCRM-1.1.3@, SugarCRM Public License v1.1.3 - | Sun_PPP -- ^ @Sun-PPP@, Sun PPP License, SPDX License List 3.23 - | SunPro -- ^ @SunPro@, SunPro License, SPDX License List 3.23 + | Sun_PPP_2000 -- ^ @Sun-PPP-2000@, Sun PPP License (2000), SPDX License List 3.25 + | Sun_PPP -- ^ @Sun-PPP@, Sun PPP License, SPDX License List 3.23, SPDX License List 3.25 + | SunPro -- ^ @SunPro@, SunPro License, SPDX License List 3.23, SPDX License List 3.25 | SWL -- ^ @SWL@, Scheme Widget Library (SWL) Software License Agreement - | Swrule -- ^ @swrule@, swrule License, SPDX License List 3.23 - | Symlinks -- ^ @Symlinks@, Symlinks License, SPDX License List 3.23 - | TAPR_OHL_1_0 -- ^ @TAPR-OHL-1.0@, TAPR Open Hardware License v1.0, SPDX License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 + | Swrule -- ^ @swrule@, swrule License, SPDX License List 3.23, SPDX License List 3.25 + | Symlinks -- ^ @Symlinks@, Symlinks License, SPDX License List 3.23, SPDX License List 3.25 + | TAPR_OHL_1_0 -- ^ @TAPR-OHL-1.0@, TAPR Open Hardware License v1.0, SPDX License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 | TCL -- ^ @TCL@, TCL/TK License | TCP_wrappers -- ^ @TCP-wrappers@, TCP Wrappers License - | TermReadKey -- ^ @TermReadKey@, TermReadKey License, SPDX License List 3.23 - | TGPPL_1_0 -- ^ @TGPPL-1.0@, Transitive Grace Period Public Licence 1.0, SPDX License List 3.23 + | TermReadKey -- ^ @TermReadKey@, TermReadKey License, SPDX License List 3.23, SPDX License List 3.25 + | TGPPL_1_0 -- ^ @TGPPL-1.0@, Transitive Grace Period Public Licence 1.0, SPDX License List 3.23, SPDX License List 3.25 + | Threeparttable -- ^ @threeparttable@, threeparttable License, SPDX License List 3.25 | TMate -- ^ @TMate@, TMate Open Source License | TORQUE_1_1 -- ^ @TORQUE-1.1@, TORQUE v2.5+ Software License v1.1 | TOSL -- ^ @TOSL@, Trusster Open Source License - | TPDL -- ^ @TPDL@, Time::ParseDate License, SPDX License List 3.23 - | TPL_1_0 -- ^ @TPL-1.0@, THOR Public License 1.0, SPDX License List 3.23 - | TTWL -- ^ @TTWL@, Text-Tabs+Wrap License, SPDX License List 3.23 - | TTYP0 -- ^ @TTYP0@, TTYP0 License, SPDX License List 3.23 - | TU_Berlin_1_0 -- ^ @TU-Berlin-1.0@, Technische Universitaet Berlin License 1.0, SPDX License List 3.2, SPDX License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 - | TU_Berlin_2_0 -- ^ @TU-Berlin-2.0@, Technische Universitaet Berlin License 2.0, SPDX License List 3.2, SPDX License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 - | UCAR -- ^ @UCAR@, UCAR License, SPDX License List 3.23 - | UCL_1_0 -- ^ @UCL-1.0@, Upstream Compatibility License v1.0, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23 - | Ulem -- ^ @ulem@, ulem License, SPDX License List 3.23 - | UMich_Merit -- ^ @UMich-Merit@, Michigan/Merit Networks License, SPDX License List 3.23 - | Unicode_3_0 -- ^ @Unicode-3.0@, Unicode License v3, SPDX License List 3.23 + | TPDL -- ^ @TPDL@, Time::ParseDate License, SPDX License List 3.23, SPDX License List 3.25 + | TPL_1_0 -- ^ @TPL-1.0@, THOR Public License 1.0, SPDX License List 3.23, SPDX License List 3.25 + | TTWL -- ^ @TTWL@, Text-Tabs+Wrap License, SPDX License List 3.23, SPDX License List 3.25 + | TTYP0 -- ^ @TTYP0@, TTYP0 License, SPDX License List 3.23, SPDX License List 3.25 + | TU_Berlin_1_0 -- ^ @TU-Berlin-1.0@, Technische Universitaet Berlin License 1.0, SPDX License List 3.2, SPDX License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 + | TU_Berlin_2_0 -- ^ @TU-Berlin-2.0@, Technische Universitaet Berlin License 2.0, SPDX License List 3.2, SPDX License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 + | Ubuntu_font_1_0 -- ^ @Ubuntu-font-1.0@, Ubuntu Font Licence v1.0, SPDX License List 3.25 + | UCAR -- ^ @UCAR@, UCAR License, SPDX License List 3.23, SPDX License List 3.25 + | UCL_1_0 -- ^ @UCL-1.0@, Upstream Compatibility License v1.0, SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 + | Ulem -- ^ @ulem@, ulem License, SPDX License List 3.23, SPDX License List 3.25 + | UMich_Merit -- ^ @UMich-Merit@, Michigan/Merit Networks License, SPDX License List 3.23, SPDX License List 3.25 + | Unicode_3_0 -- ^ @Unicode-3.0@, Unicode License v3, SPDX License List 3.23, SPDX License List 3.25 | Unicode_DFS_2015 -- ^ @Unicode-DFS-2015@, Unicode License Agreement - Data Files and Software (2015) | Unicode_DFS_2016 -- ^ @Unicode-DFS-2016@, Unicode License Agreement - Data Files and Software (2016) | Unicode_TOU -- ^ @Unicode-TOU@, Unicode Terms of Use - | UnixCrypt -- ^ @UnixCrypt@, UnixCrypt License, SPDX License List 3.23 + | UnixCrypt -- ^ @UnixCrypt@, UnixCrypt License, SPDX License List 3.23, SPDX License List 3.25 | Unlicense -- ^ @Unlicense@, The Unlicense | UPL_1_0 -- ^ @UPL-1.0@, Universal Permissive License v1.0 - | URT_RLE -- ^ @URT-RLE@, Utah Raster Toolkit Run Length Encoded License, SPDX License List 3.23 + | URT_RLE -- ^ @URT-RLE@, Utah Raster Toolkit Run Length Encoded License, SPDX License List 3.23, SPDX License List 3.25 | Vim -- ^ @Vim@, Vim License | VOSTROM -- ^ @VOSTROM@, VOSTROM Public License for Open Source | VSL_1_0 -- ^ @VSL-1.0@, Vovida Software License v1.0 | W3C_19980720 -- ^ @W3C-19980720@, W3C Software Notice and License (1998-07-20) | W3C_20150513 -- ^ @W3C-20150513@, W3C Software Notice and Document License (2015-05-13) | W3C -- ^ @W3C@, W3C Software Notice and License (2002-12-31) - | W3m -- ^ @w3m@, w3m License, SPDX License List 3.23 + | W3m -- ^ @w3m@, w3m License, SPDX License List 3.23, SPDX License List 3.25 | Watcom_1_0 -- ^ @Watcom-1.0@, Sybase Open Watcom Public License 1.0 - | Widget_Workshop -- ^ @Widget-Workshop@, Widget Workshop License, SPDX License List 3.23 + | Widget_Workshop -- ^ @Widget-Workshop@, Widget Workshop License, SPDX License List 3.23, SPDX License List 3.25 | Wsuipa -- ^ @Wsuipa@, Wsuipa License | WTFPL -- ^ @WTFPL@, Do What The F*ck You Want To Public License - | X11_distribute_modifications_variant -- ^ @X11-distribute-modifications-variant@, X11 License Distribution Modification Variant, SPDX License List 3.16, SPDX License List 3.23 + | X11_distribute_modifications_variant -- ^ @X11-distribute-modifications-variant@, X11 License Distribution Modification Variant, SPDX License List 3.16, SPDX License List 3.23, SPDX License List 3.25 + | X11_swapped -- ^ @X11-swapped@, X11 swapped final paragraphs, SPDX License List 3.25 | X11 -- ^ @X11@, X11 License - | Xdebug_1_03 -- ^ @Xdebug-1.03@, Xdebug License v 1.03, SPDX License List 3.23 + | Xdebug_1_03 -- ^ @Xdebug-1.03@, Xdebug License v 1.03, SPDX License List 3.23, SPDX License List 3.25 | Xerox -- ^ @Xerox@, Xerox License - | Xfig -- ^ @Xfig@, Xfig License, SPDX License List 3.23 + | Xfig -- ^ @Xfig@, Xfig License, SPDX License List 3.23, SPDX License List 3.25 | XFree86_1_1 -- ^ @XFree86-1.1@, XFree86 License 1.1 | Xinetd -- ^ @xinetd@, xinetd License - | Xkeyboard_config_Zinoviev -- ^ @xkeyboard-config-Zinoviev@, xkeyboard-config Zinoviev License, SPDX License List 3.23 - | Xlock -- ^ @xlock@, xlock License, SPDX License List 3.23 + | Xkeyboard_config_Zinoviev -- ^ @xkeyboard-config-Zinoviev@, xkeyboard-config Zinoviev License, SPDX License List 3.23, SPDX License List 3.25 + | Xlock -- ^ @xlock@, xlock License, SPDX License List 3.23, SPDX License List 3.25 | Xnet -- ^ @Xnet@, X.Net License | Xpp -- ^ @xpp@, XPP License | XSkat -- ^ @XSkat@, XSkat License + | Xzoom -- ^ @xzoom@, xzoom License, SPDX License List 3.25 | YPL_1_0 -- ^ @YPL-1.0@, Yahoo! Public License v1.0 | YPL_1_1 -- ^ @YPL-1.1@, Yahoo! Public License v1.1 | Zed -- ^ @Zed@, Zed License - | Zeeff -- ^ @Zeeff@, Zeeff License, SPDX License List 3.23 + | Zeeff -- ^ @Zeeff@, Zeeff License, SPDX License List 3.23, SPDX License List 3.25 | Zend_2_0 -- ^ @Zend-2.0@, Zend License v2.0 | Zimbra_1_3 -- ^ @Zimbra-1.3@, Zimbra Public License v1.3 | Zimbra_1_4 -- ^ @Zimbra-1.4@, Zimbra Public License v1.4 @@ -727,7 +756,8 @@ licenseIdMigrationMessage = go where -- | License SPDX identifier, e.g. @"BSD-3-Clause"@. licenseId :: LicenseId -> String -licenseId NullBSD = "0BSD" +licenseId N_0BSD = "0BSD" +licenseId N_3D_Slicer_1_0 = "3D-Slicer-1.0" licenseId AAL = "AAL" licenseId Abstyles = "Abstyles" licenseId AdaCore_doc = "AdaCore-doc" @@ -748,12 +778,14 @@ licenseId AGPL_1_0_or_later = "AGPL-1.0-or-later" licenseId AGPL_3_0_only = "AGPL-3.0-only" licenseId AGPL_3_0_or_later = "AGPL-3.0-or-later" licenseId Aladdin = "Aladdin" +licenseId AMD_newlib = "AMD-newlib" licenseId AMDPLPA = "AMDPLPA" licenseId AML_glslang = "AML-glslang" licenseId AML = "AML" licenseId AMPAS = "AMPAS" licenseId ANTLR_PD_fallback = "ANTLR-PD-fallback" licenseId ANTLR_PD = "ANTLR-PD" +licenseId Any_OSI = "any-OSI" licenseId Apache_1_0 = "Apache-1.0" licenseId Apache_1_1 = "Apache-1.1" licenseId Apache_2_0 = "Apache-2.0" @@ -790,6 +822,7 @@ licenseId BSD_1_Clause = "BSD-1-Clause" licenseId BSD_2_Clause_FreeBSD = "BSD-2-Clause-FreeBSD" licenseId BSD_2_Clause_NetBSD = "BSD-2-Clause-NetBSD" licenseId BSD_2_Clause_Darwin = "BSD-2-Clause-Darwin" +licenseId BSD_2_Clause_first_lines = "BSD-2-Clause-first-lines" licenseId BSD_2_Clause_Patent = "BSD-2-Clause-Patent" licenseId BSD_2_Clause_Views = "BSD-2-Clause-Views" licenseId BSD_2_Clause = "BSD-2-Clause" @@ -829,6 +862,7 @@ licenseId CAL_1_0_Combined_Work_Exception = "CAL-1.0-Combined-Work-Exception" licenseId CAL_1_0 = "CAL-1.0" licenseId Caldera_no_preamble = "Caldera-no-preamble" licenseId Caldera = "Caldera" +licenseId Catharon = "Catharon" licenseId CATOSL_1_1 = "CATOSL-1.1" licenseId CC_BY_1_0 = "CC-BY-1.0" licenseId CC_BY_2_0 = "CC-BY-2.0" @@ -925,11 +959,14 @@ licenseId CrystalStacker = "CrystalStacker" licenseId CUA_OPL_1_0 = "CUA-OPL-1.0" licenseId Cube = "Cube" licenseId Curl = "curl" +licenseId Cve_tou = "cve-tou" licenseId D_FSL_1_0 = "D-FSL-1.0" licenseId DEC_3_Clause = "DEC-3-Clause" licenseId Diffmark = "diffmark" licenseId DL_DE_BY_2_0 = "DL-DE-BY-2.0" licenseId DL_DE_ZERO_2_0 = "DL-DE-ZERO-2.0" +licenseId DocBook_Schema = "DocBook-Schema" +licenseId DocBook_XML = "DocBook-XML" licenseId DOC = "DOC" licenseId Dotseqn = "Dotseqn" licenseId DRL_1_0 = "DRL-1.0" @@ -1004,26 +1041,35 @@ licenseId GPL_3_0_or_later = "GPL-3.0-or-later" licenseId Graphics_Gems = "Graphics-Gems" licenseId GSOAP_1_3b = "gSOAP-1.3b" licenseId Gtkbook = "gtkbook" +licenseId Gutmann = "Gutmann" licenseId HaskellReport = "HaskellReport" licenseId Hdparm = "hdparm" +licenseId HIDAPI = "HIDAPI" licenseId Hippocratic_2_1 = "Hippocratic-2.1" licenseId HP_1986 = "HP-1986" licenseId HP_1989 = "HP-1989" licenseId HPND_DEC = "HPND-DEC" licenseId HPND_doc_sell = "HPND-doc-sell" licenseId HPND_doc = "HPND-doc" +licenseId HPND_export_US_acknowledgement = "HPND-export-US-acknowledgement" licenseId HPND_export_US_modify = "HPND-export-US-modify" licenseId HPND_export_US = "HPND-export-US" +licenseId HPND_export2_US = "HPND-export2-US" licenseId HPND_Fenneberg_Livingston = "HPND-Fenneberg-Livingston" licenseId HPND_INRIA_IMAG = "HPND-INRIA-IMAG" +licenseId HPND_Intel = "HPND-Intel" licenseId HPND_Kevlin_Henney = "HPND-Kevlin-Henney" licenseId HPND_Markus_Kuhn = "HPND-Markus-Kuhn" +licenseId HPND_merchantability_variant = "HPND-merchantability-variant" licenseId HPND_MIT_disclaimer = "HPND-MIT-disclaimer" +licenseId HPND_Netrek = "HPND-Netrek" licenseId HPND_Pbmplus = "HPND-Pbmplus" licenseId HPND_sell_MIT_disclaimer_xserver = "HPND-sell-MIT-disclaimer-xserver" licenseId HPND_sell_regexpr = "HPND-sell-regexpr" +licenseId HPND_sell_variant_MIT_disclaimer_rev = "HPND-sell-variant-MIT-disclaimer-rev" licenseId HPND_sell_variant_MIT_disclaimer = "HPND-sell-variant-MIT-disclaimer" licenseId HPND_sell_variant = "HPND-sell-variant" +licenseId HPND_UC_export_US = "HPND-UC-export-US" licenseId HPND_UC = "HPND-UC" licenseId HPND = "HPND" licenseId HTMLTIDY = "HTMLTIDY" @@ -1106,6 +1152,7 @@ licenseId MIT_CMU = "MIT-CMU" licenseId MIT_enna = "MIT-enna" licenseId MIT_feh = "MIT-feh" licenseId MIT_Festival = "MIT-Festival" +licenseId MIT_Khronos_old = "MIT-Khronos-old" licenseId MIT_Modern_Variant = "MIT-Modern-Variant" licenseId MIT_open_group = "MIT-open-group" licenseId MIT_testregex = "MIT-testregex" @@ -1134,7 +1181,9 @@ licenseId NAIST_2003 = "NAIST-2003" licenseId NASA_1_3 = "NASA-1.3" licenseId Naumen = "Naumen" licenseId NBPL_1_0 = "NBPL-1.0" +licenseId NCBI_PD = "NCBI-PD" licenseId NCGL_UK_2_0 = "NCGL-UK-2.0" +licenseId NCL = "NCL" licenseId NCSA = "NCSA" licenseId Net_SNMP = "Net-SNMP" licenseId NetCDF = "NetCDF" @@ -1157,6 +1206,7 @@ licenseId NRL = "NRL" licenseId NTP_0 = "NTP-0" licenseId NTP = "NTP" licenseId O_UDA_1_0 = "O-UDA-1.0" +licenseId OAR = "OAR" licenseId OCCT_PL = "OCCT-PL" licenseId OCLC_2_0 = "OCLC-2.0" licenseId ODbL_1_0 = "ODbL-1.0" @@ -1213,11 +1263,13 @@ licenseId PDDL_1_0 = "PDDL-1.0" licenseId PHP_3_01 = "PHP-3.01" licenseId PHP_3_0 = "PHP-3.0" licenseId Pixar = "Pixar" +licenseId Pkgconf = "pkgconf" licenseId Plexus = "Plexus" licenseId Pnmstitch = "pnmstitch" licenseId PolyForm_Noncommercial_1_0_0 = "PolyForm-Noncommercial-1.0.0" licenseId PolyForm_Small_Business_1_0_0 = "PolyForm-Small-Business-1.0.0" licenseId PostgreSQL = "PostgreSQL" +licenseId PPL = "PPL" licenseId PSF_2_0 = "PSF-2.0" licenseId Psfrag = "psfrag" licenseId Psutils = "psutils" @@ -1235,6 +1287,7 @@ licenseId RPL_1_5 = "RPL-1.5" licenseId RPSL_1_0 = "RPSL-1.0" licenseId RSA_MD = "RSA-MD" licenseId RSCPL = "RSCPL" +licenseId Ruby_pty = "Ruby-pty" licenseId Ruby = "Ruby" licenseId SAX_PD_2_0 = "SAX-PD-2.0" licenseId SAX_PD = "SAX-PD" @@ -1271,6 +1324,7 @@ licenseId SSH_short = "SSH-short" licenseId SSLeay_standalone = "SSLeay-standalone" licenseId SSPL_1_0 = "SSPL-1.0" licenseId SugarCRM_1_1_3 = "SugarCRM-1.1.3" +licenseId Sun_PPP_2000 = "Sun-PPP-2000" licenseId Sun_PPP = "Sun-PPP" licenseId SunPro = "SunPro" licenseId SWL = "SWL" @@ -1281,6 +1335,7 @@ licenseId TCL = "TCL" licenseId TCP_wrappers = "TCP-wrappers" licenseId TermReadKey = "TermReadKey" licenseId TGPPL_1_0 = "TGPPL-1.0" +licenseId Threeparttable = "threeparttable" licenseId TMate = "TMate" licenseId TORQUE_1_1 = "TORQUE-1.1" licenseId TOSL = "TOSL" @@ -1290,6 +1345,7 @@ licenseId TTWL = "TTWL" licenseId TTYP0 = "TTYP0" licenseId TU_Berlin_1_0 = "TU-Berlin-1.0" licenseId TU_Berlin_2_0 = "TU-Berlin-2.0" +licenseId Ubuntu_font_1_0 = "Ubuntu-font-1.0" licenseId UCAR = "UCAR" licenseId UCL_1_0 = "UCL-1.0" licenseId Ulem = "ulem" @@ -1314,6 +1370,7 @@ licenseId Widget_Workshop = "Widget-Workshop" licenseId Wsuipa = "Wsuipa" licenseId WTFPL = "WTFPL" licenseId X11_distribute_modifications_variant = "X11-distribute-modifications-variant" +licenseId X11_swapped = "X11-swapped" licenseId X11 = "X11" licenseId Xdebug_1_03 = "Xdebug-1.03" licenseId Xerox = "Xerox" @@ -1325,6 +1382,7 @@ licenseId Xlock = "xlock" licenseId Xnet = "Xnet" licenseId Xpp = "xpp" licenseId XSkat = "XSkat" +licenseId Xzoom = "xzoom" licenseId YPL_1_0 = "YPL-1.0" licenseId YPL_1_1 = "YPL-1.1" licenseId Zed = "Zed" @@ -1340,7 +1398,8 @@ licenseId ZPL_2_1 = "ZPL-2.1" -- | License name, e.g. @"GNU General Public License v2.0 only"@ licenseName :: LicenseId -> String -licenseName NullBSD = "BSD Zero Clause License" +licenseName N_0BSD = "BSD Zero Clause License" +licenseName N_3D_Slicer_1_0 = "3D Slicer License v1.0" licenseName AAL = "Attribution Assurance License" licenseName Abstyles = "Abstyles License" licenseName AdaCore_doc = "AdaCore Doc License" @@ -1361,12 +1420,14 @@ licenseName AGPL_1_0_or_later = "Affero General Public License v1.0 or later" licenseName AGPL_3_0_only = "GNU Affero General Public License v3.0 only" licenseName AGPL_3_0_or_later = "GNU Affero General Public License v3.0 or later" licenseName Aladdin = "Aladdin Free Public License" +licenseName AMD_newlib = "AMD newlib License" licenseName AMDPLPA = "AMD's plpa_map.c License" licenseName AML_glslang = "AML glslang variant License" licenseName AML = "Apple MIT License" licenseName AMPAS = "Academy of Motion Picture Arts and Sciences BSD" licenseName ANTLR_PD_fallback = "ANTLR Software Rights Notice with license fallback" licenseName ANTLR_PD = "ANTLR Software Rights Notice" +licenseName Any_OSI = "Any OSI License" licenseName Apache_1_0 = "Apache License 1.0" licenseName Apache_1_1 = "Apache License 1.1" licenseName Apache_2_0 = "Apache License 2.0" @@ -1403,6 +1464,7 @@ licenseName BSD_1_Clause = "BSD 1-Clause License" licenseName BSD_2_Clause_FreeBSD = "BSD 2-Clause FreeBSD License" licenseName BSD_2_Clause_NetBSD = "BSD 2-Clause NetBSD License" licenseName BSD_2_Clause_Darwin = "BSD 2-Clause - Ian Darwin variant" +licenseName BSD_2_Clause_first_lines = "BSD 2-Clause - first lines requirement" licenseName BSD_2_Clause_Patent = "BSD-2-Clause Plus Patent License" licenseName BSD_2_Clause_Views = "BSD 2-Clause with views sentence" licenseName BSD_2_Clause = "BSD 2-Clause \"Simplified\" License" @@ -1442,6 +1504,7 @@ licenseName CAL_1_0_Combined_Work_Exception = "Cryptographic Autonomy License 1. licenseName CAL_1_0 = "Cryptographic Autonomy License 1.0" licenseName Caldera_no_preamble = "Caldera License (without preamble)" licenseName Caldera = "Caldera License" +licenseName Catharon = "Catharon License" licenseName CATOSL_1_1 = "Computer Associates Trusted Open Source License 1.1" licenseName CC_BY_1_0 = "Creative Commons Attribution 1.0 Generic" licenseName CC_BY_2_0 = "Creative Commons Attribution 2.0 Generic" @@ -1538,11 +1601,14 @@ licenseName CrystalStacker = "CrystalStacker License" licenseName CUA_OPL_1_0 = "CUA Office Public License v1.0" licenseName Cube = "Cube License" licenseName Curl = "curl License" +licenseName Cve_tou = "Common Vulnerability Enumeration ToU License" licenseName D_FSL_1_0 = "Deutsche Freie Software Lizenz" licenseName DEC_3_Clause = "DEC 3-Clause License" licenseName Diffmark = "diffmark license" licenseName DL_DE_BY_2_0 = "Data licence Germany \8211 attribution \8211 version 2.0" licenseName DL_DE_ZERO_2_0 = "Data licence Germany \8211 zero \8211 version 2.0" +licenseName DocBook_Schema = "DocBook Schema License" +licenseName DocBook_XML = "DocBook XML License" licenseName DOC = "DOC License" licenseName Dotseqn = "Dotseqn License" licenseName DRL_1_0 = "Detection Rule License 1.0" @@ -1617,26 +1683,35 @@ licenseName GPL_3_0_or_later = "GNU General Public License v3.0 or later" licenseName Graphics_Gems = "Graphics Gems License" licenseName GSOAP_1_3b = "gSOAP Public License v1.3b" licenseName Gtkbook = "gtkbook License" +licenseName Gutmann = "Gutmann License" licenseName HaskellReport = "Haskell Language Report License" licenseName Hdparm = "hdparm License" +licenseName HIDAPI = "HIDAPI License" licenseName Hippocratic_2_1 = "Hippocratic License 2.1" licenseName HP_1986 = "Hewlett-Packard 1986 License" licenseName HP_1989 = "Hewlett-Packard 1989 License" licenseName HPND_DEC = "Historical Permission Notice and Disclaimer - DEC variant" licenseName HPND_doc_sell = "Historical Permission Notice and Disclaimer - documentation sell variant" licenseName HPND_doc = "Historical Permission Notice and Disclaimer - documentation variant" +licenseName HPND_export_US_acknowledgement = "HPND with US Government export control warning and acknowledgment" licenseName HPND_export_US_modify = "HPND with US Government export control warning and modification rqmt" licenseName HPND_export_US = "HPND with US Government export control warning" +licenseName HPND_export2_US = "HPND with US Government export control and 2 disclaimers" licenseName HPND_Fenneberg_Livingston = "Historical Permission Notice and Disclaimer - Fenneberg-Livingston variant" licenseName HPND_INRIA_IMAG = "Historical Permission Notice and Disclaimer - INRIA-IMAG variant" +licenseName HPND_Intel = "Historical Permission Notice and Disclaimer - Intel variant" licenseName HPND_Kevlin_Henney = "Historical Permission Notice and Disclaimer - Kevlin Henney variant" licenseName HPND_Markus_Kuhn = "Historical Permission Notice and Disclaimer - Markus Kuhn variant" +licenseName HPND_merchantability_variant = "Historical Permission Notice and Disclaimer - merchantability variant" licenseName HPND_MIT_disclaimer = "Historical Permission Notice and Disclaimer with MIT disclaimer" +licenseName HPND_Netrek = "Historical Permission Notice and Disclaimer - Netrek variant" licenseName HPND_Pbmplus = "Historical Permission Notice and Disclaimer - Pbmplus variant" licenseName HPND_sell_MIT_disclaimer_xserver = "Historical Permission Notice and Disclaimer - sell xserver variant with MIT disclaimer" licenseName HPND_sell_regexpr = "Historical Permission Notice and Disclaimer - sell regexpr variant" +licenseName HPND_sell_variant_MIT_disclaimer_rev = "HPND sell variant with MIT disclaimer - reverse" licenseName HPND_sell_variant_MIT_disclaimer = "HPND sell variant with MIT disclaimer" licenseName HPND_sell_variant = "Historical Permission Notice and Disclaimer - sell variant" +licenseName HPND_UC_export_US = "Historical Permission Notice and Disclaimer - University of California, US export warning" licenseName HPND_UC = "Historical Permission Notice and Disclaimer - University of California variant" licenseName HPND = "Historical Permission Notice and Disclaimer" licenseName HTMLTIDY = "HTML Tidy License" @@ -1719,6 +1794,7 @@ licenseName MIT_CMU = "CMU License" licenseName MIT_enna = "enna License" licenseName MIT_feh = "feh License" licenseName MIT_Festival = "MIT Festival Variant" +licenseName MIT_Khronos_old = "MIT Khronos - old variant" licenseName MIT_Modern_Variant = "MIT License Modern Variant" licenseName MIT_open_group = "MIT Open Group variant" licenseName MIT_testregex = "MIT testregex Variant" @@ -1747,7 +1823,9 @@ licenseName NAIST_2003 = "Nara Institute of Science and Technology License (2003 licenseName NASA_1_3 = "NASA Open Source Agreement 1.3" licenseName Naumen = "Naumen Public License" licenseName NBPL_1_0 = "Net Boolean Public License v1" +licenseName NCBI_PD = "NCBI Public Domain Notice" licenseName NCGL_UK_2_0 = "Non-Commercial Government Licence" +licenseName NCL = "NCL Source Code License" licenseName NCSA = "University of Illinois/NCSA Open Source License" licenseName Net_SNMP = "Net-SNMP License" licenseName NetCDF = "NetCDF license" @@ -1770,6 +1848,7 @@ licenseName NRL = "NRL License" licenseName NTP_0 = "NTP No Attribution" licenseName NTP = "NTP License" licenseName O_UDA_1_0 = "Open Use of Data Agreement v1.0" +licenseName OAR = "OAR License" licenseName OCCT_PL = "Open CASCADE Technology Public License" licenseName OCLC_2_0 = "OCLC Research Public License 2.0" licenseName ODbL_1_0 = "Open Data Commons Open Database License v1.0" @@ -1826,11 +1905,13 @@ licenseName PDDL_1_0 = "Open Data Commons Public Domain Dedication & License 1.0 licenseName PHP_3_01 = "PHP License v3.01" licenseName PHP_3_0 = "PHP License v3.0" licenseName Pixar = "Pixar License" +licenseName Pkgconf = "pkgconf License" licenseName Plexus = "Plexus Classworlds License" licenseName Pnmstitch = "pnmstitch License" licenseName PolyForm_Noncommercial_1_0_0 = "PolyForm Noncommercial License 1.0.0" licenseName PolyForm_Small_Business_1_0_0 = "PolyForm Small Business License 1.0.0" licenseName PostgreSQL = "PostgreSQL License" +licenseName PPL = "Peer Production License" licenseName PSF_2_0 = "Python Software Foundation License 2.0" licenseName Psfrag = "psfrag License" licenseName Psutils = "psutils License" @@ -1848,6 +1929,7 @@ licenseName RPL_1_5 = "Reciprocal Public License 1.5" licenseName RPSL_1_0 = "RealNetworks Public Source License v1.0" licenseName RSA_MD = "RSA Message-Digest License" licenseName RSCPL = "Ricoh Source Code Public License" +licenseName Ruby_pty = "Ruby pty extension license" licenseName Ruby = "Ruby License" licenseName SAX_PD_2_0 = "Sax Public Domain Notice 2.0" licenseName SAX_PD = "Sax Public Domain Notice" @@ -1884,6 +1966,7 @@ licenseName SSH_short = "SSH short notice" licenseName SSLeay_standalone = "SSLeay License - standalone" licenseName SSPL_1_0 = "Server Side Public License, v 1" licenseName SugarCRM_1_1_3 = "SugarCRM Public License v1.1.3" +licenseName Sun_PPP_2000 = "Sun PPP License (2000)" licenseName Sun_PPP = "Sun PPP License" licenseName SunPro = "SunPro License" licenseName SWL = "Scheme Widget Library (SWL) Software License Agreement" @@ -1894,6 +1977,7 @@ licenseName TCL = "TCL/TK License" licenseName TCP_wrappers = "TCP Wrappers License" licenseName TermReadKey = "TermReadKey License" licenseName TGPPL_1_0 = "Transitive Grace Period Public Licence 1.0" +licenseName Threeparttable = "threeparttable License" licenseName TMate = "TMate Open Source License" licenseName TORQUE_1_1 = "TORQUE v2.5+ Software License v1.1" licenseName TOSL = "Trusster Open Source License" @@ -1903,6 +1987,7 @@ licenseName TTWL = "Text-Tabs+Wrap License" licenseName TTYP0 = "TTYP0 License" licenseName TU_Berlin_1_0 = "Technische Universitaet Berlin License 1.0" licenseName TU_Berlin_2_0 = "Technische Universitaet Berlin License 2.0" +licenseName Ubuntu_font_1_0 = "Ubuntu Font Licence v1.0" licenseName UCAR = "UCAR License" licenseName UCL_1_0 = "Upstream Compatibility License v1.0" licenseName Ulem = "ulem License" @@ -1927,6 +2012,7 @@ licenseName Widget_Workshop = "Widget Workshop License" licenseName Wsuipa = "Wsuipa License" licenseName WTFPL = "Do What The F*ck You Want To Public License" licenseName X11_distribute_modifications_variant = "X11 License Distribution Modification Variant" +licenseName X11_swapped = "X11 swapped final paragraphs" licenseName X11 = "X11 License" licenseName Xdebug_1_03 = "Xdebug License v 1.03" licenseName Xerox = "Xerox License" @@ -1938,6 +2024,7 @@ licenseName Xlock = "xlock License" licenseName Xnet = "X.Net License" licenseName Xpp = "XPP License" licenseName XSkat = "XSkat License" +licenseName Xzoom = "xzoom License" licenseName YPL_1_0 = "Yahoo! Public License v1.0" licenseName YPL_1_1 = "Yahoo! Public License v1.1" licenseName Zed = "Zed License" @@ -1955,7 +2042,7 @@ licenseName ZPL_2_1 = "Zope Public License 2.1" -- -- See . licenseIsOsiApproved :: LicenseId -> Bool -licenseIsOsiApproved NullBSD = True +licenseIsOsiApproved N_0BSD = True licenseIsOsiApproved AAL = True licenseIsOsiApproved AFL_1_1 = True licenseIsOsiApproved AFL_1_2 = True @@ -2080,6 +2167,7 @@ licenseIsOsiApproved Unicode_DFS_2016 = True licenseIsOsiApproved Unlicense = True licenseIsOsiApproved UPL_1_0 = True licenseIsOsiApproved VSL_1_0 = True +licenseIsOsiApproved W3C_20150513 = True licenseIsOsiApproved W3C = True licenseIsOsiApproved Watcom_1_0 = True licenseIsOsiApproved Xnet = True @@ -2218,6 +2306,7 @@ licenseIdList LicenseListVersion_3_0 = , BSD_2_Clause_FreeBSD , BSD_2_Clause_NetBSD , Bzip2_1_0_5 + , Net_SNMP ] ++ bulkOfLicenses licenseIdList LicenseListVersion_3_2 = @@ -2228,6 +2317,7 @@ licenseIdList LicenseListVersion_3_2 = , Bzip2_1_0_5 , Linux_OpenIB , MIT_0 + , Net_SNMP , ODC_By_1_0 , TU_Berlin_1_0 , TU_Berlin_2_0 @@ -2252,6 +2342,7 @@ licenseIdList LicenseListVersion_3_6 = , Libpng_2_0 , Linux_OpenIB , MIT_0 + , Net_SNMP , ODC_By_1_0 , OGL_UK_1_0 , OGL_UK_2_0 @@ -2295,6 +2386,7 @@ licenseIdList LicenseListVersion_3_9 = , MulanPSL_1_0 , MulanPSL_2_0 , NCGL_UK_2_0 + , Net_SNMP , NTP_0 , O_UDA_1_0 , ODC_By_1_0 @@ -2370,6 +2462,7 @@ licenseIdList LicenseListVersion_3_10 = , MulanPSL_1_0 , MulanPSL_2_0 , NCGL_UK_2_0 + , Net_SNMP , NIST_PD_fallback , NIST_PD , NTP_0 @@ -2483,6 +2576,7 @@ licenseIdList LicenseListVersion_3_16 = , MulanPSL_2_0 , NAIST_2003 , NCGL_UK_2_0 + , Net_SNMP , NIST_PD_fallback , NIST_PD , NLOD_2_0 @@ -2707,6 +2801,298 @@ licenseIdList LicenseListVersion_3_23 = , MulanPSL_2_0 , NAIST_2003 , NCGL_UK_2_0 + , Net_SNMP + , NICTA_1_0 + , NIST_PD_fallback + , NIST_PD + , NIST_Software + , NLOD_2_0 + , NTP_0 + , O_UDA_1_0 + , ODC_By_1_0 + , OFFIS + , OFL_1_0_no_RFN + , OFL_1_0_RFN + , OFL_1_1_no_RFN + , OFL_1_1_RFN + , OGC_1_0 + , OGDL_Taiwan_1_0 + , OGL_Canada_2_0 + , OGL_UK_1_0 + , OGL_UK_2_0 + , OGL_UK_3_0 + , OLFL_1_3 + , OpenPBS_2_3 + , OpenSSL_standalone + , OpenVision + , OPL_UK_3_0 + , OPUBL_1_0 + , PADL + , Parity_6_0_0 + , Parity_7_0_0 + , Pixar + , Pnmstitch + , PolyForm_Noncommercial_1_0_0 + , PolyForm_Small_Business_1_0_0 + , PSF_2_0 + , Python_2_0_1 + , Python_ldap + , QPL_1_0_INRIA_2004 + , Radvd + , SAX_PD_2_0 + , SchemeReport + , Sendmail_8_23 + , SGI_OpenGL + , SGP4 + , SHL_0_51 + , SHL_0_5 + , SL + , Snprintf + , SoftSurfer + , Soundex + , Ssh_keyscan + , SSH_OpenSSH + , SSH_short + , SSLeay_standalone + , SSPL_1_0 + , Sun_PPP + , SunPro + , Swrule + , Symlinks + , TAPR_OHL_1_0 + , TermReadKey + , TGPPL_1_0 + , TPDL + , TPL_1_0 + , TTWL + , TTYP0 + , TU_Berlin_1_0 + , TU_Berlin_2_0 + , UCAR + , UCL_1_0 + , Ulem + , UMich_Merit + , Unicode_3_0 + , UnixCrypt + , URT_RLE + , W3m + , Widget_Workshop + , X11_distribute_modifications_variant + , Xdebug_1_03 + , Xfig + , Xkeyboard_config_Zinoviev + , Xlock + , Zeeff + ] + ++ bulkOfLicenses +licenseIdList LicenseListVersion_3_25 = + [ N_3D_Slicer_1_0 + , AdaCore_doc + , Adobe_Display_PostScript + , Adobe_Utopia + , AGPL_1_0_only + , AGPL_1_0_or_later + , AMD_newlib + , AML_glslang + , ANTLR_PD_fallback + , Any_OSI + , App_s2p + , Arphic_1999 + , ASWF_Digital_Assets_1_0 + , ASWF_Digital_Assets_1_1 + , Baekmuk + , Bcrypt_Solar_Designer + , Bitstream_Charter + , Bitstream_Vera + , Blessing + , BlueOak_1_0_0 + , Boehm_GC + , Brian_Gladman_2_Clause + , Brian_Gladman_3_Clause + , BSD_2_Clause_Darwin + , BSD_2_Clause_first_lines + , BSD_2_Clause_Views + , BSD_3_Clause_acpica + , BSD_3_Clause_flex + , BSD_3_Clause_HP + , BSD_3_Clause_Modification + , BSD_3_Clause_No_Military_License + , BSD_3_Clause_Open_MPI + , BSD_3_Clause_Sun + , BSD_4_Clause_Shortened + , BSD_4_3RENO + , BSD_4_3TAHOE + , BSD_Advertising_Acknowledgement + , BSD_Attribution_HPND_disclaimer + , BSD_Inferno_Nettverk + , BSD_Source_beginning_file + , BSD_Systemics_W3Works + , BSD_Systemics + , BUSL_1_1 + , C_UDA_1_0 + , CAL_1_0_Combined_Work_Exception + , CAL_1_0 + , Caldera_no_preamble + , Catharon + , CC_BY_2_5_AU + , CC_BY_3_0_AT + , CC_BY_3_0_AU + , CC_BY_3_0_DE + , CC_BY_3_0_IGO + , CC_BY_3_0_NL + , CC_BY_3_0_US + , CC_BY_NC_3_0_DE + , CC_BY_NC_ND_3_0_DE + , CC_BY_NC_ND_3_0_IGO + , CC_BY_NC_SA_2_0_DE + , CC_BY_NC_SA_2_0_FR + , CC_BY_NC_SA_2_0_UK + , CC_BY_NC_SA_3_0_DE + , CC_BY_NC_SA_3_0_IGO + , CC_BY_ND_3_0_DE + , CC_BY_SA_2_0_UK + , CC_BY_SA_2_1_JP + , CC_BY_SA_3_0_AT + , CC_BY_SA_3_0_DE + , CC_BY_SA_3_0_IGO + , CC_PDDC + , CDL_1_0 + , CDLA_Permissive_2_0 + , CERN_OHL_1_1 + , CERN_OHL_1_2 + , CERN_OHL_P_2_0 + , CERN_OHL_S_2_0 + , CERN_OHL_W_2_0 + , CFITSIO + , Check_cvs + , Checkmk + , Clips + , CMU_Mach_nodoc + , CMU_Mach + , COIL_1_0 + , Community_Spec_1_0 + , Copyleft_next_0_3_0 + , Copyleft_next_0_3_1 + , Cornell_Lossless_JPEG + , Cronyx + , Cve_tou + , DEC_3_Clause + , DL_DE_BY_2_0 + , DL_DE_ZERO_2_0 + , DocBook_Schema + , DocBook_XML + , DRL_1_0 + , DRL_1_1 + , Dtoa + , Elastic_2_0 + , EPICS + , Etalab_2_0 + , FBM + , FDK_AAC + , Ferguson_Twofish + , FreeBSD_DOC + , FSFAP_no_warranty_disclaimer + , FSFULLRWD + , Furuseth + , Fwlw + , GCR_docs + , GD + , GFDL_1_1_invariants_only + , GFDL_1_1_invariants_or_later + , GFDL_1_1_no_invariants_only + , GFDL_1_1_no_invariants_or_later + , GFDL_1_2_invariants_only + , GFDL_1_2_invariants_or_later + , GFDL_1_2_no_invariants_only + , GFDL_1_2_no_invariants_or_later + , GFDL_1_3_invariants_only + , GFDL_1_3_invariants_or_later + , GFDL_1_3_no_invariants_only + , GFDL_1_3_no_invariants_or_later + , GLWTPL + , Graphics_Gems + , Gtkbook + , Gutmann + , Hdparm + , HIDAPI + , Hippocratic_2_1 + , HP_1986 + , HP_1989 + , HPND_DEC + , HPND_doc_sell + , HPND_doc + , HPND_export_US_acknowledgement + , HPND_export_US_modify + , HPND_export_US + , HPND_export2_US + , HPND_Fenneberg_Livingston + , HPND_INRIA_IMAG + , HPND_Intel + , HPND_Kevlin_Henney + , HPND_Markus_Kuhn + , HPND_merchantability_variant + , HPND_MIT_disclaimer + , HPND_Netrek + , HPND_Pbmplus + , HPND_sell_MIT_disclaimer_xserver + , HPND_sell_regexpr + , HPND_sell_variant_MIT_disclaimer_rev + , HPND_sell_variant_MIT_disclaimer + , HPND_sell_variant + , HPND_UC_export_US + , HPND_UC + , HTMLTIDY + , IEC_Code_Components_EULA + , IJG_short + , Inner_Net_2_0 + , ISC_Veillard + , Jam + , JPL_image + , JPNIC + , Kastrup + , Kazlib + , Knuth_CTAN + , Latex2e_translated_notice + , Libpng_2_0 + , Libselinux_1_0 + , Libutil_David_Nugent + , Linux_man_pages_1_para + , Linux_man_pages_copyleft_2_para + , Linux_man_pages_copyleft_var + , Linux_man_pages_copyleft + , Linux_OpenIB + , LOOP + , LPD_document + , Lsof + , Lucida_Bitmap_Fonts + , LZMA_SDK_9_11_to_9_20 + , LZMA_SDK_9_22 + , Mackerras_3_Clause_acknowledgment + , Mackerras_3_Clause + , Magaz + , Mailprio + , Martin_Birgmeier + , McPhee_slideshow + , Metamail + , Minpack + , MIT_0 + , MIT_Festival + , MIT_Khronos_old + , MIT_Modern_Variant + , MIT_open_group + , MIT_testregex + , MIT_Wu + , MMIXware + , MPEG_SSG + , Mpi_permissive + , Mplus + , MS_LPL + , MulanPSL_1_0 + , MulanPSL_2_0 + , NAIST_2003 + , NCBI_PD + , NCGL_UK_2_0 + , NCL , NICTA_1_0 , NIST_PD_fallback , NIST_PD @@ -2714,6 +3100,7 @@ licenseIdList LicenseListVersion_3_23 = , NLOD_2_0 , NTP_0 , O_UDA_1_0 + , OAR , ODC_By_1_0 , OFFIS , OFL_1_0_no_RFN @@ -2736,14 +3123,17 @@ licenseIdList LicenseListVersion_3_23 = , Parity_6_0_0 , Parity_7_0_0 , Pixar + , Pkgconf , Pnmstitch , PolyForm_Noncommercial_1_0_0 , PolyForm_Small_Business_1_0_0 + , PPL , PSF_2_0 , Python_2_0_1 , Python_ldap , QPL_1_0_INRIA_2004 , Radvd + , Ruby_pty , SAX_PD_2_0 , SchemeReport , Sendmail_8_23 @@ -2760,6 +3150,7 @@ licenseIdList LicenseListVersion_3_23 = , SSH_short , SSLeay_standalone , SSPL_1_0 + , Sun_PPP_2000 , Sun_PPP , SunPro , Swrule @@ -2767,12 +3158,14 @@ licenseIdList LicenseListVersion_3_23 = , TAPR_OHL_1_0 , TermReadKey , TGPPL_1_0 + , Threeparttable , TPDL , TPL_1_0 , TTWL , TTYP0 , TU_Berlin_1_0 , TU_Berlin_2_0 + , Ubuntu_font_1_0 , UCAR , UCL_1_0 , Ulem @@ -2783,10 +3176,12 @@ licenseIdList LicenseListVersion_3_23 = , W3m , Widget_Workshop , X11_distribute_modifications_variant + , X11_swapped , Xdebug_1_03 , Xfig , Xkeyboard_config_Zinoviev , Xlock + , Xzoom , Zeeff ] ++ bulkOfLicenses @@ -2800,6 +3195,7 @@ mkLicenseId LicenseListVersion_3_9 s = Map.lookup s stringLookup_3_9 mkLicenseId LicenseListVersion_3_10 s = Map.lookup s stringLookup_3_10 mkLicenseId LicenseListVersion_3_16 s = Map.lookup s stringLookup_3_16 mkLicenseId LicenseListVersion_3_23 s = Map.lookup s stringLookup_3_23 +mkLicenseId LicenseListVersion_3_25 s = Map.lookup s stringLookup_3_25 stringLookup_3_0 :: Map String LicenseId stringLookup_3_0 = Map.fromList $ map (\i -> (licenseId i, i)) $ @@ -2829,10 +3225,14 @@ stringLookup_3_23 :: Map String LicenseId stringLookup_3_23 = Map.fromList $ map (\i -> (licenseId i, i)) $ licenseIdList LicenseListVersion_3_23 +stringLookup_3_25 :: Map String LicenseId +stringLookup_3_25 = Map.fromList $ map (\i -> (licenseId i, i)) $ + licenseIdList LicenseListVersion_3_25 + -- | Licenses in all SPDX License lists bulkOfLicenses :: [LicenseId] bulkOfLicenses = - [ NullBSD + [ N_0BSD , AAL , Abstyles , Adobe_2006 @@ -3050,7 +3450,6 @@ bulkOfLicenses = , Naumen , NBPL_1_0 , NCSA - , Net_SNMP , NetCDF , Newsletr , NGPL diff --git a/Cabal-syntax/src/Distribution/SPDX/LicenseListVersion.hs b/Cabal-syntax/src/Distribution/SPDX/LicenseListVersion.hs index 88280ca56f9..cf12323d275 100644 --- a/Cabal-syntax/src/Distribution/SPDX/LicenseListVersion.hs +++ b/Cabal-syntax/src/Distribution/SPDX/LicenseListVersion.hs @@ -14,10 +14,11 @@ data LicenseListVersion | LicenseListVersion_3_10 | LicenseListVersion_3_16 | LicenseListVersion_3_23 + | LicenseListVersion_3_25 deriving (Eq, Ord, Show, Enum, Bounded) cabalSpecVersionToSPDXListVersion :: CabalSpecVersion -> LicenseListVersion -cabalSpecVersionToSPDXListVersion CabalSpecV3_14 = LicenseListVersion_3_23 +cabalSpecVersionToSPDXListVersion CabalSpecV3_14 = LicenseListVersion_3_25 cabalSpecVersionToSPDXListVersion CabalSpecV3_12 = LicenseListVersion_3_23 cabalSpecVersionToSPDXListVersion CabalSpecV3_8 = LicenseListVersion_3_16 cabalSpecVersionToSPDXListVersion CabalSpecV3_6 = LicenseListVersion_3_10 diff --git a/Cabal-syntax/src/Distribution/System.hs b/Cabal-syntax/src/Distribution/System.hs index e1e75aa2315..1bf6d598d03 100644 --- a/Cabal-syntax/src/Distribution/System.hs +++ b/Cabal-syntax/src/Distribution/System.hs @@ -46,10 +46,6 @@ import Control.Applicative (Applicative (..)) import Distribution.Compat.Prelude hiding (Applicative (..)) import Prelude () -#if !MIN_VERSION_base(4,10,0) -import Control.Applicative (liftA2) -#endif - import Distribution.Utils.Generic (lowercase) import qualified System.Info (arch, os) diff --git a/Cabal-syntax/src/Distribution/Types/BuildInfo.hs b/Cabal-syntax/src/Distribution/Types/BuildInfo.hs index da1f8aea88f..680b9bf49db 100644 --- a/Cabal-syntax/src/Distribution/Types/BuildInfo.hs +++ b/Cabal-syntax/src/Distribution/Types/BuildInfo.hs @@ -12,6 +12,7 @@ module Distribution.Types.BuildInfo , hcOptions , hcProfOptions , hcSharedOptions + , hcProfSharedOptions , hcStaticOptions ) where @@ -133,6 +134,7 @@ data BuildInfo = BuildInfo , options :: PerCompilerFlavor [String] , profOptions :: PerCompilerFlavor [String] , sharedOptions :: PerCompilerFlavor [String] + , profSharedOptions :: PerCompilerFlavor [String] , staticOptions :: PerCompilerFlavor [String] , customFieldsBI :: [(String, String)] -- ^ Custom fields starting @@ -193,6 +195,7 @@ instance Monoid BuildInfo where , options = mempty , profOptions = mempty , sharedOptions = mempty + , profSharedOptions = mempty , staticOptions = mempty , customFieldsBI = [] , targetBuildDepends = [] @@ -245,6 +248,7 @@ instance Semigroup BuildInfo where , options = combine options , profOptions = combine profOptions , sharedOptions = combine sharedOptions + , profSharedOptions = combine profSharedOptions , staticOptions = combine staticOptions , customFieldsBI = combine customFieldsBI , targetBuildDepends = combineNub targetBuildDepends @@ -295,6 +299,9 @@ hcProfOptions = lookupHcOptions profOptions hcSharedOptions :: CompilerFlavor -> BuildInfo -> [String] hcSharedOptions = lookupHcOptions sharedOptions +hcProfSharedOptions :: CompilerFlavor -> BuildInfo -> [String] +hcProfSharedOptions = lookupHcOptions profSharedOptions + hcStaticOptions :: CompilerFlavor -> BuildInfo -> [String] hcStaticOptions = lookupHcOptions staticOptions diff --git a/Cabal-syntax/src/Distribution/Types/BuildInfo/Lens.hs b/Cabal-syntax/src/Distribution/Types/BuildInfo/Lens.hs index 19453a671b9..ac99f3c65a5 100644 --- a/Cabal-syntax/src/Distribution/Types/BuildInfo/Lens.hs +++ b/Cabal-syntax/src/Distribution/Types/BuildInfo/Lens.hs @@ -195,6 +195,10 @@ class HasBuildInfo a where sharedOptions = buildInfo . sharedOptions {-# INLINE sharedOptions #-} + profSharedOptions :: Lens' a (PerCompilerFlavor [String]) + profSharedOptions = buildInfo . profSharedOptions + {-# INLINE profSharedOptions #-} + staticOptions :: Lens' a (PerCompilerFlavor [String]) staticOptions = buildInfo . staticOptions {-# INLINE staticOptions #-} @@ -341,6 +345,9 @@ instance HasBuildInfo BuildInfo where sharedOptions f s = fmap (\x -> s{T.sharedOptions = x}) (f (T.sharedOptions s)) {-# INLINE sharedOptions #-} + profSharedOptions f s = fmap (\x -> s{T.profSharedOptions = x}) (f (T.profSharedOptions s)) + {-# INLINE profSharedOptions #-} + staticOptions f s = fmap (\x -> s{T.staticOptions = x}) (f (T.staticOptions s)) {-# INLINE staticOptions #-} diff --git a/Cabal-syntax/src/Distribution/Types/Dependency.hs b/Cabal-syntax/src/Distribution/Types/Dependency.hs index 10d0506b57e..a152c9e3a68 100644 --- a/Cabal-syntax/src/Distribution/Types/Dependency.hs +++ b/Cabal-syntax/src/Distribution/Types/Dependency.hs @@ -33,10 +33,6 @@ import qualified Text.PrettyPrint as PP -- -- /Invariant:/ package name does not appear as 'LSubLibName' in -- set of library names. --- --- /Note:/ 'Dependency' is not an instance of 'Ord', and so it cannot be used --- in 'Set' or as the key to a 'Map'. For these and similar use cases see --- 'DependencyMap'. data Dependency = -- | The set of libraries required from the package. -- Only the selected libraries will be built. @@ -82,31 +78,21 @@ instance NFData Dependency where rnf = genericRnf -- "pkg" -- -- >>> prettyShow $ Dependency (mkPackageName "pkg") anyVersion $ NES.insert (LSubLibName $ mkUnqualComponentName "sublib") mainLibSet --- "pkg:{pkg, sublib}" +-- "pkg:{pkg,sublib}" -- -- >>> prettyShow $ Dependency (mkPackageName "pkg") anyVersion $ NES.singleton (LSubLibName $ mkUnqualComponentName "sublib") -- "pkg:sublib" -- -- >>> prettyShow $ Dependency (mkPackageName "pkg") anyVersion $ NES.insert (LSubLibName $ mkUnqualComponentName "sublib-b") $ NES.singleton (LSubLibName $ mkUnqualComponentName "sublib-a") --- "pkg:{sublib-a, sublib-b}" +-- "pkg:{sublib-a,sublib-b}" instance Pretty Dependency where - pretty (Dependency name ver sublibs) = withSubLibs (pretty name) <+> pver + pretty (Dependency name ver sublibs) = prettyLibraryNames name (NES.toNonEmpty sublibs) <+> pver where -- TODO: change to isAnyVersion after #6736 pver | isAnyVersionLight ver = PP.empty | otherwise = pretty ver - withSubLibs doc = case NES.toList sublibs of - [LMainLibName] -> doc - [LSubLibName uq] -> doc <<>> PP.colon <<>> pretty uq - _ -> doc <<>> PP.colon <<>> PP.braces prettySublibs - - prettySublibs = PP.hsep $ PP.punctuate PP.comma $ prettySublib <$> NES.toList sublibs - - prettySublib LMainLibName = PP.text $ unPackageName name - prettySublib (LSubLibName un) = PP.text $ unUnqualComponentName un - -- | -- -- >>> simpleParsec "mylib:sub" :: Maybe Dependency diff --git a/Cabal-syntax/src/Distribution/Types/DependencySatisfaction.hs b/Cabal-syntax/src/Distribution/Types/DependencySatisfaction.hs new file mode 100644 index 00000000000..56ce74c1c45 --- /dev/null +++ b/Cabal-syntax/src/Distribution/Types/DependencySatisfaction.hs @@ -0,0 +1,14 @@ +module Distribution.Types.DependencySatisfaction + ( DependencySatisfaction (..) + ) where + +import Distribution.Types.MissingDependencyReason (MissingDependencyReason) + +-- | Whether or not a dependency constraint is satisfied. +data DependencySatisfaction + = -- | The dependency constraint is satisfied. + Satisfied + | -- | The dependency constraint is not satisfied. + -- + -- Includes a reason for explanation. + Unsatisfied MissingDependencyReason diff --git a/Cabal-syntax/src/Distribution/Types/LibraryName.hs b/Cabal-syntax/src/Distribution/Types/LibraryName.hs index 2b8f53f4f89..e31d1e82423 100644 --- a/Cabal-syntax/src/Distribution/Types/LibraryName.hs +++ b/Cabal-syntax/src/Distribution/Types/LibraryName.hs @@ -10,6 +10,7 @@ module Distribution.Types.LibraryName , libraryNameString -- * Pretty & Parse + , prettyLibraryNames , prettyLibraryNameComponent , parsecLibraryNameComponent ) where @@ -21,6 +22,7 @@ import Distribution.Parsec import Distribution.Pretty import Distribution.Types.UnqualComponentName +import qualified Data.List.NonEmpty as NEL import qualified Distribution.Compat.CharParsing as P import qualified Text.PrettyPrint as Disp @@ -42,6 +44,22 @@ prettyLibraryNameComponent :: LibraryName -> Disp.Doc prettyLibraryNameComponent LMainLibName = Disp.text "lib" prettyLibraryNameComponent (LSubLibName str) = Disp.text "lib:" <<>> pretty str +-- | Pretty print a 'LibraryName' after a package name. +-- +-- Produces output like @foo@, @foo:bar@, or @foo:{bar,baz}@ +prettyLibraryNames :: Pretty a => a -> NonEmpty LibraryName -> Disp.Doc +prettyLibraryNames package libraries = + let doc = pretty package + + prettyComponent LMainLibName = pretty package + prettyComponent (LSubLibName component) = Disp.text $ unUnqualComponentName component + + prettyComponents = commaSep $ prettyComponent <$> NEL.toList libraries + in case libraries of + LMainLibName :| [] -> doc + LSubLibName component :| [] -> doc <<>> Disp.colon <<>> pretty component + _ -> doc <<>> Disp.colon <<>> Disp.braces prettyComponents + parsecLibraryNameComponent :: CabalParsing m => m LibraryName parsecLibraryNameComponent = do _ <- P.string "lib" diff --git a/Cabal-syntax/src/Distribution/Types/MissingDependency.hs b/Cabal-syntax/src/Distribution/Types/MissingDependency.hs new file mode 100644 index 00000000000..57d90276d8c --- /dev/null +++ b/Cabal-syntax/src/Distribution/Types/MissingDependency.hs @@ -0,0 +1,34 @@ +module Distribution.Types.MissingDependency + ( MissingDependency (..) + ) where + +import Distribution.Compat.Prelude +import Distribution.Pretty +import Distribution.Types.Dependency + ( Dependency + , simplifyDependency + ) +import Distribution.Types.LibraryName + ( prettyLibraryNames + ) +import Distribution.Types.MissingDependencyReason + ( MissingDependencyReason (..) + ) + +import qualified Text.PrettyPrint as PP + +-- | A missing dependency and information on why it's missing. +data MissingDependency = MissingDependency Dependency MissingDependencyReason + deriving (Show) + +instance Pretty MissingDependency where + pretty (MissingDependency dependency reason) = + let prettyReason = + case reason of + MissingLibrary libraries -> + PP.text "missing" <+> prettyLibraryNames PP.empty libraries + MissingPackage -> PP.text "missing" + MissingComponent name -> PP.text "missing component" <+> pretty name + WrongVersion versions -> + PP.text "installed:" <+> commaSpaceSep versions + in pretty (simplifyDependency dependency) <+> PP.parens prettyReason diff --git a/Cabal-syntax/src/Distribution/Types/MissingDependencyReason.hs b/Cabal-syntax/src/Distribution/Types/MissingDependencyReason.hs new file mode 100644 index 00000000000..c1c37800f21 --- /dev/null +++ b/Cabal-syntax/src/Distribution/Types/MissingDependencyReason.hs @@ -0,0 +1,25 @@ +module Distribution.Types.MissingDependencyReason + ( MissingDependencyReason (..) + ) where + +import Data.List.NonEmpty (NonEmpty) +import Distribution.Types.LibraryName (LibraryName) +import Distribution.Types.PackageName (PackageName) +import Distribution.Types.Version (Version) + +-- | A reason for a depency failing to solve. +-- +-- This helps pinpoint dependencies that are installed with an incorrect +-- version vs. dependencies that are not installed at all. +data MissingDependencyReason + = -- | One or more libraries is missing. + MissingLibrary (NonEmpty LibraryName) + | -- | A package is not installed. + MissingPackage + | -- | A package is installed, but the versions don't match. + -- + -- Contains the available versions. + WrongVersion [Version] + | -- | A component is not installed. + MissingComponent PackageName + deriving (Show) diff --git a/Cabal-syntax/src/Distribution/Types/PackageDescription.hs b/Cabal-syntax/src/Distribution/Types/PackageDescription.hs index a3f1d0c33da..5e64694ac1f 100644 --- a/Cabal-syntax/src/Distribution/Types/PackageDescription.hs +++ b/Cabal-syntax/src/Distribution/Types/PackageDescription.hs @@ -149,6 +149,7 @@ data PackageDescription = PackageDescription , extraSrcFiles :: [RelativePath Pkg File] , extraTmpFiles :: [RelativePath Pkg File] , extraDocFiles :: [RelativePath Pkg File] + , extraFiles :: [RelativePath Pkg File] } deriving (Generic, Show, Read, Eq, Ord, Typeable, Data) @@ -235,6 +236,7 @@ emptyPackageDescription = , extraSrcFiles = [] , extraTmpFiles = [] , extraDocFiles = [] + , extraFiles = [] } -- --------------------------------------------------------------------------- @@ -491,6 +493,7 @@ instance L.HasBuildInfos PackageDescription where a22 a23 a24 + a25 ) = PackageDescription a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a17 a18 a19 <$> (traverse . L.buildInfo) f x1 -- library @@ -504,3 +507,4 @@ instance L.HasBuildInfos PackageDescription where <*> pure a22 -- extra src files <*> pure a23 -- extra temp files <*> pure a24 -- extra doc files + <*> pure a25 -- extra files diff --git a/Cabal-syntax/src/Distribution/Types/PackageDescription/Lens.hs b/Cabal-syntax/src/Distribution/Types/PackageDescription/Lens.hs index 201b10d859f..5d91e32492c 100644 --- a/Cabal-syntax/src/Distribution/Types/PackageDescription/Lens.hs +++ b/Cabal-syntax/src/Distribution/Types/PackageDescription/Lens.hs @@ -159,6 +159,10 @@ extraDocFiles :: Lens' PackageDescription [RelativePath Pkg File] extraDocFiles f s = fmap (\x -> s{T.extraDocFiles = x}) (f (T.extraDocFiles s)) {-# INLINE extraDocFiles #-} +extraFiles :: Lens' PackageDescription [RelativePath Pkg File] +extraFiles f s = fmap (\x -> s{T.extraFiles = x}) (f (T.extraFiles s)) +{-# INLINE extraFiles #-} + -- | @since 3.0.0.0 allLibraries :: Traversal' PackageDescription Library allLibraries f pd = mk <$> traverse f (T.library pd) <*> traverse f (T.subLibraries pd) diff --git a/Cabal-syntax/src/Distribution/Utils/Generic.hs b/Cabal-syntax/src/Distribution/Utils/Generic.hs index 997e0132f5a..ca48c8e820a 100644 --- a/Cabal-syntax/src/Distribution/Utils/Generic.hs +++ b/Cabal-syntax/src/Distribution/Utils/Generic.hs @@ -100,11 +100,13 @@ import qualified Data.Set as Set import qualified Control.Exception as Exception import System.Directory - ( removeFile + ( copyFile + , getTemporaryDirectory + , removeFile , renameFile ) import System.FilePath - ( splitFileName + ( takeFileName , (<.>) ) import System.IO @@ -153,8 +155,8 @@ wrapLine width = wrap 0 [] -- | Gets the contents of a file, but guarantee that it gets closed. -- --- The file is read lazily but if it is not fully consumed by the action then --- the remaining input is truncated and the file is closed. +-- The file is read lazily; if it is not fully consumed by the action then an +-- exception is thrown. withFileContents :: FilePath -> (String -> IO a) -> IO a withFileContents name action = withFile @@ -167,18 +169,38 @@ withFileContents name action = -- The file is either written successfully or an IO exception is raised and -- the original file is left unchanged. -- --- On windows it is not possible to delete a file that is open by a process. --- This case will give an IO exception but the atomic property is not affected. +-- On Unix: +-- +-- - If the temp directory (@$TMPDIR@) is in a filesystem different than the +-- destination path, the renaming will be emulated via 'copyFile' then +-- 'deleteFile'. +-- +-- On Windows: +-- +-- - This operation is not guaranteed to be atomic, see 'renameFile'. +-- +-- - It is not possible to delete a file that is open by a process. This case +-- will give an IO exception but the atomic property is not affected. +-- +-- - If the temp directory (@TMP@/@TEMP@/..., see haddocks on +-- 'getTemporaryDirectory') is in a different drive than the destination path, +-- the write will be emulated via 'copyFile', then 'deleteFile'. writeFileAtomic :: FilePath -> LBS.ByteString -> IO () writeFileAtomic targetPath content = do - let (targetDir, targetFile) = splitFileName targetPath + let targetFile = takeFileName targetPath + tmpDir <- getTemporaryDirectory Exception.bracketOnError - (openBinaryTempFileWithDefaultPermissions targetDir $ targetFile <.> "tmp") + (openBinaryTempFileWithDefaultPermissions tmpDir $ targetFile <.> "tmp") (\(tmpPath, handle) -> hClose handle >> removeFile tmpPath) ( \(tmpPath, handle) -> do LBS.hPut handle content hClose handle - renameFile tmpPath targetPath + Exception.catch + (renameFile tmpPath targetPath) + ( \(_ :: Exception.SomeException) -> do + copyFile tmpPath targetPath + removeFile tmpPath + ) ) -- ------------------------------------------------------------ diff --git a/Cabal-syntax/src/Distribution/Utils/Path.hs b/Cabal-syntax/src/Distribution/Utils/Path.hs index 765b0ac6143..0e1c7c191e4 100644 --- a/Cabal-syntax/src/Distribution/Utils/Path.hs +++ b/Cabal-syntax/src/Distribution/Utils/Path.hs @@ -30,14 +30,17 @@ module Distribution.Utils.Path , Tix , Tmp , Response + , PkgConf -- * Symbolic paths , RelativePath , SymbolicPath + , AbsolutePath (..) , SymbolicPathX -- NB: constructor not exposed, to retain type safety. -- ** Symbolic path API , getSymbolicPath + , getAbsolutePath , sameDirectory , makeRelativePathEx , makeSymbolicPath @@ -47,6 +50,7 @@ module Distribution.Utils.Path , relativeSymbolicPath , symbolicPathRelative_maybe , interpretSymbolicPath + , interpretSymbolicPathAbsolute -- ** General filepath API , () @@ -59,7 +63,7 @@ module Distribution.Utils.Path -- ** Working directory handling , interpretSymbolicPathCWD , absoluteWorkingDir - , tryMakeRelativeToWorkingDir + , tryMakeRelative -- ** Module names , moduleNameSymbolicPath @@ -214,6 +218,11 @@ type RelativePath = SymbolicPathX 'OnlyRelative -- until we interpret them (using e.g. 'interpretSymbolicPath'). type SymbolicPath = SymbolicPathX 'AllowAbsolute +newtype AbsolutePath (to :: FileOrDir) = AbsolutePath (forall from. SymbolicPath from to) + +unsafeMakeAbsolutePath :: FilePath -> AbsolutePath to +unsafeMakeAbsolutePath fp = AbsolutePath (makeSymbolicPath fp) + instance Binary (SymbolicPathX allowAbsolute from to) instance (Typeable allowAbsolute, Typeable from, Typeable to) @@ -289,7 +298,7 @@ moduleNameSymbolicPath modNm = SymbolicPath $ ModuleName.toFilePath modNm -- (because the program might expect certain paths to be relative). -- -- See Note [Symbolic paths] in Distribution.Utils.Path. -interpretSymbolicPath :: Maybe (SymbolicPath CWD (Dir Pkg)) -> SymbolicPathX allowAbsolute Pkg to -> FilePath +interpretSymbolicPath :: Maybe (SymbolicPath CWD (Dir from)) -> SymbolicPathX allowAbsolute from to -> FilePath interpretSymbolicPath mbWorkDir (SymbolicPath p) = -- Note that this properly handles an absolute symbolic path, -- because if @q@ is absolute, then @p q = q@. @@ -316,9 +325,15 @@ interpretSymbolicPath mbWorkDir (SymbolicPath p) = -- appropriate to use 'interpretSymbolicPathCWD' to provide its arguments. -- -- See Note [Symbolic paths] in Distribution.Utils.Path. -interpretSymbolicPathCWD :: SymbolicPathX allowAbsolute Pkg to -> FilePath +interpretSymbolicPathCWD :: SymbolicPathX allowAbsolute from to -> FilePath interpretSymbolicPathCWD (SymbolicPath p) = p +getAbsolutePath :: AbsolutePath to -> FilePath +getAbsolutePath (AbsolutePath p) = getSymbolicPath p + +interpretSymbolicPathAbsolute :: AbsolutePath (Dir Pkg) -> SymbolicPathX allowAbsolute Pkg to -> FilePath +interpretSymbolicPathAbsolute (AbsolutePath p) sym = interpretSymbolicPath (Just p) sym + -- | Change what a symbolic path is pointing to. coerceSymbolicPath :: SymbolicPathX allowAbsolute from to1 -> SymbolicPathX allowAbsolute from to2 coerceSymbolicPath = coerce @@ -342,17 +357,19 @@ symbolicPathRelative_maybe (SymbolicPath fp) = else Just $ SymbolicPath fp -- | Absolute path to the current working directory. -absoluteWorkingDir :: Maybe (SymbolicPath CWD to) -> IO FilePath -absoluteWorkingDir Nothing = Directory.getCurrentDirectory -absoluteWorkingDir (Just wd) = Directory.makeAbsolute $ getSymbolicPath wd +absoluteWorkingDir :: Maybe (SymbolicPath CWD to) -> IO (AbsolutePath to) +absoluteWorkingDir Nothing = unsafeMakeAbsolutePath <$> Directory.getCurrentDirectory +absoluteWorkingDir (Just wd) = unsafeMakeAbsolutePath <$> Directory.makeAbsolute (getSymbolicPath wd) --- | Try to make a path relative to the current working directory. +-- | Try to make a symbolic path relative. +-- +-- This function does nothing if the path is already relative. -- -- NB: this function may fail to make the path relative. -tryMakeRelativeToWorkingDir :: Maybe (SymbolicPath CWD (Dir dir)) -> SymbolicPath dir to -> IO (SymbolicPath dir to) -tryMakeRelativeToWorkingDir mbWorkDir (SymbolicPath fp) = do - wd <- absoluteWorkingDir mbWorkDir - return $ SymbolicPath (FilePath.makeRelative wd fp) +tryMakeRelative :: Maybe (SymbolicPath CWD (Dir dir)) -> SymbolicPath dir to -> IO (SymbolicPath dir to) +tryMakeRelative mbWorkDir (SymbolicPath fp) = do + AbsolutePath wd <- absoluteWorkingDir mbWorkDir + return $ SymbolicPath (FilePath.makeRelative (getSymbolicPath wd) fp) ------------------------------------------------------------------------------- @@ -422,6 +439,16 @@ instance where SymbolicPath p1 SymbolicPath p2 = SymbolicPath (p1 p2) +instance + (b1 ~ 'Dir b2, c2 ~ c3, midAbsolute ~ OnlyRelative) + => PathLike + (AbsolutePath b1) + (SymbolicPathX midAbsolute b2 c2) + (AbsolutePath c3) + where + AbsolutePath (SymbolicPath p1) SymbolicPath p2 = + unsafeMakeAbsolutePath (p1 p2) + -------------------------------------------------------------------------------- -- Abstract directory locations. @@ -499,3 +526,8 @@ data Tmp -- -- See Note [Symbolic paths] in Distribution.Utils.Path. data Response + +-- | Abstract directory: directory for pkg-config files. +-- +-- See Note [Symbolic paths] in Distribution.Utils.Path. +data PkgConf diff --git a/Cabal-syntax/src/Distribution/Utils/Structured.hs b/Cabal-syntax/src/Distribution/Utils/Structured.hs index ba10212bca1..ec8463bd6d3 100644 --- a/Cabal-syntax/src/Distribution/Utils/Structured.hs +++ b/Cabal-syntax/src/Distribution/Utils/Structured.hs @@ -5,6 +5,7 @@ {-# LANGUAGE PatternSynonyms #-} {-# LANGUAGE PolyKinds #-} {-# LANGUAGE ScopedTypeVariables #-} +{-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} @@ -106,8 +107,8 @@ import qualified Data.Aeson as Aeson #endif import Data.Kind (Type) +import Data.Typeable (TypeRep, Typeable, typeRep) -import Distribution.Compat.Typeable (TypeRep, Typeable, typeRep) import Distribution.Utils.MD5 import Data.Monoid (mconcat) @@ -276,7 +277,7 @@ structuredDecodeOrFailIO :: (Binary.Binary a, Structured a) => LBS.ByteString -> structuredDecodeOrFailIO bs = catch (evaluate (structuredDecode bs) >>= return . Right) handler where - handler (ErrorCallWithLocation str _) = return $ Left str + handler (ErrorCall str) = return $ Left str -- | Lazily reconstruct a value previously written to a file. structuredDecodeFileOrFail :: (Binary.Binary a, Structured a) => FilePath -> IO (Either String a) @@ -418,12 +419,42 @@ instance Structured a => Structured (Ratio a) where structure = containerStructu instance Structured a => Structured [a] where structure = containerStructure instance Structured a => Structured (NonEmpty a) where structure = containerStructure -instance (Structured a1, Structured a2) => Structured (a1, a2) -instance (Structured a1, Structured a2, Structured a3) => Structured (a1, a2, a3) -instance (Structured a1, Structured a2, Structured a3, Structured a4) => Structured (a1, a2, a3, a4) -instance (Structured a1, Structured a2, Structured a3, Structured a4, Structured a5) => Structured (a1, a2, a3, a4, a5) -instance (Structured a1, Structured a2, Structured a3, Structured a4, Structured a5, Structured a6) => Structured (a1, a2, a3, a4, a5, a6) -instance (Structured a1, Structured a2, Structured a3, Structured a4, Structured a5, Structured a6, Structured a7) => Structured (a1, a2, a3, a4, a5, a6, a7) +-- These instances are defined directly because the generic names for tuples changed +-- in 9.6 (https://gitlab.haskell.org/ghc/ghc/-/issues/24291). +-- +-- By defining our own instances the STuple2 identifier will be used in the hash and +-- hence the same on all GHC versions. + +data STuple2 a b = STuple2 a b deriving (Generic) +data STuple3 a b c = STuple3 a b c deriving (Generic) +data STuple4 a b c d = STuple4 a b c d deriving (Generic) +data STuple5 a b c d e = STuple5 a b c d e deriving (Generic) +data STuple6 a b c d e f = STuple6 a b c d e f deriving (Generic) +data STuple7 a b c d e f g = STuple7 a b c d e f g deriving (Generic) + +instance (Structured a1, Structured a2) => Structured (STuple2 a1 a2) +instance (Structured a1, Structured a2) => Structured (a1, a2) where + structure Proxy = structure @(STuple2 a1 a2) Proxy + +instance (Structured a1, Structured a2, Structured a3) => Structured (STuple3 a1 a2 a3) +instance (Structured a1, Structured a2, Structured a3) => Structured (a1, a2, a3) where + structure Proxy = structure @(STuple3 a1 a2 a3) Proxy + +instance (Structured a1, Structured a2, Structured a3, Structured a4) => Structured (STuple4 a1 a2 a3 a4) +instance (Structured a1, Structured a2, Structured a3, Structured a4) => Structured (a1, a2, a3, a4) where + structure Proxy = structure @(STuple4 a1 a2 a3 a4) Proxy + +instance (Structured a1, Structured a2, Structured a3, Structured a4, Structured a5) => Structured (STuple5 a1 a2 a3 a4 a5) +instance (Structured a1, Structured a2, Structured a3, Structured a4, Structured a5) => Structured (a1, a2, a3, a4, a5) where + structure Proxy = structure @(STuple5 a1 a2 a3 a4 a5) Proxy + +instance (Structured a1, Structured a2, Structured a3, Structured a4, Structured a5, Structured a6) => Structured (STuple6 a1 a2 a3 a4 a5 a6) +instance (Structured a1, Structured a2, Structured a3, Structured a4, Structured a5, Structured a6) => Structured (a1, a2, a3, a4, a5, a6) where + structure Proxy = structure @(STuple6 a1 a2 a3 a4 a5 a6) Proxy + +instance (Structured a1, Structured a2, Structured a3, Structured a4, Structured a5, Structured a6, Structured a7) => Structured (STuple7 a1 a2 a3 a4 a5 a6 a7) +instance (Structured a1, Structured a2, Structured a3, Structured a4, Structured a5, Structured a6, Structured a7) => Structured (a1, a2, a3, a4, a5, a6, a7) where + structure Proxy = structure @(STuple7 a1 a2 a3 a4 a5 a6 a7) Proxy instance Structured BS.ByteString where structure = nominalStructure instance Structured LBS.ByteString where structure = nominalStructure diff --git a/Cabal-syntax/src/Language/Haskell/Extension.hs b/Cabal-syntax/src/Language/Haskell/Extension.hs index 22082d6d0b3..dce34560586 100644 --- a/Cabal-syntax/src/Language/Haskell/Extension.hs +++ b/Cabal-syntax/src/Language/Haskell/Extension.hs @@ -551,6 +551,11 @@ data KnownExtension | -- | Allow the use of built-in syntax for list, tuple and sum type constructors -- rather than being exclusive to data constructors. ListTuplePuns + | -- | Support multiline strings. + MultilineStrings + | -- | Allow use of or-pattern syntax, condensing multiple patterns + -- into a single one. + OrPatterns deriving (Generic, Show, Read, Eq, Ord, Enum, Bounded, Typeable, Data) instance Binary KnownExtension diff --git a/Cabal-tests/Cabal-tests.cabal b/Cabal-tests/Cabal-tests.cabal index f48222332f4..60ae8828610 100644 --- a/Cabal-tests/Cabal-tests.cabal +++ b/Cabal-tests/Cabal-tests.cabal @@ -52,12 +52,11 @@ test-suite unit-tests UnitTests.Distribution.Utils.ShortText UnitTests.Distribution.Utils.Structured UnitTests.Distribution.Version - UnitTests.Orphans main-is: UnitTests.hs build-depends: array - , base >=4.11 && <5 + , base >=4.13 && <5 , bytestring , Cabal , Cabal-described @@ -71,7 +70,7 @@ test-suite unit-tests , QuickCheck >=2.14 && <2.15 , tasty >=1.2.3 && <1.6 , tasty-hunit - , tasty-quickcheck + , tasty-quickcheck <0.12 , temporary , text @@ -150,6 +149,7 @@ test-suite hackage-tests , deepseq , directory , filepath + , time build-depends: base-compat >=0.11.0 && <0.14 @@ -176,7 +176,7 @@ test-suite rpmvercmp QuickCheck , tasty >=1.2.3 && <1.6 , tasty-hunit - , tasty-quickcheck + , tasty-quickcheck <0.12 c-sources: tests/cbits/rpmvercmp.c cc-options: -Wall diff --git a/Cabal-tests/lib/Test/Utils/TempTestDir.hs b/Cabal-tests/lib/Test/Utils/TempTestDir.hs index a4b0b08cba4..7d1ca76e04f 100644 --- a/Cabal-tests/lib/Test/Utils/TempTestDir.hs +++ b/Cabal-tests/lib/Test/Utils/TempTestDir.hs @@ -2,11 +2,12 @@ module Test.Utils.TempTestDir ( withTestDir + , withTestDir' , removeDirectoryRecursiveHack ) where import Distribution.Compat.Internal.TempFile (createTempDirectory) -import Distribution.Simple.Utils (warn) +import Distribution.Simple.Utils (warn, TempFileOptions (..), defaultTempFileOptions) import Distribution.Verbosity import Control.Concurrent (threadDelay) @@ -23,12 +24,26 @@ import qualified System.Info (os) -- | Much like 'withTemporaryDirectory' but with a number of hacks to make -- sure on windows that we can clean up the directory at the end. withTestDir :: (MonadIO m, MonadMask m) => Verbosity -> String -> (FilePath -> m a) -> m a -withTestDir verbosity template action = do - systmpdir <- liftIO getTemporaryDirectory +withTestDir verbosity template action = withTestDir' verbosity defaultTempFileOptions template action + +withTestDir' :: (MonadIO m, MonadMask m) => Verbosity -> TempFileOptions -> String -> (FilePath -> m a) -> m a +withTestDir' verbosity tempFileOpts template action = do + systmpdir <- + -- MacOS returns /var/folders/... which is a symlink (/var -> /private/var), + -- so the test-suite struggles to make the build cwd-agnostic in particular + -- for the ShowBuildInfo tests. This canonicalizePath call makes it + -- /private/var/folders/... which will work. + liftIO $ canonicalizePath =<< getTemporaryDirectory bracket ( do { tmpRelDir <- liftIO $ createTempDirectory systmpdir template ; return $ systmpdir tmpRelDir } ) - (liftIO . removeDirectoryRecursiveHack verbosity) + (liftIO + -- This ensures that the temp files are not deleted at the end of the test. + -- It replicates the behavior of @withTempDirectoryEx@. + . when (not (optKeepTempFiles tempFileOpts)) + -- This is the bit that helps with Windows deleting all files. + . removeDirectoryRecursiveHack verbosity + ) action -- | On Windows, file locks held by programs we run (in this case VCSs) diff --git a/Cabal-tests/tests/HackageTests.hs b/Cabal-tests/tests/HackageTests.hs index 9bff0ce05cc..e400e73629d 100644 --- a/Cabal-tests/tests/HackageTests.hs +++ b/Cabal-tests/tests/HackageTests.hs @@ -33,6 +33,7 @@ import System.FilePath (()) import Data.Orphans () import qualified Codec.Archive.Tar as Tar +import qualified Codec.Archive.Tar.Entry as Tar import qualified Data.ByteString as B import qualified Data.ByteString.Char8 as B8 import qualified Data.ByteString.Lazy as BSL @@ -56,11 +57,14 @@ import Data.TreeDiff.Instances.Cabal () import Data.TreeDiff.Pretty (ansiWlEditExprCompact) #endif +import Data.Time.Clock.System +import Data.Time.Format + ------------------------------------------------------------------------------- -- parseIndex: Index traversal ------------------------------------------------------------------------------- -parseIndex :: (Monoid a, NFData a) => (FilePath -> Bool) +parseIndex :: (Monoid a, NFData a) => (Tar.EpochTime -> FilePath -> Bool) -> (FilePath -> B.ByteString -> IO a) -> IO a parseIndex predicate action = do configPath <- getCabalConfigPath @@ -99,7 +103,7 @@ parseIndex predicate action = do parseIndex' :: (Monoid a, NFData a) - => (FilePath -> Bool) + => (Tar.EpochTime -> FilePath -> Bool) -> (FilePath -> B.ByteString -> IO a) -> FilePath -> IO a parseIndex' predicate action path = do putStrLn $ "Reading index from: " ++ path @@ -110,7 +114,7 @@ parseIndex' predicate action path = do where cons entry entries - | predicate (Tar.entryPath entry) = entry : entries + | predicate (Tar.entryTime entry) (Tar.entryPath entry) = entry : entries | otherwise = entries f entry = case Tar.entryContent entry of @@ -320,6 +324,13 @@ main = join (O.execParser opts) , O.progDesc "tests using Hackage's index" ] + indexP = + fmap cvt <$> O.optional (O.strOption (O.long "index-state" <> O.metavar "YYYY-MM-DD")) + where + cvt = + systemSeconds . utcToSystemTime . + parseTimeOrError False defaultTimeLocale "%Y-%m-%d" + optsP = subparser [ command "read-fields" readFieldsP "Parse outer format (to '[Field]', TODO: apply Quirks)" @@ -330,20 +341,20 @@ main = join (O.execParser opts) defaultA = do putStrLn "Default action: parsec k" - parsecA (mkPredicate ["k"]) False + parsecA ["k"] False Nothing - readFieldsP = readFieldsA <$> prefixP - readFieldsA pfx = parseIndex pfx readFieldTest + readFieldsP = readFieldsA <$> prefixP <*> indexP + readFieldsA pfx idx = parseIndex (mkPredicate pfx idx) readFieldTest - parsecP = parsecA <$> prefixP <*> keepGoingP + parsecP = parsecA <$> prefixP <*> keepGoingP <*> indexP keepGoingP = O.flag' True (O.long "keep-going") <|> O.flag' False (O.long "no-keep-going") <|> pure False - parsecA pfx keepGoing = do + parsecA pfx keepGoing idx = do begin <- Clock.getTime Clock.Monotonic - ParsecResult n w f <- parseIndex pfx (parseParsecTest keepGoing) + ParsecResult n w f <- parseIndex (mkPredicate pfx idx) (parseParsecTest keepGoing) end <- Clock.getTime Clock.Monotonic let diff = Clock.toNanoSecs $ Clock.diffTimeSpec end begin @@ -353,14 +364,14 @@ main = join (O.execParser opts) putStrLn $ showFFloat (Just 6) (fromInteger diff / 1e9 :: Double) " seconds elapsed" putStrLn $ showFFloat (Just 6) (fromInteger diff / 1e6 / fromIntegral n :: Double) " milliseconds per file" - roundtripP = roundtripA <$> prefixP <*> testFieldsP - roundtripA pfx testFieldsTransform = do - Sum n <- parseIndex pfx (roundtripTest testFieldsTransform) + roundtripP = roundtripA <$> prefixP <*> testFieldsP <*> indexP + roundtripA pfx testFieldsTransform idx = do + Sum n <- parseIndex (mkPredicate pfx idx) (roundtripTest testFieldsTransform) putStrLn $ show n ++ " files processed" - checkP = checkA <$> prefixP - checkA pfx = do - CheckResult n w x a b c d e <- parseIndex pfx parseCheckTest + checkP = checkA <$> prefixP <*> indexP + checkA pfx idx = do + CheckResult n w x a b c d e <- parseIndex (mkPredicate pfx idx) parseCheckTest putStrLn $ show n ++ " files processed" putStrLn $ show w ++ " files have lexer/parser warnings" putStrLn $ show x ++ " files have check warnings" @@ -370,7 +381,7 @@ main = join (O.execParser opts) putStrLn $ show d ++ " build dist suspicious warning" putStrLn $ show e ++ " build dist inexcusable" - prefixP = fmap mkPredicate $ many $ O.strArgument $ mconcat + prefixP = many $ O.strArgument $ mconcat [ O.metavar "PREFIX" , O.help "Check only files starting with a prefix" ] @@ -380,8 +391,14 @@ main = join (O.execParser opts) , O.help "Test also 'showFields . fromParsecFields . readFields' transform" ] - mkPredicate [] = const True - mkPredicate pfxs = \n -> any (`isPrefixOf` n) pfxs + indexPredicate :: Maybe Tar.EpochTime -> (k -> Bool) -> (Tar.EpochTime -> k -> Bool) + indexPredicate Nothing k = const k + indexPredicate (Just indexDate) k = + \e -> if (e <= indexDate) then k else const False + + mkPredicate :: [String] -> Maybe Tar.EpochTime -> (Tar.EpochTime -> FilePath -> Bool) + mkPredicate [] idx = indexPredicate idx (const True) + mkPredicate pfxs idx = indexPredicate idx (\n -> any (`isPrefixOf` n) pfxs) command name p desc = O.command name (O.info (p <**> O.helper) (O.progDesc desc)) diff --git a/Cabal-tests/tests/ParserTests/regressions/Octree-0.5.expr b/Cabal-tests/tests/ParserTests/regressions/Octree-0.5.expr index 3d03421210b..04f54ea5d93 100644 --- a/Cabal-tests/tests/ParserTests/regressions/Octree-0.5.expr +++ b/Cabal-tests/tests/ParserTests/regressions/Octree-0.5.expr @@ -66,7 +66,8 @@ GenericPackageDescription { dataDir = SymbolicPath ".", extraSrcFiles = [], extraTmpFiles = [], - extraDocFiles = []}, + extraDocFiles = [], + extraFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [], condLibrary = Just @@ -132,6 +133,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -238,6 +241,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -339,6 +344,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], diff --git a/Cabal-tests/tests/ParserTests/regressions/anynone.expr b/Cabal-tests/tests/ParserTests/regressions/anynone.expr index 3191425d609..919f554180a 100644 --- a/Cabal-tests/tests/ParserTests/regressions/anynone.expr +++ b/Cabal-tests/tests/ParserTests/regressions/anynone.expr @@ -32,7 +32,8 @@ GenericPackageDescription { dataDir = SymbolicPath ".", extraSrcFiles = [], extraTmpFiles = [], - extraDocFiles = []}, + extraDocFiles = [], + extraFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [], condLibrary = Just @@ -95,6 +96,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], diff --git a/Cabal-tests/tests/ParserTests/regressions/big-version.expr b/Cabal-tests/tests/ParserTests/regressions/big-version.expr index e677de20626..c219ac95241 100644 --- a/Cabal-tests/tests/ParserTests/regressions/big-version.expr +++ b/Cabal-tests/tests/ParserTests/regressions/big-version.expr @@ -34,7 +34,8 @@ GenericPackageDescription { dataDir = SymbolicPath ".", extraSrcFiles = [], extraTmpFiles = [], - extraDocFiles = []}, + extraDocFiles = [], + extraFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [], condLibrary = Just @@ -96,6 +97,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], diff --git a/Cabal-tests/tests/ParserTests/regressions/common-conditional.expr b/Cabal-tests/tests/ParserTests/regressions/common-conditional.expr index f6ffe291e59..8969ff6f5fa 100644 --- a/Cabal-tests/tests/ParserTests/regressions/common-conditional.expr +++ b/Cabal-tests/tests/ParserTests/regressions/common-conditional.expr @@ -44,7 +44,8 @@ GenericPackageDescription { dataDir = SymbolicPath ".", extraSrcFiles = [], extraTmpFiles = [], - extraDocFiles = []}, + extraDocFiles = [], + extraFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [ MkPackageFlag { @@ -112,6 +113,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -187,6 +190,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -278,6 +283,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -356,6 +363,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -432,6 +441,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -501,6 +512,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -593,6 +606,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -670,6 +685,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], diff --git a/Cabal-tests/tests/ParserTests/regressions/common.expr b/Cabal-tests/tests/ParserTests/regressions/common.expr index e0eb4a1dde7..e39820ec833 100644 --- a/Cabal-tests/tests/ParserTests/regressions/common.expr +++ b/Cabal-tests/tests/ParserTests/regressions/common.expr @@ -47,7 +47,8 @@ GenericPackageDescription { dataDir = SymbolicPath ".", extraSrcFiles = [], extraTmpFiles = [], - extraDocFiles = []}, + extraDocFiles = [], + extraFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [], condLibrary = Just @@ -110,6 +111,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -186,6 +189,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], diff --git a/Cabal-tests/tests/ParserTests/regressions/common2.expr b/Cabal-tests/tests/ParserTests/regressions/common2.expr index b3cb004eecb..ae85c83ea2b 100644 --- a/Cabal-tests/tests/ParserTests/regressions/common2.expr +++ b/Cabal-tests/tests/ParserTests/regressions/common2.expr @@ -43,7 +43,8 @@ GenericPackageDescription { dataDir = SymbolicPath ".", extraSrcFiles = [], extraTmpFiles = [], - extraDocFiles = []}, + extraDocFiles = [], + extraFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [], condLibrary = Just @@ -106,6 +107,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -205,6 +208,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -285,6 +290,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -386,6 +393,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -462,6 +471,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -562,6 +573,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -639,6 +652,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -716,6 +731,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], diff --git a/Cabal-tests/tests/ParserTests/regressions/common3.expr b/Cabal-tests/tests/ParserTests/regressions/common3.expr index 21b200baa7b..5436936b3a2 100644 --- a/Cabal-tests/tests/ParserTests/regressions/common3.expr +++ b/Cabal-tests/tests/ParserTests/regressions/common3.expr @@ -47,7 +47,8 @@ GenericPackageDescription { dataDir = SymbolicPath ".", extraSrcFiles = [], extraTmpFiles = [], - extraDocFiles = []}, + extraDocFiles = [], + extraFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [], condLibrary = Just @@ -110,6 +111,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -186,6 +189,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], diff --git a/Cabal-tests/tests/ParserTests/regressions/elif.expr b/Cabal-tests/tests/ParserTests/regressions/elif.expr index 1315d689467..5bf616b7c15 100644 --- a/Cabal-tests/tests/ParserTests/regressions/elif.expr +++ b/Cabal-tests/tests/ParserTests/regressions/elif.expr @@ -42,7 +42,8 @@ GenericPackageDescription { dataDir = SymbolicPath ".", extraSrcFiles = [], extraTmpFiles = [], - extraDocFiles = []}, + extraDocFiles = [], + extraFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [], condLibrary = Just @@ -105,6 +106,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -172,6 +175,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], diff --git a/Cabal-tests/tests/ParserTests/regressions/elif2.expr b/Cabal-tests/tests/ParserTests/regressions/elif2.expr index 61f2177cbaa..f0ecd6bb111 100644 --- a/Cabal-tests/tests/ParserTests/regressions/elif2.expr +++ b/Cabal-tests/tests/ParserTests/regressions/elif2.expr @@ -42,7 +42,8 @@ GenericPackageDescription { dataDir = SymbolicPath ".", extraSrcFiles = [], extraTmpFiles = [], - extraDocFiles = []}, + extraDocFiles = [], + extraFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [], condLibrary = Just @@ -105,6 +106,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -172,6 +175,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -245,6 +250,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -312,6 +319,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -385,6 +394,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], diff --git a/Cabal-tests/tests/ParserTests/regressions/encoding-0.8.expr b/Cabal-tests/tests/ParserTests/regressions/encoding-0.8.expr index e1b125e7a32..4e45a86b8c4 100644 --- a/Cabal-tests/tests/ParserTests/regressions/encoding-0.8.expr +++ b/Cabal-tests/tests/ParserTests/regressions/encoding-0.8.expr @@ -47,7 +47,8 @@ GenericPackageDescription { SymbolicPath "--", SymbolicPath "--"], extraTmpFiles = [], - extraDocFiles = []}, + extraDocFiles = [], + extraFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [], condLibrary = Just @@ -114,6 +115,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], diff --git a/Cabal-tests/tests/ParserTests/regressions/generics-sop.expr b/Cabal-tests/tests/ParserTests/regressions/generics-sop.expr index 9084371a614..60be619bd16 100644 --- a/Cabal-tests/tests/ParserTests/regressions/generics-sop.expr +++ b/Cabal-tests/tests/ParserTests/regressions/generics-sop.expr @@ -123,7 +123,8 @@ GenericPackageDescription { extraSrcFiles = [ SymbolicPath "CHANGELOG.md"], extraTmpFiles = [], - extraDocFiles = []}, + extraDocFiles = [], + extraFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [], condLibrary = Just @@ -242,6 +243,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -373,6 +376,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -457,6 +462,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -561,6 +568,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -631,6 +640,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -702,6 +713,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [ @@ -798,6 +811,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], diff --git a/Cabal-tests/tests/ParserTests/regressions/hasktorch.expr b/Cabal-tests/tests/ParserTests/regressions/hasktorch.expr index 346af927d1b..7eea76ce8c1 100644 --- a/Cabal-tests/tests/ParserTests/regressions/hasktorch.expr +++ b/Cabal-tests/tests/ParserTests/regressions/hasktorch.expr @@ -54,7 +54,8 @@ GenericPackageDescription { dataDir = SymbolicPath ".", extraSrcFiles = [], extraTmpFiles = [], - extraDocFiles = []}, + extraDocFiles = [], + extraFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [ MkPackageFlag { @@ -322,6 +323,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -642,6 +645,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -884,6 +889,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -1084,6 +1091,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -1438,6 +1447,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -2740,6 +2751,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -2829,6 +2842,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -5072,6 +5087,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -6424,6 +6441,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -6514,6 +6533,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -8182,6 +8203,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -8670,6 +8693,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -9433,6 +9458,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -9554,6 +9581,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -9659,6 +9688,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -9764,6 +9795,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -9858,6 +9891,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -9978,6 +10013,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], diff --git a/Cabal-tests/tests/ParserTests/regressions/hidden-main-lib.expr b/Cabal-tests/tests/ParserTests/regressions/hidden-main-lib.expr index fba99528b53..3e67f519199 100644 --- a/Cabal-tests/tests/ParserTests/regressions/hidden-main-lib.expr +++ b/Cabal-tests/tests/ParserTests/regressions/hidden-main-lib.expr @@ -34,7 +34,8 @@ GenericPackageDescription { dataDir = SymbolicPath ".", extraSrcFiles = [], extraTmpFiles = [], - extraDocFiles = []}, + extraDocFiles = [], + extraFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [], condLibrary = Just @@ -97,6 +98,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], diff --git a/Cabal-tests/tests/ParserTests/regressions/indentation.expr b/Cabal-tests/tests/ParserTests/regressions/indentation.expr index e5b106dc5cd..ea8c219ca0a 100644 --- a/Cabal-tests/tests/ParserTests/regressions/indentation.expr +++ b/Cabal-tests/tests/ParserTests/regressions/indentation.expr @@ -44,7 +44,8 @@ GenericPackageDescription { dataDir = SymbolicPath ".", extraSrcFiles = [], extraTmpFiles = [], - extraDocFiles = []}, + extraDocFiles = [], + extraFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [], condLibrary = Just @@ -106,6 +107,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], diff --git a/Cabal-tests/tests/ParserTests/regressions/indentation2.expr b/Cabal-tests/tests/ParserTests/regressions/indentation2.expr index 46f24105f0f..f26c9a4e005 100644 --- a/Cabal-tests/tests/ParserTests/regressions/indentation2.expr +++ b/Cabal-tests/tests/ParserTests/regressions/indentation2.expr @@ -37,7 +37,8 @@ GenericPackageDescription { dataDir = SymbolicPath ".", extraSrcFiles = [], extraTmpFiles = [], - extraDocFiles = []}, + extraDocFiles = [], + extraFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [], condLibrary = Just @@ -99,6 +100,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], diff --git a/Cabal-tests/tests/ParserTests/regressions/indentation3.expr b/Cabal-tests/tests/ParserTests/regressions/indentation3.expr index 0191d063f6e..08db6b1fec6 100644 --- a/Cabal-tests/tests/ParserTests/regressions/indentation3.expr +++ b/Cabal-tests/tests/ParserTests/regressions/indentation3.expr @@ -39,7 +39,8 @@ GenericPackageDescription { dataDir = SymbolicPath ".", extraSrcFiles = [], extraTmpFiles = [], - extraDocFiles = []}, + extraDocFiles = [], + extraFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [], condLibrary = Just @@ -101,6 +102,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], diff --git a/Cabal-tests/tests/ParserTests/regressions/issue-5055.expr b/Cabal-tests/tests/ParserTests/regressions/issue-5055.expr index 07c04ec6cb9..03fab0246e4 100644 --- a/Cabal-tests/tests/ParserTests/regressions/issue-5055.expr +++ b/Cabal-tests/tests/ParserTests/regressions/issue-5055.expr @@ -34,7 +34,8 @@ GenericPackageDescription { dataDir = SymbolicPath ".", extraSrcFiles = [], extraTmpFiles = [], - extraDocFiles = []}, + extraDocFiles = [], + extraFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [], condLibrary = Nothing, @@ -100,6 +101,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -183,6 +186,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -267,6 +272,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], diff --git a/Cabal-tests/tests/ParserTests/regressions/issue-5846.expr b/Cabal-tests/tests/ParserTests/regressions/issue-5846.expr index 2ff7de7917e..0d031503a53 100644 --- a/Cabal-tests/tests/ParserTests/regressions/issue-5846.expr +++ b/Cabal-tests/tests/ParserTests/regressions/issue-5846.expr @@ -32,7 +32,8 @@ GenericPackageDescription { dataDir = SymbolicPath ".", extraSrcFiles = [], extraTmpFiles = [], - extraDocFiles = []}, + extraDocFiles = [], + extraFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [], condLibrary = Just @@ -94,6 +95,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], diff --git a/Cabal-tests/tests/ParserTests/regressions/issue-5846.format b/Cabal-tests/tests/ParserTests/regressions/issue-5846.format index 749a9c20524..93e53fc48bd 100644 --- a/Cabal-tests/tests/ParserTests/regressions/issue-5846.format +++ b/Cabal-tests/tests/ParserTests/regressions/issue-5846.format @@ -5,7 +5,7 @@ version: 5846 library default-language: Haskell2010 build-depends: - lib1:{a, b}, + lib1:{a,b}, lib2:c, lib3:d >=1, - lib4:{a, b} >=1 + lib4:{a,b} >=1 diff --git a/Cabal-tests/tests/ParserTests/regressions/issue-6083-a.expr b/Cabal-tests/tests/ParserTests/regressions/issue-6083-a.expr index 43c345dd170..bbe56f81a5c 100644 --- a/Cabal-tests/tests/ParserTests/regressions/issue-6083-a.expr +++ b/Cabal-tests/tests/ParserTests/regressions/issue-6083-a.expr @@ -32,7 +32,8 @@ GenericPackageDescription { dataDir = SymbolicPath ".", extraSrcFiles = [], extraTmpFiles = [], - extraDocFiles = []}, + extraDocFiles = [], + extraFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [], condLibrary = Just @@ -94,6 +95,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -189,6 +192,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -255,6 +260,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -335,6 +342,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], diff --git a/Cabal-tests/tests/ParserTests/regressions/issue-6083-b.expr b/Cabal-tests/tests/ParserTests/regressions/issue-6083-b.expr index e6606851627..17b9f8319bb 100644 --- a/Cabal-tests/tests/ParserTests/regressions/issue-6083-b.expr +++ b/Cabal-tests/tests/ParserTests/regressions/issue-6083-b.expr @@ -32,7 +32,8 @@ GenericPackageDescription { dataDir = SymbolicPath ".", extraSrcFiles = [], extraTmpFiles = [], - extraDocFiles = []}, + extraDocFiles = [], + extraFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [], condLibrary = Just @@ -94,6 +95,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -189,6 +192,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -255,6 +260,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -345,6 +352,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], diff --git a/Cabal-tests/tests/ParserTests/regressions/issue-6083-c.expr b/Cabal-tests/tests/ParserTests/regressions/issue-6083-c.expr index 7435b0d59b4..8db694b7389 100644 --- a/Cabal-tests/tests/ParserTests/regressions/issue-6083-c.expr +++ b/Cabal-tests/tests/ParserTests/regressions/issue-6083-c.expr @@ -32,7 +32,8 @@ GenericPackageDescription { dataDir = SymbolicPath ".", extraSrcFiles = [], extraTmpFiles = [], - extraDocFiles = []}, + extraDocFiles = [], + extraFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [], condLibrary = Just @@ -94,6 +95,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -189,6 +192,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], diff --git a/Cabal-tests/tests/ParserTests/regressions/issue-6083-pkg-pkg.expr b/Cabal-tests/tests/ParserTests/regressions/issue-6083-pkg-pkg.expr index a221632efa4..26a3c260959 100644 --- a/Cabal-tests/tests/ParserTests/regressions/issue-6083-pkg-pkg.expr +++ b/Cabal-tests/tests/ParserTests/regressions/issue-6083-pkg-pkg.expr @@ -32,7 +32,8 @@ GenericPackageDescription { dataDir = SymbolicPath ".", extraSrcFiles = [], extraTmpFiles = [], - extraDocFiles = []}, + extraDocFiles = [], + extraFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [], condLibrary = Just @@ -94,6 +95,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], diff --git a/Cabal-tests/tests/ParserTests/regressions/issue-774.expr b/Cabal-tests/tests/ParserTests/regressions/issue-774.expr index e1ffb85dceb..a9b2fc7bcc3 100644 --- a/Cabal-tests/tests/ParserTests/regressions/issue-774.expr +++ b/Cabal-tests/tests/ParserTests/regressions/issue-774.expr @@ -41,7 +41,8 @@ GenericPackageDescription { dataDir = SymbolicPath ".", extraSrcFiles = [], extraTmpFiles = [], - extraDocFiles = []}, + extraDocFiles = [], + extraFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [], condLibrary = Just @@ -108,6 +109,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], diff --git a/Cabal-tests/tests/ParserTests/regressions/jaeger-flamegraph.expr b/Cabal-tests/tests/ParserTests/regressions/jaeger-flamegraph.expr index c9e675ceb76..fd9b1fa3a28 100644 --- a/Cabal-tests/tests/ParserTests/regressions/jaeger-flamegraph.expr +++ b/Cabal-tests/tests/ParserTests/regressions/jaeger-flamegraph.expr @@ -73,7 +73,8 @@ GenericPackageDescription { dataDir = SymbolicPath ".", extraSrcFiles = [], extraTmpFiles = [], - extraDocFiles = []}, + extraDocFiles = [], + extraFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [], condLibrary = Just @@ -139,6 +140,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -238,6 +241,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -403,6 +408,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], diff --git a/Cabal-tests/tests/ParserTests/regressions/leading-comma-2.expr b/Cabal-tests/tests/ParserTests/regressions/leading-comma-2.expr index 0bb5556b2f4..37bb5adfea5 100644 --- a/Cabal-tests/tests/ParserTests/regressions/leading-comma-2.expr +++ b/Cabal-tests/tests/ParserTests/regressions/leading-comma-2.expr @@ -34,7 +34,8 @@ GenericPackageDescription { dataDir = SymbolicPath ".", extraSrcFiles = [], extraTmpFiles = [], - extraDocFiles = []}, + extraDocFiles = [], + extraFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [], condLibrary = Just @@ -104,6 +105,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], diff --git a/Cabal-tests/tests/ParserTests/regressions/leading-comma.expr b/Cabal-tests/tests/ParserTests/regressions/leading-comma.expr index b1ba1b282f4..6b31a91ecc4 100644 --- a/Cabal-tests/tests/ParserTests/regressions/leading-comma.expr +++ b/Cabal-tests/tests/ParserTests/regressions/leading-comma.expr @@ -34,7 +34,8 @@ GenericPackageDescription { dataDir = SymbolicPath ".", extraSrcFiles = [], extraTmpFiles = [], - extraDocFiles = []}, + extraDocFiles = [], + extraFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [], condLibrary = Just @@ -97,6 +98,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], diff --git a/Cabal-tests/tests/ParserTests/regressions/libpq1.expr b/Cabal-tests/tests/ParserTests/regressions/libpq1.expr index 8906a91f63b..db39305d20f 100644 --- a/Cabal-tests/tests/ParserTests/regressions/libpq1.expr +++ b/Cabal-tests/tests/ParserTests/regressions/libpq1.expr @@ -111,7 +111,8 @@ GenericPackageDescription { "cbits/noticehandlers.h", SymbolicPath "CHANGELOG.md"], extraTmpFiles = [], - extraDocFiles = []}, + extraDocFiles = [], + extraFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [ MkPackageFlag { @@ -190,6 +191,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -289,6 +292,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -373,6 +378,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -464,6 +471,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -529,6 +538,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -596,6 +607,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -661,6 +674,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -728,6 +743,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], diff --git a/Cabal-tests/tests/ParserTests/regressions/libpq2.expr b/Cabal-tests/tests/ParserTests/regressions/libpq2.expr index 3c26ece45ad..80b558d0b91 100644 --- a/Cabal-tests/tests/ParserTests/regressions/libpq2.expr +++ b/Cabal-tests/tests/ParserTests/regressions/libpq2.expr @@ -115,7 +115,8 @@ GenericPackageDescription { "cbits/noticehandlers.h", SymbolicPath "CHANGELOG.md"], extraTmpFiles = [], - extraDocFiles = []}, + extraDocFiles = [], + extraFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [ MkPackageFlag { @@ -195,6 +196,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -294,6 +297,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -378,6 +383,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -466,6 +473,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -531,6 +540,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -598,6 +609,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -663,6 +676,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -730,6 +745,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], diff --git a/Cabal-tests/tests/ParserTests/regressions/mixin-1.expr b/Cabal-tests/tests/ParserTests/regressions/mixin-1.expr index de8a15f04c0..b8372437dd6 100644 --- a/Cabal-tests/tests/ParserTests/regressions/mixin-1.expr +++ b/Cabal-tests/tests/ParserTests/regressions/mixin-1.expr @@ -32,7 +32,8 @@ GenericPackageDescription { dataDir = SymbolicPath ".", extraSrcFiles = [], extraTmpFiles = [], - extraDocFiles = []}, + extraDocFiles = [], + extraFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [], condLibrary = Nothing, @@ -98,6 +99,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], diff --git a/Cabal-tests/tests/ParserTests/regressions/mixin-2.expr b/Cabal-tests/tests/ParserTests/regressions/mixin-2.expr index 3bf06bc9c3b..a4d3459be3d 100644 --- a/Cabal-tests/tests/ParserTests/regressions/mixin-2.expr +++ b/Cabal-tests/tests/ParserTests/regressions/mixin-2.expr @@ -32,7 +32,8 @@ GenericPackageDescription { dataDir = SymbolicPath ".", extraSrcFiles = [], extraTmpFiles = [], - extraDocFiles = []}, + extraDocFiles = [], + extraFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [], condLibrary = Nothing, @@ -98,6 +99,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], diff --git a/Cabal-tests/tests/ParserTests/regressions/mixin-3.expr b/Cabal-tests/tests/ParserTests/regressions/mixin-3.expr index 0c0fc57a8b8..2b1d37c79e9 100644 --- a/Cabal-tests/tests/ParserTests/regressions/mixin-3.expr +++ b/Cabal-tests/tests/ParserTests/regressions/mixin-3.expr @@ -32,7 +32,8 @@ GenericPackageDescription { dataDir = SymbolicPath ".", extraSrcFiles = [], extraTmpFiles = [], - extraDocFiles = []}, + extraDocFiles = [], + extraFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [], condLibrary = Nothing, @@ -98,6 +99,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], diff --git a/Cabal-tests/tests/ParserTests/regressions/monad-param.expr b/Cabal-tests/tests/ParserTests/regressions/monad-param.expr index 28d57c1e3b0..aaeb1af1044 100644 --- a/Cabal-tests/tests/ParserTests/regressions/monad-param.expr +++ b/Cabal-tests/tests/ParserTests/regressions/monad-param.expr @@ -42,7 +42,8 @@ GenericPackageDescription { dataDir = SymbolicPath ".", extraSrcFiles = [], extraTmpFiles = [], - extraDocFiles = []}, + extraDocFiles = [], + extraFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [], condLibrary = Just @@ -120,6 +121,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], diff --git a/Cabal-tests/tests/ParserTests/regressions/multiple-libs-2.expr b/Cabal-tests/tests/ParserTests/regressions/multiple-libs-2.expr index a8c6b0c0c4a..dc6371bc75c 100644 --- a/Cabal-tests/tests/ParserTests/regressions/multiple-libs-2.expr +++ b/Cabal-tests/tests/ParserTests/regressions/multiple-libs-2.expr @@ -34,7 +34,8 @@ GenericPackageDescription { dataDir = SymbolicPath ".", extraSrcFiles = [], extraTmpFiles = [], - extraDocFiles = []}, + extraDocFiles = [], + extraFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [], condLibrary = Just @@ -97,6 +98,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -175,6 +178,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], diff --git a/Cabal-tests/tests/ParserTests/regressions/noVersion.expr b/Cabal-tests/tests/ParserTests/regressions/noVersion.expr index 8187272c2c0..0d5bf636569 100644 --- a/Cabal-tests/tests/ParserTests/regressions/noVersion.expr +++ b/Cabal-tests/tests/ParserTests/regressions/noVersion.expr @@ -34,7 +34,8 @@ GenericPackageDescription { dataDir = SymbolicPath ".", extraSrcFiles = [], extraTmpFiles = [], - extraDocFiles = []}, + extraDocFiles = [], + extraFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [], condLibrary = Just @@ -97,6 +98,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], diff --git a/Cabal-tests/tests/ParserTests/regressions/nothing-unicode.expr b/Cabal-tests/tests/ParserTests/regressions/nothing-unicode.expr index 2f2663733c6..f6a8c64a566 100644 --- a/Cabal-tests/tests/ParserTests/regressions/nothing-unicode.expr +++ b/Cabal-tests/tests/ParserTests/regressions/nothing-unicode.expr @@ -44,7 +44,8 @@ GenericPackageDescription { dataDir = SymbolicPath ".", extraSrcFiles = [], extraTmpFiles = [], - extraDocFiles = []}, + extraDocFiles = [], + extraFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [ MkPackageFlag { @@ -112,6 +113,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -179,6 +182,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], diff --git a/Cabal-tests/tests/ParserTests/regressions/shake.expr b/Cabal-tests/tests/ParserTests/regressions/shake.expr index 8dd849d75bd..560c38e1dc4 100644 --- a/Cabal-tests/tests/ParserTests/regressions/shake.expr +++ b/Cabal-tests/tests/ParserTests/regressions/shake.expr @@ -149,7 +149,8 @@ GenericPackageDescription { extraTmpFiles = [], extraDocFiles = [ SymbolicPath "CHANGES.txt", - SymbolicPath "README.md"]}, + SymbolicPath "README.md"], + extraFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [ MkPackageFlag { @@ -306,6 +307,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -519,6 +522,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -586,6 +591,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -660,6 +667,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -727,6 +736,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -805,6 +816,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -982,6 +995,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -1206,6 +1221,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -1271,6 +1288,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -1335,6 +1354,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -1406,6 +1427,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -1470,6 +1493,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -1545,6 +1570,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -1764,6 +1791,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -1992,6 +2021,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -2061,6 +2092,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -2130,6 +2163,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -2198,6 +2233,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -2273,6 +2310,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -2341,6 +2380,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -2420,6 +2461,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], diff --git a/Cabal-tests/tests/ParserTests/regressions/spdx-1.expr b/Cabal-tests/tests/ParserTests/regressions/spdx-1.expr index 2ca07bf2322..24f0aff227a 100644 --- a/Cabal-tests/tests/ParserTests/regressions/spdx-1.expr +++ b/Cabal-tests/tests/ParserTests/regressions/spdx-1.expr @@ -33,7 +33,8 @@ GenericPackageDescription { dataDir = SymbolicPath ".", extraSrcFiles = [], extraTmpFiles = [], - extraDocFiles = []}, + extraDocFiles = [], + extraFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [], condLibrary = Just @@ -95,6 +96,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], diff --git a/Cabal-tests/tests/ParserTests/regressions/spdx-2.expr b/Cabal-tests/tests/ParserTests/regressions/spdx-2.expr index 9c50edd4864..992486c3be5 100644 --- a/Cabal-tests/tests/ParserTests/regressions/spdx-2.expr +++ b/Cabal-tests/tests/ParserTests/regressions/spdx-2.expr @@ -37,7 +37,8 @@ GenericPackageDescription { dataDir = SymbolicPath ".", extraSrcFiles = [], extraTmpFiles = [], - extraDocFiles = []}, + extraDocFiles = [], + extraFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [], condLibrary = Just @@ -99,6 +100,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], diff --git a/Cabal-tests/tests/ParserTests/regressions/spdx-3.expr b/Cabal-tests/tests/ParserTests/regressions/spdx-3.expr index 944faa4c0c0..f38e0b24b30 100644 --- a/Cabal-tests/tests/ParserTests/regressions/spdx-3.expr +++ b/Cabal-tests/tests/ParserTests/regressions/spdx-3.expr @@ -37,7 +37,8 @@ GenericPackageDescription { dataDir = SymbolicPath ".", extraSrcFiles = [], extraTmpFiles = [], - extraDocFiles = []}, + extraDocFiles = [], + extraFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [], condLibrary = Just @@ -99,6 +100,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], diff --git a/Cabal-tests/tests/ParserTests/regressions/th-lift-instances.expr b/Cabal-tests/tests/ParserTests/regressions/th-lift-instances.expr index 8f2edf09a36..fa6fd5ee308 100644 --- a/Cabal-tests/tests/ParserTests/regressions/th-lift-instances.expr +++ b/Cabal-tests/tests/ParserTests/regressions/th-lift-instances.expr @@ -61,7 +61,8 @@ GenericPackageDescription { SymbolicPath ".vim.custom", SymbolicPath "README.md"], extraTmpFiles = [], - extraDocFiles = []}, + extraDocFiles = [], + extraFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [], condLibrary = Just @@ -127,6 +128,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -298,6 +301,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -473,6 +478,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -577,6 +584,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], diff --git a/Cabal-tests/tests/ParserTests/regressions/version-sets.expr b/Cabal-tests/tests/ParserTests/regressions/version-sets.expr index b134e4584ad..8983fa4ea73 100644 --- a/Cabal-tests/tests/ParserTests/regressions/version-sets.expr +++ b/Cabal-tests/tests/ParserTests/regressions/version-sets.expr @@ -59,7 +59,8 @@ GenericPackageDescription { dataDir = SymbolicPath ".", extraSrcFiles = [], extraTmpFiles = [], - extraDocFiles = []}, + extraDocFiles = [], + extraFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [], condLibrary = Just @@ -121,6 +122,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], diff --git a/Cabal-tests/tests/ParserTests/regressions/wl-pprint-indef.expr b/Cabal-tests/tests/ParserTests/regressions/wl-pprint-indef.expr index 03959b195c0..a8b4fa3c604 100644 --- a/Cabal-tests/tests/ParserTests/regressions/wl-pprint-indef.expr +++ b/Cabal-tests/tests/ParserTests/regressions/wl-pprint-indef.expr @@ -51,7 +51,8 @@ GenericPackageDescription { dataDir = SymbolicPath ".", extraSrcFiles = [], extraTmpFiles = [], - extraDocFiles = []}, + extraDocFiles = [], + extraFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [], condLibrary = Just @@ -114,6 +115,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], @@ -202,6 +205,8 @@ GenericPackageDescription { [], sharedOptions = PerCompilerFlavor [] [], + profSharedOptions = + PerCompilerFlavor [] [], staticOptions = PerCompilerFlavor [] [], customFieldsBI = [], diff --git a/Cabal-tests/tests/UnitTests/Distribution/Simple/Utils.hs b/Cabal-tests/tests/UnitTests/Distribution/Simple/Utils.hs index 2e544c8c52d..48e8aae9c1d 100644 --- a/Cabal-tests/tests/UnitTests/Distribution/Simple/Utils.hs +++ b/Cabal-tests/tests/UnitTests/Distribution/Simple/Utils.hs @@ -23,16 +23,14 @@ import Test.Tasty.HUnit withTempFileTest :: Assertion withTempFileTest = do fileName <- newIORef "" - tempDir <- getTemporaryDirectory - withTempFile tempDir ".foo" $ \fileName' _handle -> do + withTempFile ".foo" $ \fileName' _handle -> do writeIORef fileName fileName' fileExists <- readIORef fileName >>= doesFileExist assertBool "Temporary file not deleted by 'withTempFile'!" (not fileExists) withTempFileRemovedTest :: Assertion withTempFileRemovedTest = do - tempDir <- getTemporaryDirectory - withTempFile tempDir ".foo" $ \fileName handle -> do + withTempFile ".foo" $ \fileName handle -> do hClose handle removeFile fileName @@ -58,9 +56,8 @@ rawSystemStdInOutTextDecodingTest ghcPath -- so skip the test if it's not. | show localeEncoding /= "UTF-8" = return () | otherwise = do - tempDir <- getTemporaryDirectory - res <- withTempFile tempDir ".hs" $ \filenameHs handleHs -> do - withTempFile tempDir ".exe" $ \filenameExe handleExe -> do + res <- withTempFile ".hs" $ \filenameHs handleHs -> do + withTempFile ".exe" $ \filenameExe handleExe -> do -- Small program printing not utf8 hPutStrLn handleHs "import Data.ByteString" hPutStrLn handleHs "main = Data.ByteString.putStr (Data.ByteString.pack [32, 32, 255])" diff --git a/Cabal-tests/tests/UnitTests/Distribution/Utils/CharSet.hs b/Cabal-tests/tests/UnitTests/Distribution/Utils/CharSet.hs index c2180b630b7..a7d629ccb08 100644 --- a/Cabal-tests/tests/UnitTests/Distribution/Utils/CharSet.hs +++ b/Cabal-tests/tests/UnitTests/Distribution/Utils/CharSet.hs @@ -1,8 +1,4 @@ {-# LANGUAGE CPP #-} --- isAlpha and isAlphaNum definitions change from base to base -#if MIN_VERSION_base(4,12,0) && !MIN_VERSION_base(4,13,0) -#define HAS_TESTS -#endif module UnitTests.Distribution.Utils.CharSet where import Prelude hiding (Foldable(..)) diff --git a/Cabal-tests/tests/UnitTests/Distribution/Utils/Structured.hs b/Cabal-tests/tests/UnitTests/Distribution/Utils/Structured.hs index 641551473e8..025440c3598 100644 --- a/Cabal-tests/tests/UnitTests/Distribution/Utils/Structured.hs +++ b/Cabal-tests/tests/UnitTests/Distribution/Utils/Structured.hs @@ -13,8 +13,6 @@ import Distribution.Types.VersionRange (VersionRange) import Distribution.Types.GenericPackageDescription (GenericPackageDescription) import Distribution.Types.LocalBuildInfo (LocalBuildInfo) -import UnitTests.Orphans () - tests :: TestTree tests = testGroup "Distribution.Utils.Structured" -- This test also verifies that structureHash doesn't loop. @@ -32,16 +30,8 @@ md5Check proxy md5Int = structureHash proxy @?= md5FromInteger md5Int md5CheckGenericPackageDescription :: Proxy GenericPackageDescription -> Assertion md5CheckGenericPackageDescription proxy = md5Check proxy -#if MIN_VERSION_base(4,19,0) - 0x4acd7857947385180d814f36dc1a759e -#else - 0x3ff3fa6c3c570bcafa10b457b1208cc8 -#endif + 0x09251b46ffc5178a7526d31e794d9c62 md5CheckLocalBuildInfo :: Proxy LocalBuildInfo -> Assertion md5CheckLocalBuildInfo proxy = md5Check proxy -#if MIN_VERSION_base(4,19,0) - 0x552eca9ce2e4a34e74deff571f279fc4 -#else - 0x48497d6b3f15df06f1107b81b98febe1 -#endif + 0x93b7e8ebb5b9f879fa5fe49b1708b43b diff --git a/Cabal-tests/tests/UnitTests/Orphans.hs b/Cabal-tests/tests/UnitTests/Orphans.hs deleted file mode 100644 index d6b49a91929..00000000000 --- a/Cabal-tests/tests/UnitTests/Orphans.hs +++ /dev/null @@ -1,10 +0,0 @@ -{-# LANGUAGE CPP #-} -{-# LANGUAGE StandaloneDeriving #-} -{-# OPTIONS_GHC -fno-warn-orphans #-} -module UnitTests.Orphans where - -#if !MIN_VERSION_base(4,7,0) -import GHC.Fingerprint (Fingerprint (..)) - -deriving instance Show Fingerprint -#endif diff --git a/Cabal-tests/tests/custom-setup/CabalDoctestSetup.hs b/Cabal-tests/tests/custom-setup/CabalDoctestSetup.hs index a89ce9b36e7..a6a59c144c9 100644 --- a/Cabal-tests/tests/custom-setup/CabalDoctestSetup.hs +++ b/Cabal-tests/tests/custom-setup/CabalDoctestSetup.hs @@ -103,7 +103,7 @@ import Distribution.Simple (UserHooks (..), autoconfUserHooks, defaultMainWithHooks, simpleUserHooks) import Distribution.Simple.Compiler - (CompilerFlavor (GHC), CompilerId (..), PackageDB (..), compilerId) + (CompilerFlavor (GHC), CompilerId (..), PackageDB, PackageDBX (..), compilerId) import Distribution.Simple.LocalBuildInfo (ComponentLocalBuildInfo (componentPackageDeps), LocalBuildInfo, compiler, withExeLBI, withLibLBI, withPackageDB, withTestLBI @@ -119,8 +119,6 @@ import Distribution.Simple.Utils import Distribution.Text (display) import Distribution.Verbosity -import System.FilePath - (()) import qualified Data.Foldable as F (for_) @@ -160,7 +158,9 @@ import Distribution.Package import Distribution.Utils.Path ( SymbolicPathX , makeSymbolicPath - , makeRelativePathEx ) + , makeRelativePathEx + , interpretSymbolicPathCWD + , ()) import qualified Distribution.Utils.Path as Cabal (getSymbolicPath) import Distribution.Simple.Utils @@ -336,7 +336,7 @@ generateBuildModule testSuiteName flags pkg lbi = do let distPref = fromFlag (buildDistPref flags) -- Package DBs & environments - let dbStack = withPackageDB lbi ++ [ SpecificPackageDB $ toFilePath distPref "package.conf.inplace" ] + let dbStack = withPackageDB lbi ++ [ SpecificPackageDB $ distPref makeRelativePathEx "package.conf.inplace" ] let dbFlags = "-hide-all-packages" : packageDbArgs dbStack let envFlags | ghcCanBeToldToIgnorePkgEnvs = [ "-package-env=-" ] @@ -539,7 +539,7 @@ generateBuildModule testSuiteName flags pkg lbi = do : concatMap specific dbs _ -> ierror where - specific (SpecificPackageDB db) = [ "-package-conf=" ++ db ] + specific (SpecificPackageDB db) = [ "-package-conf=" ++ interpretSymbolicPathCWD db ] specific _ = ierror ierror = error $ "internal error: unexpected package db stack: " ++ show dbstack @@ -557,7 +557,7 @@ generateBuildModule testSuiteName flags pkg lbi = do dbs -> "-clear-package-db" : concatMap single dbs where - single (SpecificPackageDB db) = [ "-package-db=" ++ db ] + single (SpecificPackageDB db) = [ "-package-db=" ++ interpretSymbolicPathCWD db ] single GlobalPackageDB = [ "-global-package-db" ] single UserPackageDB = [ "-user-package-db" ] isSpecific (SpecificPackageDB _) = True diff --git a/Cabal-tests/tests/custom-setup/IdrisSetup.hs b/Cabal-tests/tests/custom-setup/IdrisSetup.hs index 952be052961..339f9fd9c38 100644 --- a/Cabal-tests/tests/custom-setup/IdrisSetup.hs +++ b/Cabal-tests/tests/custom-setup/IdrisSetup.hs @@ -45,10 +45,6 @@ module IdrisSetup (main) where # define MIN_VERSION_Cabal(x,y,z) 0 #endif -#if !defined(MIN_VERSION_base) -# define MIN_VERSION_base(x,y,z) 0 -#endif - import Control.Monad import Data.IORef import Control.Exception (SomeException, catch) @@ -85,11 +81,6 @@ configConfigurationsFlags = unFlagAssignment . S.configConfigurationsFlags configConfigurationsFlags = S.configConfigurationsFlags #endif -#if !MIN_VERSION_base(4,6,0) -lookupEnv :: String -> IO (Maybe String) -lookupEnv v = lookup v `fmap` getEnvironment -#endif - -- After Idris is built, we need to check and install the prelude and other libs -- ----------------------------------------------------------------------------- diff --git a/Cabal-tree-diff/Cabal-tree-diff.cabal b/Cabal-tree-diff/Cabal-tree-diff.cabal index a6f65532b1c..d7703621f8d 100644 --- a/Cabal-tree-diff/Cabal-tree-diff.cabal +++ b/Cabal-tree-diff/Cabal-tree-diff.cabal @@ -1,6 +1,6 @@ cabal-version: 2.2 name: Cabal-tree-diff -version: 3.13.0.0 +version: 3.15.0.0 synopsis: QuickCheck instances for types in Cabal category: Testing description: Provides tree-diff ToExpr instances for some types in Cabal @@ -11,8 +11,8 @@ library ghc-options: -Wall build-depends: , base - , Cabal-syntax ^>=3.13.0.0 - , Cabal ^>=3.13.0.0 + , Cabal-syntax ^>=3.15.0.0 + , Cabal ^>=3.15.0.0 , tree-diff ^>=0.1 || ^>=0.2 || ^>=0.3 exposed-modules: Data.TreeDiff.Instances.Cabal diff --git a/Cabal/Cabal.cabal b/Cabal/Cabal.cabal index e6a978234c2..a9e108d1f7b 100644 --- a/Cabal/Cabal.cabal +++ b/Cabal/Cabal.cabal @@ -1,6 +1,6 @@ cabal-version: 3.0 name: Cabal -version: 3.13.0.0 +version: 3.15.0.0 copyright: 2003-2024, Cabal Development Team (see AUTHORS file) license: BSD-3-Clause license-file: LICENSE @@ -34,12 +34,12 @@ library hs-source-dirs: src build-depends: - Cabal-syntax ^>= 3.13, + Cabal-syntax ^>= 3.15, array >= 0.4.0.1 && < 0.6, - base >= 4.11 && < 5, + base >= 4.13 && < 5, bytestring >= 0.10.0.0 && < 0.13, containers >= 0.5.0.0 && < 0.8, - deepseq >= 1.3.0.1 && < 1.6, + deepseq >= 1.3.0.1 && < 1.7, directory >= 1.2 && < 1.4, filepath >= 1.3.0.1 && < 1.6, pretty >= 1.1.1 && < 1.2, @@ -101,6 +101,7 @@ library Distribution.Simple.BuildPaths Distribution.Simple.BuildTarget Distribution.Simple.BuildToolDepends + Distribution.Simple.BuildWay Distribution.Simple.CCompiler Distribution.Simple.Command Distribution.Simple.Compiler @@ -188,7 +189,6 @@ library Distribution.Compat.Parsing, Distribution.Compat.Prelude, Distribution.Compat.Semigroup, - Distribution.Compat.Typeable, Distribution.Compiler, Distribution.FieldGrammar, Distribution.FieldGrammar.Class, @@ -248,6 +248,7 @@ library Distribution.Types.ConfVar, Distribution.Types.Dependency, Distribution.Types.DependencyMap, + Distribution.Types.DependencySatisfaction, Distribution.Types.ExeDependency, Distribution.Types.Executable, Distribution.Types.Executable.Lens, @@ -271,6 +272,8 @@ library Distribution.Types.Library.Lens, Distribution.Types.LibraryName, Distribution.Types.LibraryVisibility, + Distribution.Types.MissingDependency, + Distribution.Types.MissingDependencyReason, Distribution.Types.Mixin, Distribution.Types.Module, Distribution.Types.ModuleReexport, diff --git a/Cabal/ChangeLog.md b/Cabal/ChangeLog.md index 7aebc02edda..ea3b88e1082 100644 --- a/Cabal/ChangeLog.md +++ b/Cabal/ChangeLog.md @@ -1,3 +1,9 @@ +# 3.14.0.0 [Hécate](mailto:hecate+github@glitchbra.in) September 2024 +* See https://github.com/haskell/cabal/blob/master/release-notes/Cabal-3.14.0.0.md + +# 3.12.1.0 [Artem Pelenitsyn](mailto:a.pelenitsyn@gmail.com) June 2024 +* See https://github.com/haskell/cabal/blob/master/release-notes/Cabal-3.12.1.0.md + # 3.12.0.0 [Francesco Ariis](mailto:fa-ml@ariis.it) May 2024 # 3.12.0.0 [Francesco Ariis](mailto:fa-ml@ariis.it) March 2024 * See https://github.com/haskell/cabal/blob/master/release-notes/Cabal-3.12.0.0.md diff --git a/Cabal/Makefile b/Cabal/Makefile index a99f4edaeb5..e74ee82079d 100644 --- a/Cabal/Makefile +++ b/Cabal/Makefile @@ -1,4 +1,4 @@ -VERSION=3.13.0.0 +VERSION=3.15.0.0 #KIND=devel KIND=rc diff --git a/Cabal/src/Distribution/Backpack/Configure.hs b/Cabal/src/Distribution/Backpack/Configure.hs index 8e9eb18ae6a..f3dec5055ee 100644 --- a/Cabal/src/Distribution/Backpack/Configure.hs +++ b/Cabal/src/Distribution/Backpack/Configure.hs @@ -70,7 +70,7 @@ configureComponentLocalBuildInfos -> Flag String -- configIPID -> Flag ComponentId -- configCID -> PackageDescription - -> ([PreExistingComponent], [PromisedComponent]) + -> ([PreExistingComponent], [ConfiguredPromisedComponent]) -> FlagAssignment -- configConfigurationsFlags -> [(ModuleName, Module)] -- configInstantiateWith -> InstalledPackageIndex @@ -118,7 +118,7 @@ configureComponentLocalBuildInfos `Map.union` Map.fromListWith Map.union [ (pkg, Map.singleton (ann_cname aid) aid) - | PromisedComponent pkg aid <- promisedPkgDeps + | ConfiguredPromisedComponent pkg aid <- promisedPkgDeps ] graph1 <- toConfiguredComponents @@ -151,7 +151,7 @@ configureComponentLocalBuildInfos , emptyModuleShape ) ) - | PromisedComponent _ aid <- promisedPkgDeps + | ConfiguredPromisedComponent _ aid <- promisedPkgDeps ] uid_lookup def_uid | Just pkg <- PackageIndex.lookupUnitId installedPackageSet uid = @@ -208,7 +208,7 @@ configureComponentLocalBuildInfos toComponentLocalBuildInfos :: Compiler -> InstalledPackageIndex -- FULL set - -> [PromisedComponent] + -> [ConfiguredPromisedComponent] -> PackageDescription -> [PreExistingComponent] -- external package deps -> [ReadyComponent] diff --git a/Cabal/src/Distribution/Backpack/PreExistingComponent.hs b/Cabal/src/Distribution/Backpack/PreExistingComponent.hs index 5f937de9062..0fba79bcb87 100644 --- a/Cabal/src/Distribution/Backpack/PreExistingComponent.hs +++ b/Cabal/src/Distribution/Backpack/PreExistingComponent.hs @@ -1,7 +1,7 @@ -- | See module Distribution.Backpack.PreExistingComponent ( PreExistingComponent (..) - , PromisedComponent (..) + , ConfiguredPromisedComponent (..) , ipiToPreExistingComponent ) where @@ -24,12 +24,12 @@ import Distribution.Types.AnnotatedId -- These components are promised to @configure@ but are not yet built. -- -- In other words this is 'PreExistingComponent' which doesn't yet exist. -data PromisedComponent = PromisedComponent +data ConfiguredPromisedComponent = ConfiguredPromisedComponent { pr_pkgname :: PackageName , pr_cid :: AnnotatedId ComponentId } -instance Package PromisedComponent where +instance Package ConfiguredPromisedComponent where packageId = packageId . pr_cid -- | Stripped down version of 'LinkedComponent' for things diff --git a/Cabal/src/Distribution/Compat/Async.hs b/Cabal/src/Distribution/Compat/Async.hs index dbc22c58359..b1234c8e346 100644 --- a/Cabal/src/Distribution/Compat/Async.hs +++ b/Cabal/src/Distribution/Compat/Async.hs @@ -29,6 +29,8 @@ import Control.Exception ( BlockedIndefinitelyOnMVar (..) , Exception (..) , SomeException (..) + , asyncExceptionFromException + , asyncExceptionToException , catch , evaluate , mask @@ -41,10 +43,6 @@ import Control.Monad (void) import Data.Typeable (Typeable) import GHC.Exts (inline) -#if MIN_VERSION_base(4,7,0) -import Control.Exception (asyncExceptionFromException, asyncExceptionToException) -#endif - -- | Async, but based on 'MVar', as we don't depend on @stm@. data AsyncM a = Async { asyncThreadId :: {-# UNPACK #-} !ThreadId @@ -148,15 +146,11 @@ data AsyncCancelled = AsyncCancelled , Typeable ) -{- FOURMOLU_DISABLE -} instance Exception AsyncCancelled where -#if MIN_VERSION_base(4,7,0) -- wraps in SomeAsyncException -- See https://github.com/ghc/ghc/commit/756a970eacbb6a19230ee3ba57e24999e4157b09 fromException = asyncExceptionFromException toException = asyncExceptionToException -#endif -{- FOURMOLU_ENABLE -} -- | Cancel an asynchronous action -- diff --git a/Cabal/src/Distribution/Compat/ResponseFile.hs b/Cabal/src/Distribution/Compat/ResponseFile.hs index 189a423bd08..8619ae56962 100644 --- a/Cabal/src/Distribution/Compat/ResponseFile.hs +++ b/Cabal/src/Distribution/Compat/ResponseFile.hs @@ -8,63 +8,15 @@ module Distribution.Compat.ResponseFile (expandResponse, escapeArgs) where import Distribution.Compat.Prelude + +import GHC.ResponseFile (escapeArgs, unescapeArgs) + import Prelude () import System.FilePath import System.IO (hPutStrLn, stderr) import System.IO.Error -#if MIN_VERSION_base(4,12,0) -import GHC.ResponseFile (unescapeArgs, escapeArgs) -#else - -unescapeArgs :: String -> [String] -unescapeArgs = filter (not . null) . unescape - -data Quoting = NoneQ | SngQ | DblQ - -unescape :: String -> [String] -unescape args = reverse . map reverse $ go args NoneQ False [] [] - where - -- n.b., the order of these cases matters; these are cribbed from gcc - -- case 1: end of input - go [] _q _bs a as = a:as - -- case 2: back-slash escape in progress - go (c:cs) q True a as = go cs q False (c:a) as - -- case 3: no back-slash escape in progress, but got a back-slash - go (c:cs) q False a as - | '\\' == c = go cs q True a as - -- case 4: single-quote escaping in progress - go (c:cs) SngQ False a as - | '\'' == c = go cs NoneQ False a as - | otherwise = go cs SngQ False (c:a) as - -- case 5: double-quote escaping in progress - go (c:cs) DblQ False a as - | '"' == c = go cs NoneQ False a as - | otherwise = go cs DblQ False (c:a) as - -- case 6: no escaping is in progress - go (c:cs) NoneQ False a as - | isSpace c = go cs NoneQ False [] (a:as) - | '\'' == c = go cs SngQ False a as - | '"' == c = go cs DblQ False a as - | otherwise = go cs NoneQ False (c:a) as - -escapeArgs :: [String] -> String -escapeArgs = unlines . map escapeArg - -escapeArg :: String -> String -escapeArg = reverse . foldl' escape [] - -escape :: String -> Char -> String -escape cs c - | isSpace c - || '\\' == c - || '\'' == c - || '"' == c = c:'\\':cs -- n.b., our caller must reverse the result - | otherwise = c:cs - -#endif - -- | The arg file / response file parser. -- -- This is not a well-documented capability, and is a bit eccentric diff --git a/Cabal/src/Distribution/Compat/Stack.hs b/Cabal/src/Distribution/Compat/Stack.hs index 41d4ff8b460..616a66d090d 100644 --- a/Cabal/src/Distribution/Compat/Stack.hs +++ b/Cabal/src/Distribution/Compat/Stack.hs @@ -13,91 +13,31 @@ module Distribution.Compat.Stack , parentSrcLocPrefix ) where -import System.IO.Error - -#ifdef MIN_VERSION_base -#if MIN_VERSION_base(4,8,1) -#define GHC_STACK_SUPPORTED 1 -#endif -#endif - -#ifdef GHC_STACK_SUPPORTED import GHC.Stack -#endif - -#ifdef GHC_STACK_SUPPORTED +import System.IO.Error -#if MIN_VERSION_base(4,9,0) type WithCallStack a = HasCallStack => a -#elif MIN_VERSION_base(4,8,1) -type WithCallStack a = (?callStack :: CallStack) => a -#endif - -#if !MIN_VERSION_base(4,9,0) --- NB: Can't say WithCallStack (WithCallStack a -> a); --- Haskell doesn't support this kind of implicit parameter! --- See https://mail.haskell.org/pipermail/ghc-devs/2016-January/011096.html --- Since this function doesn't do anything, it's OK to --- give it a less good type. -withFrozenCallStack :: WithCallStack (a -> a) -withFrozenCallStack x = x - -callStack :: (?callStack :: CallStack) => CallStack -callStack = ?callStack - -prettyCallStack :: CallStack -> String -prettyCallStack = showCallStack -#endif -- | Give the *parent* of the person who invoked this; -- so it's most suitable for being called from a utility function. -- You probably want to call this using 'withFrozenCallStack'; otherwise -- it's not very useful. We didn't implement this for base-4.8.1 -- because we cannot rely on freezing to have taken place. --- parentSrcLocPrefix :: WithCallStack String -#if MIN_VERSION_base(4,9,0) parentSrcLocPrefix = case getCallStack callStack of - (_:(_, loc):_) -> showLoc loc + (_ : (_, loc) : _) -> showLoc loc [(_, loc)] -> showLoc loc [] -> error "parentSrcLocPrefix: empty call stack" - where - showLoc loc = - srcLocFile loc ++ ":" ++ show (srcLocStartLine loc) ++ ": " -#else -parentSrcLocPrefix = "Call sites not available with base < 4.9.0.0 (GHC 8.0): " -#endif + where + showLoc loc = + srcLocFile loc ++ ":" ++ show (srcLocStartLine loc) ++ ": " -- Yeah, this uses skivvy implementation details. withLexicalCallStack :: (a -> WithCallStack (IO b)) -> WithCallStack (a -> IO b) withLexicalCallStack f = - let stk = ?callStack - in \x -> let ?callStack = stk in f x - -#else - -data CallStack = CallStack - deriving (Eq, Show) - -type WithCallStack a = a - -withFrozenCallStack :: a -> a -withFrozenCallStack x = x - -callStack :: CallStack -callStack = CallStack - -prettyCallStack :: CallStack -> String -prettyCallStack _ = "Call stacks not available with base < 4.8.1.0 (GHC 7.10)" - -parentSrcLocPrefix :: String -parentSrcLocPrefix = "Call sites not available with base < 4.9.0.0 (GHC 8.0): " - -withLexicalCallStack :: (a -> IO b) -> a -> IO b -withLexicalCallStack f = f - -#endif + let stk = ?callStack + in \x -> let ?callStack = stk in f x -- | This function is for when you *really* want to add a call -- stack to raised IO, but you don't have a diff --git a/Cabal/src/Distribution/Compat/Time.hs b/Cabal/src/Distribution/Compat/Time.hs index 9af0500fae1..03d57449eb4 100644 --- a/Cabal/src/Distribution/Compat/Time.hs +++ b/Cabal/src/Distribution/Compat/Time.hs @@ -34,11 +34,7 @@ import Data.Time.Clock.POSIX (POSIXTime, getPOSIXTime, posixDayLength) import qualified Prelude import Data.Bits ((.|.), unsafeShiftL) -#if MIN_VERSION_base(4,7,0) import Data.Bits (finiteBitSize) -#else -import Data.Bits (bitSize) -#endif import Foreign ( allocaBytes, peekByteOff ) import System.IO.Error ( mkIOError, doesNotExistErrorType ) @@ -92,15 +88,9 @@ getModTime path = allocaBytes size_WIN32_FILE_ATTRIBUTE_DATA $ \info -> do index_WIN32_FILE_ATTRIBUTE_DATA_ftLastWriteTime_dwLowDateTime dwHigh <- peekByteOff info index_WIN32_FILE_ATTRIBUTE_DATA_ftLastWriteTime_dwHighDateTime -#if MIN_VERSION_base(4,7,0) let qwTime = (fromIntegral (dwHigh :: DWORD) `unsafeShiftL` finiteBitSize dwHigh) .|. (fromIntegral (dwLow :: DWORD)) -#else - let qwTime = - (fromIntegral (dwHigh :: DWORD) `unsafeShiftL` bitSize dwHigh) - .|. (fromIntegral (dwLow :: DWORD)) -#endif return $! ModTime (qwTime :: Word64) {- FOURMOLU_DISABLE -} diff --git a/Cabal/src/Distribution/PackageDescription/Check.hs b/Cabal/src/Distribution/PackageDescription/Check.hs index ef97b0d23be..8bab6ec961a 100644 --- a/Cabal/src/Distribution/PackageDescription/Check.hs +++ b/Cabal/src/Distribution/PackageDescription/Check.hs @@ -409,6 +409,7 @@ checkPackageDescription extraSrcFiles_ extraTmpFiles_ extraDocFiles_ + extraFiles_ ) = do -- § Sanity checks. checkPackageId package_ @@ -456,6 +457,7 @@ checkPackageDescription mapM_ (checkPath False "extra-source-files" PathKindGlob . getSymbolicPath) extraSrcFiles_ mapM_ (checkPath False "extra-tmp-files" PathKindFile . getSymbolicPath) extraTmpFiles_ mapM_ (checkPath False "extra-doc-files" PathKindGlob . getSymbolicPath) extraDocFiles_ + mapM_ (checkPath False "extra-files" PathKindGlob . getSymbolicPath) extraFiles_ mapM_ (checkPath False "data-files" PathKindGlob . getSymbolicPath) dataFiles_ let rawDataDir = getSymbolicPath dataDir_ checkPath True "data-dir" PathKindDirectory rawDataDir @@ -465,15 +467,17 @@ checkPackageDescription -- § Globs. dataGlobs <- mapM (checkGlob "data-files" . getSymbolicPath) dataFiles_ - extraGlobs <- mapM (checkGlob "extra-source-files" . getSymbolicPath) extraSrcFiles_ + extraSrcGlobs <- mapM (checkGlob "extra-source-files" . getSymbolicPath) extraSrcFiles_ docGlobs <- mapM (checkGlob "extra-doc-files" . getSymbolicPath) extraDocFiles_ + extraGlobs <- mapM (checkGlob "extra-files" . getSymbolicPath) extraFiles_ -- We collect globs to feed them to checkMissingDocs. -- § Missing documentation. checkMissingDocs (catMaybes dataGlobs) - (catMaybes extraGlobs) + (catMaybes extraSrcGlobs) (catMaybes docGlobs) + (catMaybes extraGlobs) -- § Datafield checks. checkSetupBuildInfo setupBuildInfo_ @@ -519,6 +523,7 @@ checkPackageDescription checkCabalFile (packageName pkg) mapM_ (checkGlobFile specVersion_ "." "extra-source-files" . getSymbolicPath) extraSrcFiles_ mapM_ (checkGlobFile specVersion_ "." "extra-doc-files" . getSymbolicPath) extraDocFiles_ + mapM_ (checkGlobFile specVersion_ "." "extra-files" . getSymbolicPath) extraFiles_ mapM_ (checkGlobFile specVersion_ rawDataDir "data-files" . getSymbolicPath) dataFiles_ where checkNull @@ -679,6 +684,7 @@ checkSourceRepos rs = do checkP (isNothing repoLocation_) (PackageDistInexcusable MissingLocation) + checkGitProtocol repoLocation_ checkP ( repoType_ == Just (KnownRepoType CVS) && isNothing repoModule_ @@ -717,6 +723,17 @@ checkMissingVcsInfo rs = repoTypeDirname Monotone = ["_MTN"] repoTypeDirname Pijul = [".pijul"] +-- git:// lacks TLS or other encryption, see +-- https://git-scm.com/book/en/v2/Git-on-the-Server-The-Protocols#_the_cons_4 +checkGitProtocol + :: Monad m + => Maybe String -- Repository location + -> CheckM m () +checkGitProtocol mloc = + checkP + (fmap (isPrefixOf "git://") mloc == Just True) + (PackageBuildWarning GitProtocol) + -- ------------------------------------------------------------ -- Package and distribution checks -- ------------------------------------------------------------ @@ -985,8 +1002,9 @@ checkMissingDocs => [Glob] -- data-files globs. -> [Glob] -- extra-source-files globs. -> [Glob] -- extra-doc-files globs. + -> [Glob] -- extra-files globs. -> CheckM m () -checkMissingDocs dgs esgs edgs = do +checkMissingDocs dgs esgs edgs efgs = do extraDocSupport <- (>= CabalSpecV1_18) <$> asksCM ccSpecVersion -- Everything in this block uses CheckPreDistributionOps interface. @@ -1005,9 +1023,10 @@ checkMissingDocs dgs esgs edgs = do rgs <- realGlob dgs res <- realGlob esgs red <- realGlob edgs + ref <- realGlob efgs -- 3. Check if anything in 1. is missing in 2. - let mcs = checkDoc extraDocSupport des (rgs ++ res ++ red) + let mcs = checkDoc extraDocSupport des (rgs ++ res ++ red ++ ref) -- 4. Check if files are present but in the wrong field. let pcsData = checkDocMove extraDocSupport "data-files" des rgs diff --git a/Cabal/src/Distribution/PackageDescription/Check/Warning.hs b/Cabal/src/Distribution/PackageDescription/Check/Warning.hs index 859b3f12c50..8588333c1a5 100644 --- a/Cabal/src/Distribution/PackageDescription/Check/Warning.hs +++ b/Cabal/src/Distribution/PackageDescription/Check/Warning.hs @@ -47,7 +47,7 @@ import Distribution.Types.PackageName (PackageName) import Distribution.Types.TestType (TestType, knownTestTypes) import Distribution.Types.UnqualComponentName import Distribution.Types.Version (Version) -import Distribution.Utils.Path +import Distribution.Utils.Path (FileOrDir (..), Pkg, RelativePath, getSymbolicPath) import Language.Haskell.Extension (Extension) import qualified Data.Either as Either @@ -193,6 +193,7 @@ data CheckExplanation | UnrecognisedSourceRepo String | MissingType | MissingLocation + | GitProtocol | MissingModule | MissingTag | SubdirRelPath @@ -355,6 +356,7 @@ data CheckExplanationID | CIUnrecognisedSourceRepo | CIMissingType | CIMissingLocation + | CIGitProtocol | CIMissingModule | CIMissingTag | CISubdirRelPath @@ -496,6 +498,7 @@ checkExplanationId (NoLicenseFile{}) = CINoLicenseFile checkExplanationId (UnrecognisedSourceRepo{}) = CIUnrecognisedSourceRepo checkExplanationId (MissingType{}) = CIMissingType checkExplanationId (MissingLocation{}) = CIMissingLocation +checkExplanationId (GitProtocol{}) = CIGitProtocol checkExplanationId (MissingModule{}) = CIMissingModule checkExplanationId (MissingTag{}) = CIMissingTag checkExplanationId (SubdirRelPath{}) = CISubdirRelPath @@ -642,6 +645,7 @@ ppCheckExplanationId CINoLicenseFile = "no-license-file" ppCheckExplanationId CIUnrecognisedSourceRepo = "unrecognised-repo-type" ppCheckExplanationId CIMissingType = "repo-no-type" ppCheckExplanationId CIMissingLocation = "repo-no-location" +ppCheckExplanationId CIGitProtocol = "git-protocol" ppCheckExplanationId CIMissingModule = "repo-no-module" ppCheckExplanationId CIMissingTag = "repo-no-tag" ppCheckExplanationId CISubdirRelPath = "repo-relative-dir" @@ -964,6 +968,10 @@ ppExplanation MissingType = "The source-repository 'type' is a required field." ppExplanation MissingLocation = "The source-repository 'location' is a required field." +ppExplanation GitProtocol = + "Cloning over git:// might lead to an arbitrary code execution " + ++ "vulnerability. Furthermore, popular forges like GitHub do " + ++ "not support it. Use https:// or ssh:// instead." ppExplanation MissingModule = "For a CVS source-repository, the 'module' is a required field." ppExplanation MissingTag = diff --git a/Cabal/src/Distribution/Simple.hs b/Cabal/src/Distribution/Simple.hs index 85eabcbe93c..3533cf78336 100644 --- a/Cabal/src/Distribution/Simple.hs +++ b/Cabal/src/Distribution/Simple.hs @@ -67,6 +67,7 @@ module Distribution.Simple -- ** Standard sets of hooks , simpleUserHooks , autoconfUserHooks + , autoconfSetupHooks , emptyUserHooks ) where @@ -110,6 +111,7 @@ import Distribution.Simple.SetupHooks.Internal ) import Distribution.Simple.Test import Distribution.Simple.Utils +import qualified Distribution.Types.LocalBuildConfig as LBC import Distribution.Utils.Path import Distribution.Verbosity import Distribution.Version @@ -548,7 +550,7 @@ cleanAction globalFlags hooks flags args = do flags' = flags{cleanCommonFlags = common'} - mbWorkDirFlag = cleanWorkingDir flags + mbWorkDirFlag = cleanWorkingDir flags' mbWorkDir = flagToMaybe mbWorkDirFlag pbi <- preClean hooks args flags' @@ -935,16 +937,11 @@ autoconfUserHooks = let common = configCommonFlags flags verbosity = fromFlag $ setupVerbosity common mbWorkDir = flagToMaybe $ setupWorkingDir common - baseDir = packageRoot common - confExists <- doesFileExist $ baseDir "configure" - if confExists - then - runConfigureScript - verbosity - flags - lbi - else dieWithException verbosity ConfigureScriptNotFound - + runConfigureScript + flags + (flagAssignment lbi) + (withPrograms lbi) + (hostPlatform lbi) pbi <- getHookedBuildInfo verbosity mbWorkDir (buildDir lbi) sanityCheckHookedBuildInfo verbosity pkg_descr pbi let pkg_descr' = updatePackageDescription pbi pkg_descr @@ -991,6 +988,65 @@ getHookedBuildInfo verbosity mbWorkDir build_dir = do info verbosity $ "Reading parameters from " ++ getSymbolicPath infoFile readHookedBuildInfo verbosity mbWorkDir infoFile +autoconfSetupHooks :: SetupHooks +autoconfSetupHooks = + SetupHooks.noSetupHooks + { SetupHooks.configureHooks = + SetupHooks.noConfigureHooks + { SetupHooks.postConfPackageHook = Just post_conf_pkg + , SetupHooks.preConfComponentHook = Just pre_conf_comp + } + } + where + post_conf_pkg + :: SetupHooks.PostConfPackageInputs + -> IO () + post_conf_pkg + ( SetupHooks.PostConfPackageInputs + { SetupHooks.localBuildConfig = + LBC.LocalBuildConfig{LBC.withPrograms = progs} + , SetupHooks.packageBuildDescr = + LBC.PackageBuildDescr + { LBC.configFlags = cfg + , LBC.flagAssignment = flags + , LBC.hostPlatform = plat + } + } + ) = runConfigureScript cfg flags progs plat + + pre_conf_comp + :: SetupHooks.PreConfComponentInputs + -> IO SetupHooks.PreConfComponentOutputs + pre_conf_comp + ( SetupHooks.PreConfComponentInputs + { SetupHooks.packageBuildDescr = + LBC.PackageBuildDescr + { LBC.configFlags = cfg + , localPkgDescr = pkg_descr + } + , SetupHooks.component = component + } + ) = do + let verbosity = fromFlag $ configVerbosity cfg + mbWorkDir = flagToMaybe $ configWorkingDir cfg + distPref = configDistPref cfg + dist_dir <- findDistPrefOrDefault distPref + -- Read the ".buildinfo" file and use that to update + -- the components (main library + executables only). + hbi <- getHookedBuildInfo verbosity mbWorkDir (dist_dir makeRelativePathEx "build") + sanityCheckHookedBuildInfo verbosity pkg_descr hbi + -- SetupHooks TODO: we are reading getHookedBuildInfo once + -- for each component. I think this is inherent to the SetupHooks + -- approach. + let comp_name = componentName component + diff <- case SetupHooks.hookedBuildInfoComponentDiff_maybe hbi comp_name of + Nothing -> return $ SetupHooks.emptyComponentDiff comp_name + Just do_diff -> do_diff + return $ + SetupHooks.PreConfComponentOutputs + { SetupHooks.componentDiff = diff + } + defaultTestHook :: Args -> PackageDescription @@ -1038,6 +1094,7 @@ defaultInstallHook_setupHooks inst_hooks pkg_descr localbuildinfo _ flags = do defaultRegisterFlags { regInPlace = installInPlace flags , regPackageDB = installPackageDB flags + , registerCommonFlags = installCommonFlags flags } when (hasLibs pkg_descr) $ register pkg_descr localbuildinfo registerFlags diff --git a/Cabal/src/Distribution/Simple/Build.hs b/Cabal/src/Distribution/Simple/Build.hs index f22b5790239..e153c25b9d7 100644 --- a/Cabal/src/Distribution/Simple/Build.hs +++ b/Cabal/src/Distribution/Simple/Build.hs @@ -275,7 +275,6 @@ dumpBuildInfo -- ^ Flags that the user passed to build -> IO () dumpBuildInfo verbosity distPref dumpBuildInfoFlag pkg_descr lbi flags = do - let mbWorkDir = flagToMaybe $ buildWorkingDir flags when shouldDumpBuildInfo $ do -- Changing this line might break consumers of the dumped build info. -- Announce changes on mailing lists! @@ -289,13 +288,12 @@ dumpBuildInfo verbosity distPref dumpBuildInfoFlag pkg_descr lbi flags = do activeTargets ) - wdir <- absoluteWorkingDir mbWorkDir - (compilerProg, _) <- case flavorToProgram (compilerFlavor (compiler lbi)) of Nothing -> dieWithException verbosity $ UnknownCompilerFlavor (compilerFlavor (compiler lbi)) Just program -> requireProgram verbosity program (withPrograms lbi) + wdir <- absoluteWorkingDirLBI lbi let (warns, json) = mkBuildInfo wdir pkg_descr lbi flags (compilerProg, compiler lbi) activeTargets buildInfoText = renderJson json unless (null warns) $ @@ -791,7 +789,7 @@ testSuiteLibV09AsLibAndExe -> TestSuite -> ComponentLocalBuildInfo -> LocalBuildInfo - -> FilePath + -> AbsolutePath (Dir Pkg) -- ^ absolute inplace dir -> SymbolicPath Pkg (Dir Dist) -> ( PackageDescription @@ -911,7 +909,7 @@ createInternalPackageDB verbosity lbi distPref = do existsAlready <- doesPackageDBExist dbPath when existsAlready $ deletePackageDB dbPath createPackageDB verbosity (compiler lbi) (withPrograms lbi) False dbPath - return (SpecificPackageDB dbPath) + return (SpecificPackageDB dbRelPath) where dbRelPath = internalPackageDBPath lbi distPref dbPath = interpretSymbolicPathLBI lbi dbRelPath diff --git a/Cabal/src/Distribution/Simple/Build/PathsModule/Z.hs b/Cabal/src/Distribution/Simple/Build/PathsModule/Z.hs index 25c924720ec..ad979c42951 100644 --- a/Cabal/src/Distribution/Simple/Build/PathsModule/Z.hs +++ b/Cabal/src/Distribution/Simple/Build/PathsModule/Z.hs @@ -69,7 +69,6 @@ render z_root = execWriter $ do return () tell "\n" tell "import qualified Control.Exception as Exception\n" - tell "import qualified Data.List as List\n" tell "import Data.Version (Version(..))\n" tell "import System.Environment (getEnv)\n" tell "import Prelude\n" @@ -306,9 +305,14 @@ render z_root = execWriter $ do tell "joinFileName \"\" fname = fname\n" tell "joinFileName \".\" fname = fname\n" tell "joinFileName dir \"\" = dir\n" - tell "joinFileName dir fname\n" - tell " | isPathSeparator (List.last dir) = dir ++ fname\n" + tell "joinFileName dir@(c:cs) fname\n" + tell " | isPathSeparator (lastChar c cs) = dir ++ fname\n" tell " | otherwise = dir ++ pathSeparator : fname\n" + tell " where\n" + tell " -- We do not use Data.List.NonEmpty.last, as that would limit the module to\n" + tell " -- base >= 4.9.0.0 (GHC >= 8.0.1).\n" + tell " lastChar x [] = x\n" + tell " lastChar _ (x:xs) = lastChar x xs\n" tell "\n" tell "pathSeparator :: Char\n" if (zIsWindows z_root) diff --git a/Cabal/src/Distribution/Simple/BuildPaths.hs b/Cabal/src/Distribution/Simple/BuildPaths.hs index 4c44bd380f2..0875de87c91 100644 --- a/Cabal/src/Distribution/Simple/BuildPaths.hs +++ b/Cabal/src/Distribution/Simple/BuildPaths.hs @@ -19,6 +19,9 @@ module Distribution.Simple.BuildPaths , srcPref , buildInfoPref , haddockDirName + , haddockLibraryDirPath + , haddockTestDirPath + , haddockBenchmarkDirPath , hscolourPref , haddockPref , autogenPackageModulesDir @@ -26,12 +29,17 @@ module Distribution.Simple.BuildPaths , autogenPathsModuleName , autogenPackageInfoModuleName , cppHeaderName - , haddockName + , haddockPath + , haddockPackageLibraryName + , haddockPackageLibraryName' + , haddockLibraryName + , haddockLibraryPath , mkGenericStaticLibName , mkLibName , mkProfLibName , mkGenericSharedLibName , mkSharedLibName + , mkProfSharedLibName , mkStaticLibName , mkGenericSharedBundledLibName , exeExtension @@ -43,6 +51,8 @@ module Distribution.Simple.BuildPaths , getSourceFiles , getLibSourceFiles , getExeSourceFiles + , getTestSourceFiles + , getBenchmarkSourceFiles , getFLibSourceFiles , exeBuildDir , flibBuildDir @@ -91,10 +101,44 @@ buildInfoPref distPref = distPref makeRelativePathEx "build-info.json" -- | This is the name of the directory in which the generated haddocks -- should be stored. It does not include the @/doc/html@ prefix. +-- +-- It is also used by `haddock-project` when constructing its output directory. haddockDirName :: HaddockTarget -> PackageDescription -> FilePath haddockDirName ForDevelopment = prettyShow . packageName haddockDirName ForHackage = (++ "-docs") . prettyShow . packageId +-- | This is the name of the directory in which the generated haddocks for +-- a (sub)library should be stored. It does not include the @/doc/html@ +-- prefix. +-- +-- It is also used by `haddock-project` when constructing its output directory. +haddockLibraryDirPath + :: HaddockTarget + -> PackageDescription + -> Library + -> FilePath +haddockLibraryDirPath haddockTarget pkg_descr lib = + case libName lib of + LSubLibName sublib_name -> + haddockDirName haddockTarget pkg_descr prettyShow sublib_name + _ -> haddockDirName haddockTarget pkg_descr + +haddockTestDirPath + :: HaddockTarget + -> PackageDescription + -> TestSuite + -> FilePath +haddockTestDirPath haddockTarget pkg_descr test = + haddockDirName haddockTarget pkg_descr prettyShow (testName test) + +haddockBenchmarkDirPath + :: HaddockTarget + -> PackageDescription + -> Benchmark + -> FilePath +haddockBenchmarkDirPath haddockTarget pkg_descr bench = + haddockDirName haddockTarget pkg_descr prettyShow (benchmarkName bench) + -- | The directory to which generated haddock documentation should be written. haddockPref :: HaddockTarget @@ -138,8 +182,35 @@ autogenPackageInfoModuleName pkg_descr = fixchar '-' = '_' fixchar c = c -haddockName :: PackageDescription -> FilePath -haddockName pkg_descr = prettyShow (packageName pkg_descr) <.> "haddock" +haddockPath :: PackageDescription -> FilePath +haddockPath pkg_descr = prettyShow (packageName pkg_descr) <.> "haddock" + +-- | A name of a (sub)library used by haddock, in the form +-- `:` if it is a sublibrary, or `` if it is the +-- main library. +-- +-- Used by `haddock-project` and `Distribution.Simple.Haddock`. +haddockPackageLibraryName :: PackageDescription -> Library -> String +haddockPackageLibraryName pkg_descr lib = + haddockPackageLibraryName' (packageName pkg_descr) (libName lib) + +haddockPackageLibraryName' :: PackageName -> LibraryName -> String +haddockPackageLibraryName' pkg_name lib_name = + case lib_name of + LSubLibName sublib_name -> + prettyShow pkg_name ++ ":" ++ prettyShow sublib_name + LMainLibName -> prettyShow pkg_name + +-- | A name of a (sub)library used by haddock. +haddockLibraryName :: PackageDescription -> Library -> String +haddockLibraryName pkg_descr lib = + case libName lib of + LSubLibName sublib_name -> prettyShow sublib_name + LMainLibName -> prettyShow (packageName pkg_descr) + +-- | File path of the ".haddock" file. +haddockLibraryPath :: PackageDescription -> Library -> FilePath +haddockLibraryPath pkg_descr lib = haddockLibraryName pkg_descr lib <.> "haddock" -- ----------------------------------------------------------------------------- -- Source File helper @@ -183,6 +254,48 @@ getExeSourceFiles verbosity lbi exe clbi = do : coerceSymbolicPath (exeBuildDir lbi exe) : hsSourceDirs bi +getTestSourceFiles + :: Verbosity + -> LocalBuildInfo + -> TestSuite + -> ComponentLocalBuildInfo + -> IO [(ModuleName.ModuleName, SymbolicPath Pkg 'File)] +getTestSourceFiles verbosity lbi test@TestSuite{testInterface = TestSuiteExeV10 _ path} clbi = do + moduleFiles <- getSourceFiles verbosity mbWorkDir searchpaths modules + srcMainPath <- findFileCwd verbosity mbWorkDir (hsSourceDirs bi) path + return ((ModuleName.main, srcMainPath) : moduleFiles) + where + mbWorkDir = mbWorkDirLBI lbi + bi = testBuildInfo test + modules = otherModules bi + searchpaths = + autogenComponentModulesDir lbi clbi + : autogenPackageModulesDir lbi + : coerceSymbolicPath (testBuildDir lbi test) + : hsSourceDirs bi +getTestSourceFiles _ _ _ _ = return [] + +getBenchmarkSourceFiles + :: Verbosity + -> LocalBuildInfo + -> Benchmark + -> ComponentLocalBuildInfo + -> IO [(ModuleName.ModuleName, SymbolicPath Pkg 'File)] +getBenchmarkSourceFiles verbosity lbi bench@Benchmark{benchmarkInterface = BenchmarkExeV10 _ path} clbi = do + moduleFiles <- getSourceFiles verbosity mbWorkDir searchpaths modules + srcMainPath <- findFileCwd verbosity mbWorkDir (hsSourceDirs bi) path + return ((ModuleName.main, srcMainPath) : moduleFiles) + where + mbWorkDir = mbWorkDirLBI lbi + bi = benchmarkBuildInfo bench + modules = otherModules bi + searchpaths = + autogenComponentModulesDir lbi clbi + : autogenPackageModulesDir lbi + : coerceSymbolicPath (benchmarkBuildDir lbi bench) + : hsSourceDirs bi +getBenchmarkSourceFiles _ _ _ _ = return [] + getFLibSourceFiles :: Verbosity -> LocalBuildInfo @@ -283,6 +396,10 @@ mkSharedLibName :: Platform -> CompilerId -> UnitId -> String mkSharedLibName platform comp lib = mkGenericSharedLibName platform comp (getHSLibraryName lib) +mkProfSharedLibName :: Platform -> CompilerId -> UnitId -> String +mkProfSharedLibName platform comp lib = + mkGenericSharedLibName platform comp (getHSLibraryName lib ++ "_p") + -- Static libs are named the same as shared libraries, only with -- a different extension. mkStaticLibName :: Platform -> CompilerId -> UnitId -> String diff --git a/Cabal/src/Distribution/Simple/BuildWay.hs b/Cabal/src/Distribution/Simple/BuildWay.hs new file mode 100644 index 00000000000..614c229d462 --- /dev/null +++ b/Cabal/src/Distribution/Simple/BuildWay.hs @@ -0,0 +1,14 @@ +{-# LANGUAGE LambdaCase #-} + +module Distribution.Simple.BuildWay where + +data BuildWay = StaticWay | DynWay | ProfWay | ProfDynWay + deriving (Eq, Ord, Show, Read, Enum) + +-- | Returns the object/interface extension prefix for the given build way (e.g. "dyn_" for 'DynWay') +buildWayPrefix :: BuildWay -> String +buildWayPrefix = \case + StaticWay -> "" + ProfWay -> "p_" + DynWay -> "dyn_" + ProfDynWay -> "p_dyn_" diff --git a/Cabal/src/Distribution/Simple/Compiler.hs b/Cabal/src/Distribution/Simple/Compiler.hs index ae8d1c05136..52395a56668 100644 --- a/Cabal/src/Distribution/Simple/Compiler.hs +++ b/Cabal/src/Distribution/Simple/Compiler.hs @@ -1,6 +1,9 @@ {-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} +{-# LANGUAGE DeriveFoldable #-} +{-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE DeriveGeneric #-} +{-# LANGUAGE DeriveTraversable #-} ----------------------------------------------------------------------------- @@ -35,11 +38,21 @@ module Distribution.Simple.Compiler , compilerInfo -- * Support for package databases - , PackageDB (..) + , PackageDB , PackageDBStack + , PackageDBCWD + , PackageDBStackCWD + , PackageDBX (..) + , PackageDBStackX + , PackageDBS + , PackageDBStackS , registrationPackageDB , absolutePackageDBPaths , absolutePackageDBPath + , interpretPackageDB + , interpretPackageDBStack + , coercePackageDB + , coercePackageDBStack -- * Support for optimisation levels , OptimisationLevel (..) @@ -63,6 +76,11 @@ module Distribution.Simple.Compiler , unitIdSupported , coverageSupported , profilingSupported + , profilingDynamicSupported + , profilingDynamicSupportedOrUnknown + , profilingVanillaSupported + , profilingVanillaSupportedOrUnknown + , dynamicSupported , backpackSupported , arResponseFilesSupported , arDashLSupported @@ -90,7 +108,6 @@ import Language.Haskell.Extension import qualified Data.Map as Map (lookup) import System.Directory (canonicalizePath) -import System.FilePath (isRelative) data Compiler = Compiler { compilerId :: CompilerId @@ -176,15 +193,17 @@ compilerInfo c = -- the file system. This can be used to build isolated environments of -- packages, for example to build a collection of related packages -- without installing them globally. -data PackageDB +-- +-- Abstracted over +data PackageDBX fp = GlobalPackageDB | UserPackageDB | -- | NB: the path might be relative or it might be absolute - SpecificPackageDB FilePath - deriving (Eq, Generic, Ord, Show, Read, Typeable) + SpecificPackageDB fp + deriving (Eq, Generic, Ord, Show, Read, Typeable, Functor, Foldable, Traversable) -instance Binary PackageDB -instance Structured PackageDB +instance Binary fp => Binary (PackageDBX fp) +instance Structured fp => Structured (PackageDBX fp) -- | We typically get packages from several databases, and stack them -- together. This type lets us be explicit about that stacking. For example @@ -201,11 +220,20 @@ instance Structured PackageDB -- we can use several custom package dbs and the user package db together. -- -- When it comes to writing, the top most (last) package is used. -type PackageDBStack = [PackageDB] +type PackageDBStackX from = [PackageDBX from] + +type PackageDB = PackageDBX (SymbolicPath Pkg (Dir PkgDB)) +type PackageDBStack = PackageDBStackX (SymbolicPath Pkg (Dir PkgDB)) + +type PackageDBS from = PackageDBX (SymbolicPath from (Dir PkgDB)) +type PackageDBStackS from = PackageDBStackX (SymbolicPath from (Dir PkgDB)) + +type PackageDBCWD = PackageDBX FilePath +type PackageDBStackCWD = PackageDBStackX FilePath -- | Return the package that we should register into. This is the package db at -- the top of the stack. -registrationPackageDB :: PackageDBStack -> PackageDB +registrationPackageDB :: PackageDBStackX from -> PackageDBX from registrationPackageDB dbs = case safeLast dbs of Nothing -> error "internal error: empty package db set" Just p -> p @@ -225,10 +253,30 @@ absolutePackageDBPath _ GlobalPackageDB = return GlobalPackageDB absolutePackageDBPath _ UserPackageDB = return UserPackageDB absolutePackageDBPath mbWorkDir (SpecificPackageDB db) = do let db' = - if isRelative db - then interpretSymbolicPath mbWorkDir (makeRelativePathEx db) - else db - SpecificPackageDB <$> canonicalizePath db' + case symbolicPathRelative_maybe db of + Nothing -> getSymbolicPath db + Just rel_path -> interpretSymbolicPath mbWorkDir rel_path + SpecificPackageDB . makeSymbolicPath <$> canonicalizePath db' + +interpretPackageDB :: Maybe (SymbolicPath CWD (Dir Pkg)) -> PackageDB -> PackageDBCWD +interpretPackageDB _ GlobalPackageDB = GlobalPackageDB +interpretPackageDB _ UserPackageDB = UserPackageDB +interpretPackageDB mbWorkDir (SpecificPackageDB db) = + SpecificPackageDB (interpretSymbolicPath mbWorkDir db) + +interpretPackageDBStack :: Maybe (SymbolicPath CWD (Dir Pkg)) -> PackageDBStack -> PackageDBStackCWD +interpretPackageDBStack mbWorkDir = map (interpretPackageDB mbWorkDir) + +-- | Transform a package db using a FilePath into one using symbolic paths. +coercePackageDB :: PackageDBCWD -> PackageDBX (SymbolicPath CWD (Dir PkgDB)) +coercePackageDB GlobalPackageDB = GlobalPackageDB +coercePackageDB UserPackageDB = UserPackageDB +coercePackageDB (SpecificPackageDB db) = SpecificPackageDB (makeSymbolicPath db) + +coercePackageDBStack + :: [PackageDBCWD] + -> [PackageDBX (SymbolicPath CWD (Dir PkgDB))] +coercePackageDBStack = map coercePackageDB -- ------------------------------------------------------------ @@ -428,6 +476,49 @@ profilingSupported comp = GHCJS -> True _ -> False +-- | Returns Just if we can certainly determine whether a way is supported +-- if we don't know, return Nothing +waySupported :: String -> Compiler -> Maybe Bool +waySupported way comp = + case compilerFlavor comp of + GHC -> + -- Infomation about compiler ways is only accurately reported after + -- 9.10.1. Which is useful as this is before profiling dynamic support + -- was introduced. (See GHC #24881) + if compilerVersion comp >= mkVersion [9, 10, 1] + then case Map.lookup "RTS ways" (compilerProperties comp) of + Just ways -> Just (way `elem` words ways) + Nothing -> Just False + else Nothing + _ -> Nothing + +-- | Either profiling is definitely supported or we don't know (so assume +-- it is) +profilingVanillaSupportedOrUnknown :: Compiler -> Bool +profilingVanillaSupportedOrUnknown comp = profilingVanillaSupported comp `elem` [Just True, Nothing] + +-- | Is the compiler distributed with profiling libraries +profilingVanillaSupported :: Compiler -> Maybe Bool +profilingVanillaSupported comp = waySupported "p" comp + +-- | Is the compiler distributed with profiling dynamic libraries +profilingDynamicSupported :: Compiler -> Maybe Bool +profilingDynamicSupported comp = + -- Certainly not before this version, as it was not implemented yet. + if compilerVersion comp <= mkVersion [9, 11, 0] + then Just False + else waySupported "p_dyn" comp + +-- | Either profiling dynamic is definitely supported or we don't know (so assume +-- it is) +profilingDynamicSupportedOrUnknown :: Compiler -> Bool +profilingDynamicSupportedOrUnknown comp = + profilingDynamicSupported comp `elem` [Just True, Nothing] + +-- | Is the compiler distributed with dynamic libraries +dynamicSupported :: Compiler -> Maybe Bool +dynamicSupported comp = waySupported "dyn" comp + -- | Does this compiler support a package database entry with: -- "visibility"? libraryVisibilitySupported :: Compiler -> Bool diff --git a/Cabal/src/Distribution/Simple/Configure.hs b/Cabal/src/Distribution/Simple/Configure.hs index 9e561e791c6..56d8517b3b9 100644 --- a/Cabal/src/Distribution/Simple/Configure.hs +++ b/Cabal/src/Distribution/Simple/Configure.hs @@ -81,6 +81,7 @@ import Distribution.PackageDescription.Configuration import Distribution.PackageDescription.PrettyPrint import Distribution.Simple.BuildTarget import Distribution.Simple.BuildToolDepends +import Distribution.Simple.BuildWay import Distribution.Simple.Compiler import Distribution.Simple.LocalBuildInfo import Distribution.Simple.PackageIndex (InstalledPackageIndex, lookupUnitId) @@ -105,9 +106,11 @@ import qualified Distribution.Simple.SetupHooks.Internal as SetupHooks import Distribution.Simple.Utils import Distribution.System import Distribution.Types.ComponentRequestedSpec +import Distribution.Types.DependencySatisfaction (DependencySatisfaction (..)) import Distribution.Types.GivenComponent import qualified Distribution.Types.LocalBuildConfig as LBC import Distribution.Types.LocalBuildInfo +import Distribution.Types.MissingDependencyReason (MissingDependencyReason (..)) import Distribution.Types.PackageVersionConstraint import Distribution.Utils.LogProgress import Distribution.Utils.NubList @@ -153,7 +156,6 @@ import System.Directory ( canonicalizePath , createDirectoryIfMissing , doesFileExist - , getTemporaryDirectory , removeFile ) import System.FilePath @@ -207,20 +209,20 @@ data ConfigStateFileError dispConfigStateFileError :: ConfigStateFileError -> Doc dispConfigStateFileError ConfigStateFileNoHeader = text "Saved package config file header is missing." - <+> text "Re-run the 'configure' command." + <+> text "Re-run the 'Setup configure' command." dispConfigStateFileError ConfigStateFileBadHeader = text "Saved package config file header is corrupt." - <+> text "Re-run the 'configure' command." + <+> text "Re-run the 'Setup configure' command." dispConfigStateFileError ConfigStateFileNoParse = text "Saved package config file is corrupt." - <+> text "Re-run the 'configure' command." + <+> text "Re-run the 'Setup configure' command." dispConfigStateFileError ConfigStateFileMissing{} = - text "Run the 'configure' command first." + text "Run the 'Setup configure' command first." dispConfigStateFileError (ConfigStateFileBadVersion oldCabal oldCompiler _) = text "Saved package config file is outdated:" $+$ badCabal $+$ badCompiler - $+$ text "Re-run the 'configure' command." + $+$ text "Re-run the 'Setup configure' command." where badCabal = text "• the Cabal version changed from" @@ -709,7 +711,7 @@ computeLocalBuildConfig cfg comp programDb = do -- rely on them. By the time that bug was fixed, ghci had -- been changed to read shared libraries instead of archive -- files (see next code block). - not (GHC.isDynamic comp) + not (GHC.compilerBuildWay comp `elem` [DynWay, ProfDynWay]) CompilerId GHCJS _ -> not (GHCJS.isDynamic comp) _ -> False @@ -734,7 +736,7 @@ computeLocalBuildConfig cfg comp programDb = do CompilerId GHC _ -> -- if ghc is dynamic, then ghci needs a shared -- library, so we build one by default. - GHC.isDynamic comp + GHC.compilerBuildWay comp == DynWay CompilerId GHCJS _ -> GHCJS.isDynamic comp _ -> False @@ -754,12 +756,6 @@ computeLocalBuildConfig cfg comp programDb = do withFullyStaticExe_ = fromFlag $ configFullyStaticExe cfg - when (withDynExe_ && not withSharedLib_) $ - warn verbosity $ - "Executables will use dynamic linking, but a shared library " - ++ "is not being built. Linking will fail if any executables " - ++ "depend on the library." - setProfiling <- configureProfiling verbosity cfg comp setCoverage <- configureCoverage verbosity cfg comp @@ -792,6 +788,7 @@ computeLocalBuildConfig cfg comp programDb = do , withDynExe = withDynExe_ , withFullyStaticExe = withFullyStaticExe_ , withProfLib = False + , withProfLibShared = False , withProfLibDetail = ProfDetailNone , withProfExe = False , withProfExeDetail = ProfDetailNone @@ -807,6 +804,20 @@ computeLocalBuildConfig cfg comp programDb = do , relocatable = fromFlagOrDefault False $ configRelocatable cfg } + -- Dynamic executable, but no shared vanilla libraries + when (LBC.withDynExe buildOptions && not (LBC.withProfExe buildOptions) && not (LBC.withSharedLib buildOptions)) $ + warn verbosity $ + "Executables will use dynamic linking, but a shared library " + ++ "is not being built. Linking will fail if any executables " + ++ "depend on the library." + + -- Profiled dynamic executable, but no shared profiling libraries + when (LBC.withDynExe buildOptions && LBC.withProfExe buildOptions && not (LBC.withProfLibShared buildOptions)) $ + warn verbosity $ + "Executables will use profiled dynamic linking, but a profiled shared library " + ++ "is not being built. Linking will fail if any executables " + ++ "depend on the library." + return $ LBC.LocalBuildConfig { extraConfigArgs = [] -- Currently configure does not @@ -818,7 +829,7 @@ computeLocalBuildConfig cfg comp programDb = do data PackageInfo = PackageInfo { internalPackageSet :: Set LibraryName - , promisedDepsSet :: Map (PackageName, ComponentName) ComponentId + , promisedDepsSet :: Map (PackageName, ComponentName) PromisedComponent , installedPackageSet :: InstalledPackageIndex , requiredDepsMap :: Map (PackageName, ComponentName) InstalledPackageInfo } @@ -848,29 +859,33 @@ configurePackage cfg lbc0 pkg_descr00 flags enabled comp platform programDb0 pac -- right before calling configurePackage? -- Configure certain external build tools, see below for which ones. - let requiredBuildTools = do - bi <- enabledBuildInfos pkg_descr0 enabled - -- First, we collect any tool dep that we know is external. This is, - -- in practice: - -- - -- 1. `build-tools` entries on the whitelist - -- - -- 2. `build-tool-depends` that aren't from the current package. - let externBuildToolDeps = - [ LegacyExeDependency (unUnqualComponentName eName) versionRange - | buildTool@(ExeDependency _ eName versionRange) <- - getAllToolDependencies pkg_descr0 bi - , not $ isInternal pkg_descr0 buildTool - ] - -- Second, we collect any build-tools entry we don't know how to - -- desugar. We'll never have any idea how to build them, so we just - -- hope they are already on the PATH. - let unknownBuildTools = - [ buildTool - | buildTool <- buildTools bi - , Nothing == desugarBuildTool pkg_descr0 buildTool - ] - externBuildToolDeps ++ unknownBuildTools + let requiredBuildTools + -- If --ignore-build-tools is set, no build tool is required: + | fromFlagOrDefault False $ configIgnoreBuildTools cfg = + [] + | otherwise = do + bi <- enabledBuildInfos pkg_descr0 enabled + -- First, we collect any tool dep that we know is external. This is, + -- in practice: + -- + -- 1. `build-tools` entries on the whitelist + -- + -- 2. `build-tool-depends` that aren't from the current package. + let externBuildToolDeps = + [ LegacyExeDependency (unUnqualComponentName eName) versionRange + | buildTool@(ExeDependency _ eName versionRange) <- + getAllToolDependencies pkg_descr0 bi + , not $ isInternal pkg_descr0 buildTool + ] + -- Second, we collect any build-tools entry we don't know how to + -- desugar. We'll never have any idea how to build them, so we just + -- hope they are already on the PATH. + let unknownBuildTools = + [ buildTool + | buildTool <- buildTools bi + , Nothing == desugarBuildTool pkg_descr0 buildTool + ] + externBuildToolDeps ++ unknownBuildTools programDb1 <- configureAllKnownPrograms (lessVerbose verbosity) programDb0 @@ -1099,7 +1114,7 @@ finalCheckPackage -> LBC.PackageBuildDescr -> HookedBuildInfo -> PackageInfo - -> IO ([PreExistingComponent], [PromisedComponent]) + -> IO ([PreExistingComponent], [ConfiguredPromisedComponent]) finalCheckPackage g_pkg_descr ( LBC.PackageBuildDescr @@ -1196,7 +1211,7 @@ configureComponents :: LBC.LocalBuildConfig -> LBC.PackageBuildDescr -> PackageInfo - -> ([PreExistingComponent], [PromisedComponent]) + -> ([PreExistingComponent], [ConfiguredPromisedComponent]) -> IO LocalBuildInfo configureComponents lbc@(LBC.LocalBuildConfig{withPrograms = programDb}) @@ -1266,7 +1281,9 @@ configureComponents extraCoverageUnitIds = case enabled of -- Whole package configure, add package libs ComponentRequestedSpec{} -> mapMaybe mbCompUnitId buildComponents - -- Component configure, no need to do anything + -- Component configure, no need to do anything since + -- extra-coverage-for will be passed for all other components that + -- should be covered. OneComponentRequestedSpec{} -> [] mbCompUnitId LibComponentLocalBuildInfo{componentUnitId} = Just componentUnitId mbCompUnitId _ = Nothing @@ -1291,6 +1308,9 @@ configureComponents when (LBC.relocatable $ LBC.withBuildOptions lbc) $ checkRelocatable verbosity pkg_descr lbi + when (LBC.withDynExe $ LBC.withBuildOptions lbc) $ + checkSharedExes verbosity lbi + -- TODO: This is not entirely correct, because the dirs may vary -- across libraries/executables let dirs = absoluteInstallDirs pkg_descr lbi NoCopyDest @@ -1354,8 +1374,8 @@ configureComponents return lbi -mkPromisedDepsSet :: [GivenComponent] -> Map (PackageName, ComponentName) ComponentId -mkPromisedDepsSet comps = Map.fromList [((pn, CLibName ln), cid) | GivenComponent pn ln cid <- comps] +mkPromisedDepsSet :: [PromisedComponent] -> Map (PackageName, ComponentName) PromisedComponent +mkPromisedDepsSet comps = Map.fromList [((packageName pn, CLibName ln), p) | p@(PromisedComponent pn ln _) <- comps] -- | Adds the extra program paths from the flags provided to @configure@ as -- well as specified locations for certain known programs and their default @@ -1458,10 +1478,10 @@ dependencySatisfiable -- ^ installed set -> Set LibraryName -- ^ library components - -> Map (PackageName, ComponentName) ComponentId + -> Map (PackageName, ComponentName) PromisedComponent -> Map (PackageName, ComponentName) InstalledPackageInfo -- ^ required dependencies - -> (Dependency -> Bool) + -> (Dependency -> DependencySatisfaction) dependencySatisfiable use_external_internal_deps exact_config @@ -1487,16 +1507,14 @@ dependencySatisfiable internalDepSatisfiable else -- Backward compatibility for the old sublibrary syntax - ( sublibs == mainLibSet - && Map.member - ( pn - , CLibName $ - LSubLibName $ - packageNameToUnqualComponentName depName - ) - requiredDepsMap - ) - || all visible sublibs + let depComponentName = + CLibName $ LSubLibName $ packageNameToUnqualComponentName depName + invisibleLibraries = NES.filter (not . visible) sublibs + in if sublibs == mainLibSet && Map.member (pn, depComponentName) requiredDepsMap + then Satisfied + else case nonEmpty $ Set.toList invisibleLibraries of + Nothing -> Satisfied + Just invisibleLibraries' -> Unsatisfied $ MissingLibrary invisibleLibraries' | isInternalDep = if use_external_internal_deps then -- When we are doing per-component configure, we now need to @@ -1513,12 +1531,31 @@ dependencySatisfiable isInternalDep = pn == depName depSatisfiable = - not . null $ PackageIndex.lookupDependency installedPackageSet depName vr + let allVersions = PackageIndex.lookupPackageName installedPackageSet depName + eligibleVersions = + [ version + | (version, _infos) <- PackageIndex.eligibleDependencies allVersions + ] + in if null $ PackageIndex.matchingDependencies vr allVersions + then + if null eligibleVersions + then Unsatisfied $ MissingPackage + else Unsatisfied $ WrongVersion eligibleVersions + else Satisfied internalDepSatisfiable = - Set.isSubsetOf (NES.toSet sublibs) packageLibraries + let missingLibraries = (NES.toSet sublibs) `Set.difference` packageLibraries + in case nonEmpty $ Set.toList missingLibraries of + Nothing -> Satisfied + Just missingLibraries' -> Unsatisfied $ MissingLibrary missingLibraries' + internalDepSatisfiableExternally = - all (\ln -> not $ null $ PackageIndex.lookupInternalDependency installedPackageSet pn vr ln) sublibs + -- TODO: Might need to propagate information on which versions _are_ available, if any... + let missingLibraries = + NES.filter (null . PackageIndex.lookupInternalDependency installedPackageSet pn vr) sublibs + in case nonEmpty $ Set.toList missingLibraries of + Nothing -> Satisfied + Just missingLibraries' -> Unsatisfied $ MissingLibrary missingLibraries' -- Check whether a library exists and is visible. -- We don't disambiguate between dependency on non-existent or private @@ -1553,7 +1590,7 @@ configureFinalizedPackage -> ConfigFlags -> ComponentRequestedSpec -> [PackageVersionConstraint] - -> (Dependency -> Bool) + -> (Dependency -> DependencySatisfaction) -- ^ tests if a dependency is satisfiable. -- Might say it's satisfiable even when not. -> Compiler @@ -1620,14 +1657,14 @@ configureDependencies :: Verbosity -> UseExternalInternalDeps -> Set LibraryName - -> Map (PackageName, ComponentName) ComponentId + -> Map (PackageName, ComponentName) PromisedComponent -> InstalledPackageIndex -- ^ installed packages -> Map (PackageName, ComponentName) InstalledPackageInfo -- ^ required deps -> PackageDescription -> ComponentRequestedSpec - -> IO ([PreExistingComponent], [PromisedComponent]) + -> IO ([PreExistingComponent], [ConfiguredPromisedComponent]) configureDependencies verbosity use_external_internal_deps @@ -1732,7 +1769,7 @@ configureCoverage verbosity cfg comp = do -- -- Note that @--enable-executable-profiling@ also affects profiling -- of benchmarks and (non-detailed) test suites. -computeEffectiveProfiling :: ConfigFlags -> (Bool {- lib -}, Bool {- exe -}) +computeEffectiveProfiling :: ConfigFlags -> (Bool {- lib vanilla-}, Bool {- lib shared -}, Bool {- exe -}) computeEffectiveProfiling cfg = -- The --profiling flag sets the default for both libs and exes, -- but can be overridden by --library-profiling, or the old deprecated @@ -1740,15 +1777,20 @@ computeEffectiveProfiling cfg = -- -- The --profiling-detail and --library-profiling-detail flags behave -- similarly - let tryExeProfiling = + let dynamicExe = fromFlagOrDefault False (configDynExe cfg) + tryExeProfiling = fromFlagOrDefault False (mappend (configProf cfg) (configProfExe cfg)) tryLibProfiling = fromFlagOrDefault - tryExeProfiling - (mappend (configProf cfg) (configProfLib cfg)) - in (tryLibProfiling, tryExeProfiling) + (tryExeProfiling && not dynamicExe) + (configProfLib cfg) + tryLibProfilingShared = + fromFlagOrDefault + (tryExeProfiling && dynamicExe) + (configProfShared cfg) + in (tryLibProfiling, tryLibProfilingShared, tryExeProfiling) -- | Select and apply profiling settings for the build based on the -- 'ConfigFlags' and 'Compiler'. @@ -1758,7 +1800,7 @@ configureProfiling -> Compiler -> IO (LBC.BuildOptions -> LBC.BuildOptions) configureProfiling verbosity cfg comp = do - let (tryLibProfiling, tryExeProfiling) = computeEffectiveProfiling cfg + let (tryLibProfiling, tryLibProfilingShared, tryExeProfiling) = computeEffectiveProfiling cfg tryExeProfileLevel = fromFlagOrDefault @@ -1785,8 +1827,8 @@ configureProfiling verbosity cfg comp = do return ProfDetailDefault checkProfileLevel other = return other - (exeProfWithoutLibProf, applyProfiling) <- - if profilingSupported comp + applyProfiling <- + if profilingSupported comp && (profilingVanillaSupportedOrUnknown comp || profilingDynamicSupportedOrUnknown comp) then do exeLevel <- checkProfileLevel tryExeProfileLevel libLevel <- checkProfileLevel tryLibProfileLevel @@ -1797,11 +1839,46 @@ configureProfiling verbosity cfg comp = do , LBC.withProfExe = tryExeProfiling , LBC.withProfExeDetail = exeLevel } - return (tryExeProfiling && not tryLibProfiling, apply) + let compilerSupportsProfilingDynamic = profilingDynamicSupportedOrUnknown comp + apply2 <- + if compilerSupportsProfilingDynamic + then -- Case 1: We support profiled shared libraries so turn on shared profiling + -- libraries if the user asked for it. + return $ \buildOptions -> apply buildOptions{LBC.withProfLibShared = tryLibProfilingShared} + else -- Case 2: Compiler doesn't support profiling shared so turn them off + do + -- If we wanted to enable profiling shared libraries.. tell the + -- user we couldn't. + when (profilingVanillaSupportedOrUnknown comp && tryLibProfilingShared) $ + warn + verbosity + ( "The compiler " + ++ showCompilerId comp + ++ " does not support " + ++ "profiling shared objects. Static profiled objects " + ++ "will be built." + ) + return $ \buildOptions -> + let original_options = apply buildOptions + in original_options + { LBC.withProfLibShared = False + , LBC.withProfLib = profilingVanillaSupportedOrUnknown comp && (tryLibProfilingShared || LBC.withProfLib original_options) + , LBC.withDynExe = if LBC.withProfExe original_options then False else LBC.withDynExe original_options + } + + when (tryExeProfiling && not (tryLibProfiling || tryLibProfilingShared)) $ do + warn + verbosity + ( "Executables will be built with profiling, but library " + ++ "profiling is disabled. Linking will fail if any executables " + ++ "depend on the library." + ) + return apply2 else do let apply buildOptions = buildOptions { LBC.withProfLib = False + , LBC.withProfLibShared = False , LBC.withProfLibDetail = ProfDetailNone , LBC.withProfExe = False , LBC.withProfExeDetail = ProfDetailNone @@ -1814,15 +1891,7 @@ configureProfiling verbosity cfg comp = do ++ " does not support " ++ "profiling. Profiling has been disabled." ) - return (False, apply) - - when exeProfWithoutLibProf $ - warn - verbosity - ( "Executables will be built with profiling, but library " - ++ "profiling is disabled. Linking will fail if any executables " - ++ "depend on the library." - ) + return apply return applyProfiling @@ -1861,7 +1930,7 @@ data DependencyResolution -- we need to build packages in the interactive ghci session, no matter -- whether they have been built before. -- Building them in the configure phase is then redundant and costs time. - PromisedDependency PromisedComponent + PromisedDependency ConfiguredPromisedComponent | -- | An internal dependency ('PackageId' should be a library name) -- which we are going to have to build. (The -- 'PackageId' here is a hack to get a modest amount of @@ -1874,7 +1943,7 @@ selectDependency -- ^ Package id of current package -> Set LibraryName -- ^ package libraries - -> Map (PackageName, ComponentName) ComponentId + -> Map (PackageName, ComponentName) PromisedComponent -- ^ Set of components that are promised, i.e. are not installed already. See 'PromisedDependency' for more details. -> InstalledPackageIndex -- ^ Installed packages @@ -1926,8 +1995,8 @@ selectDependency -- We have to look it up externally do_external_external :: LibraryName -> Either FailedDependency DependencyResolution do_external_external lib - | Just cid <- Map.lookup (dep_pkgname, CLibName lib) promisedIndex = - return $ PromisedDependency (PromisedComponent dep_pkgname (AnnotatedId currentCabalId (CLibName lib) cid)) + | Just pc <- Map.lookup (dep_pkgname, CLibName lib) promisedIndex = + return $ PromisedDependency (ConfiguredPromisedComponent dep_pkgname (AnnotatedId (promisedComponentPackage pc) (CLibName lib) (promisedComponentId pc))) do_external_external lib = do ipi <- case Map.lookup (dep_pkgname, CLibName lib) requiredDepsMap of -- If we know the exact pkg to use, then use it. @@ -1940,8 +2009,8 @@ selectDependency do_external_internal :: LibraryName -> Either FailedDependency DependencyResolution do_external_internal lib - | Just cid <- Map.lookup (dep_pkgname, CLibName lib) promisedIndex = - return $ PromisedDependency (PromisedComponent dep_pkgname (AnnotatedId currentCabalId (CLibName lib) cid)) + | Just pc <- Map.lookup (dep_pkgname, CLibName lib) promisedIndex = + return $ PromisedDependency (ConfiguredPromisedComponent dep_pkgname (AnnotatedId (promisedComponentPackage pc) (CLibName lib) (promisedComponentId pc))) do_external_internal lib = do ipi <- case Map.lookup (dep_pkgname, CLibName lib) requiredDepsMap of -- If we know the exact pkg to use, then use it. @@ -1985,8 +2054,8 @@ reportFailedDependencies verbosity failed = getInstalledPackages :: Verbosity -> Compiler - -> Maybe (SymbolicPath CWD (Dir Pkg)) - -> PackageDBStack + -> Maybe (SymbolicPath CWD (Dir from)) + -> PackageDBStackX (SymbolicPath from (Dir PkgDB)) -- ^ The stack of package databases. -> ProgramDb -> IO InstalledPackageIndex @@ -2000,14 +2069,14 @@ getInstalledPackages verbosity comp mbWorkDir packageDBs progdb = do case compilerFlavor comp of GHC -> GHC.getInstalledPackages verbosity comp mbWorkDir packageDBs' progdb GHCJS -> GHCJS.getInstalledPackages verbosity mbWorkDir packageDBs' progdb - UHC -> UHC.getInstalledPackages verbosity comp packageDBs' progdb + UHC -> UHC.getInstalledPackages verbosity comp mbWorkDir packageDBs' progdb HaskellSuite{} -> HaskellSuite.getInstalledPackages verbosity packageDBs' progdb flv -> dieWithException verbosity $ HowToFindInstalledPackages flv where packageDBExists (SpecificPackageDB path0) = do - let path = interpretSymbolicPath mbWorkDir $ makeSymbolicPath path0 + let path = interpretSymbolicPath mbWorkDir path0 exists <- doesPathExist path unless exists $ warn verbosity $ @@ -2045,8 +2114,8 @@ getPackageDBContents verbosity comp mbWorkDir packageDB progdb = do getInstalledPackagesMonitorFiles :: Verbosity -> Compiler - -> Maybe (SymbolicPath CWD ('Dir Pkg)) - -> PackageDBStack + -> Maybe (SymbolicPath CWD ('Dir from)) + -> PackageDBStackS from -> ProgramDb -> Platform -> IO [FilePath] @@ -2093,7 +2162,7 @@ getInstalledPackagesById verbosity lbi@LocalBuildInfo{compiler = comp, withPacka -- @--global@, @--user@ and @--package-db=global|user|clear|$file@. -- This function combines the global/user flag and interprets the package-db -- flag into a single package db stack. -interpretPackageDbFlags :: Bool -> [Maybe PackageDB] -> PackageDBStack +interpretPackageDbFlags :: Bool -> [Maybe (PackageDBX fp)] -> PackageDBStackX fp interpretPackageDbFlags userInstall specificDBs = extra initialStack specificDBs where @@ -2210,55 +2279,77 @@ configureRequiredProgram verbosity progdb (LegacyExeDependency progName verRange) = - case lookupKnownProgram progName progdb of - Nothing -> - -- Try to configure it as a 'simpleProgram' automatically - -- - -- There's a bit of a story behind this line. In old versions - -- of Cabal, there were only internal build-tools dependencies. So the - -- behavior in this case was: - -- - -- - If a build-tool dependency was internal, don't do - -- any checking. + case lookupProgramByName progName progdb of + Just prog -> + -- If the program has already been configured, use it + -- (as long as the version is compatible). -- - -- - If it was external, call 'configureRequiredProgram' to - -- "configure" the executable. In particular, if - -- the program was not "known" (present in 'ProgramDb'), - -- then we would just error. This was fine, because - -- the only way a program could be executed from 'ProgramDb' - -- is if some library code from Cabal actually called it, - -- and the pre-existing Cabal code only calls known - -- programs from 'defaultProgramDb', and so if it - -- is calling something else, you have a Custom setup - -- script, and in that case you are expected to register - -- the program you want to call in the ProgramDb. - -- - -- OK, so that was fine, until I (ezyang, in 2016) refactored - -- Cabal to support per-component builds. In this case, what - -- was previously an internal build-tool dependency now became - -- an external one, and now previously "internal" dependencies - -- are now external. But these are permitted to exist even - -- when they are not previously configured (something that - -- can only occur by a Custom script.) - -- - -- So, I decided, "Fine, let's just accept these in any - -- case." Thus this line. The alternative would have been to - -- somehow detect when a build-tools dependency was "internal" (by - -- looking at the unflattened package description) but this - -- would also be incompatible with future work to support - -- external executable dependencies: we definitely cannot - -- assume they will be preinitialized in the 'ProgramDb'. - configureProgram verbosity (simpleProgram progName) progdb - Just prog - -- requireProgramVersion always requires the program have a version - -- but if the user says "build-depends: foo" ie no version constraint - -- then we should not fail if we cannot discover the program version. - | verRange == anyVersion -> do - (_, progdb') <- requireProgram verbosity prog progdb - return progdb' - | otherwise -> do - (_, _, progdb') <- requireProgramVersion verbosity prog verRange progdb - return progdb' + -- Not doing so means falling back to the "simpleProgram" path below, + -- which might fail if the program has custom logic to find a version + -- (such as hsc2hs). + let loc = locationPath $ programLocation prog + in case programVersion prog of + Nothing + | verRange == anyVersion -> + return progdb + | otherwise -> + dieWithException verbosity $! + UnknownVersionDb (programId prog) verRange loc + Just version + | withinRange version verRange -> + return progdb + | otherwise -> + dieWithException verbosity $! + BadVersionDb (programId prog) version verRange loc + Nothing -> + -- Otherwise, try to configure it as a 'simpleProgram' automatically + case lookupKnownProgram progName progdb of + Nothing -> + -- There's a bit of a story behind this line. In old versions + -- of Cabal, there were only internal build-tools dependencies. So the + -- behavior in this case was: + -- + -- - If a build-tool dependency was internal, don't do + -- any checking. + -- + -- - If it was external, call 'configureRequiredProgram' to + -- "configure" the executable. In particular, if + -- the program was not "known" (present in 'ProgramDb'), + -- then we would just error. This was fine, because + -- the only way a program could be executed from 'ProgramDb' + -- is if some library code from Cabal actually called it, + -- and the pre-existing Cabal code only calls known + -- programs from 'defaultProgramDb', and so if it + -- is calling something else, you have a Custom setup + -- script, and in that case you are expected to register + -- the program you want to call in the ProgramDb. + -- + -- OK, so that was fine, until I (ezyang, in 2016) refactored + -- Cabal to support per-component builds. In this case, what + -- was previously an internal build-tool dependency now became + -- an external one, and now previously "internal" dependencies + -- are now external. But these are permitted to exist even + -- when they are not previously configured (something that + -- can only occur by a Custom script.) + -- + -- So, I decided, "Fine, let's just accept these in any + -- case." Thus this line. The alternative would have been to + -- somehow detect when a build-tools dependency was "internal" (by + -- looking at the unflattened package description) but this + -- would also be incompatible with future work to support + -- external executable dependencies: we definitely cannot + -- assume they will be preinitialized in the 'ProgramDb'. + configureProgram verbosity (simpleProgram progName) progdb + Just prog + -- requireProgramVersion always requires the program have a version + -- but if the user says "build-depends: foo" ie no version constraint + -- then we should not fail if we cannot discover the program version. + | verRange == anyVersion -> do + (_, progdb') <- requireProgram verbosity prog progdb + return progdb' + | otherwise -> do + (_, _, progdb') <- requireProgramVersion verbosity prog verRange progdb + return progdb' -- ----------------------------------------------------------------------------- -- Configuring pkg-config package dependencies @@ -2601,10 +2692,9 @@ checkForeignDeps pkg lbi verbosity = builds :: String -> [ProgArg] -> IO Bool builds program args = - do - tempDir <- makeSymbolicPath <$> getTemporaryDirectory - withTempFileCwd mbWorkDir tempDir ".c" $ \cName cHnd -> - withTempFileCwd mbWorkDir tempDir "" $ \oNname oHnd -> do + withTempFileCwd ".c" $ \cName cHnd -> + withTempFileCwd "" $ \oNname oHnd -> + do hPutStrLn cHnd program hClose cHnd hClose oHnd @@ -2616,8 +2706,8 @@ checkForeignDeps pkg lbi verbosity = (withPrograms lbi) (getSymbolicPath cName : "-o" : getSymbolicPath oNname : args) return True - `catchIO` (\_ -> return False) - `catchExit` (\_ -> return False) + `catchIO` (\_ -> return False) + `catchExit` (\_ -> return False) explainErrors Nothing [] = return () -- should be impossible! explainErrors _ _ @@ -2651,6 +2741,18 @@ checkPackageProblems verbosity dir gpkg pkg = do classEW (PackageDistSuspiciousWarn _) = Nothing classEW (PackageDistInexcusable _) = Nothing +-- | Perform checks if a shared executable can be built +checkSharedExes + :: Verbosity + -> LocalBuildInfo + -> IO () +checkSharedExes verbosity lbi = + when (os == Windows) $ + dieWithException verbosity $ + NoOSSupport os "shared executables" + where + (Platform _ os) = hostPlatform lbi + -- | Preform checks if a relocatable build is allowed checkRelocatable :: Verbosity @@ -2673,7 +2775,7 @@ checkRelocatable verbosity pkg lbi = checkOS = unless (os `elem` [OSX, Linux]) $ dieWithException verbosity $ - NoOSSupport os + NoOSSupport os "relocatable builds" where (Platform _ os) = hostPlatform lbi diff --git a/Cabal/src/Distribution/Simple/ConfigureScript.hs b/Cabal/src/Distribution/Simple/ConfigureScript.hs index 3661c683ceb..cf2a18297ee 100644 --- a/Cabal/src/Distribution/Simple/ConfigureScript.hs +++ b/Cabal/src/Distribution/Simple/ConfigureScript.hs @@ -1,4 +1,5 @@ {-# LANGUAGE CPP #-} +{-# LANGUAGE DataKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE RankNTypes #-} @@ -23,6 +24,7 @@ import Prelude () -- local import Distribution.PackageDescription import Distribution.Pretty +import Distribution.Simple.Configure (findDistPrefOrDefault) import Distribution.Simple.Errors import Distribution.Simple.LocalBuildInfo import Distribution.Simple.Program @@ -30,12 +32,12 @@ import Distribution.Simple.Program.Db import Distribution.Simple.Setup.Common import Distribution.Simple.Setup.Config import Distribution.Simple.Utils -import Distribution.System (buildPlatform) +import Distribution.System (Platform, buildPlatform) import Distribution.Utils.NubList import Distribution.Utils.Path -import Distribution.Verbosity -- Base +import System.Directory (createDirectoryIfMissing, doesFileExist) import qualified System.FilePath as FilePath #ifdef mingw32_HOST_OS import System.FilePath (normalise, splitDrive) @@ -48,14 +50,25 @@ import qualified Data.List.NonEmpty as NonEmpty import qualified Data.Map as Map runConfigureScript - :: Verbosity - -> ConfigFlags - -> LocalBuildInfo + :: ConfigFlags + -> FlagAssignment + -> ProgramDb + -> Platform + -- ^ host platform -> IO () -runConfigureScript verbosity flags lbi = do +runConfigureScript cfg flags programDb hp = do + let commonCfg = configCommonFlags cfg + verbosity = fromFlag $ setupVerbosity commonCfg + dist_dir <- findDistPrefOrDefault $ setupDistPref commonCfg + let build_dir = dist_dir makeRelativePathEx "build" + mbWorkDir = flagToMaybe $ setupWorkingDir commonCfg + configureScriptPath = packageRoot commonCfg "configure" + confExists <- doesFileExist configureScriptPath + unless confExists $ + dieWithException verbosity (ConfigureScriptNotFound configureScriptPath) + configureFile <- + makeAbsolute $ configureScriptPath env <- getEnvironment - let commonFlags = configCommonFlags flags - programDb = withPrograms lbi (ccProg, ccFlags) <- configureCCompiler verbosity programDb ccProgShort <- getShortPathName ccProg -- The C compiler's compilation and linker flags (e.g. @@ -64,8 +77,8 @@ runConfigureScript verbosity flags lbi = do -- to ccFlags -- We don't try and tell configure which ld to use, as we don't have -- a way to pass its flags too - configureFile <- - makeAbsolute $ packageRoot commonFlags "configure" + + let configureFile' = toUnix configureFile -- autoconf is fussy about filenames, and has a set of forbidden -- characters that can't appear in the build directory, etc: -- https://www.gnu.org/software/autoconf/manual/autoconf.html#File-System-Conventions @@ -79,7 +92,6 @@ runConfigureScript verbosity flags lbi = do -- TODO: We don't check for colons, tildes or leading dashes. We -- also should check the builddir's path, destdir, and all other -- paths as well. - let configureFile' = toUnix configureFile for_ badAutoconfCharacters $ \(c, cname) -> when (c `elem` FilePath.dropDrive configureFile') $ warn verbosity $ @@ -111,7 +123,7 @@ runConfigureScript verbosity flags lbi = do Map.fromListWith (<>) [ (flagEnvVar flag, (flag, bool) :| []) - | (flag, bool) <- unFlagAssignment $ flagAssignment lbi + | (flag, bool) <- unFlagAssignment flags ] -- A map from env vars to flag names to the single flag we will go with cabalFlagMapDeconflicted :: Map String (FlagName, Bool) <- @@ -143,10 +155,10 @@ runConfigureScript verbosity flags lbi = do ] ++ [ ( "CABAL_FLAGS" - , Just $ unwords [showFlagValue fv | fv <- unFlagAssignment $ flagAssignment lbi] + , Just $ unwords [showFlagValue fv | fv <- unFlagAssignment flags] ) ] - let extraPath = fromNubList $ configProgramPathExtra flags + let extraPath = fromNubList $ configProgramPathExtra cfg let cflagsEnv = maybe (unwords ccFlags) (++ (" " ++ unwords ccFlags)) $ lookup "CFLAGS" env @@ -160,7 +172,6 @@ runConfigureScript verbosity flags lbi = do ("CFLAGS", Just cflagsEnv) : [("PATH", Just pathEnv) | not (null extraPath)] ++ cabalFlagEnv - hp = hostPlatform lbi maybeHostFlag = if hp == buildPlatform then [] else ["--host=" ++ show (pretty hp)] args' = configureFile' : args ++ ["CC=" ++ ccProgShort] ++ maybeHostFlag shProg = simpleProgram "sh" @@ -169,14 +180,16 @@ runConfigureScript verbosity flags lbi = do lookupProgram shProg `fmap` configureProgram verbosity shProg progDb case shConfiguredProg of - Just sh -> + Just sh -> do + let build_in = interpretSymbolicPath mbWorkDir build_dir + createDirectoryIfMissing True build_in runProgramInvocation verbosity $ (programInvocation (sh{programOverrideEnv = overEnv}) args') - { progInvokeCwd = Just (interpretSymbolicPathLBI lbi $ buildDir lbi) + { progInvokeCwd = Just build_in } Nothing -> dieWithException verbosity NotFoundMsg where - args = configureArgs backwardsCompatHack flags + args = configureArgs backwardsCompatHack cfg backwardsCompatHack = False -- | Convert Windows path to Unix ones diff --git a/Cabal/src/Distribution/Simple/Errors.hs b/Cabal/src/Distribution/Simple/Errors.hs index 8513f92c7b9..253b2f0dfbe 100644 --- a/Cabal/src/Distribution/Simple/Errors.hs +++ b/Cabal/src/Distribution/Simple/Errors.hs @@ -31,6 +31,7 @@ import Distribution.Simple.InstallDirs import Distribution.Simple.PreProcess.Types (Suffix) import Distribution.Simple.SetupHooks.Errors import Distribution.System (OS) +import Distribution.Types.MissingDependency (MissingDependency) import Distribution.Types.VersionRange.Internal () import Distribution.Version import Text.PrettyPrint @@ -115,7 +116,7 @@ data CabalException | CheckSemaphoreSupport | NoLibraryForPackage | SanityCheckHookedBuildInfo UnqualComponentName - | ConfigureScriptNotFound + | ConfigureScriptNotFound FilePath | NoValidComponent | ConfigureEitherSingleOrAll | ConfigCIDValidForPreComponent @@ -126,7 +127,7 @@ data CabalException | CantFindForeignLibraries [String] | ExpectedAbsoluteDirectory FilePath | FlagsNotSpecified [FlagName] - | EncounteredMissingDependency [Dependency] + | EncounteredMissingDependency [MissingDependency] | CompilerDoesn'tSupportThinning | CompilerDoesn'tSupportReexports | CompilerDoesn'tSupportBackpack @@ -138,7 +139,7 @@ data CabalException | BadVersion String String PkgconfigVersion | UnknownCompilerException | NoWorkingGcc - | NoOSSupport OS + | NoOSSupport OS String | NoCompilerSupport String | InstallDirsNotPrefixRelative (InstallDirs FilePath) | ExplainErrors (Maybe (Either [Char] [Char])) [String] @@ -314,7 +315,7 @@ versionRequirement range exceptionMessage :: CabalException -> String exceptionMessage e = case e of NoBenchMarkProgram cmd -> "Could not find benchmark program \"" ++ cmd ++ "\". Did you build the package first?" - EnableBenchMark -> "No benchmarks enabled. Did you remember to configure with " ++ "\'--enable-benchmarks\'?" + EnableBenchMark -> "No benchmarks enabled. Did you remember to \'Setup configure\' with " ++ "\'--enable-benchmarks\'?" BenchMarkNameDisabled bmName -> "Package configured with benchmark " ++ bmName ++ " disabled." NoBenchMark bmName -> "no such benchmark: " ++ bmName NoLibraryFound -> "No executables and no library found. Nothing to do." @@ -331,8 +332,8 @@ exceptionMessage e = case e of ++ ".\n" ++ "If the module " ++ "is autogenerated it should be added to 'autogen-modules'." - RegMultipleInstancePkg -> "HcPkg.register: the compiler does not support,registering multiple instances of packages." - SuppressingChecksOnFile -> "HcPkg.register: the compiler does not support ,suppressing checks on files." + RegMultipleInstancePkg -> "HcPkg.register: the compiler does not support registering multiple instances of packages." + SuppressingChecksOnFile -> "HcPkg.register: the compiler does not support suppressing checks on files." NoSupportDirStylePackageDb -> "HcPkg.writeRegistrationFileDirectly: compiler does not support dir style package dbs" OnlySupportSpecificPackageDb -> "HcPkg.writeRegistrationFileDirectly: only supports SpecificPackageDB for now" FailedToParseOutputDescribe programId pkgId -> "failed to parse output of '" ++ programId ++ " describe " ++ prettyShow pkgId ++ "'" @@ -353,7 +354,7 @@ exceptionMessage e = case e of ++ " but " ++ "haddock is using GHC version " ++ prettyShow haddockGhcVersion - MustHaveSharedLibraries -> "Must have vanilla or shared libraries " ++ "enabled in order to run haddock" + MustHaveSharedLibraries -> "Must have vanilla or shared libraries enabled in order to run haddock" HaddockPackageFlags inf -> "internal error when calculating transitive " ++ "package dependencies.\nDebug info: " @@ -391,7 +392,7 @@ exceptionMessage e = case e of GlobalPackageDBLimitation -> "With current ghc versions the global package db is always used " ++ "and must be listed first. This ghc limitation may be lifted in " - ++ "future, see https://gitlab.haskell.org/ghc/ghc/-/issues/5977" + ++ "the future, see https://gitlab.haskell.org/ghc/ghc/-/issues/5977" GlobalPackageDBSpecifiedFirst -> "If the global package db is specified, it must be " ++ "specified first and cannot be specified multiple times" @@ -487,8 +488,7 @@ exceptionMessage e = case e of ++ "suite type " ++ prettyShow tt NoSupportForPreProcessingBenchmark tt -> - "No support for preprocessing benchmark " - ++ "type " + "No support for preprocessing benchmark type " ++ prettyShow tt CantFindSourceForPreProcessFile errorStr -> errorStr NoSupportPreProcessingTestExtras tt -> @@ -511,11 +511,11 @@ exceptionMessage e = case e of SanityCheckHookedBuildInfo exe1 -> "The buildinfo contains info for an executable called '" ++ prettyShow exe1 - ++ "' but the package does not have a " + ++ "' but the package does not have an " ++ "executable with that name." - ConfigureScriptNotFound -> "configure script not found." + ConfigureScriptNotFound fp -> "configure script not found at " ++ fp ++ "." NoValidComponent -> "No valid component targets found" - ConfigureEitherSingleOrAll -> "Can only configure either single component or all of them" + ConfigureEitherSingleOrAll -> "Can only configure either a single component or all of them" ConfigCIDValidForPreComponent -> "--cid is only supported for per-component configure" SanityCheckForEnableComponents -> "--enable-tests/--enable-benchmarks are incompatible with" @@ -525,23 +525,23 @@ exceptionMessage e = case e of ++ " are incompatible with each other." UnsupportedLanguages pkgId compilerId langs -> "The package " - ++ prettyShow (pkgId) + ++ prettyShow pkgId ++ " requires the following languages which are not " ++ "supported by " - ++ prettyShow (compilerId) + ++ prettyShow compilerId ++ ": " ++ intercalate ", " langs UnsupportedLanguageExtension pkgId compilerId exts -> "The package " - ++ prettyShow (pkgId) + ++ prettyShow pkgId ++ " requires the following language extensions which are not " ++ "supported by " - ++ prettyShow (compilerId) + ++ prettyShow compilerId ++ ": " ++ intercalate ", " exts CantFindForeignLibraries unsupportedFLibs -> "Cannot build some foreign libraries: " - ++ intercalate "," unsupportedFLibs + ++ intercalate ", " unsupportedFLibs ExpectedAbsoluteDirectory fPath -> "expected an absolute directory name for --prefix: " ++ fPath FlagsNotSpecified diffFlags -> "'--exact-configuration' was given, " @@ -553,7 +553,7 @@ exceptionMessage e = case e of . nest 4 . sep . punctuate comma - . map (pretty . simplifyDependency) + . map pretty $ missing ) CompilerDoesn'tSupportThinning -> @@ -572,7 +572,7 @@ exceptionMessage e = case e of ++ "' refers to a library which is defined within the same " ++ "package. To use this feature the package must specify at " ++ "least 'cabal-version: >= 1.8'." - ReportFailedDependencies failed hackageUrl -> (intercalate "\n\n" (map reportFailedDependency failed)) + ReportFailedDependencies failed hackageUrl -> intercalate "\n\n" (map reportFailedDependency failed) where reportFailedDependency (DependencyNotExists pkgname) = "there is no version of " @@ -617,15 +617,16 @@ exceptionMessage e = case e of NoWorkingGcc -> unlines [ "No working gcc" - , "This package depends on foreign library but we cannot " + , "This package depends on a foreign library but we cannot " ++ "find a working C compiler. If you have it in a " ++ "non-standard location you can use the --with-gcc " ++ "flag to specify it." ] - NoOSSupport os -> + NoOSSupport os what -> "Operating system: " ++ prettyShow os - ++ ", does not support relocatable builds" + ++ ", does not support " + ++ what NoCompilerSupport comp -> "Compiler: " ++ comp @@ -673,8 +674,8 @@ exceptionMessage e = case e of ++ "where it is." ++ "If the library file does exist, it may contain errors that " ++ "are caught by the C compiler at the preprocessing stage. " - ++ "In this case you can re-run configure with the verbosity " - ++ "flag -v3 to see the error messages." + ++ "In this case you can re-run 'Setup configure' with the " + ++ "verbosity flag -v3 to see the error messages." messagePlural = "This problem can usually be solved by installing the system " ++ "packages that provide these libraries (you may need the " @@ -684,18 +685,18 @@ exceptionMessage e = case e of ++ "where they are." ++ "If the library files do exist, it may contain errors that " ++ "are caught by the C compiler at the preprocessing stage. " - ++ "In this case you can re-run configure with the verbosity " - ++ "flag -v3 to see the error messages." + ++ "In this case you can re-run 'Setup configure' with the " + ++ "verbosity flag -v3 to see the error messages." headerCppMessage = "If the header file does exist, it may contain errors that " ++ "are caught by the C compiler at the preprocessing stage. " - ++ "In this case you can re-run configure with the verbosity " - ++ "flag -v3 to see the error messages." + ++ "In this case you can re-run 'Setup configure' with the " + ++ "verbosity flag -v3 to see the error messages." headerCcMessage = "The header file contains a compile error. " - ++ "You can re-run configure with the verbosity flag " + ++ "You can re-run 'Setup configure' with the verbosity flag " ++ "-v3 to see the error messages from the C compiler." - CheckPackageProblems errors -> (intercalate "\n\n" $ errors) + CheckPackageProblems errors -> intercalate "\n\n" errors LibDirDepsPrefixNotRelative l p -> "Library directory of a dependency: " ++ show l @@ -756,7 +757,7 @@ exceptionMessage e = case e of RegisMultiplePkgNotSupported -> "Registering multiple package instances is not yet supported for this compiler" RegisteringNotImplemented -> "Registering is not implemented for this compiler" NoTestSuitesEnabled -> - "No test suites enabled. Did you remember to configure with " + "No test suites enabled. Did you remember to 'Setup configure' with " ++ "\'--enable-tests\'?" TestNameDisabled tName -> "Package configured with test suite " diff --git a/Cabal/src/Distribution/Simple/GHC.hs b/Cabal/src/Distribution/Simple/GHC.hs index 095e657264e..db475a01dd5 100644 --- a/Cabal/src/Distribution/Simple/GHC.hs +++ b/Cabal/src/Distribution/Simple/GHC.hs @@ -4,6 +4,7 @@ {-# LANGUAGE MultiWayIf #-} {-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE RankNTypes #-} +{-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TupleSections #-} ----------------------------------------------------------------------------- @@ -61,7 +62,7 @@ module Distribution.Simple.GHC , Internal.componentCcGhcOptions , getGhcAppDir , getLibDir - , isDynamic + , compilerBuildWay , getGlobalPackageDB , pkgRoot @@ -98,6 +99,7 @@ import Distribution.Simple.BuildPaths import Distribution.Simple.Compiler import Distribution.Simple.Errors import qualified Distribution.Simple.GHC.Build as GHC +import Distribution.Simple.GHC.Build.Modules (BuildWay (..)) import Distribution.Simple.GHC.Build.Utils import Distribution.Simple.GHC.EnvironmentParser import Distribution.Simple.GHC.ImplInfo @@ -393,8 +395,8 @@ getGhcInfo verbosity ghcProg = Internal.getGhcInfo verbosity implInfo ghcProg -- | Given a single package DB, return all installed packages. getPackageDBContents :: Verbosity - -> Maybe (SymbolicPath CWD (Dir Pkg)) - -> PackageDB + -> Maybe (SymbolicPath CWD (Dir from)) + -> PackageDBX (SymbolicPath from (Dir PkgDB)) -> ProgramDb -> IO InstalledPackageIndex getPackageDBContents verbosity mbWorkDir packagedb progdb = do @@ -405,8 +407,8 @@ getPackageDBContents verbosity mbWorkDir packagedb progdb = do getInstalledPackages :: Verbosity -> Compiler - -> Maybe (SymbolicPath CWD (Dir Pkg)) - -> PackageDBStack + -> Maybe (SymbolicPath CWD (Dir from)) + -> PackageDBStackX (SymbolicPath from (Dir PkgDB)) -> ProgramDb -> IO InstalledPackageIndex getInstalledPackages verbosity comp mbWorkDir packagedbs progdb = do @@ -428,7 +430,7 @@ getInstalledPackages verbosity comp mbWorkDir packagedbs progdb = do -- 'getInstalledPackages'. toPackageIndex :: Verbosity - -> [(PackageDB, [InstalledPackageInfo])] + -> [(PackageDBX a, [InstalledPackageInfo])] -> ProgramDb -> IO InstalledPackageIndex toPackageIndex verbosity pkgss progdb = do @@ -491,7 +493,7 @@ checkPackageDbEnvVar :: Verbosity -> IO () checkPackageDbEnvVar verbosity = Internal.checkPackageDbEnvVar verbosity "GHC" "GHC_PACKAGE_PATH" -checkPackageDbStack :: Verbosity -> Compiler -> PackageDBStack -> IO () +checkPackageDbStack :: Eq fp => Verbosity -> Compiler -> PackageDBStackX fp -> IO () checkPackageDbStack verbosity comp = if flagPackageConf implInfo then checkPackageDbStackPre76 verbosity @@ -499,7 +501,7 @@ checkPackageDbStack verbosity comp = where implInfo = ghcVersionImplInfo (compilerVersion comp) -checkPackageDbStackPost76 :: Verbosity -> PackageDBStack -> IO () +checkPackageDbStackPost76 :: Eq fp => Verbosity -> PackageDBStackX fp -> IO () checkPackageDbStackPost76 _ (GlobalPackageDB : rest) | GlobalPackageDB `notElem` rest = return () checkPackageDbStackPost76 verbosity rest @@ -507,7 +509,7 @@ checkPackageDbStackPost76 verbosity rest dieWithException verbosity CheckPackageDbStackPost76 checkPackageDbStackPost76 _ _ = return () -checkPackageDbStackPre76 :: Verbosity -> PackageDBStack -> IO () +checkPackageDbStackPre76 :: Eq fp => Verbosity -> PackageDBStackX fp -> IO () checkPackageDbStackPre76 _ (GlobalPackageDB : rest) | GlobalPackageDB `notElem` rest = return () checkPackageDbStackPre76 verbosity rest @@ -528,10 +530,10 @@ removeMingwIncludeDir pkg = -- | Get the packages from specific PackageDBs, not cumulative. getInstalledPackages' :: Verbosity - -> Maybe (SymbolicPath CWD (Dir Pkg)) - -> [PackageDB] + -> Maybe (SymbolicPath CWD (Dir from)) + -> [PackageDBX (SymbolicPath from (Dir PkgDB))] -> ProgramDb - -> IO [(PackageDB, [InstalledPackageInfo])] + -> IO [(PackageDBX (SymbolicPath from (Dir PkgDB)), [InstalledPackageInfo])] getInstalledPackages' verbosity mbWorkDir packagedbs progdb = sequenceA [ do @@ -541,21 +543,22 @@ getInstalledPackages' verbosity mbWorkDir packagedbs progdb = ] getInstalledPackagesMonitorFiles - :: Verbosity - -> Maybe (SymbolicPath CWD (Dir Pkg)) + :: forall from + . Verbosity + -> Maybe (SymbolicPath CWD (Dir from)) -> Platform -> ProgramDb - -> [PackageDB] + -> [PackageDBS from] -> IO [FilePath] getInstalledPackagesMonitorFiles verbosity mbWorkDir platform progdb = traverse getPackageDBPath where - getPackageDBPath :: PackageDB -> IO FilePath + getPackageDBPath :: PackageDBS from -> IO FilePath getPackageDBPath GlobalPackageDB = selectMonitorFile =<< getGlobalPackageDB verbosity ghcProg getPackageDBPath UserPackageDB = selectMonitorFile =<< getUserPackageDB verbosity ghcProg platform - getPackageDBPath (SpecificPackageDB path) = selectMonitorFile path + getPackageDBPath (SpecificPackageDB path) = selectMonitorFile (interpretSymbolicPath mbWorkDir path) -- GHC has old style file dbs, and new style directory dbs. -- Note that for dir style dbs, we only need to monitor the cache file, not @@ -733,7 +736,7 @@ libAbiHash verbosity _pkg_descr lbi lib clbi = do , ghcOptFPic = toFlag True , ghcOptHiSuffix = toFlag "dyn_hi" , ghcOptObjSuffix = toFlag "dyn_o" - , ghcOptExtra = hcSharedOptions GHC libBi + , ghcOptExtra = hcOptions GHC libBi ++ hcSharedOptions GHC libBi } profArgs = vanillaArgs @@ -745,13 +748,30 @@ libAbiHash verbosity _pkg_descr lbi lib clbi = do (withProfLibDetail lbi) , ghcOptHiSuffix = toFlag "p_hi" , ghcOptObjSuffix = toFlag "p_o" - , ghcOptExtra = hcProfOptions GHC libBi + , ghcOptExtra = hcOptions GHC libBi ++ hcProfOptions GHC libBi + } + profDynArgs = + vanillaArgs + `mappend` mempty + { ghcOptProfilingMode = toFlag True + , ghcOptProfilingAuto = + Internal.profDetailLevelFlag + True + (withProfLibDetail lbi) + , ghcOptDynLinkMode = toFlag GhcDynamicOnly + , ghcOptFPic = toFlag True + , ghcOptHiSuffix = toFlag "p_dyn_hi" + , ghcOptObjSuffix = toFlag "p_dyn_o" + , ghcOptExtra = hcOptions GHC libBi ++ hcProfSharedOptions GHC libBi } - ghcArgs - | withVanillaLib lbi = vanillaArgs - | withSharedLib lbi = sharedArgs - | withProfLib lbi = profArgs - | otherwise = error "libAbiHash: Can't find an enabled library way" + ghcArgs = + let (libWays, _, _) = buildWays lbi + in case libWays (componentIsIndefinite clbi) of + (ProfDynWay : _) -> profDynArgs + (ProfWay : _) -> profArgs + (StaticWay : _) -> vanillaArgs + (DynWay : _) -> sharedArgs + _ -> error "libAbiHash: Can't find an enabled library way" (ghcProg, _) <- requireProgram verbosity ghcProgram (withPrograms lbi) @@ -870,75 +890,91 @@ installLib -> ComponentLocalBuildInfo -> IO () installLib verbosity lbi targetDir dynlibTargetDir _builtDir pkg lib clbi = do + let + (wantedLibWays, _, _) = buildWays lbi + isIndef = componentIsIndefinite clbi + libWays = wantedLibWays isIndef + + info verbosity ("Wanted install ways: " ++ show libWays) + -- copy .hi files over: - whenVanilla $ copyModuleFiles $ Suffix "hi" - whenProf $ copyModuleFiles $ Suffix "p_hi" - whenShared $ copyModuleFiles $ Suffix "dyn_hi" + forM_ (wantedLibWays isIndef) $ \w -> case w of + StaticWay -> copyModuleFiles (Suffix "hi") + DynWay -> copyModuleFiles (Suffix "dyn_hi") + ProfWay -> copyModuleFiles (Suffix "p_hi") + ProfDynWay -> copyModuleFiles (Suffix "p_dyn_hi") -- copy extra compilation artifacts that ghc plugins may produce copyDirectoryIfExists extraCompilationArtifacts -- copy the built library files over: - whenHasCode $ do - whenVanilla $ do - sequence_ - [ installOrdinary + when (has_code && hasLib) $ do + forM_ libWays $ \w -> case w of + StaticWay -> do + sequence_ + [ installOrdinary + builtDir + targetDir + (mkGenericStaticLibName (l ++ f)) + | l <- + getHSLibraryName + (componentUnitId clbi) + : (extraBundledLibs (libBuildInfo lib)) + , f <- "" : extraLibFlavours (libBuildInfo lib) + ] + whenGHCi $ installOrdinary builtDir targetDir ghciLibName + ProfWay -> do + installOrdinary builtDir targetDir profileLibName + whenGHCi $ installOrdinary builtDir targetDir ghciProfLibName + ProfDynWay -> do + installShared builtDir - targetDir - (mkGenericStaticLibName (l ++ f)) - | l <- - getHSLibraryName - (componentUnitId clbi) - : (extraBundledLibs (libBuildInfo lib)) - , f <- "" : extraLibFlavours (libBuildInfo lib) - ] - whenGHCi $ installOrdinary builtDir targetDir ghciLibName - whenProf $ do - installOrdinary builtDir targetDir profileLibName - whenGHCi $ installOrdinary builtDir targetDir ghciProfLibName - whenShared $ - if - -- The behavior for "extra-bundled-libraries" changed in version 2.5.0. - -- See ghc issue #15837 and Cabal PR #5855. - | specVersion pkg < CabalSpecV3_0 -> do - sequence_ - [ installShared - builtDir - dynlibTargetDir - (mkGenericSharedLibName platform compiler_id (l ++ f)) - | l <- getHSLibraryName uid : extraBundledLibs (libBuildInfo lib) - , f <- "" : extraDynLibFlavours (libBuildInfo lib) - ] - | otherwise -> do - sequence_ - [ installShared - builtDir - dynlibTargetDir - ( mkGenericSharedLibName - platform - compiler_id - (getHSLibraryName uid ++ f) - ) - | f <- "" : extraDynLibFlavours (libBuildInfo lib) - ] - sequence_ - [ do - files <- getDirectoryContents (i builtDir) - let l' = - mkGenericSharedBundledLibName - platform - compiler_id - l - forM_ files $ \file -> - when (l' `isPrefixOf` file) $ do - isFile <- doesFileExist (i $ builtDir makeRelativePathEx file) - when isFile $ do - installShared - builtDir - dynlibTargetDir - file - | l <- extraBundledLibs (libBuildInfo lib) - ] + dynlibTargetDir + (mkProfSharedLibName platform compiler_id uid) + DynWay -> do + if + -- The behavior for "extra-bundled-libraries" changed in version 2.5.0. + -- See ghc issue #15837 and Cabal PR #5855. + | specVersion pkg < CabalSpecV3_0 -> do + sequence_ + [ installShared + builtDir + dynlibTargetDir + (mkGenericSharedLibName platform compiler_id (l ++ f)) + | l <- getHSLibraryName uid : extraBundledLibs (libBuildInfo lib) + , f <- "" : extraDynLibFlavours (libBuildInfo lib) + ] + | otherwise -> do + sequence_ + [ installShared + builtDir + dynlibTargetDir + ( mkGenericSharedLibName + platform + compiler_id + (getHSLibraryName uid ++ f) + ) + | f <- "" : extraDynLibFlavours (libBuildInfo lib) + ] + sequence_ + [ do + files <- getDirectoryContents (i builtDir) + let l' = + mkGenericSharedBundledLibName + platform + compiler_id + (l ++ f) + forM_ files $ \file -> + when (l' `isPrefixOf` file) $ do + isFile <- doesFileExist (i $ builtDir makeRelativePathEx file) + when isFile $ do + installShared + builtDir + dynlibTargetDir + file + | l <- extraBundledLibs (libBuildInfo lib) + , f <- "" : extraDynLibFlavours (libBuildInfo lib) + ] where -- See Note [Symbolic paths] in Distribution.Utils.Path i = interpretSymbolicPathLBI lbi @@ -997,11 +1033,7 @@ installLib verbosity lbi targetDir dynlibTargetDir _builtDir pkg lib clbi = do Platform JavaScript _ -> True _ -> False has_code = not (componentIsIndefinite clbi) - whenHasCode = when has_code - whenVanilla = when (hasLib && withVanillaLib lbi) - whenProf = when (hasLib && withProfLib lbi && has_code) whenGHCi = when (hasLib && withGHCiLib lbi && has_code) - whenShared = when (hasLib && withSharedLib lbi && has_code) -- ----------------------------------------------------------------------------- -- Registering @@ -1027,8 +1059,8 @@ hcPkgInfo progdb = registerPackage :: Verbosity -> ProgramDb - -> Maybe (SymbolicPath CWD (Dir Pkg)) - -> PackageDBStack + -> Maybe (SymbolicPath CWD (Dir from)) + -> PackageDBStackS from -> InstalledPackageInfo -> HcPkg.RegisterOptions -> IO () @@ -1066,4 +1098,4 @@ pkgRoot verbosity lbi = fmap makeSymbolicPath . pkgRoot' pkgRoot' (SpecificPackageDB fp) = return $ takeDirectory $ - interpretSymbolicPathLBI lbi (unsafeMakeSymbolicPath fp) + interpretSymbolicPathLBI lbi fp diff --git a/Cabal/src/Distribution/Simple/GHC/Build.hs b/Cabal/src/Distribution/Simple/GHC/Build.hs index 51f7d650338..0993e916886 100644 --- a/Cabal/src/Distribution/Simple/GHC/Build.hs +++ b/Cabal/src/Distribution/Simple/GHC/Build.hs @@ -6,19 +6,20 @@ import Distribution.Compat.Prelude import Prelude () import Control.Monad.IO.Class -import qualified Data.Set as Set import Distribution.PackageDescription as PD hiding (buildInfo) import Distribution.Simple.Build.Inputs import Distribution.Simple.Flag (Flag) import Distribution.Simple.GHC.Build.ExtraSources import Distribution.Simple.GHC.Build.Link import Distribution.Simple.GHC.Build.Modules -import Distribution.Simple.GHC.Build.Utils (withDynFLib) +import Distribution.Simple.GHC.Build.Utils (compilerBuildWay, isHaskell, withDynFLib) import Distribution.Simple.LocalBuildInfo import Distribution.Simple.Program.Builtin (ghcProgram) import Distribution.Simple.Program.Db (requireProgram) import Distribution.Simple.Utils -import Distribution.Types.ComponentLocalBuildInfo (componentIsIndefinite) + +import Distribution.Types.ComponentLocalBuildInfo +import Distribution.Types.PackageName.Magic (fakePackageId) import Distribution.Types.ParStrat import Distribution.Utils.NubList (fromNubListR) import Distribution.Utils.Path @@ -70,10 +71,11 @@ build build numJobs pkg_descr pbci = do let verbosity = buildVerbosity pbci - component = buildComponent pbci isLib = buildIsLib pbci lbi = localBuildInfo pbci + bi = buildBI pbci clbi = buildCLBI pbci + isIndef = componentIsIndefinite clbi mbWorkDir = mbWorkDirLBI lbi i = interpretSymbolicPathLBI lbi -- See Note [Symbolic paths] in Distribution.Utils.Path @@ -100,7 +102,7 @@ build numJobs pkg_descr pbci = do if isLib then -- NB: this might fail to make the buildTargetDir relative, -- as noted in #9776. Oh well. - tryMakeRelativeToWorkingDir mbWorkDir buildTargetDir0 + tryMakeRelative mbWorkDir buildTargetDir0 else return buildTargetDir0 -- To preserve the previous behaviour, we don't use relative dirs for -- executables. Historically, this isn't needed to reduce the CLI limit @@ -110,41 +112,40 @@ build numJobs pkg_descr pbci = do (ghcProg, _) <- liftIO $ requireProgram verbosity ghcProgram (withPrograms lbi) - -- Determine in which ways we want to build the component - let - wantVanilla = if isLib then withVanillaLib lbi else False - -- Arguably, wantStatic should be "withFullyStaticExe lbi" for executables, - -- but it was not before the refactor. - wantStatic = if isLib then withStaticLib lbi else not (wantDynamic || wantProf) - wantDynamic = case component of - CLib{} -> withSharedLib lbi - CFLib flib -> withDynFLib flib - CExe{} -> withDynExe lbi - CTest{} -> withDynExe lbi - CBench{} -> withDynExe lbi - wantProf = if isLib then withProfLib lbi else withProfExe lbi - - -- See also Note [Building Haskell Modules accounting for TH] in Distribution.Simple.GHC.Build.Modules - -- We build static by default if no other way is wanted. - -- For executables and foreign libraries, there should only be one wanted way. - wantedWays = - Set.fromList $ - -- If building a library, we accumulate all the ways, - -- otherwise, we take just one. - (if isLib then id else take 1) $ - [ProfWay | wantProf] - -- I don't see why we shouldn't build with dynamic - -- indefinite components. - <> [DynWay | wantDynamic && not (componentIsIndefinite clbi)] - <> [StaticWay | wantStatic || wantVanilla || not (wantDynamic || wantProf)] - - liftIO $ info verbosity ("Wanted build ways: " ++ show (Set.toList wantedWays)) - + -- Ways which are wanted from configuration flags + let wantedWays@(wantedLibWays, wantedFLibWay, wantedExeWay) = buildWays lbi + + -- Ways which are needed due to the compiler configuration + let doingTH = usesTemplateHaskellOrQQ bi + defaultGhcWay = compilerBuildWay (buildCompiler pbci) + wantedModBuildWays = case buildComponent pbci of + CLib _ -> wantedLibWays isIndef + CFLib fl -> [wantedFLibWay (withDynFLib fl)] + CExe _ -> [wantedExeWay] + CTest _ -> [wantedExeWay] + CBench _ -> [wantedExeWay] + finalModBuildWays = + wantedModBuildWays + ++ [defaultGhcWay | doingTH && defaultGhcWay `notElem` wantedModBuildWays] + compNameStr = showComponentName $ componentName $ buildComponent pbci + + liftIO $ info verbosity ("Wanted module build ways(" ++ compNameStr ++ "): " ++ show wantedModBuildWays) + liftIO $ info verbosity ("Final module build ways(" ++ compNameStr ++ "): " ++ show finalModBuildWays) -- We need a separate build and link phase, and C sources must be compiled -- after Haskell modules, because C sources may depend on stub headers -- generated from compiling Haskell modules (#842, #3294). - buildOpts <- buildHaskellModules numJobs ghcProg pkg_descr buildTargetDir wantedWays pbci - extraSources <- buildAllExtraSources ghcProg buildTargetDir pbci + (mbMainFile, inputModules) <- componentInputs buildTargetDir pkg_descr pbci + let (hsMainFile, nonHsMainFile) = + case mbMainFile of + Just mainFile + | PD.package pkg_descr == fakePackageId + || isHaskell (getSymbolicPath mainFile) -> + (Just mainFile, Nothing) + | otherwise -> + (Nothing, Just mainFile) + Nothing -> (Nothing, Nothing) + buildOpts <- buildHaskellModules numJobs ghcProg hsMainFile inputModules buildTargetDir finalModBuildWays pbci + extraSources <- buildAllExtraSources nonHsMainFile ghcProg buildTargetDir wantedWays pbci linkOrLoadComponent ghcProg pkg_descr diff --git a/Cabal/src/Distribution/Simple/GHC/Build/ExtraSources.hs b/Cabal/src/Distribution/Simple/GHC/Build/ExtraSources.hs index fc204cda30a..31aa92a3b2a 100644 --- a/Cabal/src/Distribution/Simple/GHC/Build/ExtraSources.hs +++ b/Cabal/src/Distribution/Simple/GHC/Build/ExtraSources.hs @@ -19,22 +19,26 @@ import Distribution.Types.Component import Distribution.Types.TargetInfo import Distribution.Simple.Build.Inputs +import Distribution.Simple.GHC.Build.Modules import Distribution.Simple.GHC.Build.Utils import Distribution.Simple.LocalBuildInfo import Distribution.Simple.Program.Types import Distribution.System (Arch (JavaScript), Platform (..)) import Distribution.Types.ComponentLocalBuildInfo -import Distribution.Types.Executable import Distribution.Utils.Path import Distribution.Verbosity (Verbosity) -- | An action that builds all the extra build sources of a component, i.e. C, -- C++, Js, Asm, C-- sources. buildAllExtraSources - :: ConfiguredProgram + :: Maybe (SymbolicPath Pkg File) + -- ^ An optional non-Haskell Main file + -> ConfiguredProgram -- ^ The GHC configured program -> SymbolicPath Pkg (Dir Artifacts) -- ^ The build directory for this target + -> (Bool -> [BuildWay], Bool -> BuildWay, BuildWay) + -- ^ Needed build ways -> PreBuildComponentInputs -- ^ The context and component being built in it. -> IO (NubListR (SymbolicPath Pkg File)) @@ -53,53 +57,50 @@ buildCSources , buildJsSources , buildAsmSources , buildCmmSources - :: ConfiguredProgram + :: Maybe (SymbolicPath Pkg File) + -- ^ An optional non-Haskell Main file + -> ConfiguredProgram -- ^ The GHC configured program -> SymbolicPath Pkg (Dir Artifacts) -- ^ The build directory for this target + -> (Bool -> [BuildWay], Bool -> BuildWay, BuildWay) + -- ^ Needed build ways -> PreBuildComponentInputs -- ^ The context and component being built in it. -> IO (NubListR (SymbolicPath Pkg File)) -- ^ Returns the list of extra sources that were built -buildCSources = +buildCSources mbMainFile = buildExtraSources "C Sources" Internal.componentCcGhcOptions - True ( \c -> do let cFiles = cSources (componentBuildInfo c) case c of - CExe exe - | let mainPath = getSymbolicPath $ modulePath exe - , isC mainPath -> - cFiles ++ [makeSymbolicPath mainPath] - -- NB: Main.hs is relative to hs-source-dirs, but Main.c - -- is relative to the package. + CExe{} + | Just main <- mbMainFile + , isC $ getSymbolicPath main -> + cFiles ++ [main] _otherwise -> cFiles ) -buildCxxSources = +buildCxxSources mbMainFile = buildExtraSources "C++ Sources" Internal.componentCxxGhcOptions - True ( \c -> do let cxxFiles = cxxSources (componentBuildInfo c) case c of - CExe exe - | let mainPath = getSymbolicPath $ modulePath exe - , isCxx mainPath -> - do cxxFiles ++ [makeSymbolicPath mainPath] - -- NB: Main.hs is relative to hs-source-dirs, but Main.c++ - -- is relative to the package. + CExe{} + | Just main <- mbMainFile + , isCxx $ getSymbolicPath main -> + cxxFiles ++ [main] _otherwise -> cxxFiles ) -buildJsSources ghcProg buildTargetDir = do +buildJsSources _mbMainFile ghcProg buildTargetDir neededWays = do Platform hostArch _ <- hostPlatform <$> localBuildInfo let hasJsSupport = hostArch == JavaScript buildExtraSources "JS Sources" Internal.componentJsGhcOptions - False ( \c -> if hasJsSupport then -- JS files are C-like with GHC's JS backend: they are @@ -111,17 +112,16 @@ buildJsSources ghcProg buildTargetDir = do ) ghcProg buildTargetDir -buildAsmSources = + neededWays +buildAsmSources _mbMainFile = buildExtraSources "Assembler Sources" Internal.componentAsmGhcOptions - True (asmSources . componentBuildInfo) -buildCmmSources = +buildCmmSources _mbMainFile = buildExtraSources "C-- Sources" Internal.componentCmmGhcOptions - True (cmmSources . componentBuildInfo) -- | Create 'PreBuildComponentRules' for a given type of extra build sources @@ -142,10 +142,6 @@ buildExtraSources -- invocation of GHC when compiling these extra sources (e.g. -- @'Internal.componentCxxGhcOptions'@, -- @'Internal.componentCmmGhcOptions'@) - -> Bool - -- ^ Some types of build sources should not be built in the dynamic way, namely, JS sources. - -- I'm not entirely sure this remains true after we migrate to supporting GHC's JS backend rather than GHCJS. - -- Boolean for "do we allow building these sources the dynamic way?" -> (Component -> [SymbolicPath Pkg File]) -- ^ View the extra sources of a component, typically from -- the build info (e.g. @'asmSources'@, @'cSources'@). @@ -156,108 +152,109 @@ buildExtraSources -- ^ The GHC configured program -> SymbolicPath Pkg (Dir Artifacts) -- ^ The build directory for this target + -> (Bool -> [BuildWay], Bool -> BuildWay, BuildWay) + -- ^ Needed build ways -> PreBuildComponentInputs -- ^ The context and component being built in it. -> IO (NubListR (SymbolicPath Pkg File)) -- ^ Returns the list of extra sources that were built -buildExtraSources description componentSourceGhcOptions wantDyn viewSources ghcProg buildTargetDir = - \PreBuildComponentInputs{buildingWhat, localBuildInfo = lbi, targetInfo} -> do - let - bi = componentBuildInfo (targetComponent targetInfo) - verbosity = buildingWhatVerbosity buildingWhat - clbi = targetCLBI targetInfo - mbWorkDir = mbWorkDirLBI lbi - i = interpretSymbolicPath mbWorkDir - sources = viewSources (targetComponent targetInfo) - comp = compiler lbi - platform = hostPlatform lbi - -- Instead of keeping this logic here, we really just want to - -- receive as an input the `neededWays` from GHC/Build.build and build - -- accordingly, since we've already determined the extra needed ways - -- needed for e.g. template haskell. Although we'd have to account for 'wantDyn'. - isGhcDynamic = isDynamic comp - doingTH = usesTemplateHaskellOrQQ bi - forceSharedLib = doingTH && isGhcDynamic - runGhcProg = runGHC verbosity ghcProg comp platform +buildExtraSources + description + componentSourceGhcOptions + viewSources + ghcProg + buildTargetDir + (neededLibWays, neededFLibWay, neededExeWay) = + \PreBuildComponentInputs{buildingWhat, localBuildInfo = lbi, targetInfo} -> do + let + bi = componentBuildInfo (targetComponent targetInfo) + verbosity = buildingWhatVerbosity buildingWhat + clbi = targetCLBI targetInfo + isIndef = componentIsIndefinite clbi + mbWorkDir = mbWorkDirLBI lbi + i = interpretSymbolicPath mbWorkDir + sources = viewSources (targetComponent targetInfo) + comp = compiler lbi + platform = hostPlatform lbi + runGhcProg = runGHC verbosity ghcProg comp platform - buildAction :: SymbolicPath Pkg File -> IO () - buildAction sourceFile = do - let baseSrcOpts = - componentSourceGhcOptions - verbosity - lbi - bi - clbi - buildTargetDir - sourceFile - vanillaSrcOpts - -- Dynamic GHC requires C sources to be built - -- with -fPIC for REPL to work. See #2207. - | isGhcDynamic && wantDyn = baseSrcOpts{ghcOptFPic = toFlag True} - | otherwise = baseSrcOpts - profSrcOpts = - vanillaSrcOpts - `mappend` mempty - { ghcOptProfilingMode = toFlag True - } - sharedSrcOpts = - vanillaSrcOpts - `mappend` mempty - { ghcOptFPic = toFlag True - , ghcOptDynLinkMode = toFlag GhcDynamicOnly - } - -- TODO: Placing all Haskell, C, & C++ objects in a single directory - -- Has the potential for file collisions. In general we would - -- consider this a user error. However, we should strive to - -- add a warning if this occurs. - odir = fromFlag (ghcOptObjDir vanillaSrcOpts) + buildAction :: SymbolicPath Pkg File -> IO () + buildAction sourceFile = do + let baseSrcOpts = + componentSourceGhcOptions + verbosity + lbi + bi + clbi + buildTargetDir + sourceFile + vanillaSrcOpts = + -- -fPIC is used in case you are using the repl + -- of a dynamically linked GHC + baseSrcOpts{ghcOptFPic = toFlag True} + profSrcOpts = + vanillaSrcOpts + `mappend` mempty + { ghcOptProfilingMode = toFlag True + } + sharedSrcOpts = + vanillaSrcOpts + `mappend` mempty + { ghcOptFPic = toFlag True + , ghcOptDynLinkMode = toFlag GhcDynamicOnly + } + profSharedSrcOpts = + vanillaSrcOpts + `mappend` mempty + { ghcOptProfilingMode = toFlag True + , ghcOptFPic = toFlag True + , ghcOptDynLinkMode = toFlag GhcDynamicOnly + } + -- TODO: Placing all Haskell, C, & C++ objects in a single directory + -- Has the potential for file collisions. In general we would + -- consider this a user error. However, we should strive to + -- add a warning if this occurs. + odir = fromFlag (ghcOptObjDir vanillaSrcOpts) - compileIfNeeded :: GhcOptions -> IO () - compileIfNeeded opts = do - needsRecomp <- checkNeedsRecompilation mbWorkDir sourceFile opts - when needsRecomp $ runGhcProg mbWorkDir opts + compileIfNeeded :: GhcOptions -> IO () + compileIfNeeded opts = do + needsRecomp <- checkNeedsRecompilation mbWorkDir sourceFile opts + when needsRecomp $ runGhcProg mbWorkDir opts - -- TODO: This whole section can be streamlined to the - -- wantedWays+neededWays logic used in Build/Modules.hs - createDirectoryIfMissingVerbose verbosity True (i odir) - case targetComponent targetInfo of - -- For libraries, we compile extra objects in the three ways: vanilla, shared, and profiled. - -- We suffix shared objects with .dyn_o and profiled ones with .p_o. - CLib _lib - -- Unless for repl, in which case we only need the vanilla way - | BuildRepl _ <- buildingWhat -> - compileIfNeeded vanillaSrcOpts - | otherwise -> - do + createDirectoryIfMissingVerbose verbosity True (i odir) + case targetComponent targetInfo of + -- For libraries, we compile extra objects in the four ways: vanilla, shared, profiled and profiled shared. + -- We suffix shared objects with `.dyn_o`, profiled ones with `.p_o` and profiled shared ones with `.p_dyn_o`. + CLib _lib + -- Unless for repl, in which case we only need the vanilla way + | BuildRepl _ <- buildingWhat -> compileIfNeeded vanillaSrcOpts - when (wantDyn && (forceSharedLib || withSharedLib lbi)) $ - compileIfNeeded sharedSrcOpts{ghcOptObjSuffix = toFlag "dyn_o"} - when (withProfLib lbi) $ - compileIfNeeded profSrcOpts{ghcOptObjSuffix = toFlag "p_o"} - - -- For foreign libraries, we determine with which options to build the - -- objects (vanilla vs shared vs profiled) - CFLib flib - | withProfExe lbi -> -- It doesn't sound right to query "ProfExe" for a foreign library... - compileIfNeeded profSrcOpts - | withDynFLib flib && wantDyn -> - compileIfNeeded sharedSrcOpts - | otherwise -> - compileIfNeeded vanillaSrcOpts - -- For the remaining component types (Exec, Test, Bench), we also - -- determine with which options to build the objects (vanilla vs shared vs - -- profiled), but predicate is the same for the three kinds. - _exeLike - | withProfExe lbi -> - compileIfNeeded profSrcOpts - | withDynExe lbi && wantDyn -> - compileIfNeeded sharedSrcOpts - | otherwise -> - compileIfNeeded vanillaSrcOpts - -- build any sources - if (null sources || componentIsIndefinite clbi) - then return mempty - else do - info verbosity ("Building " ++ description ++ "...") - traverse_ buildAction sources - return (toNubListR sources) + | otherwise -> + do + forM_ (neededLibWays isIndef) $ \case + StaticWay -> compileIfNeeded vanillaSrcOpts + DynWay -> compileIfNeeded sharedSrcOpts{ghcOptObjSuffix = toFlag "dyn_o"} + ProfWay -> compileIfNeeded profSrcOpts{ghcOptObjSuffix = toFlag "p_o"} + ProfDynWay -> compileIfNeeded profSharedSrcOpts{ghcOptObjSuffix = toFlag "p_dyn_o"} + CFLib flib -> + case neededFLibWay (withDynFLib flib) of + StaticWay -> compileIfNeeded vanillaSrcOpts + DynWay -> compileIfNeeded sharedSrcOpts + ProfWay -> compileIfNeeded profSrcOpts + ProfDynWay -> compileIfNeeded profSharedSrcOpts + -- For the remaining component types (Exec, Test, Bench), we also + -- determine with which options to build the objects (vanilla vs shared vs + -- profiled), but predicate is the same for the three kinds. + _exeLike -> + case neededExeWay of + StaticWay -> compileIfNeeded vanillaSrcOpts + DynWay -> compileIfNeeded sharedSrcOpts + ProfWay -> compileIfNeeded profSrcOpts + ProfDynWay -> compileIfNeeded profSharedSrcOpts + -- build any sources + if (null sources || componentIsIndefinite clbi) + then return mempty + else do + info verbosity ("Building " ++ description ++ "...") + traverse_ buildAction sources + return (toNubListR sources) diff --git a/Cabal/src/Distribution/Simple/GHC/Build/Link.hs b/Cabal/src/Distribution/Simple/GHC/Build/Link.hs index ee0f21ffa6d..ef9f33d79c9 100644 --- a/Cabal/src/Distribution/Simple/GHC/Build/Link.hs +++ b/Cabal/src/Distribution/Simple/GHC/Build/Link.hs @@ -8,8 +8,6 @@ module Distribution.Simple.GHC.Build.Link where import Distribution.Compat.Prelude import Prelude () -import Control.Exception (assert) -import Control.Monad (forM_) import Control.Monad.IO.Class import qualified Data.ByteString.Lazy.Char8 as BS import qualified Data.Set as Set @@ -76,128 +74,148 @@ linkOrLoadComponent -> (SymbolicPath Pkg (Dir Artifacts), SymbolicPath Pkg (Dir Build)) -- ^ The build target dir, and the target dir. -- See Note [Build Target Dir vs Target Dir] in Distribution.Simple.GHC.Build - -> (Set.Set BuildWay, BuildWay -> GhcOptions) + -> ((Bool -> [BuildWay], Bool -> BuildWay, BuildWay), BuildWay -> GhcOptions) -- ^ The set of build ways wanted based on the user opts, and a function to -- convert a build way into the set of ghc options that were used to build -- that way. -> PreBuildComponentInputs -- ^ The context and component being built in it. -> IO () -linkOrLoadComponent ghcProg pkg_descr extraSources (buildTargetDir, targetDir) (wantedWays, buildOpts) pbci = do - let - verbosity = buildVerbosity pbci - target = targetInfo pbci - component = buildComponent pbci - what = buildingWhat pbci - lbi = localBuildInfo pbci - bi = buildBI pbci - clbi = buildCLBI pbci - mbWorkDir = mbWorkDirLBI lbi +linkOrLoadComponent + ghcProg + pkg_descr + extraSources + (buildTargetDir, targetDir) + ((wantedLibWays, wantedFLibWay, wantedExeWay), buildOpts) + pbci = do + let + verbosity = buildVerbosity pbci + target = targetInfo pbci + component = buildComponent pbci + what = buildingWhat pbci + lbi = localBuildInfo pbci + bi = buildBI pbci + clbi = buildCLBI pbci + isIndef = componentIsIndefinite clbi + mbWorkDir = mbWorkDirLBI lbi - -- See Note [Symbolic paths] in Distribution.Utils.Path - i = interpretSymbolicPathLBI lbi + -- See Note [Symbolic paths] in Distribution.Utils.Path + i = interpretSymbolicPathLBI lbi - -- ensure extra lib dirs exist before passing to ghc - cleanedExtraLibDirs <- liftIO $ filterM (doesDirectoryExist . i) (extraLibDirs bi) - cleanedExtraLibDirsStatic <- liftIO $ filterM (doesDirectoryExist . i) (extraLibDirsStatic bi) + -- ensure extra lib dirs exist before passing to ghc + cleanedExtraLibDirs <- liftIO $ filterM (doesDirectoryExist . i) (extraLibDirs bi) + cleanedExtraLibDirsStatic <- liftIO $ filterM (doesDirectoryExist . i) (extraLibDirsStatic bi) - let - extraSourcesObjs :: [RelativePath Artifacts File] - extraSourcesObjs = - [ makeRelativePathEx $ getSymbolicPath src `replaceExtension` objExtension - | src <- extraSources - ] - - -- TODO: Shouldn't we use withStaticLib for libraries and something else - -- for foreign libs in the three cases where we use `withFullyStaticExe` below? - linkerOpts rpaths = - mempty - { ghcOptLinkOptions = - PD.ldOptions bi - ++ [ "-static" - | withFullyStaticExe lbi - ] - -- Pass extra `ld-options` given - -- through to GHC's linker. - ++ maybe - [] - programOverrideArgs - (lookupProgram ldProgram (withPrograms lbi)) - , ghcOptLinkLibs = - if withFullyStaticExe lbi - then extraLibsStatic bi - else extraLibs bi - , ghcOptLinkLibPath = - toNubListR $ + let + extraSourcesObjs :: [RelativePath Artifacts File] + extraSourcesObjs = + [ makeRelativePathEx $ getSymbolicPath src `replaceExtension` objExtension + | src <- extraSources + ] + + -- TODO: Shouldn't we use withStaticLib for libraries and something else + -- for foreign libs in the three cases where we use `withFullyStaticExe` below? + linkerOpts rpaths = + mempty + { ghcOptLinkOptions = + PD.ldOptions bi + ++ [ "-static" + | withFullyStaticExe lbi + ] + -- Pass extra `ld-options` given + -- through to GHC's linker. + ++ maybe + [] + programOverrideArgs + (lookupProgram ldProgram (withPrograms lbi)) + , ghcOptLinkLibs = if withFullyStaticExe lbi - then cleanedExtraLibDirsStatic - else cleanedExtraLibDirs - , ghcOptLinkFrameworks = toNubListR $ map getSymbolicPath $ PD.frameworks bi - , ghcOptLinkFrameworkDirs = toNubListR $ PD.extraFrameworkDirs bi - , ghcOptInputFiles = - toNubListR - [ coerceSymbolicPath $ buildTargetDir obj - | obj <- extraSourcesObjs - ] - , ghcOptNoLink = Flag False - , ghcOptRPaths = rpaths - } - case what of - BuildRepl replFlags -> liftIO $ do - let - -- For repl we use the vanilla (static) ghc options - staticOpts = buildOpts StaticWay - replOpts = - staticOpts - { -- Repl options use Static as the base, but doesn't need to pass -static. - -- However, it maybe should, for uniformity. - ghcOptDynLinkMode = NoFlag - , ghcOptExtra = - Internal.filterGhciFlags - (ghcOptExtra staticOpts) - <> replOptionsFlags (replReplOptions replFlags) - , ghcOptInputModules = replNoLoad (replReplOptions replFlags) (ghcOptInputModules staticOpts) - , ghcOptInputFiles = replNoLoad (replReplOptions replFlags) (ghcOptInputFiles staticOpts) - } - -- For a normal compile we do separate invocations of ghc for - -- compiling as for linking. But for repl we have to do just - -- the one invocation, so that one has to include all the - -- linker stuff too, like -l flags and any .o files from C - -- files etc. - -- - -- TODO: The repl doesn't use the runtime paths from linkerOpts - -- (ghcOptRPaths), which looks like a bug. After the refactor we - -- can fix this. - `mappend` linkerOpts mempty - `mappend` mempty - { ghcOptMode = toFlag GhcModeInteractive - , ghcOptOptimisation = toFlag GhcNoOptimisation + then extraLibsStatic bi + else extraLibs bi + , ghcOptLinkLibPath = + toNubListR $ + if withFullyStaticExe lbi + then cleanedExtraLibDirsStatic + else cleanedExtraLibDirs + , ghcOptLinkFrameworks = toNubListR $ map getSymbolicPath $ PD.frameworks bi + , ghcOptLinkFrameworkDirs = toNubListR $ PD.extraFrameworkDirs bi + , ghcOptInputFiles = + toNubListR + [ coerceSymbolicPath $ buildTargetDir obj + | obj <- extraSourcesObjs + ] + , ghcOptNoLink = Flag False + , ghcOptRPaths = rpaths + } + + case what of + BuildRepl replFlags -> liftIO $ do + let + -- For repl we use the vanilla (static) ghc options + staticOpts = buildOpts StaticWay + replOpts = + staticOpts + { -- Repl options use Static as the base, but doesn't need to pass -static. + -- However, it maybe should, for uniformity. + ghcOptDynLinkMode = NoFlag + , ghcOptExtra = + Internal.filterGhciFlags + (ghcOptExtra staticOpts) + <> replOptionsFlags (replReplOptions replFlags) + } + -- For a normal compile we do separate invocations of ghc for + -- compiling as for linking. But for repl we have to do just + -- the one invocation, so that one has to include all the + -- linker stuff too, like -l flags and any .o files from C + -- files etc. + -- + -- TODO: The repl doesn't use the runtime paths from linkerOpts + -- (ghcOptRPaths), which looks like a bug. After the refactor we + -- can fix this. + `mappend` linkerOpts mempty + `mappend` mempty + { ghcOptMode = toFlag GhcModeInteractive + , ghcOptOptimisation = toFlag GhcNoOptimisation + } + replOpts_final = + replOpts + { ghcOptInputModules = replNoLoad (replReplOptions replFlags) (ghcOptInputModules replOpts) + , ghcOptInputFiles = replNoLoad (replReplOptions replFlags) (ghcOptInputFiles replOpts) } - -- TODO: problem here is we need the .c files built first, so we can load them - -- with ghci, but .c files can depend on .h files generated by ghc by ffi - -- exports. - when (case component of CLib lib -> null (allLibModules lib clbi); _ -> False) $ - warn verbosity "No exposed modules" - runReplOrWriteFlags ghcProg lbi replFlags replOpts (pkgName (PD.package pkg_descr)) target - _otherwise -> - let - runGhcProg = runGHC verbosity ghcProg comp platform mbWorkDir - platform = hostPlatform lbi - comp = compiler lbi - in - when (not $ componentIsIndefinite clbi) $ do - -- If not building dynamically, we don't pass any runtime paths. - rpaths <- if DynWay `Set.member` wantedWays then getRPaths pbci else return (toNubListR []) - liftIO $ do - info verbosity "Linking..." - let linkExeLike name = linkExecutable (linkerOpts rpaths) (wantedWays, buildOpts) targetDir name runGhcProg lbi - case component of - CLib lib -> linkLibrary buildTargetDir cleanedExtraLibDirs pkg_descr verbosity runGhcProg lib lbi clbi extraSources rpaths wantedWays - CFLib flib -> linkFLib flib bi lbi (linkerOpts rpaths) (wantedWays, buildOpts) targetDir runGhcProg - CExe exe -> linkExeLike (exeName exe) - CTest test -> linkExeLike (testName test) - CBench bench -> linkExeLike (benchmarkName bench) + -- TODO: problem here is we need the .c files built first, so we can load them + -- with ghci, but .c files can depend on .h files generated by ghc by ffi + -- exports. + when (case component of CLib lib -> null (allLibModules lib clbi); _ -> False) $ + warn verbosity "No exposed modules" + runReplOrWriteFlags ghcProg lbi replFlags replOpts_final (pkgName (PD.package pkg_descr)) target + _otherwise -> + let + runGhcProg = runGHC verbosity ghcProg comp platform mbWorkDir + platform = hostPlatform lbi + comp = compiler lbi + get_rpaths ways = + if DynWay `Set.member` ways then getRPaths pbci else return (toNubListR []) + in + when (not $ componentIsIndefinite clbi) $ do + -- If not building dynamically, we don't pass any runtime paths. + liftIO $ do + info verbosity "Linking..." + let linkExeLike name = do + rpaths <- get_rpaths (Set.singleton wantedExeWay) + linkExecutable (linkerOpts rpaths) (wantedExeWay, buildOpts) targetDir name runGhcProg lbi + case component of + CLib lib -> do + let libWays = wantedLibWays isIndef + rpaths <- get_rpaths (Set.fromList libWays) + linkLibrary buildTargetDir cleanedExtraLibDirs pkg_descr verbosity runGhcProg lib lbi clbi extraSources rpaths libWays + CFLib flib -> do + let flib_way = wantedFLibWay (withDynFLib flib) + rpaths <- get_rpaths (Set.singleton flib_way) + linkFLib flib bi lbi (linkerOpts rpaths) (flib_way, buildOpts) targetDir runGhcProg + CExe exe -> linkExeLike (exeName exe) + CTest test -> linkExeLike (testName test) + CBench bench -> linkExeLike (benchmarkName bench) -- | Link a library component linkLibrary @@ -217,7 +235,7 @@ linkLibrary -- ^ Extra build sources (that were compiled to objects) -> NubListR FilePath -- ^ A list with the runtime-paths (rpaths), or empty if not linking dynamically - -> Set.Set BuildWay + -> [BuildWay] -- ^ Wanted build ways and corresponding build options -> IO () linkLibrary buildTargetDir cleanedExtraLibDirs pkg_descr verbosity runGhcProg lib lbi clbi extraSources rpaths wantedWays = do @@ -237,6 +255,9 @@ linkLibrary buildTargetDir cleanedExtraLibDirs pkg_descr verbosity runGhcProg li sharedLibFilePath = buildTargetDir makeRelativePathEx (mkSharedLibName (hostPlatform lbi) compiler_id uid) + profSharedLibFilePath = + buildTargetDir + makeRelativePathEx (mkProfSharedLibName (hostPlatform lbi) compiler_id uid) staticLibFilePath = buildTargetDir makeRelativePathEx (mkStaticLibName (hostPlatform lbi) compiler_id uid) @@ -252,6 +273,9 @@ linkLibrary buildTargetDir cleanedExtraLibDirs pkg_descr verbosity runGhcProg li sharedLibInstallPath = libInstallPath mkSharedLibName (hostPlatform lbi) compiler_id uid + profSharedLibInstallPath = + libInstallPath + mkProfSharedLibName (hostPlatform lbi) compiler_id uid getObjFiles :: BuildWay -> IO [SymbolicPath Pkg File] getObjFiles way = @@ -358,6 +382,32 @@ linkLibrary buildTargetDir cleanedExtraLibDirs pkg_descr verbosity runGhcProg li toNubListR $ PD.extraFrameworkDirs libBi , ghcOptRPaths = rpaths } + ghcProfSharedLinkArgs pdynObjectFiles = + ghcBaseLinkArgs + { ghcOptShared = toFlag True + , ghcOptProfilingMode = toFlag True + , ghcOptProfilingAuto = + Internal.profDetailLevelFlag + True + (withProfLibDetail lbi) + , ghcOptDynLinkMode = toFlag GhcDynamicOnly + , ghcOptInputFiles = toNubListR pdynObjectFiles + , ghcOptOutputFile = toFlag profSharedLibFilePath + , -- For dynamic libs, Mac OS/X needs to know the install location + -- at build time. This only applies to GHC < 7.8 - see the + -- discussion in #1660. + ghcOptDylibName = + if hostOS == OSX + && ghcVersion < mkVersion [7, 8] + then toFlag profSharedLibInstallPath + else mempty + , ghcOptLinkLibs = extraLibs libBi + , ghcOptLinkLibPath = toNubListR $ cleanedExtraLibDirs + , ghcOptLinkFrameworks = toNubListR $ map getSymbolicPath $ PD.frameworks libBi + , ghcOptLinkFrameworkDirs = + toNubListR $ PD.extraFrameworkDirs libBi + , ghcOptRPaths = rpaths + } ghcStaticLinkArgs staticObjectFiles = ghcBaseLinkArgs { ghcOptStaticLib = toFlag True @@ -371,6 +421,7 @@ linkLibrary buildTargetDir cleanedExtraLibDirs pkg_descr verbosity runGhcProg li staticObjectFiles <- getObjFiles StaticWay profObjectFiles <- getObjFiles ProfWay dynamicObjectFiles <- getObjFiles DynWay + profDynamicObjectFiles <- getObjFiles ProfDynWay let linkWay = \case @@ -384,6 +435,8 @@ linkLibrary buildTargetDir cleanedExtraLibDirs pkg_descr verbosity runGhcProg li ldProg ghciProfLibFilePath profObjectFiles + ProfDynWay -> do + runGhcProg $ ghcProfSharedLinkArgs profDynamicObjectFiles DynWay -> do runGhcProg $ ghcSharedLinkArgs dynamicObjectFiles StaticWay -> do @@ -413,7 +466,7 @@ linkLibrary buildTargetDir cleanedExtraLibDirs pkg_descr verbosity runGhcProg li linkExecutable :: (GhcOptions) -- ^ The linker-specific GHC options - -> (Set.Set BuildWay, BuildWay -> GhcOptions) + -> (BuildWay, BuildWay -> GhcOptions) -- ^ The wanted build ways and corresponding GhcOptions that were -- used to compile the modules in that way. -> SymbolicPath Pkg (Dir Build) @@ -425,30 +478,27 @@ linkExecutable -- ^ Run the configured GHC program -> LocalBuildInfo -> IO () -linkExecutable linkerOpts (wantedWays, buildOpts) targetDir targetName runGhcProg lbi = do - -- When building an executable, we should only "want" one build way. - assert (Set.size wantedWays == 1) $ - forM_ wantedWays $ \way -> do - let baseOpts = buildOpts way - linkOpts = - baseOpts - `mappend` linkerOpts - `mappend` mempty - { -- If there are no input Haskell files we pass -no-hs-main, and - -- assume there is a main function in another non-haskell object - ghcOptLinkNoHsMain = toFlag (ghcOptInputFiles baseOpts == mempty && ghcOptInputScripts baseOpts == mempty) - } - comp = compiler lbi +linkExecutable linkerOpts (way, buildOpts) targetDir targetName runGhcProg lbi = do + let baseOpts = buildOpts way + linkOpts = + baseOpts + `mappend` linkerOpts + `mappend` mempty + { -- If there are no input Haskell files we pass -no-hs-main, and + -- assume there is a main function in another non-haskell object + ghcOptLinkNoHsMain = toFlag (ghcOptInputFiles baseOpts == mempty && ghcOptInputScripts baseOpts == mempty) + } + comp = compiler lbi - -- Work around old GHCs not relinking in this - -- situation, see #3294 - let target = - targetDir makeRelativePathEx (exeTargetName (hostPlatform lbi) targetName) - when (compilerVersion comp < mkVersion [7, 7]) $ do - let targetPath = interpretSymbolicPathLBI lbi target - e <- doesFileExist targetPath - when e (removeFile targetPath) - runGhcProg linkOpts{ghcOptOutputFile = toFlag target} + -- Work around old GHCs not relinking in this + -- situation, see #3294 + let target = + targetDir makeRelativePathEx (exeTargetName (hostPlatform lbi) targetName) + when (compilerVersion comp < mkVersion [7, 7]) $ do + let targetPath = interpretSymbolicPathLBI lbi target + e <- doesFileExist targetPath + when e (removeFile targetPath) + runGhcProg linkOpts{ghcOptOutputFile = toFlag target} -- | Link a foreign library component linkFLib @@ -457,7 +507,7 @@ linkFLib -> LocalBuildInfo -> (GhcOptions) -- ^ The linker-specific GHC options - -> (Set.Set BuildWay, BuildWay -> GhcOptions) + -> (BuildWay, BuildWay -> GhcOptions) -- ^ The wanted build ways and corresponding GhcOptions that were -- used to compile the modules in that way. -> SymbolicPath Pkg (Dir Build) @@ -466,7 +516,7 @@ linkFLib -> (GhcOptions -> IO ()) -- ^ Run the configured GHC program -> IO () -linkFLib flib bi lbi linkerOpts (wantedWays, buildOpts) targetDir runGhcProg = do +linkFLib flib bi lbi linkerOpts (way, buildOpts) targetDir runGhcProg = do let comp = compiler lbi @@ -498,8 +548,8 @@ linkFLib flib bi lbi linkerOpts (wantedWays, buildOpts) targetDir runGhcProg = d else statRtsVanillaLib (rtsStaticInfo rtsInfo) ] - linkOpts :: BuildWay -> GhcOptions - linkOpts way = case foreignLibType flib of + linkOpts :: GhcOptions + linkOpts = case foreignLibType flib of ForeignLibNativeShared -> (buildOpts way) `mappend` linkerOpts @@ -521,13 +571,10 @@ linkFLib flib bi lbi linkerOpts (wantedWays, buildOpts) targetDir runGhcProg = d -- soname on supported platforms. See also the note for -- @flibBuildName@. let buildName = flibBuildName lbi flib - -- There should not be more than one wanted way when building an flib - assert (Set.size wantedWays == 1) $ - forM_ wantedWays $ \way -> do - let outFile = targetDir makeRelativePathEx buildName - runGhcProg (linkOpts way){ghcOptOutputFile = toFlag outFile} - let i = interpretSymbolicPathLBI lbi - renameFile (i outFile) (i targetDir flibTargetName lbi flib) + let outFile = targetDir makeRelativePathEx buildName + runGhcProg linkOpts{ghcOptOutputFile = toFlag outFile} + let i = interpretSymbolicPathLBI lbi + renameFile (i outFile) (i targetDir flibTargetName lbi flib) -- | Calculate the RPATHs for the component we are building. -- @@ -688,7 +735,9 @@ runReplOrWriteFlags ghcProg lbi rflags ghcOpts pkg_name target = Flag out_dir -> do let uid = componentUnitId clbi this_unit = prettyShow uid - reexported_modules = [mn | LibComponentLocalBuildInfo{} <- [clbi], IPI.ExposedModule mn (Just{}) <- componentExposedModules clbi] + reexported_modules = + [ mn | LibComponentLocalBuildInfo{componentExposedModules = exposed_mods} <- [clbi], IPI.ExposedModule mn (Just{}) <- exposed_mods + ] hidden_modules = otherModules bi extra_opts = concat $ diff --git a/Cabal/src/Distribution/Simple/GHC/Build/Modules.hs b/Cabal/src/Distribution/Simple/GHC/Build/Modules.hs index 9c9e55a03bf..2e8ba35ccb6 100644 --- a/Cabal/src/Distribution/Simple/GHC/Build/Modules.hs +++ b/Cabal/src/Distribution/Simple/GHC/Build/Modules.hs @@ -5,7 +5,12 @@ {-# LANGUAGE RankNTypes #-} {-# LANGUAGE TupleSections #-} -module Distribution.Simple.GHC.Build.Modules (buildHaskellModules, BuildWay (..), buildWayPrefix) where +module Distribution.Simple.GHC.Build.Modules + ( buildHaskellModules + , BuildWay (..) + , buildWayPrefix + , componentInputs + ) where import Control.Monad.IO.Class import Distribution.Compat.Prelude @@ -17,6 +22,7 @@ import Distribution.ModuleName (ModuleName) import qualified Distribution.PackageDescription as PD import Distribution.Pretty import Distribution.Simple.Build.Inputs +import Distribution.Simple.BuildWay import Distribution.Simple.Compiler import Distribution.Simple.GHC.Build.Utils import qualified Distribution.Simple.GHC.Internal as Internal @@ -97,13 +103,15 @@ buildHaskellModules -- ^ The parallelism strategy (e.g. num of jobs) -> ConfiguredProgram -- ^ The GHC configured program - -> PD.PackageDescription - -- ^ The package description + -> Maybe (SymbolicPath Pkg File) + -- ^ Optional path to a Haskell Main file to build + -> [ModuleName] + -- ^ The Haskell modules to build -> SymbolicPath Pkg ('Dir Artifacts) -- ^ The path to the build directory for this target, which -- has already been created. - -> Set.Set BuildWay - -- ^ The set of wanted build ways according to user options + -> [BuildWay] + -- ^ The set of needed build ways according to user options -> PreBuildComponentInputs -- ^ The context and component being built in it. -> IO (BuildWay -> GhcOptions) @@ -111,7 +119,7 @@ buildHaskellModules -- invocation used to compile the component in that 'BuildWay'. -- This can be useful in, eg, a linker invocation, in which we want to use the -- same options and list the same inputs as those used for building. -buildHaskellModules numJobs ghcProg pkg_descr buildTargetDir wantedWays pbci = do +buildHaskellModules numJobs ghcProg mbMainFile inputModules buildTargetDir neededLibWays pbci = do -- See Note [Building Haskell Modules accounting for TH] let @@ -140,15 +148,13 @@ buildHaskellModules numJobs ghcProg pkg_descr buildTargetDir wantedWays pbci = d | isCoverageEnabled = Flag $ Hpc.mixDir (coerceSymbolicPath $ coerceSymbolicPath buildTargetDir extraCompilationArtifacts) way | otherwise = mempty - (inputFiles, inputModules) <- componentInputs buildTargetDir pkg_descr pbci - let mbWorkDir = mbWorkDirLBI lbi runGhcProg = runGHC verbosity ghcProg comp platform mbWorkDir platform = hostPlatform lbi - -- See Note [Building Haskell Modules accounting for TH] - doingTH = usesTemplateHaskellOrQQ bi + (hsMains, scriptMains) = + partition (isHaskell . getSymbolicPath) (maybeToList mbMainFile) -- We define the base opts which are shared across different build ways in -- 'buildHaskellModules' @@ -163,16 +169,8 @@ buildHaskellModules numJobs ghcProg pkg_descr buildTargetDir wantedWays pbci = d ghcOptNoLink = if isLib then NoFlag else toFlag True , ghcOptNumJobs = numJobs , ghcOptInputModules = toNubListR inputModules - , ghcOptInputFiles = - toNubListR $ - if PD.package pkg_descr == fakePackageId - then filter (isHaskell . getSymbolicPath) inputFiles - else inputFiles - , ghcOptInputScripts = - toNubListR $ - if PD.package pkg_descr == fakePackageId - then filter (not . isHaskell . getSymbolicPath) inputFiles - else [] + , ghcOptInputFiles = toNubListR hsMains + , ghcOptInputScripts = toNubListR scriptMains , ghcOptExtra = buildWayExtraHcOptions way GHC bi , ghcOptHiSuffix = optSuffixFlag (buildWayPrefix way) "hi" , ghcOptObjSuffix = optSuffixFlag (buildWayPrefix way) "o" @@ -200,6 +198,18 @@ buildHaskellModules numJobs ghcProg pkg_descr buildTargetDir wantedWays pbci = d (if isLib then True else False) ((if isLib then withProfLibDetail else withProfExeDetail) lbi) } + profDynOpts = + (baseOpts ProfDynWay) + { ghcOptDynLinkMode = toFlag GhcDynamicOnly -- use -dynamic + , -- TODO: Does it hurt to set -fPIC for executables? + ghcOptFPic = toFlag True -- use -fPIC + , ghcOptProfilingMode = toFlag True + , ghcOptProfilingAuto = + Internal.profDetailLevelFlag + (if isLib then True else False) + ((if isLib then withProfLibDetail else withProfExeDetail) lbi) + } + -- Options for building both static and dynamic way at the same time, using -- the GHC flag -static and -dynamic-too dynTooOpts = @@ -212,45 +222,84 @@ buildHaskellModules numJobs ghcProg pkg_descr buildTargetDir wantedWays pbci = d -- (Note that `baseOtps StaticWay = hcStaticOptions`, not hcSharedOpts) } + profDynTooOpts = + (baseOpts ProfWay) + { ghcOptDynLinkMode = toFlag GhcStaticAndDynamic -- use -dynamic-too + , -- TODO: Does it hurt to set -fPIC for executables? + ghcOptFPic = toFlag True -- use -fPIC + , ghcOptProfilingMode = toFlag True + , ghcOptProfilingAuto = + Internal.profDetailLevelFlag + (if isLib then True else False) + ((if isLib then withProfLibDetail else withProfExeDetail) lbi) + , ghcOptDynHiSuffix = toFlag (buildWayPrefix ProfDynWay ++ "hi") + , ghcOptDynObjSuffix = toFlag (buildWayPrefix ProfDynWay ++ "o") + , ghcOptHPCDir = hpcdir Hpc.ProfDyn + -- Should we pass hcSharedOpts in the -dynamic-too ghc invocation? + -- (Note that `baseOtps StaticWay = hcStaticOptions`, not hcSharedOpts) + } + -- Determines how to build for each way, also serves as the base options -- for loading modules in 'linkOrLoadComponent' buildOpts way = case way of StaticWay -> staticOpts DynWay -> dynOpts ProfWay -> profOpts - - defaultGhcWay = if isDynamic comp then DynWay else StaticWay + ProfDynWay -> profDynOpts -- If there aren't modules, or if we're loading the modules in repl, don't build. - unless (forRepl || (null inputFiles && null inputModules)) $ liftIO $ do + unless (forRepl || (isNothing mbMainFile && null inputModules)) $ liftIO $ do -- See Note [Building Haskell Modules accounting for TH] let - neededWays = - wantedWays - <> Set.fromList - -- TODO: You also don't need to build the GHC way when doing TH if - -- you are using an external interpreter!! - [defaultGhcWay | doingTH && defaultGhcWay `Set.notMember` wantedWays] + neededLibWaysSet = Set.fromList neededLibWays -- If we need both static and dynamic, use dynamic-too instead of -- compiling twice (if we support it) useDynamicToo = - StaticWay `Set.member` neededWays - && DynWay `Set.member` neededWays + StaticWay `Set.member` neededLibWaysSet + && DynWay `Set.member` neededLibWaysSet && supportsDynamicToo comp && null (hcSharedOptions GHC bi) + useProfDynamicToo = + ProfWay `Set.member` neededLibWaysSet + && ProfDynWay `Set.member` neededLibWaysSet + && supportsDynamicToo comp + && null (hcSharedOptions GHC bi) + + defaultGhcWay = compilerBuildWay comp + + order w + | w == defaultGhcWay = 0 + | otherwise = fromEnum w + 1 + -- The ways we'll build, in order orderedBuilds - -- If we can use dynamic-too, do it first. The default GHC way can only - -- be static or dynamic, so, if we build both right away, any modules - -- possibly needed by TH later (e.g. if building profiled) are already built. + -- We need to make sure that the way which is the way the compiler is built + -- is built first so that Template Haskell works. + | useProfDynamicToo && useDynamicToo = + if defaultGhcWay `elem` [ProfDynWay, ProfWay] + then [buildProfAndProfDynamicToo, buildStaticAndDynamicToo] + else [buildStaticAndDynamicToo, buildProfAndProfDynamicToo] + | useProfDynamicToo && not useDynamicToo = + if defaultGhcWay `elem` [ProfDynWay, ProfWay] + then + [buildProfAndProfDynamicToo] + ++ (runGhcProg . buildOpts <$> neededLibWays \\ [ProfDynWay, ProfWay]) + else + (runGhcProg . buildOpts <$> neededLibWays \\ [ProfDynWay, ProfWay]) + ++ [buildProfAndProfDynamicToo] | useDynamicToo = - [buildStaticAndDynamicToo] - ++ (runGhcProg . buildOpts <$> Set.toList neededWays \\ [StaticWay, DynWay]) + if defaultGhcWay `elem` [StaticWay, DynWay] + then + [buildStaticAndDynamicToo] + ++ (runGhcProg . buildOpts <$> neededLibWays \\ [StaticWay, DynWay]) + else + (runGhcProg . buildOpts <$> neededLibWays \\ [StaticWay, DynWay]) + ++ [buildStaticAndDynamicToo] -- Otherwise, we need to ensure the defaultGhcWay is built first | otherwise = - runGhcProg . buildOpts <$> sortOn (\w -> if w == defaultGhcWay then 0 else fromEnum w + 1) (Set.toList neededWays) + runGhcProg . buildOpts <$> sortOn order neededLibWays buildStaticAndDynamicToo = do runGhcProg dynTooOpts @@ -264,27 +313,31 @@ buildHaskellModules numJobs ghcProg pkg_descr buildTargetDir wantedWays pbci = d -- both ways. copyDirectoryRecursive verbosity (i dynDir) (i vanillaDir) _ -> return () + + buildProfAndProfDynamicToo = do + runGhcProg profDynTooOpts + case (hpcdir Hpc.ProfDyn, hpcdir Hpc.Prof) of + (Flag profDynDir, Flag profDir) -> + -- When the vanilla and shared library builds are done + -- in one pass, only one set of HPC module interfaces + -- are generated. This set should suffice for both + -- static and dynamically linked executables. We copy + -- the modules interfaces so they are available under + -- both ways. + copyDirectoryRecursive verbosity (i profDynDir) (i profDir) + _ -> return () in -- REVIEW:ADD? info verbosity "Building Haskell Sources..." sequence_ orderedBuilds return buildOpts -data BuildWay = StaticWay | DynWay | ProfWay - deriving (Eq, Ord, Show, Enum) - --- | Returns the object/interface extension prefix for the given build way (e.g. "dyn_" for 'DynWay') -buildWayPrefix :: BuildWay -> String -buildWayPrefix = \case - StaticWay -> "" - ProfWay -> "p_" - DynWay -> "dyn_" - -- | Returns the corresponding 'Hpc.Way' for a 'BuildWay' buildWayHpcWay :: BuildWay -> Hpc.Way buildWayHpcWay = \case StaticWay -> Hpc.Vanilla ProfWay -> Hpc.Prof DynWay -> Hpc.Dyn + ProfDynWay -> Hpc.ProfDyn -- | Returns a function to extract the extra haskell compiler options from a -- 'BuildInfo' and 'CompilerFlavor' @@ -293,26 +346,28 @@ buildWayExtraHcOptions = \case StaticWay -> hcStaticOptions ProfWay -> hcProfOptions DynWay -> hcSharedOptions + ProfDynWay -> hcProfSharedOptions --- | Returns a pair of the Haskell input files and Haskell modules of the --- component being built. +-- | Returns a pair of the main file and Haskell modules of the component being +-- built. The main file is not necessarily a Haskell file. It could also be +-- e.g. a C source, or, a Haskell repl script (that does not necessarily have +-- an extension). -- --- The "input files" are either the path to the main Haskell module, or a repl --- script (that does not necessarily have an extension). +-- The main file is Nothing if the component is not executable. componentInputs :: SymbolicPath Pkg (Dir Artifacts) -- ^ Target build dir -> PD.PackageDescription -> PreBuildComponentInputs -- ^ The context and component being built in it. - -> IO ([SymbolicPath Pkg File], [ModuleName]) - -- ^ The Haskell input files, and the Haskell modules + -> IO (Maybe (SymbolicPath Pkg File), [ModuleName]) + -- ^ The main input file, and the Haskell modules componentInputs buildTargetDir pkg_descr pbci = case component of CLib lib -> - pure ([], allLibModules lib clbi) + pure (Nothing, allLibModules lib clbi) CFLib flib -> - pure ([], foreignLibModules flib) + pure (Nothing, foreignLibModules flib) CExe Executable{buildInfo = bi', modulePath} -> exeLikeInputs bi' modulePath CTest TestSuite{testBuildInfo = bi', testInterface = TestSuiteExeV10 _ mainFile} -> @@ -351,6 +406,6 @@ componentInputs buildTargetDir pkg_descr pbci = "Enabling workaround for Main module '" ++ prettyShow mainModName ++ "' listed in 'other-modules' illegally!" - return ([main], filter (/= mainModName) otherModNames) - else return ([main], otherModNames) - else return ([], otherModNames) + return (Just main, filter (/= mainModName) otherModNames) + else return (Just main, otherModNames) + else return (Just main, otherModNames) diff --git a/Cabal/src/Distribution/Simple/GHC/Build/Utils.hs b/Cabal/src/Distribution/Simple/GHC/Build/Utils.hs index fb8bd21351a..e61fc50c9c4 100644 --- a/Cabal/src/Distribution/Simple/GHC/Build/Utils.hs +++ b/Cabal/src/Distribution/Simple/GHC/Build/Utils.hs @@ -13,6 +13,7 @@ import qualified Distribution.ModuleName as ModuleName import Distribution.PackageDescription as PD import Distribution.PackageDescription.Utils (cabalBug) import Distribution.Simple.BuildPaths +import Distribution.Simple.BuildWay import Distribution.Simple.Compiler import qualified Distribution.Simple.GHC.Internal as Internal import Distribution.Simple.Program.GHC @@ -30,7 +31,7 @@ import System.FilePath ) -- | Find the path to the entry point of an executable (typically specified in --- @main-is@, and found in @hs-source-dirs@). +-- @main-is@, and found in @hs-source-dirs@ -- yes, even when @main-is@ is not a Haskell file). findExecutableMain :: Verbosity -> Maybe (SymbolicPath CWD (Dir Pkg)) @@ -47,10 +48,21 @@ findExecutableMain verbosity mbWorkDir buildDir (bnfo, modPath) = supportsDynamicToo :: Compiler -> Bool supportsDynamicToo = Internal.ghcLookupProperty "Support dynamic-too" +compilerBuildWay :: Compiler -> BuildWay +compilerBuildWay c = + case (isDynamic c, isProfiled c) of + (True, True) -> ProfDynWay + (True, False) -> DynWay + (False, True) -> ProfWay + (False, False) -> StaticWay + -- | Is this compiler's RTS dynamically linked? isDynamic :: Compiler -> Bool isDynamic = Internal.ghcLookupProperty "GHC Dynamic" +isProfiled :: Compiler -> Bool +isProfiled = Internal.ghcLookupProperty "GHC Profiled" + -- | Should we dynamically link the foreign library, based on its 'foreignLibType'? withDynFLib :: ForeignLib -> Bool withDynFLib flib = diff --git a/Cabal/src/Distribution/Simple/GHC/EnvironmentParser.hs b/Cabal/src/Distribution/Simple/GHC/EnvironmentParser.hs index 38ec484fe28..709a375a703 100644 --- a/Cabal/src/Distribution/Simple/GHC/EnvironmentParser.hs +++ b/Cabal/src/Distribution/Simple/GHC/EnvironmentParser.hs @@ -11,8 +11,6 @@ import Distribution.Compat.Prelude import Prelude () import Distribution.Simple.Compiler - ( PackageDB (..) - ) import Distribution.Simple.GHC.Internal ( GhcEnvironmentFileEntry (..) ) @@ -26,7 +24,7 @@ import Text.Parsec.String , parseFromFile ) -parseEnvironmentFileLine :: Parser GhcEnvironmentFileEntry +parseEnvironmentFileLine :: Parser (GhcEnvironmentFileEntry FilePath) parseEnvironmentFileLine = GhcEnvFileComment <$> comment <|> GhcEnvFilePackageId <$> unitId @@ -50,10 +48,10 @@ newtype ParseErrorExc = ParseErrorExc P.ParseError instance Exception ParseErrorExc -parseGhcEnvironmentFile :: Parser [GhcEnvironmentFileEntry] +parseGhcEnvironmentFile :: Parser [GhcEnvironmentFileEntry FilePath] parseGhcEnvironmentFile = parseEnvironmentFileLine `P.sepEndBy` P.endOfLine <* P.eof -readGhcEnvironmentFile :: FilePath -> IO [GhcEnvironmentFileEntry] +readGhcEnvironmentFile :: FilePath -> IO [GhcEnvironmentFileEntry FilePath] readGhcEnvironmentFile path = either (throwIO . ParseErrorExc) return =<< parseFromFile parseGhcEnvironmentFile path diff --git a/Cabal/src/Distribution/Simple/GHC/Internal.hs b/Cabal/src/Distribution/Simple/GHC/Internal.hs index a4b75cdb6d3..6e27b41bc83 100644 --- a/Cabal/src/Distribution/Simple/GHC/Internal.hs +++ b/Cabal/src/Distribution/Simple/GHC/Internal.hs @@ -75,8 +75,8 @@ import Distribution.Simple.Program.GHC import Distribution.Simple.Setup.Common (extraCompilationArtifacts) import Distribution.Simple.Utils import Distribution.System -import Distribution.Types.ComponentId (ComponentId) import Distribution.Types.ComponentLocalBuildInfo +import Distribution.Types.GivenComponent import Distribution.Types.LocalBuildInfo import Distribution.Types.TargetInfo import Distribution.Types.UnitId @@ -85,7 +85,7 @@ import Distribution.Utils.Path import Distribution.Verbosity import Distribution.Version (Version) import Language.Haskell.Extension -import System.Directory (getDirectoryContents, getTemporaryDirectory) +import System.Directory (getDirectoryContents) import System.Environment (getEnv) import System.FilePath ( takeDirectory @@ -221,9 +221,8 @@ configureToolchain _implInfo ghcProg ghcInfo = -- we need to find out if ld supports the -x flag configureLd' :: Verbosity -> ConfiguredProgram -> IO ConfiguredProgram configureLd' verbosity ldProg = do - tempDir <- getTemporaryDirectory - ldx <- withTempFile tempDir ".c" $ \testcfile testchnd -> - withTempFile tempDir ".o" $ \testofile testohnd -> do + ldx <- withTempFile ".c" $ \testcfile testchnd -> + withTempFile ".o" $ \testofile testohnd -> do hPutStrLn testchnd "int foo() { return 0; }" hClose testchnd hClose testohnd @@ -236,7 +235,7 @@ configureToolchain _implInfo ghcProg ghcInfo = , "-o" , testofile ] - withTempFile tempDir ".o" $ \testofile' testohnd' -> + withTempFile ".o" $ \testofile' testohnd' -> do hClose testohnd' _ <- @@ -672,7 +671,7 @@ getHaskellObjects _implInfo lib lbi clbi pref wanted_obj_ext allow_split_objs -- and is a hack to avoid passing bogus `-package` arguments to GHC. The assumption being that -- in 99% of cases we will include the right `-package` so that the C file finds the right headers. mkGhcOptPackages - :: Map (PackageName, ComponentName) ComponentId + :: Map (PackageName, ComponentName) PromisedComponent -> ComponentLocalBuildInfo -> [(OpenUnitId, ModuleRenaming)] mkGhcOptPackages promisedPkgsMap clbi = @@ -680,7 +679,7 @@ mkGhcOptPackages promisedPkgsMap clbi = ] where -- Promised deps are going to be simple UnitIds - promised_cids = Set.fromList (map newSimpleUnitId (Map.elems promisedPkgsMap)) + promised_cids = Set.fromList (map (newSimpleUnitId . promisedComponentId) (Map.elems promisedPkgsMap)) substTopDir :: FilePath -> IPI.InstalledPackageInfo -> IPI.InstalledPackageInfo substTopDir topDir ipo = @@ -766,7 +765,7 @@ ghcPlatformAndVersionString (Platform arch os) version = -- Constructing GHC environment files -- | The kinds of entries we can stick in a @.ghc.environment@ file. -data GhcEnvironmentFileEntry +data GhcEnvironmentFileEntry fp = -- | @-- a comment@ GhcEnvFileComment String | -- | @package-id foo-1.0-4fe301a...@ @@ -774,7 +773,7 @@ data GhcEnvironmentFileEntry | -- | @global-package-db@, -- @user-package-db@ or -- @package-db blah/package.conf.d/@ - GhcEnvFilePackageDb PackageDB + GhcEnvFilePackageDb (PackageDBX fp) | -- | @clear-package-db@ GhcEnvFileClearPackageDbStack deriving (Eq, Ord, Show) @@ -785,9 +784,9 @@ data GhcEnvironmentFileEntry -- If you need to do anything more complicated then either use this as a basis -- and add more entries, or just make all the entries directly. simpleGhcEnvironmentFile - :: PackageDBStack + :: PackageDBStackX fp -> [UnitId] - -> [GhcEnvironmentFileEntry] + -> [GhcEnvironmentFileEntry fp] simpleGhcEnvironmentFile packageDBs pkgids = GhcEnvFileClearPackageDbStack : map GhcEnvFilePackageDb packageDBs @@ -805,7 +804,7 @@ writeGhcEnvironmentFile -- ^ the GHC target platform -> Version -- ^ the GHC version - -> [GhcEnvironmentFileEntry] + -> [GhcEnvironmentFileEntry FilePath] -- ^ the content -> IO FilePath writeGhcEnvironmentFile directory platform ghcversion entries = do @@ -820,12 +819,12 @@ ghcEnvironmentFileName platform ghcversion = ".ghc.environment." ++ ghcPlatformAndVersionString platform ghcversion -- | Render a bunch of GHC environment file entries -renderGhcEnvironmentFile :: [GhcEnvironmentFileEntry] -> String +renderGhcEnvironmentFile :: [GhcEnvironmentFileEntry FilePath] -> String renderGhcEnvironmentFile = unlines . map renderGhcEnvironmentFileEntry -- | Render an individual GHC environment file entry -renderGhcEnvironmentFileEntry :: GhcEnvironmentFileEntry -> String +renderGhcEnvironmentFileEntry :: GhcEnvironmentFileEntry FilePath -> String renderGhcEnvironmentFileEntry entry = case entry of GhcEnvFileComment comment -> format comment where diff --git a/Cabal/src/Distribution/Simple/GHCJS.hs b/Cabal/src/Distribution/Simple/GHCJS.hs index 973230ee3c7..748855a6bbd 100644 --- a/Cabal/src/Distribution/Simple/GHCJS.hs +++ b/Cabal/src/Distribution/Simple/GHCJS.hs @@ -313,8 +313,8 @@ getGhcInfo verbosity ghcjsProg = Internal.getGhcInfo verbosity implInfo ghcjsPro -- | Given a single package DB, return all installed packages. getPackageDBContents :: Verbosity - -> Maybe (SymbolicPath CWD (Dir Pkg)) - -> PackageDB + -> Maybe (SymbolicPath CWD (Dir from)) + -> PackageDBX (SymbolicPath from (Dir PkgDB)) -> ProgramDb -> IO InstalledPackageIndex getPackageDBContents verbosity mbWorkDir packagedb progdb = do @@ -324,8 +324,8 @@ getPackageDBContents verbosity mbWorkDir packagedb progdb = do -- | Given a package DB stack, return all installed packages. getInstalledPackages :: Verbosity - -> Maybe (SymbolicPath CWD (Dir Pkg)) - -> PackageDBStack + -> Maybe (SymbolicPath CWD (Dir from)) + -> PackageDBStackX (SymbolicPath from (Dir PkgDB)) -> ProgramDb -> IO InstalledPackageIndex getInstalledPackages verbosity mbWorkDir packagedbs progdb = do @@ -337,7 +337,7 @@ getInstalledPackages verbosity mbWorkDir packagedbs progdb = do toPackageIndex :: Verbosity - -> [(PackageDB, [InstalledPackageInfo])] + -> [(PackageDBX a, [InstalledPackageInfo])] -> ProgramDb -> IO InstalledPackageIndex toPackageIndex verbosity pkgss progdb = do @@ -393,7 +393,7 @@ checkPackageDbEnvVar :: Verbosity -> IO () checkPackageDbEnvVar verbosity = Internal.checkPackageDbEnvVar verbosity "GHCJS" "GHCJS_PACKAGE_PATH" -checkPackageDbStack :: Verbosity -> PackageDBStack -> IO () +checkPackageDbStack :: Eq fp => Verbosity -> PackageDBStackX fp -> IO () checkPackageDbStack _ (GlobalPackageDB : rest) | GlobalPackageDB `notElem` rest = return () checkPackageDbStack verbosity rest @@ -404,10 +404,10 @@ checkPackageDbStack verbosity _ = getInstalledPackages' :: Verbosity - -> Maybe (SymbolicPath CWD (Dir Pkg)) - -> [PackageDB] + -> Maybe (SymbolicPath CWD (Dir from)) + -> [PackageDBX (SymbolicPath from (Dir PkgDB))] -> ProgramDb - -> IO [(PackageDB, [InstalledPackageInfo])] + -> IO [(PackageDBX (SymbolicPath from (Dir PkgDB)), [InstalledPackageInfo])] getInstalledPackages' verbosity mbWorkDir packagedbs progdb = sequenceA [ do @@ -432,7 +432,7 @@ getInstalledPackagesMonitorFiles verbosity platform mbWorkDir progdb = selectMonitorFile =<< getGlobalPackageDB verbosity ghcjsProg getPackageDBPath UserPackageDB = selectMonitorFile =<< getUserPackageDB verbosity ghcjsProg platform - getPackageDBPath (SpecificPackageDB path) = selectMonitorFile path + getPackageDBPath (SpecificPackageDB path) = selectMonitorFile (interpretSymbolicPath mbWorkDir path) -- GHC has old style file dbs, and new style directory dbs. -- Note that for dir style dbs, we only need to monitor the cache file, not @@ -583,7 +583,7 @@ buildOrReplLib mReplFlags verbosity numJobs _pkg_descr lbi lib clbi = do , ghcOptFPic = toFlag True , -- ghcOptHiSuffix = toFlag "dyn_hi", -- ghcOptObjSuffix = toFlag "dyn_o", - ghcOptExtra = hcSharedOptions GHC libBi + ghcOptExtra = hcOptions GHC libBi ++ hcSharedOptions GHC libBi , ghcOptHPCDir = hpcdir Hpc.Dyn } @@ -772,7 +772,7 @@ buildOrReplLib mReplFlags verbosity numJobs _pkg_descr lbi lib clbi = do , ghcOptDynLinkMode = toFlag GhcDynamicOnly , ghcOptInputFiles = toNubListR dynamicObjectFiles , ghcOptOutputFile = toFlag sharedLibFilePath - , ghcOptExtra = hcSharedOptions GHC libBi + , ghcOptExtra = hcOptions GHC libBi ++ hcSharedOptions GHC libBi , -- For dynamic libs, Mac OS/X needs to know the install location -- at build time. This only applies to GHC < 7.8 - see the -- discussion in #1660. @@ -1330,7 +1330,7 @@ gbuild verbosity numJobs pkg_descr lbi bm clbi = do ghcOptFPic = toFlag True , ghcOptHiSuffix = toFlag "dyn_hi" , ghcOptObjSuffix = toFlag "dyn_o" - , ghcOptExtra = hcSharedOptions GHC bnfo + , ghcOptExtra = hcOptions GHC bnfo ++ hcSharedOptions GHC bnfo , ghcOptHPCDir = hpcdir Hpc.Dyn } dynTooOpts = @@ -1781,7 +1781,7 @@ libAbiHash verbosity _pkg_descr lbi lib clbi = do , ghcOptFPic = toFlag True , ghcOptHiSuffix = toFlag "js_dyn_hi" , ghcOptObjSuffix = toFlag "js_dyn_o" - , ghcOptExtra = hcSharedOptions GHC libBi + , ghcOptExtra = hcOptions GHC libBi ++ hcSharedOptions GHC libBi } profArgs = vanillaArgs @@ -1850,7 +1850,7 @@ installExe exeFileName = exeName' fixedExeBaseName = progprefix ++ exeName' ++ progsuffix installBinary dest = do - runDbProgram verbosity ghcjsProgram (withPrograms lbi) $ + runDbProgramCwd verbosity (mbWorkDirLBI lbi) ghcjsProgram (withPrograms lbi) $ [ "--install-executable" , buildPref exeName' exeFileName , "-o" @@ -2026,8 +2026,8 @@ hcPkgInfo progdb = registerPackage :: Verbosity -> ProgramDb - -> Maybe (SymbolicPath CWD (Dir Pkg)) - -> PackageDBStack + -> Maybe (SymbolicPath CWD (Dir from)) + -> PackageDBStackS from -> InstalledPackageInfo -> HcPkg.RegisterOptions -> IO () @@ -2066,7 +2066,7 @@ pkgRoot verbosity lbi = pkgRoot' pkgRoot' (SpecificPackageDB fp) = return $ takeDirectory $ - interpretSymbolicPathLBI lbi (unsafeMakeSymbolicPath fp) + interpretSymbolicPathLBI lbi fp -- | Get the JavaScript file name and command and arguments to run a -- program compiled by GHCJS diff --git a/Cabal/src/Distribution/Simple/Haddock.hs b/Cabal/src/Distribution/Simple/Haddock.hs index 657991e16b1..ec4e60ff685 100644 --- a/Cabal/src/Distribution/Simple/Haddock.hs +++ b/Cabal/src/Distribution/Simple/Haddock.hs @@ -92,6 +92,7 @@ import Distribution.Verbosity import Distribution.Version import Control.Monad +import Data.Bool (bool) import Data.Either (rights) import System.Directory (doesDirectoryExist, doesFileExist) import System.FilePath (isAbsolute, normalise) @@ -107,6 +108,9 @@ data HaddockArgs = HaddockArgs -- ^ Path to the interface file, relative to argOutputDir, required. , argPackageName :: Flag PackageIdentifier -- ^ Package name, required. + , argComponentName :: Flag String + -- ^ Optional name used to construct haddock's `--package-name` option for + -- various components (tests suites, sublibriaries, etc). , argHideModules :: (All, [ModuleName.ModuleName]) -- ^ (Hide modules ?, modules to hide) , argIgnoreExports :: Any @@ -152,6 +156,8 @@ data HaddockArgs = HaddockArgs -- ^ Modules to process. , argResourcesDir :: Flag String -- ^ haddock's static \/ auxiliary files. + , argUseUnicode :: Flag Bool + -- ^ haddock's `--use-unicode` flag } deriving (Generic) @@ -369,8 +375,10 @@ haddock_setupHooks lbi' clbi htmlTemplate + haddockTarget + pkg_descr exe - let exeArgs' = commonArgs `mappend` exeArgs + commonArgs runHaddock verbosity mbWorkDir @@ -379,7 +387,7 @@ haddock_setupHooks platform haddockProg True - exeArgs' + exeArgs Nothing -> do warn verbosity @@ -406,9 +414,19 @@ haddock_setupHooks lbi' clbi htmlTemplate + haddockTarget + pkg_descr lib - let libArgs' = commonArgs `mappend` libArgs - runHaddock verbosity mbWorkDir tmpFileOpts comp platform haddockProg True libArgs' + commonArgs + runHaddock + verbosity + mbWorkDir + tmpFileOpts + comp + platform + haddockProg + True + libArgs inplaceDir <- absoluteWorkingDirLBI lbi let @@ -450,21 +468,78 @@ haddock_setupHooks lbi' clbi htmlTemplate + haddockTarget + pkg_descr flib - let libArgs' = commonArgs `mappend` flibArgs - runHaddock verbosity mbWorkDir tmpFileOpts comp platform haddockProg True libArgs' + commonArgs + runHaddock + verbosity + mbWorkDir + tmpFileOpts + comp + platform + haddockProg + True + flibArgs ) >> return index CExe _ -> when (flag haddockExecutables) (smsg >> doExe component) >> return index - CTest _ -> when (flag haddockTestSuites) (smsg >> doExe component) >> return index - CBench _ -> when (flag haddockBenchmarks) (smsg >> doExe component) >> return index + CTest test -> do + when (flag haddockTestSuites) $ do + smsg + testArgs <- + fromTest + verbosity + haddockArtifactsDirs + lbi' + clbi + htmlTemplate + haddockTarget + pkg_descr + test + commonArgs + runHaddock + verbosity + mbWorkDir + tmpFileOpts + comp + platform + haddockProg + True + testArgs + return index + CBench bench -> do + when (flag haddockBenchmarks) $ do + smsg + benchArgs <- + fromBenchmark + verbosity + haddockArtifactsDirs + lbi' + clbi + htmlTemplate + haddockTarget + pkg_descr + bench + commonArgs + runHaddock + verbosity + mbWorkDir + tmpFileOpts + comp + platform + haddockProg + True + benchArgs + return index return ipi for_ (extraDocFiles pkg_descr) $ \fpath -> do files <- matchDirFileGlob verbosity (specVersion pkg_descr) mbWorkDir fpath + let targetDir = Dir $ unDir' (argOutputDir commonArgs) haddockDirName haddockTarget pkg_descr for_ files $ - copyFileToCwd verbosity mbWorkDir (unDir $ argOutputDir commonArgs) + copyFileToCwd verbosity mbWorkDir (unDir targetDir) -- | Execute 'Haddock' configured with 'HaddocksFlags'. It is used to build -- index and contents for documentation of multiple packages. @@ -528,6 +603,7 @@ fromFlags env flags = os -> os , argOutputDir = maybe mempty (Dir . getSymbolicPath) . flagToMaybe $ setupDistPref commonFlags , argGhcOptions = mempty{ghcOptExtra = ghcArgs} + , argUseUnicode = haddockUseUnicode flags } where ghcArgs = fromMaybe [] . lookup "ghc" . haddockProgramArgs $ flags @@ -547,13 +623,11 @@ fromHaddockProjectFlags flags = } fromPackageDescription :: HaddockTarget -> PackageDescription -> HaddockArgs -fromPackageDescription haddockTarget pkg_descr = +fromPackageDescription _haddockTarget pkg_descr = mempty - { argInterfaceFile = Flag $ haddockName pkg_descr + { argInterfaceFile = Flag $ haddockPath pkg_descr , argPackageName = Flag $ packageId $ pkg_descr - , argOutputDir = - Dir $ - "doc" "html" haddockDirName haddockTarget pkg_descr + , argOutputDir = Dir $ "doc" "html" , argPrologue = Flag $ ShortText.fromShortText $ @@ -674,9 +748,13 @@ fromLibrary -> ComponentLocalBuildInfo -> Maybe PathTemplate -- ^ template for HTML location + -> HaddockTarget + -> PackageDescription -> Library + -> HaddockArgs + -- ^ common args -> IO HaddockArgs -fromLibrary verbosity haddockArtifactsDirs lbi clbi htmlTemplate lib = do +fromLibrary verbosity haddockArtifactsDirs lbi clbi htmlTemplate haddockTarget pkg_descr lib commonArgs = do inFiles <- map snd `fmap` getLibSourceFiles verbosity lbi lib clbi args <- mkHaddockArgs @@ -687,10 +765,30 @@ fromLibrary verbosity haddockArtifactsDirs lbi clbi htmlTemplate lib = do htmlTemplate inFiles (libBuildInfo lib) - return - args - { argHideModules = (mempty, otherModules (libBuildInfo lib)) - } + let args' = + commonArgs + <> args + { argOutputDir = + Dir $ haddockLibraryDirPath haddockTarget pkg_descr lib + , argInterfaceFile = Flag $ haddockLibraryPath pkg_descr lib + } + args'' = + args' + { argHideModules = (mempty, otherModules (libBuildInfo lib)) + , argTitle = Flag $ haddockPackageLibraryName pkg_descr lib + , argComponentName = toFlag (haddockPackageLibraryName' (pkgName (package pkg_descr)) (libName lib)) + , -- we need to accommodate for `argOutputDir`, see `haddockLibraryPath` + argBaseUrl = case (libName lib, argBaseUrl args') of + (LSubLibName _, Flag url) -> Flag $ ".." url + (_, a) -> a + , argContents = case (libName lib, argContents args') of + (LSubLibName _, Flag url) -> Flag $ ".." url + (_, a) -> a + , argIndex = case (libName lib, argIndex args') of + (LSubLibName _, Flag url) -> Flag $ ".." url + (_, a) -> a + } + return args'' fromExecutable :: Verbosity @@ -701,9 +799,13 @@ fromExecutable -> ComponentLocalBuildInfo -> Maybe PathTemplate -- ^ template for HTML location + -> HaddockTarget + -> PackageDescription -> Executable + -> HaddockArgs + -- ^ common args -> IO HaddockArgs -fromExecutable verbosity haddockArtifactsDirs lbi clbi htmlTemplate exe = do +fromExecutable verbosity haddockArtifactsDirs lbi clbi htmlTemplate haddockTarget pkg_descr exe commonArgs = do inFiles <- map snd `fmap` getExeSourceFiles verbosity lbi exe clbi args <- mkHaddockArgs @@ -714,10 +816,127 @@ fromExecutable verbosity haddockArtifactsDirs lbi clbi htmlTemplate exe = do htmlTemplate inFiles (buildInfo exe) + let args' = + commonArgs + <> args + { argOutputDir = + Dir $ + haddockDirName haddockTarget pkg_descr + unUnqualComponentName (exeName exe) + } + return + args' + { argTitle = Flag $ unUnqualComponentName $ exeName exe + , -- we need to accommodate `argOutputDir` + argBaseUrl = case argBaseUrl args' of + Flag url -> Flag $ ".." url + NoFlag -> NoFlag + , argContents = case argContents args' of + Flag url -> Flag $ ".." url + NoFlag -> NoFlag + , argIndex = case argIndex args' of + Flag url -> Flag $ ".." url + NoFlag -> NoFlag + } + +fromTest + :: Verbosity + -> (SymbolicPath Pkg (Path.Dir Artifacts), SymbolicPath Pkg (Path.Dir Artifacts), SymbolicPath Pkg (Path.Dir Artifacts)) + -- ^ Directories for -hidir, -odir, and -stubdir to GHC through Haddock. + -- See Note [Hi Haddock Recompilation Avoidance] + -> LocalBuildInfo + -> ComponentLocalBuildInfo + -> Maybe PathTemplate + -- ^ template for HTML location + -> HaddockTarget + -> PackageDescription + -> TestSuite + -> HaddockArgs + -- ^ common args + -> IO HaddockArgs +fromTest verbosity haddockArtifactsDirs lbi clbi htmlTemplate haddockTarget pkg_descr test commonArgs = do + inFiles <- map snd `fmap` getTestSourceFiles verbosity lbi test clbi + args <- + mkHaddockArgs + verbosity + haddockArtifactsDirs + lbi + clbi + htmlTemplate + inFiles + (testBuildInfo test) + let args' = + commonArgs + <> args + { argOutputDir = + Dir $ + haddockDirName haddockTarget pkg_descr + unUnqualComponentName (testName test) + } return - args - { argOutputDir = Dir $ unUnqualComponentName $ exeName exe - , argTitle = Flag $ unUnqualComponentName $ exeName exe + args' + { argTitle = Flag $ prettyShow (packageName pkg_descr) + , argComponentName = Flag $ prettyShow (packageName pkg_descr) ++ ":" ++ unUnqualComponentName (testName test) + , -- we need to accommodate `argOutputDir` + argBaseUrl = case argBaseUrl args' of + Flag url -> Flag $ ".." url + NoFlag -> NoFlag + , argContents = case argContents args' of + Flag url -> Flag $ ".." url + NoFlag -> NoFlag + , argIndex = case argIndex args' of + Flag url -> Flag $ ".." url + NoFlag -> NoFlag + } + +fromBenchmark + :: Verbosity + -> (SymbolicPath Pkg (Path.Dir Artifacts), SymbolicPath Pkg (Path.Dir Artifacts), SymbolicPath Pkg (Path.Dir Artifacts)) + -- ^ Directories for -hidir, -odir, and -stubdir to GHC through Haddock. + -- See Note [Hi Haddock Recompilation Avoidance] + -> LocalBuildInfo + -> ComponentLocalBuildInfo + -> Maybe PathTemplate + -- ^ template for HTML location + -> HaddockTarget + -> PackageDescription + -> Benchmark + -> HaddockArgs + -- ^ common args + -> IO HaddockArgs +fromBenchmark verbosity haddockArtifactsDirs lbi clbi htmlTemplate haddockTarget pkg_descr bench commonArgs = do + inFiles <- map snd `fmap` getBenchmarkSourceFiles verbosity lbi bench clbi + args <- + mkHaddockArgs + verbosity + haddockArtifactsDirs + lbi + clbi + htmlTemplate + inFiles + (benchmarkBuildInfo bench) + let args' = + commonArgs + <> args + { argOutputDir = + Dir $ + haddockDirName haddockTarget pkg_descr + unUnqualComponentName (benchmarkName bench) + } + return + args' + { argTitle = Flag $ prettyShow (packageName pkg_descr) + , argComponentName = Flag $ prettyShow (packageName pkg_descr) ++ ":" ++ unUnqualComponentName (benchmarkName bench) + , -- we need to accommodate `argOutputDir` + argBaseUrl = case argBaseUrl args' of + Flag url -> Flag $ ".." url + NoFlag -> NoFlag + , argContents = case argContents args' of + Flag url -> Flag $ ".." url + NoFlag -> NoFlag + , argIndex = case argIndex args' of + Flag url -> Flag $ ".." url + NoFlag -> NoFlag } fromForeignLib @@ -729,9 +948,13 @@ fromForeignLib -> ComponentLocalBuildInfo -> Maybe PathTemplate -- ^ template for HTML location + -> HaddockTarget + -> PackageDescription -> ForeignLib + -> HaddockArgs + -- ^ common args -> IO HaddockArgs -fromForeignLib verbosity haddockArtifactsDirs lbi clbi htmlTemplate flib = do +fromForeignLib verbosity haddockArtifactsDirs lbi clbi htmlTemplate haddockTarget pkg_descr flib commonArgs = do inFiles <- map snd `fmap` getFLibSourceFiles verbosity lbi flib clbi args <- mkHaddockArgs @@ -742,10 +965,27 @@ fromForeignLib verbosity haddockArtifactsDirs lbi clbi htmlTemplate flib = do htmlTemplate inFiles (foreignLibBuildInfo flib) + let args' = + commonArgs + <> args + { argOutputDir = + Dir $ + haddockDirName haddockTarget pkg_descr + unUnqualComponentName (foreignLibName flib) + } return - args - { argOutputDir = Dir $ unUnqualComponentName $ foreignLibName flib - , argTitle = Flag $ unUnqualComponentName $ foreignLibName flib + args' + { argTitle = Flag $ unUnqualComponentName $ foreignLibName flib + , -- we need to accommodate `argOutputDir` + argBaseUrl = case argBaseUrl args' of + Flag url -> Flag $ ".." url + NoFlag -> NoFlag + , argContents = case argContents args' of + Flag url -> Flag $ ".." url + NoFlag -> NoFlag + , argIndex = case argIndex args' of + Flag url -> Flag $ ".." url + NoFlag -> NoFlag } compToExe :: Component -> Maybe Executable @@ -893,27 +1133,23 @@ renderArgs verbosity mbWorkDir tmpFileOpts version comp platform args k = do withResponseFile verbosity tmpFileOpts - mbWorkDir - outputDir "haddock-response.txt" (if haddockSupportsUTF8 then Just utf8 else Nothing) renderedArgs (\responseFileName -> k ["@" ++ responseFileName] result) else k renderedArgs result - case argPrologue args of - Flag prologueText -> - withTempFileEx tmpFileOpts mbWorkDir outputDir "haddock-prologue.txt" $ + case (argPrologueFile args, argPrologue args) of + (Flag pfile, _) -> + withPrologueArgs ["--prologue=" ++ pfile] + (_, Flag prologueText) -> + withTempFileEx tmpFileOpts "haddock-prologue.txt" $ \prologueFileName h -> do when haddockSupportsUTF8 (hSetEncoding h utf8) hPutStrLn h prologueText hClose h withPrologueArgs ["--prologue=" ++ u prologueFileName] - _ -> - withPrologueArgs - ( case argPrologueFile args of - Flag pfile -> ["--prologue=" ++ pfile] - _ -> [] - ) + (NoFlag, NoFlag) -> + withPrologueArgs [] where -- See Note [Symbolic paths] in Distribution.Utils.Path i = interpretSymbolicPath mbWorkDir @@ -962,7 +1198,10 @@ renderPureArgs version comp platform args = maybe [] ( \pkg -> - [ "--package-name=" ++ prettyShow (pkgName pkg) + [ "--package-name=" + ++ case argComponentName args of + Flag name -> name + _ -> prettyShow (pkgName pkg) , "--package-version=" ++ prettyShow (pkgVersion pkg) ] ) @@ -974,10 +1213,10 @@ renderPureArgs version comp platform args = , [ "--quickjump" | isVersion 2 19, True <- flagToList . argQuickJump $ args ] , ["--hyperlinked-source" | isHyperlinkedSource] - , (\(All b, xs) -> bool (map (("--hide=" ++) . prettyShow) xs) [] b) + , (\(All b, xs) -> bool [] (map (("--hide=" ++) . prettyShow) xs) b) . argHideModules $ args - , bool ["--ignore-all-exports"] [] . getAny . argIgnoreExports $ args + , bool [] ["--ignore-all-exports"] . getAny . argIgnoreExports $ args , -- Haddock's --source-* options are ignored once --hyperlinked-source is -- set. -- See https://haskell-haddock.readthedocs.io/en/latest/invoking.html#cmdoption-hyperlinked-source @@ -1001,11 +1240,11 @@ renderPureArgs version comp platform args = $ args , maybe [] ((: []) . ("--css=" ++)) . flagToMaybe . argCssFile $ args , maybe [] ((: []) . ("--use-contents=" ++)) . flagToMaybe . argContents $ args - , bool ["--gen-contents"] [] . fromFlagOrDefault False . argGenContents $ args + , bool [] ["--gen-contents"] . fromFlagOrDefault False . argGenContents $ args , maybe [] ((: []) . ("--use-index=" ++)) . flagToMaybe . argIndex $ args - , bool ["--gen-index"] [] . fromFlagOrDefault False . argGenIndex $ args + , bool [] ["--gen-index"] . fromFlagOrDefault False . argGenIndex $ args , maybe [] ((: []) . ("--base-url=" ++)) . flagToMaybe . argBaseUrl $ args - , bool [] [verbosityFlag] . getAny . argVerbose $ args + , bool [verbosityFlag] [] . getAny . argVerbose $ args , map (\o -> case o of Hoogle -> "--hoogle"; Html -> "--html") . fromFlagOrDefault [] . argOutput @@ -1017,8 +1256,8 @@ renderPureArgs version comp platform args = ( (: []) . ("--title=" ++) . ( bool - (++ " (internal documentation)") id + (++ " (internal documentation)") (getAny $ argIgnoreExports args) ) ) @@ -1040,6 +1279,7 @@ renderPureArgs version comp platform args = -- We pass this option by default to haddock to avoid recompilation -- See Note [Hi Haddock Recompilation Avoidance] ["--no-tmp-comp-dir" | version >= mkVersion [2, 28, 0]] + , bool [] ["--use-unicode"] . fromFlagOrDefault False . argUseUnicode $ args ] where -- See Note [Symbolic paths] in Distribution.Utils.Path @@ -1078,7 +1318,6 @@ renderPureArgs version comp platform args = ] ) - bool a b c = if c then a else b isVersion major minor = version >= mkVersion [major, minor] verbosityFlag | isVersion 2 5 = "--verbosity=1" @@ -1117,7 +1356,8 @@ haddockPackagePaths ipkgs mkHtmlPath = do interfaces <- sequenceA [ case interfaceAndHtmlPath ipkg of - Nothing -> return (Left (packageId ipkg)) + Nothing -> do + return (Left (packageId ipkg)) Just (interface, html) -> do (html', hypsrc') <- case html of diff --git a/Cabal/src/Distribution/Simple/HaskellSuite.hs b/Cabal/src/Distribution/Simple/HaskellSuite.hs index d3f43f65904..0e66e17e3d7 100644 --- a/Cabal/src/Distribution/Simple/HaskellSuite.hs +++ b/Cabal/src/Distribution/Simple/HaskellSuite.hs @@ -23,6 +23,7 @@ import Distribution.Simple.Program import Distribution.Simple.Program.Builtin import Distribution.Simple.Utils import Distribution.System (Platform) +import Distribution.Utils.Path import Distribution.Verbosity import Distribution.Version import Language.Haskell.Extension @@ -129,7 +130,8 @@ getLanguages verbosity prog = do -- if we need something like that as well. getInstalledPackages :: Verbosity - -> PackageDBStack + -- Not migrated to work with --working-dir but this is legacy dead code + -> PackageDBStackX (SymbolicPath from (Dir PkgDB)) -> ProgramDb -> IO InstalledPackageIndex getInstalledPackages verbosity packagedbs progdb = @@ -179,23 +181,23 @@ buildLib verbosity pkg_descr lbi lib clbi = do let odir = buildDir lbi bi = libBuildInfo lib - srcDirs = map i (hsSourceDirs bi) ++ [i odir] + srcDirs = map u (hsSourceDirs bi) ++ [u odir] dbStack = withPackageDB lbi language = fromMaybe Haskell98 (defaultLanguage bi) progdb = withPrograms lbi pkgid = packageId pkg_descr - i = interpretSymbolicPathLBI lbi -- See Note [Symbolic paths] in Distribution.Utils.Path - runDbProgram verbosity haskellSuiteProgram progdb $ - ["compile", "--build-dir", i odir] + u = interpretSymbolicPathCWD -- See Note [Symbolic paths] in Distribution.Utils.Path + runDbProgramCwd verbosity (mbWorkDirLBI lbi) haskellSuiteProgram progdb $ + ["compile", "--build-dir", u odir] ++ concat [["-i", d] | d <- srcDirs] ++ concat [ ["-I", d] | d <- - [ i $ autogenComponentModulesDir lbi clbi - , i $ autogenPackageModulesDir lbi - , i odir + [ u $ autogenComponentModulesDir lbi clbi + , u $ autogenPackageModulesDir lbi + , u odir ] - ++ map i (includeDirs bi) + ++ map u (includeDirs bi) ] ++ [packageDbOpt pkgDb | pkgDb <- dbStack] ++ ["--package-name", prettyShow pkgid] @@ -223,7 +225,8 @@ installLib -> IO () installLib verbosity lbi targetDir dynlibTargetDir builtDir pkg lib clbi = do let progdb = withPrograms lbi - runDbProgram verbosity haskellSuitePkgProgram progdb $ + wdir = mbWorkDirLBI lbi + runDbProgramCwd verbosity wdir haskellSuitePkgProgram progdb $ [ "install-library" , "--build-dir" , builtDir @@ -239,7 +242,7 @@ installLib verbosity lbi targetDir dynlibTargetDir builtDir pkg lib clbi = do registerPackage :: Verbosity -> ProgramDb - -> PackageDBStack + -> PackageDBStackS from -> InstalledPackageInfo -> IO () registerPackage verbosity progdb packageDbs installedPkgInfo = do @@ -261,7 +264,7 @@ initPackageDB verbosity progdb dbPath = progdb ["init", dbPath] -packageDbOpt :: PackageDB -> String +packageDbOpt :: PackageDBX (SymbolicPath from (Dir PkgDB)) -> String packageDbOpt GlobalPackageDB = "--global" packageDbOpt UserPackageDB = "--user" -packageDbOpt (SpecificPackageDB db) = "--package-db=" ++ db +packageDbOpt (SpecificPackageDB db) = "--package-db=" ++ interpretSymbolicPathCWD db diff --git a/Cabal/src/Distribution/Simple/Hpc.hs b/Cabal/src/Distribution/Simple/Hpc.hs index ea1c1368057..4198d7a66ba 100644 --- a/Cabal/src/Distribution/Simple/Hpc.hs +++ b/Cabal/src/Distribution/Simple/Hpc.hs @@ -58,7 +58,7 @@ import System.Directory (createDirectoryIfMissing, doesFileExist) -- ------------------------------------------------------------------------- -- Haskell Program Coverage -data Way = Vanilla | Prof | Dyn +data Way = Vanilla | Prof | Dyn | ProfDyn deriving (Bounded, Enum, Eq, Read, Show) hpcDir @@ -73,6 +73,7 @@ hpcDir distPref way = distPref makeRelativePathEx ("hpc" wayDir) Vanilla -> "vanilla" Prof -> "prof" Dyn -> "dyn" + ProfDyn -> "prof_dyn" mixDir :: SymbolicPath Pkg (Dir Dist) diff --git a/Cabal/src/Distribution/Simple/Install.hs b/Cabal/src/Distribution/Simple/Install.hs index c46f28b3529..435d3fbbebc 100644 --- a/Cabal/src/Distribution/Simple/Install.hs +++ b/Cabal/src/Distribution/Simple/Install.hs @@ -38,7 +38,7 @@ import Distribution.Types.UnqualComponentName import Distribution.Package import Distribution.PackageDescription -import Distribution.Simple.BuildPaths (haddockName, haddockPref) +import Distribution.Simple.BuildPaths (haddockPath, haddockPref) import Distribution.Simple.BuildTarget import Distribution.Simple.Compiler ( CompilerFlavor (..) @@ -199,8 +199,8 @@ copyPackage verbosity pkg_descr lbi distPref copydest = do -- copy in htmlPref first. let haddockInterfaceFileSrc = haddockPref ForDevelopment distPref pkg_descr - makeRelativePathEx (haddockName pkg_descr) - haddockInterfaceFileDest = interfacePref haddockName pkg_descr + makeRelativePathEx (haddockPath pkg_descr) + haddockInterfaceFileDest = interfacePref haddockPath pkg_descr -- We only generate the haddock interface file for libs, So if the -- package consists only of executables there will not be one: exists <- doesFileExist $ i haddockInterfaceFileSrc diff --git a/Cabal/src/Distribution/Simple/LocalBuildInfo.hs b/Cabal/src/Distribution/Simple/LocalBuildInfo.hs index 35681ee5908..eb04ba870c6 100644 --- a/Cabal/src/Distribution/Simple/LocalBuildInfo.hs +++ b/Cabal/src/Distribution/Simple/LocalBuildInfo.hs @@ -36,6 +36,7 @@ module Distribution.Simple.LocalBuildInfo , interpretSymbolicPathLBI , mbWorkDirLBI , absoluteWorkingDirLBI + , buildWays -- * Buildable package components , Component (..) @@ -161,7 +162,7 @@ mbWorkDirLBI = flagToMaybe . setupWorkingDir . configCommonFlags . configFlags -- | Absolute path to the current working directory. -absoluteWorkingDirLBI :: LocalBuildInfo -> IO FilePath +absoluteWorkingDirLBI :: LocalBuildInfo -> IO (AbsolutePath (Dir Pkg)) absoluteWorkingDirLBI lbi = absoluteWorkingDir (mbWorkDirLBI lbi) -- | Perform the action on each enabled 'library' in the package diff --git a/Cabal/src/Distribution/Simple/PackageIndex.hs b/Cabal/src/Distribution/Simple/PackageIndex.hs index 927e10ae878..e6944430755 100644 --- a/Cabal/src/Distribution/Simple/PackageIndex.hs +++ b/Cabal/src/Distribution/Simple/PackageIndex.hs @@ -68,6 +68,7 @@ module Distribution.Simple.PackageIndex , lookupSourcePackageId , lookupPackageId , lookupPackageName + , lookupInternalPackageName , lookupDependency , lookupInternalDependency @@ -93,6 +94,10 @@ module Distribution.Simple.PackageIndex , dependencyCycles , dependencyGraph , moduleNameIndex + + -- ** Filters on lookup results + , eligibleDependencies + , matchingDependencies ) where import qualified Data.Map.Strict as Map @@ -474,7 +479,18 @@ lookupPackageName -> [(Version, [a])] lookupPackageName index name = -- Do not match internal libraries - case Map.lookup (name, LMainLibName) (packageIdIndex index) of + lookupInternalPackageName index name LMainLibName + +-- | Does a lookup by source package name and library name. +-- +-- Also looks up internal packages. +lookupInternalPackageName + :: PackageIndex a + -> PackageName + -> LibraryName + -> [(Version, [a])] +lookupInternalPackageName index name library = + case Map.lookup (name, library) (packageIdIndex index) of Nothing -> [] Just pvers -> Map.toList pvers @@ -509,23 +525,46 @@ lookupInternalDependency -> LibraryName -> [(Version, [IPI.InstalledPackageInfo])] lookupInternalDependency index name versionRange libn = - case Map.lookup (name, libn) (packageIdIndex index) of - Nothing -> [] - Just pvers -> - [ (ver, pkgs') - | (ver, pkgs) <- Map.toList pvers - , ver `withinRange` versionRange - , let pkgs' = filter eligible pkgs - , -- Enforce the invariant - not (null pkgs') - ] + matchingDependencies versionRange $ + lookupInternalPackageName index name libn + +-- | Filter a set of installed packages to ones eligible as dependencies. +-- +-- When we select for dependencies, we ONLY want to pick up indefinite +-- packages, or packages with no instantiations. We'll do mix-in linking to +-- improve any such package into an instantiated one later. +-- +-- INVARIANT: List of eligible 'IPI.InstalledPackageInfo' is non-empty. +eligibleDependencies + :: [(Version, [IPI.InstalledPackageInfo])] + -> [(Version, [IPI.InstalledPackageInfo])] +eligibleDependencies versions = + [ (ver, pkgs') + | (ver, pkgs) <- versions + , let pkgs' = filter eligible pkgs + , -- Enforce the invariant + not (null pkgs') + ] where - -- When we select for dependencies, we ONLY want to pick up indefinite - -- packages, or packages with no instantiations. We'll do mix-in - -- linking to improve any such package into an instantiated one - -- later. eligible pkg = IPI.indefinite pkg || null (IPI.instantiatedWith pkg) +-- | Get eligible dependencies from a list of versions. +-- +-- This can be used to filter the output of 'lookupPackageName' or +-- 'lookupInternalPackageName'. +-- +-- INVARIANT: List of eligible 'IPI.InstalledPackageInfo' is non-empty. +matchingDependencies + :: VersionRange + -> [(Version, [IPI.InstalledPackageInfo])] + -> [(Version, [IPI.InstalledPackageInfo])] +matchingDependencies versionRange versions = + let eligibleVersions = eligibleDependencies versions + in [ (ver, pkgs) + | (ver, pkgs) <- eligibleVersions + , ver `withinRange` versionRange + ] + -- -- * Case insensitive name lookups diff --git a/Cabal/src/Distribution/Simple/PreProcess.hs b/Cabal/src/Distribution/Simple/PreProcess.hs index 00e6e68cb5c..e56627893c1 100644 --- a/Cabal/src/Distribution/Simple/PreProcess.hs +++ b/Cabal/src/Distribution/Simple/PreProcess.hs @@ -347,8 +347,8 @@ preprocessFile mbWorkDir searchLoc buildLoc forSDist baseFile verbosity builtinS createDirectoryIfMissingVerbose verbosity True destDir runPreProcessorWithHsBootHack pp - (i psrcLoc, getSymbolicPath $ psrcRelFile) - (i buildLoc, srcStem <.> "hs") + (getSymbolicPath $ psrcLoc, getSymbolicPath $ psrcRelFile) + (getSymbolicPath $ buildLoc, srcStem <.> "hs") where i = interpretSymbolicPath mbWorkDir -- See Note [Symbolic paths] in Distribution.Utils.Path buildAsSrcLoc :: SymbolicPath Pkg (Dir Source) @@ -390,8 +390,9 @@ ppGreenCard _ lbi _ = { platformIndependent = False , ppOrdering = unsorted , runPreProcessor = mkSimplePreProcessor $ \inFile outFile verbosity -> - runDbProgram + runDbProgramCwd verbosity + (mbWorkDirLBI lbi) greencardProgram (withPrograms lbi) (["-tffi", "-o" ++ outFile, inFile]) @@ -510,8 +511,6 @@ ppHsc2hs bi lbi clbi = withResponseFile verbosity defaultTempFileOptions - mbWorkDir - (makeSymbolicPath $ takeDirectory outFile) "hsc2hs-response.txt" Nothing pureArgs @@ -863,8 +862,9 @@ standardPP lbi prog args = { platformIndependent = False , ppOrdering = unsorted , runPreProcessor = mkSimplePreProcessor $ \inFile outFile verbosity -> - runDbProgram + runDbProgramCwd verbosity + (mbWorkDirLBI lbi) prog (withPrograms lbi) (args ++ ["-o", outFile, inFile]) diff --git a/Cabal/src/Distribution/Simple/Program.hs b/Cabal/src/Distribution/Simple/Program.hs index f5a609f3b7e..e81501d2c39 100644 --- a/Cabal/src/Distribution/Simple/Program.hs +++ b/Cabal/src/Distribution/Simple/Program.hs @@ -1,3 +1,10 @@ +{- FUTUREWORK: + - + - Currently the logic in this module is not tested. + - + - Ideally, a set of unit tests that check whether certain + - flags trigger recompilation should be added. + - -} {-# LANGUAGE DataKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE RankNTypes #-} diff --git a/Cabal/src/Distribution/Simple/Program/Ar.hs b/Cabal/src/Distribution/Simple/Program/Ar.hs index 004b02cca1a..2e9b432385f 100644 --- a/Cabal/src/Distribution/Simple/Program/Ar.hs +++ b/Cabal/src/Distribution/Simple/Program/Ar.hs @@ -154,7 +154,7 @@ createArLibArchive verbosity lbi targetPath files = do (initial, middle, final) (map getSymbolicPath files) ] - else withResponseFile verbosity defaultTempFileOptions mbWorkDir tmpDir "ar.rsp" Nothing (map getSymbolicPath files) $ + else withResponseFile verbosity defaultTempFileOptions "ar.rsp" Nothing (map getSymbolicPath files) $ \path -> runProgramInvocation verbosity $ invokeWithResponseFile path unless diff --git a/Cabal/src/Distribution/Simple/Program/Builtin.hs b/Cabal/src/Distribution/Simple/Program/Builtin.hs index e79e676d8cc..65501111a7e 100644 --- a/Cabal/src/Distribution/Simple/Program/Builtin.hs +++ b/Cabal/src/Distribution/Simple/Program/Builtin.hs @@ -226,21 +226,13 @@ hpcProgram = -- during the configure phase. haskellSuiteProgram :: Program haskellSuiteProgram = - (simpleProgram "haskell-suite") - { -- pretend that the program exists, otherwise it won't be in the - -- "configured" state - programFindLocation = \_verbosity _searchPath -> - return $ Just ("haskell-suite-dummy-location", []) - } + simpleProgram "haskell-suite" -- This represent a haskell-suite package manager. See the comments for -- haskellSuiteProgram. haskellSuitePkgProgram :: Program haskellSuitePkgProgram = - (simpleProgram "haskell-suite-pkg") - { programFindLocation = \_verbosity _searchPath -> - return $ Just ("haskell-suite-pkg-dummy-location", []) - } + simpleProgram "haskell-suite-pkg" happyProgram :: Program happyProgram = diff --git a/Cabal/src/Distribution/Simple/Program/GHC.hs b/Cabal/src/Distribution/Simple/Program/GHC.hs index 84d6b0ccfaa..ce0ea9db92a 100644 --- a/Cabal/src/Distribution/Simple/Program/GHC.hs +++ b/Cabal/src/Distribution/Simple/Program/GHC.hs @@ -1,6 +1,7 @@ {-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE MultiWayIf #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE ScopedTypeVariables #-} @@ -227,8 +228,27 @@ normaliseGhcArgs (Just ghcVersion) PackageDescription{..} ghcArgs , "keep-going" -- try harder, the build will still fail if it's erroneous , "print-axiom-incomps" -- print more debug info for closed type families ] + , from + [9, 2] + [ "family-application-cache" + ] + , from + [9, 6] + [ "print-redundant-promotion-ticks" + , "show-error-context" + ] + , from + [9, 8] + [ "unoptimized-core-for-interpreter" + ] + , from + [9, 10] + [ "diagnostics-as-json" + , "print-error-index-links" + , "break-points" + ] ] - , flagIn . invertibleFlagSet "-d" $ ["ppr-case-as-let", "ppr-ticks"] + , flagIn $ invertibleFlagSet "-d" ["ppr-case-as-let", "ppr-ticks"] , isOptIntFlag , isIntFlag , if safeToFilterWarnings @@ -289,6 +309,7 @@ normaliseGhcArgs (Just ghcVersion) PackageDescription{..} ghcArgs , from [8, 6] ["-dhex-word-literals"] , from [8, 8] ["-fshow-docs-of-hole-fits", "-fno-show-docs-of-hole-fits"] , from [9, 0] ["-dlinear-core-lint"] + , from [9, 10] ["-dipe-stats"] ] isOptIntFlag :: String -> Any @@ -303,6 +324,8 @@ normaliseGhcArgs (Just ghcVersion) PackageDescription{..} ghcArgs , "-ddpr-cols" , "-dtrace-level" , "-fghci-hist-size" + , "-dinitial-unique" + , "-dunique-increment" ] , from [8, 2] ["-fmax-uncovered-patterns", "-fmax-errors"] , from [8, 4] $ to [8, 6] ["-fmax-valid-substitutions"] @@ -709,7 +732,10 @@ renderGhcOptions comp _platform@(Platform _arch os) opts | flagProfAuto implInfo -> ["-fprof-auto-exported"] | otherwise -> ["-auto"] , ["-split-sections" | flagBool ghcOptSplitSections] - , ["-split-objs" | flagBool ghcOptSplitObjs] + , case compilerCompatVersion GHC comp of + -- the -split-objs flag was removed in GHC 9.8 + Just ver | ver >= mkVersion [9, 8] -> [] + _ -> ["-split-objs" | flagBool ghcOptSplitObjs] , case flagToMaybe (ghcOptHPCDir opts) of Nothing -> [] Just hpcdir -> ["-fhpc", "-hpcdir", u hpcdir] @@ -799,8 +825,7 @@ renderGhcOptions comp _platform@(Platform _arch os) opts -- Packages concat - [ [ case () of - _ + [ [ if | unitIdSupported comp -> "-this-unit-id" | packageKeySupported comp -> "-this-package-key" | otherwise -> "-package-name" @@ -831,7 +856,7 @@ renderGhcOptions comp _platform@(Platform _arch os) opts , ["-hide-all-packages" | flagBool ghcOptHideAllPackages] , ["-Wmissing-home-modules" | flagBool ghcOptWarnMissingHomeModules] , ["-no-auto-link-packages" | flagBool ghcOptNoAutoLinkPackages] - , packageDbArgs implInfo (ghcOptPackageDBs opts) + , packageDbArgs implInfo (interpretPackageDBStack Nothing (ghcOptPackageDBs opts)) , concat $ let space "" = "" space xs = ' ' : xs @@ -893,7 +918,7 @@ verbosityOpts verbosity | otherwise = ["-w", "-v0"] -- | GHC <7.6 uses '-package-conf' instead of '-package-db'. -packageDbArgsConf :: PackageDBStack -> [String] +packageDbArgsConf :: PackageDBStackCWD -> [String] packageDbArgsConf dbstack = case dbstack of (GlobalPackageDB : UserPackageDB : dbs) -> concatMap specific dbs (GlobalPackageDB : dbs) -> @@ -910,7 +935,7 @@ packageDbArgsConf dbstack = case dbstack of -- | GHC >= 7.6 uses the '-package-db' flag. See -- https://gitlab.haskell.org/ghc/ghc/-/issues/5977. -packageDbArgsDb :: PackageDBStack -> [String] +packageDbArgsDb :: PackageDBStackCWD -> [String] -- special cases to make arguments prettier in common scenarios packageDbArgsDb dbstack = case dbstack of (GlobalPackageDB : UserPackageDB : dbs) @@ -929,7 +954,7 @@ packageDbArgsDb dbstack = case dbstack of isSpecific (SpecificPackageDB _) = True isSpecific _ = False -packageDbArgs :: GhcImplInfo -> PackageDBStack -> [String] +packageDbArgs :: GhcImplInfo -> PackageDBStackCWD -> [String] packageDbArgs implInfo | flagPackageConf implInfo = packageDbArgsConf | otherwise = packageDbArgsDb diff --git a/Cabal/src/Distribution/Simple/Program/HcPkg.hs b/Cabal/src/Distribution/Simple/Program/HcPkg.hs index 710020d9f6d..a494bc63f02 100644 --- a/Cabal/src/Distribution/Simple/Program/HcPkg.hs +++ b/Cabal/src/Distribution/Simple/Program/HcPkg.hs @@ -154,8 +154,8 @@ defaultRegisterOptions = register :: HcPkgInfo -> Verbosity - -> Maybe (SymbolicPath CWD (Dir Pkg)) - -> PackageDBStack + -> Maybe (SymbolicPath CWD (Dir from)) + -> PackageDBStackS from -> InstalledPackageInfo -> RegisterOptions -> IO () @@ -179,7 +179,7 @@ register hpi verbosity mbWorkDir packagedbs pkgInfo registerOptions , recacheMultiInstance hpi = do let pkgdb = registrationPackageDB packagedbs - writeRegistrationFileDirectly verbosity hpi pkgdb pkgInfo + writeRegistrationFileDirectly verbosity hpi mbWorkDir pkgdb pkgInfo recache hpi verbosity mbWorkDir pkgdb | otherwise = runProgramInvocation @@ -189,17 +189,18 @@ register hpi verbosity mbWorkDir packagedbs pkgInfo registerOptions writeRegistrationFileDirectly :: Verbosity -> HcPkgInfo - -> PackageDB + -> Maybe (SymbolicPath CWD (Dir from)) + -> PackageDBS from -> InstalledPackageInfo -> IO () -writeRegistrationFileDirectly verbosity hpi (SpecificPackageDB dir) pkgInfo +writeRegistrationFileDirectly verbosity hpi mbWorkDir (SpecificPackageDB dir) pkgInfo | supportsDirDbs hpi = do - let pkgfile = dir prettyShow (installedUnitId pkgInfo) <.> "conf" + let pkgfile = interpretSymbolicPath mbWorkDir dir prettyShow (installedUnitId pkgInfo) <.> "conf" writeUTF8File pkgfile (showInstalledPackageInfo pkgInfo) | otherwise = dieWithException verbosity NoSupportDirStylePackageDb -writeRegistrationFileDirectly verbosity _ _ _ = +writeRegistrationFileDirectly verbosity _ _ _ _ = -- We don't know here what the dir for the global or user dbs are, -- if that's needed it'll require a bit more plumbing to support. dieWithException verbosity OnlySupportSpecificPackageDb @@ -216,7 +217,7 @@ unregister hpi verbosity mbWorkDir packagedb pkgid = -- | Call @hc-pkg@ to recache the registered packages. -- -- > hc-pkg recache [--user | --global | --package-db] -recache :: HcPkgInfo -> Verbosity -> Maybe (SymbolicPath CWD (Dir Pkg)) -> PackageDB -> IO () +recache :: HcPkgInfo -> Verbosity -> Maybe (SymbolicPath CWD (Dir from)) -> PackageDBS from -> IO () recache hpi verbosity mbWorkDir packagedb = runProgramInvocation verbosity @@ -278,8 +279,8 @@ hide hpi verbosity mbWorkDir packagedb pkgid = dump :: HcPkgInfo -> Verbosity - -> Maybe (SymbolicPath CWD (Dir Pkg)) - -> PackageDB + -> Maybe (SymbolicPath CWD (Dir from)) + -> PackageDBX (SymbolicPath from (Dir PkgDB)) -> IO [InstalledPackageInfo] dump hpi verbosity mbWorkDir packagedb = do output <- @@ -432,8 +433,8 @@ initInvocation hpi verbosity path = registerInvocation :: HcPkgInfo -> Verbosity - -> Maybe (SymbolicPath CWD (Dir Pkg)) - -> PackageDBStack + -> Maybe (SymbolicPath CWD (Dir from)) + -> PackageDBStackS from -> InstalledPackageInfo -> RegisterOptions -> ProgramInvocation @@ -474,8 +475,8 @@ unregisterInvocation hpi verbosity mbWorkDir packagedb pkgid = recacheInvocation :: HcPkgInfo -> Verbosity - -> Maybe (SymbolicPath CWD (Dir Pkg)) - -> PackageDB + -> Maybe (SymbolicPath CWD (Dir from)) + -> PackageDBS from -> ProgramInvocation recacheInvocation hpi verbosity mbWorkDir packagedb = programInvocationCwd mbWorkDir (hcPkgProgram hpi) $ @@ -522,8 +523,8 @@ hideInvocation hpi verbosity mbWorkDir packagedb pkgid = dumpInvocation :: HcPkgInfo -> Verbosity - -> Maybe (SymbolicPath CWD (Dir Pkg)) - -> PackageDB + -> Maybe (SymbolicPath CWD (Dir from)) + -> PackageDBX (SymbolicPath from (Dir PkgDB)) -> ProgramInvocation dumpInvocation hpi _verbosity mbWorkDir packagedb = (programInvocationCwd mbWorkDir (hcPkgProgram hpi) args) @@ -555,7 +556,7 @@ listInvocation hpi _verbosity mbWorkDir packagedb = -- We use verbosity level 'silent' because it is important that we -- do not contaminate the output with info/debug messages. -packageDbStackOpts :: HcPkgInfo -> PackageDBStack -> [String] +packageDbStackOpts :: HcPkgInfo -> PackageDBStackS from -> [String] packageDbStackOpts hpi dbstack | noPkgDbStack hpi = [packageDbOpts hpi (registrationPackageDB dbstack)] | otherwise = case dbstack of @@ -569,7 +570,7 @@ packageDbStackOpts hpi dbstack : map specific dbs _ -> ierror where - specific (SpecificPackageDB db) = "--" ++ packageDbFlag hpi ++ "=" ++ db + specific (SpecificPackageDB db) = "--" ++ packageDbFlag hpi ++ "=" ++ interpretSymbolicPathCWD db specific _ = ierror ierror :: a ierror = error ("internal error: unexpected package db stack: " ++ show dbstack) @@ -581,10 +582,10 @@ packageDbFlag hpi | otherwise = "package-db" -packageDbOpts :: HcPkgInfo -> PackageDB -> String +packageDbOpts :: HcPkgInfo -> PackageDBX (SymbolicPath from (Dir PkgDB)) -> String packageDbOpts _ GlobalPackageDB = "--global" packageDbOpts _ UserPackageDB = "--user" -packageDbOpts hpi (SpecificPackageDB db) = "--" ++ packageDbFlag hpi ++ "=" ++ db +packageDbOpts hpi (SpecificPackageDB db) = "--" ++ packageDbFlag hpi ++ "=" ++ interpretSymbolicPathCWD db verbosityOpts :: HcPkgInfo -> Verbosity -> [String] verbosityOpts hpi v diff --git a/Cabal/src/Distribution/Simple/Program/Hpc.hs b/Cabal/src/Distribution/Simple/Program/Hpc.hs index c508900814d..fd181d32176 100644 --- a/Cabal/src/Distribution/Simple/Program/Hpc.hs +++ b/Cabal/src/Distribution/Simple/Program/Hpc.hs @@ -70,7 +70,7 @@ markup mbWorkDir hpc hpcVer verbosity tixFile hpcDirs destDir included = do return passedDirs -- Prior to GHC 8.0, hpc assumes all .mix paths are relative. - hpcDirs'' <- traverse (tryMakeRelativeToWorkingDir mbWorkDir) hpcDirs' + hpcDirs'' <- traverse (tryMakeRelative mbWorkDir) hpcDirs' runProgramInvocation verbosity diff --git a/Cabal/src/Distribution/Simple/Program/Ld.hs b/Cabal/src/Distribution/Simple/Program/Ld.hs index 5c2a33809ae..00ed5d182d7 100644 --- a/Cabal/src/Distribution/Simple/Program/Ld.hs +++ b/Cabal/src/Distribution/Simple/Program/Ld.hs @@ -83,8 +83,6 @@ combineObjectFiles verbosity lbi ldProg target files = do middle = ld middleArgs final = ld finalArgs - targetDir = takeDirectorySymbolicPath target - invokeWithResponseFile :: FilePath -> ProgramInvocation invokeWithResponseFile atFile = ld $ simpleArgs ++ ['@' : atFile] @@ -106,7 +104,7 @@ combineObjectFiles verbosity lbi ldProg target files = do if oldVersionManualOverride || responseArgumentsNotSupported then run $ multiStageProgramInvocation simple (initial, middle, final) (map getSymbolicPath files) - else withResponseFile verbosity defaultTempFileOptions mbWorkDir targetDir "ld.rsp" Nothing (map getSymbolicPath files) $ + else withResponseFile verbosity defaultTempFileOptions "ld.rsp" Nothing (map getSymbolicPath files) $ \path -> runProgramInvocation verbosity $ invokeWithResponseFile path where tmpfile = target <.> "tmp" -- perhaps should use a proper temp file diff --git a/Cabal/src/Distribution/Simple/Program/ResponseFile.hs b/Cabal/src/Distribution/Simple/Program/ResponseFile.hs index ee8271545f1..dec6cb0ae50 100644 --- a/Cabal/src/Distribution/Simple/Program/ResponseFile.hs +++ b/Cabal/src/Distribution/Simple/Program/ResponseFile.hs @@ -27,10 +27,6 @@ import Distribution.Verbosity withResponseFile :: Verbosity -> TempFileOptions - -> Maybe (SymbolicPath CWD (Dir Pkg)) - -- ^ Working directory - -> SymbolicPath Pkg (Dir Response) - -- ^ Directory to create response file in. -> String -- ^ Template for response file name. -> Maybe TextEncoding @@ -39,8 +35,8 @@ withResponseFile -- ^ Arguments to put into response file. -> (FilePath -> IO a) -> IO a -withResponseFile verbosity tmpFileOpts mbWorkDir responseDir fileNameTemplate encoding arguments f = - withTempFileEx tmpFileOpts mbWorkDir responseDir fileNameTemplate $ \responsePath hf -> do +withResponseFile verbosity tmpFileOpts fileNameTemplate encoding arguments f = + withTempFileEx tmpFileOpts fileNameTemplate $ \responsePath hf -> do let responseFileName = getSymbolicPath responsePath traverse_ (hSetEncoding hf) encoding let responseContents = diff --git a/Cabal/src/Distribution/Simple/Register.hs b/Cabal/src/Distribution/Simple/Register.hs index 78053111a4a..90704e68269 100644 --- a/Cabal/src/Distribution/Simple/Register.hs +++ b/Cabal/src/Distribution/Simple/Register.hs @@ -203,9 +203,10 @@ registerAll pkg lbi regFlags ipis = where modeGenerateRegFile = isJust (flagToMaybe (regGenPkgConf regFlags)) regFile = - fromMaybe - (prettyShow (packageId pkg) <.> "conf") - (fromFlag (regGenPkgConf regFlags)) + interpretSymbolicPathLBI lbi $ + fromMaybe + (makeSymbolicPath (prettyShow (packageId pkg) <.> "conf")) + (fromFlag (regGenPkgConf regFlags)) modeGenerateRegScript = fromFlag (regGenScript regFlags) @@ -281,7 +282,7 @@ generateRegistrationInfo verbosity pkg lib lbi clbi inplace reloc distPref packa clbi ) else do - abi_hash <- abiHash verbosity pkg inplaceDir distPref lbi lib clbi + abi_hash <- abiHash verbosity pkg distPref lbi lib clbi if reloc then relocRegistrationInfo @@ -308,13 +309,12 @@ generateRegistrationInfo verbosity pkg lib lbi clbi inplace reloc distPref packa abiHash :: Verbosity -> PackageDescription - -> FilePath -> SymbolicPath Pkg (Dir Dist) -> LocalBuildInfo -> Library -> ComponentLocalBuildInfo -> IO AbiHash -abiHash verbosity pkg inplaceDir distPref lbi lib clbi = +abiHash verbosity pkg distPref lbi lib clbi = case compilerFlavor comp of GHC -> do fmap mkAbiHash $ GHC.libAbiHash verbosity pkg lbi' lib clbi @@ -327,7 +327,7 @@ abiHash verbosity pkg inplaceDir distPref lbi lib clbi = lbi { withPackageDB = withPackageDB lbi - ++ [SpecificPackageDB (inplaceDir getSymbolicPath (internalPackageDBPath lbi distPref))] + ++ [SpecificPackageDB (internalPackageDBPath lbi distPref)] } relocRegistrationInfo @@ -427,8 +427,8 @@ registerPackage :: Verbosity -> Compiler -> ProgramDb - -> Maybe (SymbolicPath CWD (Dir Pkg)) - -> PackageDBStack + -> Maybe (SymbolicPath CWD (Dir from)) + -> PackageDBStackS from -> InstalledPackageInfo -> HcPkg.RegisterOptions -> IO () @@ -441,7 +441,7 @@ registerPackage verbosity comp progdb mbWorkDir packageDbs installedPkgInfo regi _ | HcPkg.registerMultiInstance registerOptions -> dieWithException verbosity RegisMultiplePkgNotSupported - UHC -> UHC.registerPackage verbosity comp progdb packageDbs installedPkgInfo + UHC -> UHC.registerPackage verbosity mbWorkDir comp progdb packageDbs installedPkgInfo _ -> dieWithException verbosity RegisteringNotImplemented writeHcPkgRegisterScript @@ -466,14 +466,15 @@ writeHcPkgRegisterScript verbosity mbWorkDir ipis packageDbs hpi = do -- TODO: Do something more robust here regScript = unlines scripts - info verbosity ("Creating package registration script: " ++ regScriptFileName) - writeUTF8File regScriptFileName regScript - setFileExecutable regScriptFileName + let out_file = interpretSymbolicPath mbWorkDir regScriptFileName + info verbosity ("Creating package registration script: " ++ out_file) + writeUTF8File out_file regScript + setFileExecutable out_file -regScriptFileName :: FilePath +regScriptFileName :: SymbolicPath Pkg File regScriptFileName = case buildOS of - Windows -> "register.bat" - _ -> "register.sh" + Windows -> makeSymbolicPath "register.bat" + _ -> makeSymbolicPath "register.sh" -- ----------------------------------------------------------------------------- -- Making the InstalledPackageInfo @@ -548,7 +549,7 @@ generalInstalledPackageInfo adjustRelIncDirs pkg abi_hash lib lbi clbi installDi , IPI.ldOptions = ldOptions bi , IPI.frameworks = map getSymbolicPath $ frameworks bi , IPI.frameworkDirs = map getSymbolicPath $ extraFrameworkDirs bi - , IPI.haddockInterfaces = [haddockdir installDirs haddockName pkg] + , IPI.haddockInterfaces = [haddockdir installDirs haddockLibraryPath pkg lib] , IPI.haddockHTMLs = [htmldir installDirs] , IPI.pkgRoot = Nothing , IPI.libVisibility = libVisibility lib @@ -609,8 +610,7 @@ generalInstalledPackageInfo adjustRelIncDirs pkg abi_hash lib lbi clbi installDi -- -- This function knows about the layout of in place packages. inplaceInstalledPackageInfo - :: FilePath - -- ^ top of the build tree (absolute path) + :: AbsolutePath (Dir Pkg) -> SymbolicPath Pkg (Dir Dist) -- ^ location of the dist tree -> PackageDescription @@ -629,7 +629,7 @@ inplaceInstalledPackageInfo inplaceDir distPref pkg abi_hash lib lbi clbi = clbi installDirs where - i = interpretSymbolicPath (Just $ makeSymbolicPath inplaceDir) -- See Note [Symbolic paths] in Distribution.Utils.Path + i = interpretSymbolicPathAbsolute inplaceDir -- See Note [Symbolic paths] in Distribution.Utils.Path adjustRelativeIncludeDirs = concatMap $ \d -> [ i $ makeRelativePathEx d -- local include-dir , i $ libTargetDir makeRelativePathEx d -- autogen include-dir diff --git a/Cabal/src/Distribution/Simple/Setup/Config.hs b/Cabal/src/Distribution/Simple/Setup/Config.hs index 14e76c7d769..15c1d77f553 100644 --- a/Cabal/src/Distribution/Simple/Setup/Config.hs +++ b/Cabal/src/Distribution/Simple/Setup/Config.hs @@ -127,6 +127,8 @@ data ConfigFlags = ConfigFlags , configProf :: Flag Bool -- ^ Enable profiling in the library -- and executables. + , configProfShared :: Flag Bool + -- ^ Enable shared profiling objects , configProfDetail :: Flag ProfDetailLevel -- ^ Profiling detail level -- in the library and executables. @@ -183,7 +185,7 @@ data ConfigFlags = ConfigFlags -- dependencies. , configDependencies :: [GivenComponent] -- ^ The packages depended on which already exist - , configPromisedDependencies :: [GivenComponent] + , configPromisedDependencies :: [PromisedComponent] -- ^ The packages depended on which doesn't yet exist (i.e. promised). -- Promising dependencies enables us to configure components in parallel, -- and avoids expensive builds if they are not necessary. @@ -228,6 +230,10 @@ data ConfigFlags = ConfigFlags -- testsuites run with @--enable-coverage@. Notably, this list must exclude -- indefinite libraries and instantiations because HPC does not support -- backpack (Nov. 2023). + , configIgnoreBuildTools :: Flag Bool + -- ^ When this flag is set, all tools declared in `build-tool`s and + -- `build-tool-depends` will be ignored. This allows a Cabal package with + -- build-tool-dependencies to be built even if the tool is not found. } deriving (Generic, Read, Show, Typeable) @@ -286,6 +292,7 @@ instance Eq ConfigFlags where && equal configProfExe && equal configProf && equal configProfDetail + && equal configProfShared && equal configProfLibDetail && equal configConfigureArgs && equal configOptimization @@ -319,7 +326,9 @@ instance Eq ConfigFlags where && equal configDebugInfo && equal configDumpBuildInfo && equal configUseResponseFiles + && equal configAllowDependingOnPrivateLibs && equal configCoverageFor + && equal configIgnoreBuildTools where equal f = on (==) f a b @@ -518,6 +527,13 @@ configureOptions showOrParseArgs = configProf (\v flags -> flags{configProf = v}) (boolOpt [] []) + , option + "" + ["profiling-shared"] + "Build profiling shared libraries" + configProfShared + (\v flags -> flags{configProfShared = v}) + (boolOpt [] []) , option "" ["executable-profiling"] @@ -763,13 +779,13 @@ configureOptions showOrParseArgs = , option "" ["promised-dependency"] - "A list of promised dependencies. E.g., --promised-dependency=\"void=void-0.5.8-177d5cdf20962d0581fe2e4932a6c309\"" + "A list of promised dependencies. E.g., --promised-dependency=\"void-0.5.8=void-0.5.8-177d5cdf20962d0581fe2e4932a6c309\"" configPromisedDependencies (\v flags -> flags{configPromisedDependencies = v}) ( reqArg - "NAME[:COMPONENT_NAME]=CID" - (parsecToReadE (const "dependency expected") ((\x -> [x]) `fmap` parsecGivenComponent)) - (map prettyGivenComponent) + "NAME-VER[:COMPONENT_NAME]=CID" + (parsecToReadE (const "dependency expected") ((\x -> [x]) `fmap` parsecPromisedComponent)) + (map prettyPromisedComponent) ) , option "" @@ -856,6 +872,15 @@ configureOptions showOrParseArgs = (Flag . (: []) . fromString) (fmap prettyShow . fromFlagOrDefault []) ) + , option + "" + ["ignore-build-tools"] + ( "Ignore build tool dependencies. " + ++ "If set, declared build tools needn't be found for compilation to proceed." + ) + configIgnoreBuildTools + (\v flags -> flags{configIgnoreBuildTools = v}) + trueArg ] where liftInstallDirs = @@ -880,7 +905,7 @@ readPackageDb :: String -> Maybe PackageDB readPackageDb "clear" = Nothing readPackageDb "global" = Just GlobalPackageDB readPackageDb "user" = Just UserPackageDB -readPackageDb other = Just (SpecificPackageDB other) +readPackageDb other = Just (SpecificPackageDB (makeSymbolicPath other)) showPackageDbList :: [Maybe PackageDB] -> [String] showPackageDbList = map showPackageDb @@ -892,12 +917,35 @@ showPackageDb :: Maybe PackageDB -> String showPackageDb Nothing = "clear" showPackageDb (Just GlobalPackageDB) = "global" showPackageDb (Just UserPackageDB) = "user" -showPackageDb (Just (SpecificPackageDB db)) = db +showPackageDb (Just (SpecificPackageDB db)) = getSymbolicPath db showProfDetailLevelFlag :: Flag ProfDetailLevel -> [String] showProfDetailLevelFlag NoFlag = [] showProfDetailLevelFlag (Flag dl) = [showProfDetailLevel dl] +parsecPromisedComponent :: ParsecParser PromisedComponent +parsecPromisedComponent = do + pn <- parsec + ln <- P.option LMainLibName $ do + _ <- P.char ':' + ucn <- parsec + return $ + if unUnqualComponentName ucn == unPackageName (pkgName pn) + then LMainLibName + else LSubLibName ucn + _ <- P.char '=' + cid <- parsec + return $ PromisedComponent pn ln cid + +prettyPromisedComponent :: PromisedComponent -> String +prettyPromisedComponent (PromisedComponent pn cn cid) = + prettyShow pn + ++ case cn of + LMainLibName -> "" + LSubLibName n -> ":" ++ prettyShow n + ++ "=" + ++ prettyShow cid + parsecGivenComponent :: ParsecParser GivenComponent parsecGivenComponent = do pn <- parsec diff --git a/Cabal/src/Distribution/Simple/Setup/Haddock.hs b/Cabal/src/Distribution/Simple/Setup/Haddock.hs index 402544ce511..7e8df14cfa1 100644 --- a/Cabal/src/Distribution/Simple/Setup/Haddock.hs +++ b/Cabal/src/Distribution/Simple/Setup/Haddock.hs @@ -115,6 +115,7 @@ data HaddockFlags = HaddockFlags , haddockBaseUrl :: Flag String , haddockResourcesDir :: Flag String , haddockOutputDir :: Flag FilePath + , haddockUseUnicode :: Flag Bool } deriving (Show, Generic, Typeable) @@ -170,6 +171,7 @@ defaultHaddockFlags = , haddockBaseUrl = NoFlag , haddockResourcesDir = NoFlag , haddockOutputDir = NoFlag + , haddockUseUnicode = Flag False } haddockCommand :: CommandUI HaddockFlags @@ -378,6 +380,13 @@ haddockOptions showOrParseArgs = haddockOutputDir (\v flags -> flags{haddockOutputDir = v}) (reqArgFlag "DIR") + , option + "" + ["use-unicode"] + "Pass --use-unicode option to haddock" + haddockUseUnicode + (\v flags -> flags{haddockUseUnicode = v}) + trueArg ] emptyHaddockFlags :: HaddockFlags @@ -404,7 +413,8 @@ data Visibility = Visible | Hidden deriving (Eq, Show) data HaddockProjectFlags = HaddockProjectFlags - { haddockProjectHackage :: Flag Bool + { haddockProjectCommonFlags :: !CommonSetupFlags + , haddockProjectHackage :: Flag Bool -- ^ a shortcut option which builds documentation linked to hackage. It implies: -- * `--html-location='https://hackage.haskell.org/package/$prg-$version/docs' -- * `--quickjump` @@ -441,14 +451,15 @@ data HaddockProjectFlags = HaddockProjectFlags , haddockProjectVerbosity :: Flag Verbosity , -- haddockBaseUrl is not supported, a fixed value is provided haddockProjectResourcesDir :: Flag String - , haddockProjectOutputDir :: Flag FilePath + , haddockProjectUseUnicode :: Flag Bool } deriving (Show, Generic, Typeable) defaultHaddockProjectFlags :: HaddockProjectFlags defaultHaddockProjectFlags = HaddockProjectFlags - { haddockProjectHackage = Flag False + { haddockProjectCommonFlags = defaultCommonSetupFlags + , haddockProjectHackage = Flag False , haddockProjectDir = Flag "./haddocks" , haddockProjectPrologue = NoFlag , haddockProjectTestSuites = Flag False @@ -465,8 +476,8 @@ defaultHaddockProjectFlags = , haddockProjectKeepTempFiles = Flag False , haddockProjectVerbosity = Flag normal , haddockProjectResourcesDir = NoFlag - , haddockProjectOutputDir = NoFlag , haddockProjectInterfaces = NoFlag + , haddockProjectUseUnicode = NoFlag } haddockProjectCommand :: CommandUI HaddockProjectFlags @@ -508,119 +519,141 @@ haddockProjectCommand = emptyProgramDb haddockProjectOptions :: ShowOrParseArgs -> [OptionField HaddockProjectFlags] -haddockProjectOptions _showOrParseArgs = - [ option - "" - ["hackage"] - ( concat - [ "A short-cut option to build documentation linked to hackage." - ] - ) - haddockProjectHackage - (\v flags -> flags{haddockProjectHackage = v}) - trueArg - , option - "" - ["output"] - "Output directory" - haddockProjectDir - (\v flags -> flags{haddockProjectDir = v}) - (optArg' "DIRECTORY" maybeToFlag (fmap Just . flagToList)) - , option - "" - ["prologue"] - "File path to a prologue file in haddock format" - haddockProjectPrologue - (\v flags -> flags{haddockProjectPrologue = v}) - (optArg' "PATH" maybeToFlag (fmap Just . flagToList)) - , option - "" - ["hoogle"] - "Generate a hoogle database" - haddockProjectHoogle - (\v flags -> flags{haddockProjectHoogle = v}) - trueArg - , option - "" - ["html-location"] - "Location of HTML documentation for pre-requisite packages" - haddockProjectHtmlLocation - (\v flags -> flags{haddockProjectHtmlLocation = v}) - (reqArgFlag "URL") - , option - "" - ["executables"] - "Run haddock for Executables targets" - haddockProjectExecutables - (\v flags -> flags{haddockProjectExecutables = v}) - trueArg - , option - "" - ["tests"] - "Run haddock for Test Suite targets" - haddockProjectTestSuites - (\v flags -> flags{haddockProjectTestSuites = v}) - trueArg - , option - "" - ["benchmarks"] - "Run haddock for Benchmark targets" - haddockProjectBenchmarks - (\v flags -> flags{haddockProjectBenchmarks = v}) - trueArg - , option - "" - ["foreign-libraries"] - "Run haddock for Foreign Library targets" - haddockProjectForeignLibs - (\v flags -> flags{haddockProjectForeignLibs = v}) - trueArg - , option - "" - ["internal"] - "Run haddock for internal modules and include all symbols" - haddockProjectInternal - (\v flags -> flags{haddockProjectInternal = v}) - trueArg - , option - "" - ["css"] - "Use PATH as the haddock stylesheet" - haddockProjectCss - (\v flags -> flags{haddockProjectCss = v}) - (reqArgFlag "PATH") - , option - "" - ["hscolour-css"] - "Use PATH as the HsColour stylesheet" - haddockProjectHscolourCss - (\v flags -> flags{haddockProjectHscolourCss = v}) - (reqArgFlag "PATH") - , option - "" - ["keep-temp-files"] - "Keep temporary files" - haddockProjectKeepTempFiles - (\b flags -> flags{haddockProjectKeepTempFiles = b}) - trueArg - , optionVerbosity - haddockProjectVerbosity - (\v flags -> flags{haddockProjectVerbosity = v}) - , option - "" - ["resources-dir"] - "location of Haddocks static / auxiliary files" - haddockProjectResourcesDir - (\v flags -> flags{haddockProjectResourcesDir = v}) - (reqArgFlag "DIR") - , option - "" - ["output-dir"] - "Generate haddock documentation into this directory. This flag is provided as a technology preview and is subject to change in the next releases." - haddockProjectOutputDir - (\v flags -> flags{haddockProjectOutputDir = v}) - (reqArgFlag "DIR") - ] +haddockProjectOptions showOrParseArgs = + withCommonSetupOptions + haddockProjectCommonFlags + (\c f -> f{haddockProjectCommonFlags = c}) + showOrParseArgs + [ option + "" + ["hackage"] + ( concat + [ "A short-cut option to build documentation linked to hackage." + ] + ) + haddockProjectHackage + (\v flags -> flags{haddockProjectHackage = v}) + trueArg + , option + "" + ["output"] + "Output directory" + haddockProjectDir + (\v flags -> flags{haddockProjectDir = v}) + (optArg' "DIRECTORY" maybeToFlag (fmap Just . flagToList)) + , option + "" + ["prologue"] + "File path to a prologue file in haddock format" + haddockProjectPrologue + (\v flags -> flags{haddockProjectPrologue = v}) + (optArg' "PATH" maybeToFlag (fmap Just . flagToList)) + , option + "" + ["hoogle"] + "Generate a hoogle database" + haddockProjectHoogle + (\v flags -> flags{haddockProjectHoogle = v}) + trueArg + , option + "" + ["html-location"] + "Location of HTML documentation for pre-requisite packages" + haddockProjectHtmlLocation + (\v flags -> flags{haddockProjectHtmlLocation = v}) + (reqArgFlag "URL") + , option + "" + ["executables"] + "Run haddock for Executables targets" + haddockProjectExecutables + (\v flags -> flags{haddockProjectExecutables = v}) + trueArg + , option + "" + ["tests"] + "Run haddock for Test Suite targets" + haddockProjectTestSuites + (\v flags -> flags{haddockProjectTestSuites = v}) + trueArg + , option + "" + ["benchmarks"] + "Run haddock for Benchmark targets" + haddockProjectBenchmarks + (\v flags -> flags{haddockProjectBenchmarks = v}) + trueArg + , option + "" + ["foreign-libraries"] + "Run haddock for Foreign Library targets" + haddockProjectForeignLibs + (\v flags -> flags{haddockProjectForeignLibs = v}) + trueArg + , option + "" + ["all", "haddock-all"] + "Run haddock for all targets" + ( \f -> + allFlags + [ haddockProjectExecutables f + , haddockProjectTestSuites f + , haddockProjectBenchmarks f + , haddockProjectForeignLibs f + ] + ) + ( \v flags -> + flags + { haddockProjectExecutables = v + , haddockProjectTestSuites = v + , haddockProjectBenchmarks = v + , haddockProjectForeignLibs = v + } + ) + trueArg + , option + "" + ["internal"] + "Run haddock for internal modules and include all symbols" + haddockProjectInternal + (\v flags -> flags{haddockProjectInternal = v}) + trueArg + , option + "" + ["css"] + "Use PATH as the haddock stylesheet" + haddockProjectCss + (\v flags -> flags{haddockProjectCss = v}) + (reqArgFlag "PATH") + , option + "" + ["hscolour-css"] + "Use PATH as the HsColour stylesheet" + haddockProjectHscolourCss + (\v flags -> flags{haddockProjectHscolourCss = v}) + (reqArgFlag "PATH") + , option + "" + ["keep-temp-files"] + "Keep temporary files" + haddockProjectKeepTempFiles + (\b flags -> flags{haddockProjectKeepTempFiles = b}) + trueArg + , option + "" + ["resources-dir"] + "location of Haddocks static / auxiliary files" + haddockProjectResourcesDir + (\v flags -> flags{haddockProjectResourcesDir = v}) + (reqArgFlag "DIR") + , option + "" + ["use-unicode"] + "Pass --use-unicode option to haddock" + haddockProjectUseUnicode + (\v flags -> flags{haddockProjectUseUnicode = v}) + trueArg + ] emptyHaddockProjectFlags :: HaddockProjectFlags emptyHaddockProjectFlags = mempty diff --git a/Cabal/src/Distribution/Simple/Setup/Register.hs b/Cabal/src/Distribution/Simple/Setup/Register.hs index e3eb8d6ac7a..bbd17932245 100644 --- a/Cabal/src/Distribution/Simple/Setup/Register.hs +++ b/Cabal/src/Distribution/Simple/Setup/Register.hs @@ -58,7 +58,7 @@ data RegisterFlags = RegisterFlags { registerCommonFlags :: !CommonSetupFlags , regPackageDB :: Flag PackageDB , regGenScript :: Flag Bool - , regGenPkgConf :: Flag (Maybe FilePath) + , regGenPkgConf :: Flag (Maybe (SymbolicPath Pkg (Dir PkgConf))) , regInPlace :: Flag Bool , regPrintId :: Flag Bool } @@ -154,7 +154,7 @@ registerCommand = "instead of registering, generate a package registration file/directory" regGenPkgConf (\v flags -> flags{regGenPkgConf = v}) - (optArg' "PKG" Flag flagToList) + (optArg' "PKG" (Flag . fmap makeSymbolicPath) (flagToList . fmap (fmap getSymbolicPath))) , option "" ["print-ipid"] diff --git a/Cabal/src/Distribution/Simple/ShowBuildInfo.hs b/Cabal/src/Distribution/Simple/ShowBuildInfo.hs index 493c972ae8a..970b2429d78 100644 --- a/Cabal/src/Distribution/Simple/ShowBuildInfo.hs +++ b/Cabal/src/Distribution/Simple/ShowBuildInfo.hs @@ -91,7 +91,7 @@ import Distribution.Verbosity -- | Construct a JSON document describing the build information for a -- package. mkBuildInfo - :: FilePath + :: AbsolutePath (Dir Pkg) -- ^ The source directory of the package -> PackageDescription -- ^ Mostly information from the .cabal file @@ -139,7 +139,7 @@ mkCompilerInfo compilerProgram compilerInfo = , "path" .= JsonString (programPath compilerProgram) ] -mkComponentInfo :: FilePath -> PackageDescription -> LocalBuildInfo -> ComponentLocalBuildInfo -> ([String], Json) +mkComponentInfo :: AbsolutePath (Dir Pkg) -> PackageDescription -> LocalBuildInfo -> ComponentLocalBuildInfo -> ([String], Json) mkComponentInfo wdir pkg_descr lbi clbi = ( warnings , JsonObject $ @@ -150,7 +150,7 @@ mkComponentInfo wdir pkg_descr lbi clbi = , "modules" .= JsonArray (map (JsonString . display) modules) , "src-files" .= JsonArray (map (JsonString . getSymbolicPath) sourceFiles) , "hs-src-dirs" .= JsonArray (map (JsonString . prettyShow) $ hsSourceDirs bi) - , "src-dir" .= JsonString (addTrailingPathSeparator wdir) + , "src-dir" .= JsonString (addTrailingPathSeparator (getAbsolutePath wdir)) ] <> cabalFile ) diff --git a/Cabal/src/Distribution/Simple/SrcDist.hs b/Cabal/src/Distribution/Simple/SrcDist.hs index eb9096271ef..67f901bf7fb 100644 --- a/Cabal/src/Distribution/Simple/SrcDist.hs +++ b/Cabal/src/Distribution/Simple/SrcDist.hs @@ -264,6 +264,10 @@ listPackageSources' verbosity rip mbWorkDir pkg_descr pps = $ \filename -> fmap (coerceSymbolicPath . relativeSymbolicPath) <$> matchDirFileGlobWithDie verbosity rip (specVersion pkg_descr) mbWorkDir filename + , -- Extra files. + fmap concat . for (extraFiles pkg_descr) $ \fpath -> + fmap relativeSymbolicPath + <$> matchDirFileGlobWithDie verbosity rip (specVersion pkg_descr) mbWorkDir fpath , -- License file(s). return (map (relativeSymbolicPath . coerceSymbolicPath) $ licenseFiles pkg_descr) , -- Install-include files, without autogen-include files diff --git a/Cabal/src/Distribution/Simple/Test.hs b/Cabal/src/Distribution/Simple/Test.hs index c994fb3d540..5b7a6daa718 100644 --- a/Cabal/src/Distribution/Simple/Test.hs +++ b/Cabal/src/Distribution/Simple/Test.hs @@ -81,7 +81,7 @@ test args pkg_descr lbi0 flags = do enabledTests = LBI.enabledTestLBIs pkg_descr lbi -- We must add the internalPkgDB to the package database stack to lookup -- the path to HPC dirs of libraries local to this package - internalPkgDb = i $ internalPackageDBPath lbi0 distPref + internalPkgDb = internalPackageDBPath lbi0 distPref lbi = lbi0{withPackageDB = withPackageDB lbi0 ++ [SpecificPackageDB internalPkgDb]} doTest diff --git a/Cabal/src/Distribution/Simple/UHC.hs b/Cabal/src/Distribution/Simple/UHC.hs index af085ef3a7c..aa41388c6d0 100644 --- a/Cabal/src/Distribution/Simple/UHC.hs +++ b/Cabal/src/Distribution/Simple/UHC.hs @@ -113,14 +113,15 @@ uhcLanguageExtensions = getInstalledPackages :: Verbosity -> Compiler - -> PackageDBStack + -> Maybe (SymbolicPath CWD (Dir from)) + -> PackageDBStackX (SymbolicPath from (Dir PkgDB)) -> ProgramDb -> IO InstalledPackageIndex -getInstalledPackages verbosity comp packagedbs progdb = do +getInstalledPackages verbosity comp mbWorkDir packagedbs progdb = do let compilerid = compilerId comp systemPkgDir <- getGlobalPackageDir verbosity progdb userPkgDir <- getUserPackageDir - let pkgDirs = nub (concatMap (packageDbPaths userPkgDir systemPkgDir) packagedbs) + let pkgDirs = nub (concatMap (packageDbPaths userPkgDir systemPkgDir mbWorkDir) packagedbs) -- putStrLn $ "pkgdirs: " ++ show pkgDirs pkgs <- liftM (map addBuiltinVersions . concat) $ @@ -154,12 +155,17 @@ getUserPackageDir = do homeDir <- getHomeDirectory return $ homeDir ".cabal" "lib" -- TODO: determine in some other way -packageDbPaths :: FilePath -> FilePath -> PackageDB -> [FilePath] -packageDbPaths user system db = +packageDbPaths + :: FilePath + -> FilePath + -> Maybe (SymbolicPath CWD (Dir from)) + -> PackageDBX (SymbolicPath from (Dir PkgDB)) + -> [FilePath] +packageDbPaths user system mbWorkDir db = case db of GlobalPackageDB -> [system] UserPackageDB -> [user] - SpecificPackageDB path -> [path] + SpecificPackageDB path -> [interpretSymbolicPath mbWorkDir path] -- | Hack to add version numbers to UHC-built-in packages. This should sooner or -- later be fixed on the UHC side. @@ -209,7 +215,7 @@ buildLib buildLib verbosity pkg_descr lbi lib clbi = do systemPkgDir <- getGlobalPackageDir verbosity (withPrograms lbi) userPkgDir <- getUserPackageDir - let runUhcProg = runDbProgram verbosity uhcProgram (withPrograms lbi) + let runUhcProg = runDbProgramCwd verbosity (mbWorkDirLBI lbi) uhcProgram (withPrograms lbi) let uhcArgs = -- set package name ["--pkg-build=" ++ prettyShow (packageId pkg_descr)] @@ -245,8 +251,8 @@ buildExe verbosity _pkg_descr lbi exe clbi = do userPkgDir <- getUserPackageDir let mbWorkDir = mbWorkDirLBI lbi srcMainPath <- findFileCwd verbosity mbWorkDir (hsSourceDirs $ buildInfo exe) (modulePath exe) - let runUhcProg = runDbProgram verbosity uhcProgram (withPrograms lbi) - i = interpretSymbolicPathLBI lbi -- See Note [Symbolic paths] in Distribution.Utils.Path + let runUhcProg = runDbProgramCwd verbosity (mbWorkDirLBI lbi) uhcProgram (withPrograms lbi) + u = interpretSymbolicPathCWD uhcArgs = -- common flags lib/exe constructUHCCmdLine @@ -258,9 +264,9 @@ buildExe verbosity _pkg_descr lbi exe clbi = do (buildDir lbi) verbosity -- output file - ++ ["--output", i $ buildDir lbi makeRelativePathEx (prettyShow (exeName exe))] + ++ ["--output", u $ buildDir lbi makeRelativePathEx (prettyShow (exeName exe))] -- main source module - ++ [i $ srcMainPath] + ++ [u $ srcMainPath] runUhcProg uhcArgs constructUHCCmdLine @@ -291,14 +297,14 @@ constructUHCCmdLine user system lbi bi clbi odir verbosity = ++ ["--package=uhcbase"] ++ ["--package=" ++ prettyShow (mungedName pkgid) | (_, pkgid) <- componentPackageDeps clbi] -- search paths - ++ ["-i" ++ i odir] - ++ ["-i" ++ i l | l <- nub (hsSourceDirs bi)] - ++ ["-i" ++ i (autogenComponentModulesDir lbi clbi)] - ++ ["-i" ++ i (autogenPackageModulesDir lbi)] + ++ ["-i" ++ u odir] + ++ ["-i" ++ u l | l <- nub (hsSourceDirs bi)] + ++ ["-i" ++ u (autogenComponentModulesDir lbi clbi)] + ++ ["-i" ++ u (autogenPackageModulesDir lbi)] -- cpp options ++ ["--optP=" ++ opt | opt <- cppOptions bi] -- output path - ++ ["--odir=" ++ i odir] + ++ ["--odir=" ++ u odir] -- optimization ++ ( case withOptimization lbi of NoOptimisation -> ["-O0"] @@ -306,13 +312,13 @@ constructUHCCmdLine user system lbi bi clbi odir verbosity = MaximumOptimisation -> ["-O2"] ) where - i = interpretSymbolicPathLBI lbi -- See Note [Symbolic paths] in Distribution.Utils.Path + u = interpretSymbolicPathCWD -- See Note [Symbolic paths] in Distribution.Utils.Path uhcPackageDbOptions :: FilePath -> FilePath -> PackageDBStack -> [String] uhcPackageDbOptions user system db = map (\x -> "--pkg-searchpath=" ++ x) - (concatMap (packageDbPaths user system) db) + (concatMap (packageDbPaths user system Nothing) db) -- ----------------------------------------------------------------------------- -- Installation @@ -348,16 +354,17 @@ uhcPackageSubDir compilerid = compilerid uhcTarget uhcTargetVariant registerPackage :: Verbosity + -> Maybe (SymbolicPath CWD (Dir from)) -> Compiler -> ProgramDb - -> PackageDBStack + -> PackageDBStackS from -> InstalledPackageInfo -> IO () -registerPackage verbosity comp progdb packageDbs installedPkgInfo = do +registerPackage verbosity mbWorkDir comp progdb packageDbs installedPkgInfo = do dbdir <- case registrationPackageDB packageDbs of GlobalPackageDB -> getGlobalPackageDir verbosity progdb UserPackageDB -> getUserPackageDir - SpecificPackageDB dir -> return dir + SpecificPackageDB dir -> return (interpretSymbolicPath mbWorkDir dir) let pkgdir = dbdir uhcPackageDir (prettyShow pkgid) (prettyShow compilerid) createDirectoryIfMissingVerbose verbosity True pkgdir writeUTF8File diff --git a/Cabal/src/Distribution/Simple/Utils.hs b/Cabal/src/Distribution/Simple/Utils.hs index 47caab077af..d51601e5c27 100644 --- a/Cabal/src/Distribution/Simple/Utils.hs +++ b/Cabal/src/Distribution/Simple/Utils.hs @@ -250,6 +250,7 @@ import System.Directory , getDirectoryContents , getModificationTime , getPermissions + , getTemporaryDirectory , removeDirectoryRecursive , removeFile ) @@ -1733,23 +1734,17 @@ defaultTempFileOptions = TempFileOptions{optKeepTempFiles = False} -- | Use a temporary filename that doesn't already exist withTempFile - :: FilePath - -- ^ Temp dir to create the file in - -> String + :: String -- ^ File name template. See 'openTempFile'. -> (FilePath -> Handle -> IO a) -> IO a -withTempFile tmpDir template f = withFrozenCallStack $ - withTempFileCwd Nothing (makeSymbolicPath tmpDir) template $ +withTempFile template f = withFrozenCallStack $ + withTempFileCwd template $ \fp h -> f (getSymbolicPath fp) h -- | Use a temporary filename that doesn't already exist. withTempFileCwd - :: Maybe (SymbolicPath CWD (Dir Pkg)) - -- ^ Working directory - -> SymbolicPath Pkg (Dir tmpDir) - -- ^ Temp dir to create the file in - -> String + :: String -- ^ File name template. See 'openTempFile'. -> (SymbolicPath Pkg File -> Handle -> IO a) -> IO a @@ -1758,20 +1753,17 @@ withTempFileCwd = withFrozenCallStack $ withTempFileEx defaultTempFileOptions -- | A version of 'withTempFile' that additionally takes a 'TempFileOptions' -- argument. withTempFileEx - :: forall a tmpDir + :: forall a . TempFileOptions - -> Maybe (SymbolicPath CWD (Dir Pkg)) - -- ^ Working directory - -> SymbolicPath Pkg (Dir tmpDir) - -- ^ Temp dir to create the file in -> String -- ^ File name template. See 'openTempFile'. -> (SymbolicPath Pkg File -> Handle -> IO a) -> IO a -withTempFileEx opts mbWorkDir tmpDir template action = +withTempFileEx opts template action = do + tmp <- getTemporaryDirectory withFrozenCallStack $ Exception.bracket - (openTempFile (i tmpDir) template) + (openTempFile tmp template) ( \(name, handle) -> do hClose handle unless (optKeepTempFiles opts) $ @@ -1779,12 +1771,11 @@ withTempFileEx opts mbWorkDir tmpDir template action = removeFile $ name ) - (withLexicalCallStack (\(fn, h) -> action (mkRelToPkg fn) h)) + (withLexicalCallStack (\(fn, h) -> action (mkRelToPkg tmp fn) h)) where - i = interpretSymbolicPath mbWorkDir -- See Note [Symbolic paths] in Distribution.Utils.Path - mkRelToPkg :: FilePath -> SymbolicPath Pkg File - mkRelToPkg fp = - tmpDir makeRelativePathEx (takeFileName fp) + mkRelToPkg :: FilePath -> FilePath -> SymbolicPath Pkg File + mkRelToPkg tmp fp = + makeSymbolicPath tmp makeRelativePathEx (takeFileName fp) -- 'openTempFile' returns a path of the form @i tmpDir fn@, but we -- want 'withTempFileEx' to return @tmpDir fn@. So we split off @@ -1950,6 +1941,13 @@ exeExtensions = case (buildArch, buildOS) of -- Possible improvement: on Windows, read the list of extensions from the -- PATHEXT environment variable. By default PATHEXT is ".com; .exe; .bat; -- .cmd". + -- + -- See also #10179. + -- + -- Also we cannot actually run @.bat@ files as we do now, because of + -- https://github.com/haskell/process/issues/140. If we detect one of those, + -- we should record that the program is a script and run a @Process.shell@ instead + -- of a @Process.proc@. (_, Windows) -> ["", "exe"] (_, Ghcjs) -> ["", "exe"] (Wasm32, _) -> ["", "wasm"] diff --git a/Cabal/src/Distribution/Types/GivenComponent.hs b/Cabal/src/Distribution/Types/GivenComponent.hs index c8314311d89..235c8c372a0 100644 --- a/Cabal/src/Distribution/Types/GivenComponent.hs +++ b/Cabal/src/Distribution/Types/GivenComponent.hs @@ -3,12 +3,14 @@ module Distribution.Types.GivenComponent ( GivenComponent (..) + , PromisedComponent (..) ) where import Distribution.Compat.Prelude import Distribution.Types.ComponentId import Distribution.Types.LibraryName +import Distribution.Types.PackageId import Distribution.Types.PackageName -- | A 'GivenComponent' represents a library depended on and explicitly @@ -27,3 +29,20 @@ data GivenComponent = GivenComponent instance Binary GivenComponent instance Structured GivenComponent + +-- | A 'PromisedComponent' represents a promised library depended on and explicitly +-- specified by the user/client with @--promised-dependency@ +-- +-- It enables Cabal to know which 'ComponentId' to associate with a library +-- +-- @since 3.14.0.0 +data PromisedComponent = PromisedComponent + { promisedComponentPackage :: PackageId + , promisedComponentName :: LibraryName -- --dependency is for libraries + -- only, not for any component + , promisedComponentId :: ComponentId + } + deriving (Generic, Read, Show, Eq, Typeable) + +instance Binary PromisedComponent +instance Structured PromisedComponent diff --git a/Cabal/src/Distribution/Types/LocalBuildConfig.hs b/Cabal/src/Distribution/Types/LocalBuildConfig.hs index 9126d92f1eb..929b5e60889 100644 --- a/Cabal/src/Distribution/Types/LocalBuildConfig.hs +++ b/Cabal/src/Distribution/Types/LocalBuildConfig.hs @@ -22,9 +22,9 @@ module Distribution.Types.LocalBuildConfig import Distribution.Compat.Prelude import Prelude () -import Distribution.Types.ComponentId import Distribution.Types.ComponentLocalBuildInfo import Distribution.Types.ComponentRequestedSpec +import Distribution.Types.GivenComponent import Distribution.Types.PackageDescription import Distribution.Types.UnitId @@ -101,7 +101,7 @@ data ComponentBuildDescr = ComponentBuildDescr -- ^ A map from component name to all matching -- components. These coincide with 'componentGraph' -- There may be more than one matching component because of backpack instantiations - , promisedPkgs :: Map (PackageName, ComponentName) ComponentId + , promisedPkgs :: Map (PackageName, ComponentName) PromisedComponent -- ^ The packages we were promised, but aren't already installed. -- MP: Perhaps this just needs to be a Set UnitId at this stage. , installedPkgs :: InstalledPackageIndex @@ -151,6 +151,8 @@ data BuildOptions = BuildOptions { withVanillaLib :: Bool -- ^ Whether to build normal libs. , withProfLib :: Bool + -- ^ Whether to build normal libs. + , withProfLibShared :: Bool -- ^ Whether to build profiling versions of libs. , withSharedLib :: Bool -- ^ Whether to build shared versions of libs. @@ -211,6 +213,7 @@ buildOptionsConfigFlags (BuildOptions{..}) = , configGHCiLib = toFlag $ withGHCiLib , configProfExe = toFlag $ withProfExe , configProfLib = toFlag $ withProfLib + , configProfShared = toFlag $ withProfLibShared , configProf = mempty , -- configProfDetail is for exe+lib, but overridden by configProfLibDetail -- so we specify both so we can specify independently diff --git a/Cabal/src/Distribution/Types/LocalBuildInfo.hs b/Cabal/src/Distribution/Types/LocalBuildInfo.hs index 3f9d8d74268..107eefc2766 100644 --- a/Cabal/src/Distribution/Types/LocalBuildInfo.hs +++ b/Cabal/src/Distribution/Types/LocalBuildInfo.hs @@ -28,11 +28,12 @@ module Distribution.Types.LocalBuildInfo , withPackageDB , withVanillaLib , withProfLib - , withSharedLib - , withStaticLib + , withProfLibShared , withDynExe , withFullyStaticExe , withProfExe + , withSharedLib + , withStaticLib , withProfLibDetail , withProfExeDetail , withOptimization @@ -82,6 +83,7 @@ module Distribution.Types.LocalBuildInfo , neededTargetsInBuildOrder' , withNeededTargetsInBuildOrder' , testCoverage + , buildWays -- * Functions you SHOULD NOT USE (yet), but are defined here to @@ -101,6 +103,7 @@ import Prelude () import Distribution.Types.ComponentId import Distribution.Types.ComponentLocalBuildInfo import Distribution.Types.ComponentRequestedSpec +import Distribution.Types.GivenComponent import qualified Distribution.Types.LocalBuildConfig as LBC import Distribution.Types.PackageDescription import Distribution.Types.PackageId @@ -111,6 +114,7 @@ import Distribution.Utils.Path import Distribution.PackageDescription import Distribution.Pretty +import Distribution.Simple.BuildWay import Distribution.Simple.Compiler import Distribution.Simple.Flag import Distribution.Simple.InstallDirs hiding @@ -157,7 +161,7 @@ pattern LocalBuildInfo -> Maybe (SymbolicPath Pkg File) -> Graph ComponentLocalBuildInfo -> Map ComponentName [ComponentLocalBuildInfo] - -> Map (PackageName, ComponentName) ComponentId + -> Map (PackageName, ComponentName) PromisedComponent -> InstalledPackageIndex -> PackageDescription -> ProgramDb @@ -169,6 +173,7 @@ pattern LocalBuildInfo -> Bool -> Bool -> Bool + -> Bool -> ProfDetailLevel -> ProfDetailLevel -> OptimisationLevel @@ -201,6 +206,7 @@ pattern LocalBuildInfo , withPackageDB , withVanillaLib , withProfLib + , withProfLibShared , withSharedLib , withStaticLib , withDynExe @@ -252,6 +258,7 @@ pattern LocalBuildInfo LBC.BuildOptions { withVanillaLib , withProfLib + , withProfLibShared , withSharedLib , withStaticLib , withDynExe @@ -429,6 +436,49 @@ testCoverage :: LocalBuildInfo -> Bool testCoverage (LocalBuildInfo{exeCoverage = exes, libCoverage = libs}) = exes && libs +-- | Returns a list of ways, in the order which they should be built, and the +-- way we build executable and foreign library components. +-- +-- Ideally all this info should be fixed at configure time and not dependent on +-- additional info but `LocalBuildInfo` is per package (not per component) so it's +-- currently not possible to configure components to be built in certain ways. +buildWays :: LocalBuildInfo -> (Bool -> [BuildWay], Bool -> BuildWay, BuildWay) +buildWays lbi = + let + -- enable-library-profiling (enable (static profiling way)) .p_o + -- enable-shared (enabled dynamic way) .dyn_o + -- enable-profiling-shared (enable dyanmic profilng way) .p_dyn_o + -- enable-library-vanilla (enable vanilla way) .o + -- + -- enable-executable-dynamic => build dynamic executables + -- => --enable-profiling + --enable-executable-dynamic => build dynamic profiled executables + -- => --enable-profiling => build vanilla profiled executables + + wantedLibWays is_indef = + [ProfDynWay | withProfLibShared lbi && not is_indef] + <> [ProfWay | withProfLib lbi] + -- I don't see why we shouldn't build with dynamic-- indefinite components. + <> [DynWay | withSharedLib lbi && not is_indef] + -- MP: Ideally we should have `BuildOptions` on a per component basis, in + -- which case this `is_indef` check could be moved to configure time. + <> [StaticWay | withVanillaLib lbi || withStaticLib lbi] + + wantedFLibWay is_dyn_flib = + case (is_dyn_flib, withProfExe lbi) of + (True, True) -> ProfDynWay + (False, True) -> ProfWay + (True, False) -> DynWay + (False, False) -> StaticWay + + wantedExeWay = + case (withDynExe lbi, withProfExe lbi) of + (True, True) -> ProfDynWay + (True, False) -> DynWay + (False, True) -> ProfWay + (False, False) -> StaticWay + in + (wantedLibWays, wantedFLibWay, wantedExeWay) + ------------------------------------------------------------------------------- -- Stub functions to prevent someone from accidentally defining them diff --git a/Makefile b/Makefile index d305ca16353..5cf1cae4d6f 100644 --- a/Makefile +++ b/Makefile @@ -5,12 +5,9 @@ CABALBUILD := cabal build CABALRUN := cabal run -# The newer and prefered way to call the doctest tool is: -# $ cabal repl --with-ghc=doctest -# SEE: https://github.com/haskell/cabal/issues/8504 -# There is but one caveat, we have to avoid allow-newer. +# We have to avoid allow-newer. # SEE: https://github.com/haskell/cabal/issues/6859 -DOCTEST := cabal repl --with-ghc=doctest --repl-options="-w" --ghc-options="-Wwarn" --allow-newer=False +DOCTEST := cabal doctest --allow-newer=False # default rules @@ -32,18 +29,33 @@ init: ## Set up git hooks and ignored revisions .PHONY: style style: ## Run the code styler - @fourmolu -q -i Cabal Cabal-syntax cabal-install + @fourmolu -q -i Cabal Cabal-syntax cabal-install cabal-validate .PHONY: style-modified style-modified: ## Run the code styler on modified files - @git ls-files --modified Cabal Cabal-syntax cabal-install \ + @git ls-files --modified Cabal Cabal-syntax cabal-install cabal-validate \ | grep '.hs$$' | xargs -P $(PROCS) -I {} fourmolu -q -i {} .PHONY: style-commit style-commit: ## Run the code styler on the previous commit - @git diff --name-only HEAD $(COMMIT) Cabal Cabal-syntax cabal-install \ + @git diff --name-only HEAD $(COMMIT) Cabal Cabal-syntax cabal-install cabal-validate \ | grep '.hs$$' | xargs -P $(PROCS) -I {} fourmolu -q -i {} +.PHONY: whitespace +whitespace: ## Run fix-whitespace in check mode + fix-whitespace --check --verbose + +.PHONY: fix-whitespace +fix-whitespace: ## Run fix-whitespace in fix mode + fix-whitespace --verbose + +# local checks + +.PHONY: checks +checks: whitespace style + # this should probably be a rule + hlint -j --json -- . + # source generation: SPDX SPDX_LICENSE_HS:=Cabal-syntax/src/Distribution/SPDX/LicenseId.hs @@ -55,7 +67,7 @@ SPDX_EXCEPTION_HS:=Cabal-syntax/src/Distribution/SPDX/LicenseExceptionId.hs .PHONY: spdx spdx : $(SPDX_LICENSE_HS) $(SPDX_EXCEPTION_HS) -SPDX_LICENSE_VERSIONS:=3.0 3.2 3.6 3.9 3.10 3.16 3.23 +SPDX_LICENSE_VERSIONS:=3.0 3.2 3.6 3.9 3.10 3.16 3.23 3.25 $(SPDX_LICENSE_HS) : templates/SPDX.LicenseId.template.hs cabal-dev-scripts/src/GenUtils.hs cabal-dev-scripts/src/GenSPDX.hs license-list-data/licenses-3.0.json license-list-data/licenses-3.2.json cabal run --builddir=dist-newstyle-meta --project-file=cabal.meta.project gen-spdx -- templates/SPDX.LicenseId.template.hs $(SPDX_LICENSE_VERSIONS:%=license-list-data/licenses-%.json) $(SPDX_LICENSE_HS) @@ -107,11 +119,11 @@ ghcid-cli : .PHONY: doctest doctest : - $(DOCTEST) Cabal-syntax - $(DOCTEST) Cabal-described - $(DOCTEST) --build-depends=QuickCheck Cabal - $(DOCTEST) cabal-install-solver - $(DOCTEST) cabal-install + cd Cabal-syntax && $(DOCTEST) + cd Cabal-described && $(DOCTEST) + cd Cabal && $(DOCTEST) + cd cabal-install-solver && $(DOCTEST) + cd cabal-install && $(DOCTEST) # This is not run as part of validate.sh (we need hackage-security, which is tricky to get). .PHONY: doctest-cli @@ -120,7 +132,7 @@ doctest-cli : .PHONY: doctest-install doctest-install: - cabal install doctest --overwrite-policy=always --ignore-project + cabal install doctest --overwrite-policy=always --ignore-project --flag cabal-doctest # tests @@ -178,14 +190,12 @@ cabal-install-test-accept: .PHONY: validate-via-docker-all validate-via-docker-all : validate-via-docker-8.2.2 validate-via-docker-all : validate-via-docker-8.4.4 -validate-via-docker-all : validate-via-docker-8.6.5 validate-via-docker-all : validate-via-docker-8.8.4 validate-via-docker-all : validate-via-docker-8.10.4 .PHONY: validate-dockerfiles validate-dockerfiles : .docker/validate-8.10.4.dockerfile validate-dockerfiles : .docker/validate-8.8.4.dockerfile -validate-dockerfiles : .docker/validate-8.6.5.dockerfile validate-dockerfiles : .docker/validate-8.4.4.dockerfile validate-dockerfiles : .docker/validate-8.2.2.dockerfile @@ -204,10 +214,6 @@ validate-via-docker-8.2.2: validate-via-docker-8.4.4: docker build $(DOCKERARGS) -t cabal-validate:8.4.4 -f .docker/validate-8.4.4.dockerfile . -.PHONY: validate-via-docker-8.6.5 -validate-via-docker-8.6.5: - docker build $(DOCKERARGS) -t cabal-validate:8.6.5 -f .docker/validate-8.6.5.dockerfile . - .PHONY: validate-via-docker-8.8.4 validate-via-docker-8.8.4: docker build $(DOCKERARGS) -t cabal-validate:8.8.4 -f .docker/validate-8.8.4.dockerfile . @@ -235,7 +241,7 @@ bootstrap-json-%: phony cd bootstrap && cabal run -v0 cabal-bootstrap-gen -- linux-$*.plan.json \ | python3 -m json.tool > linux-$*.json -BOOTSTRAP_GHC_VERSIONS := 8.10.7 9.0.2 9.2.8 9.4.8 9.6.4 9.8.2 +BOOTSTRAP_GHC_VERSIONS := 9.0.2 9.2.8 9.4.8 9.6.6 9.8.2 .PHONY: bootstrap-jsons bootstrap-jsons: $(BOOTSTRAP_GHC_VERSIONS:%=bootstrap-json-%) diff --git a/README.md b/README.md index 4697cf2b2c6..9d4a937db97 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,7 @@ This Cabal Git repository contains the following main packages: * [Cabal](Cabal/README.md): the Cabal library package ([license](Cabal/LICENSE)) + * [Cabal-hooks](Cabal-hooks/README.md): the library providing an API for the Cabal `Hooks` build type ([license](Cabal-hooks/LICENSE)) * [Cabal-syntax](Cabal-syntax/README.md): the `.cabal` file format library ([license](Cabal-syntax/LICENSE)) * [cabal-install](cabal-install/README.md): the package containing the `cabal` tool ([license](cabal-install/LICENSE)) * [cabal-install-solver](cabal-install-solver): the package containing the solver component of the `cabal` tool ([license](cabal-install-solver/LICENSE)) diff --git a/bootstrap/cabal-bootstrap-gen.cabal b/bootstrap/cabal-bootstrap-gen.cabal index 0b73a1de23e..b2caa03c493 100644 --- a/bootstrap/cabal-bootstrap-gen.cabal +++ b/bootstrap/cabal-bootstrap-gen.cabal @@ -8,11 +8,11 @@ executable cabal-bootstrap-gen ghc-options: -Wall main-is: Main.hs build-depends: - , aeson ^>=1.5.2.0 || ^>=2.0.3.0 || ^>=2.1.0.0 - , base ^>=4.12.0.0 || ^>=4.13.0.0 || ^>=4.14.0.0 || ^>=4.15.0.0 || ^>=4.16.0.0 || ^>=4.17.0.0 || ^>=4.18.0.0 + , aeson ^>=1.5.2.0 || ^>=2.0.3.0 || ^>=2.1.0.0 || ^>=2.2.0.0 + , base ^>=4.12.0.0 || ^>=4.13.0.0 || ^>=4.14.0.0 || ^>=4.15.0.0 || ^>=4.16.0.0 || ^>=4.17.0.0 || ^>=4.18.0.0 || ^>=4.19.0.0 , bytestring ^>=0.10.8.2 || ^>=0.11.0.0 - , Cabal ^>=3.4.1.0 || ^>=3.6.3.0 || ^>=3.10.1.0 || ^>=3.12.1.0 - , Cabal-syntax ^>=3.8.1.0 || ^>=3.10.1.0 || ^>=3.12.1.0 + , Cabal ^>=3.12.1.0 || ^>=3.14.0.0 + , Cabal-syntax ^>=3.12.1.0 || ^>=3.14.0.0 -- For the release process, we need the last *two* Cabal-syntax -- versions here: one to make CI green when release Cabal-syntax is -- not yet on Hackage and we are bumping versions. The second for diff --git a/bootstrap/generate_bootstrap_plans b/bootstrap/generate_bootstrap_plans index d10b958deb5..de77e9944dd 100755 --- a/bootstrap/generate_bootstrap_plans +++ b/bootstrap/generate_bootstrap_plans @@ -3,7 +3,7 @@ PATH+=:$PWD/jq-bin/bin ghcs_nix="https://gitlab.haskell.org/bgamari/ghcs-nix/-/archive/master/ghcs-nix-master.tar.gz" -nix build -f "$ghcs_nix" ghc-8_10_7 -o boot_ghc +nix build -f "$ghcs_nix" ghc-9_6_5 -o boot_ghc run() { local ver="$1" diff --git a/bootstrap/linux-9.0.2.json b/bootstrap/linux-9.0.2.json index 8db81ee3aa1..77f026b442b 100644 --- a/bootstrap/linux-9.0.2.json +++ b/bootstrap/linux-9.0.2.json @@ -85,7 +85,7 @@ "version": "0.12.1.0" }, { - "cabal_sha256": "d9e181e1acae0ac505d8b217dec3805c68554878f1e32b3d8351b9ce17061623", + "cabal_sha256": "345cbb1afe414a09e47737e4d14cbd51891a734e67c0ef3d77a1439518bb81e8", "component": "lib:filepath", "flags": [ "-cpphs" @@ -93,8 +93,8 @@ "package": "filepath", "revision": 0, "source": "hackage", - "src_sha256": "337a0b5bcf0898cb7f51ff327528cf26f4ac38baed7b66b28fbdea334699d8ed", - "version": "1.4.300.1" + "src_sha256": "88d6452fd199e333e66e68d2dc5d715f5c6d361661a4a8add88320a82864b788", + "version": "1.4.300.2" }, { "cabal_sha256": "3f702a252a313a7bcb56e3908a14e7f9f1b40e41b7bdc8ae8a9605a1a8686f06", @@ -109,7 +109,7 @@ "version": "2.8.5.1" }, { - "cabal_sha256": "ae1730011f547153bb52139f217d1d524202b3da730a369660fc539e5dcfff31", + "cabal_sha256": "fbeec9ec346e5272167f63dcb86af513b457a7b9fc36dc818e4c7b81608d612b", "component": "lib:directory", "flags": [ "-os-string" @@ -117,8 +117,8 @@ "package": "directory", "revision": 0, "source": "hackage", - "src_sha256": "a4e798a4e5339a7aa9577515886271386280bfbc1fe4a29fd4aa6464d4792064", - "version": "1.3.8.4" + "src_sha256": "e864ed54ddfc6e15d2eb02c87f4be8edd7719e1f9cea13e0f86909400b6ea768", + "version": "1.3.8.5" }, { "cabal_sha256": "de553eefe0b6548a560e9d8100486310548470a403c1fa21108dd03713da5fc7", @@ -141,7 +141,7 @@ "version": "0.8.9.2" }, { - "cabal_sha256": "aa7a5a92fe430a34d24d33878323c8a010021e05e410fe98b7fac3015c88dc74", + "cabal_sha256": "78c3fb91055d0607a80453327f087b9dc82168d41d0dca3ff410d21033b5e87d", "component": "lib:text", "flags": [ "-developer", @@ -149,7 +149,7 @@ "+simdutf" ], "package": "text", - "revision": 0, + "revision": 1, "source": "hackage", "src_sha256": "e40cdda8b285f4d72476ed35dc2f5f167d524e6b38bb5ec964d00ee1ff24feab", "version": "2.1.1" @@ -172,17 +172,17 @@ "revision": null, "source": "local", "src_sha256": null, - "version": "3.13.0.0" + "version": "3.15.0.0" }, { - "cabal_sha256": "7785a72bc140ae5a9ef2439f10637b5fd104999832f1d93328d4973f37cb8469", + "cabal_sha256": "684028fb5ac3d1c7657fe516f2a442d95a53ae2fcf6f6151544f3ed5289f6320", "component": "lib:process", "flags": [], "package": "process", "revision": 0, "source": "hackage", - "src_sha256": "b468355ab46966537eb171ed5593a0a1facc8d2eefc38659e43768f68f5dcb96", - "version": "1.6.19.0" + "src_sha256": "a816655978c2527d8d7a6ebfd6f1ca79027f27ac4f2f28888f1581b2d558aea5", + "version": "1.6.23.0" }, { "cabal_sha256": null, @@ -192,7 +192,7 @@ "revision": null, "source": "local", "src_sha256": null, - "version": "3.13.0.0" + "version": "3.15.0.0" }, { "cabal_sha256": null, @@ -217,7 +217,7 @@ "version": "0.68.10" }, { - "cabal_sha256": "25440c1bbd5772fdbbeec068f20138121131e1a56453db0adc113dcdf9044105", + "cabal_sha256": "17b834d2b75df8a8aef05de523280f613bb9c9aa9c31f269d5b90c1431a3749b", "component": "lib:network", "flags": [ "-devel" @@ -225,15 +225,15 @@ "package": "network", "revision": 0, "source": "hackage", - "src_sha256": "c45696744dc437d93a56871a3dd869965b7b50eda3fe3c1a90a35e2fbb9cb9ca", - "version": "3.2.0.0" + "src_sha256": "efb04947946f52cccba802c2a8fc2f4259f0bdfd0bce95094c84e71583647f0c", + "version": "3.2.2.0" }, { - "cabal_sha256": "0a6ee328b71119d7dfcd004f0ec8feb77e6e78d8f6de1a281568edd3d3b6d83f", + "cabal_sha256": "129a59ba3ccfcd06192fd6da899e2711ae276a466915a047bd6727e4a0321d2e", "component": "lib:th-compat", "flags": [], "package": "th-compat", - "revision": 1, + "revision": 2, "source": "hackage", "src_sha256": "81f55fafc7afad7763c09cb8b7b4165ca3765edcf70ffa42c7393043a1382a1e", "version": "0.1.5" @@ -264,36 +264,37 @@ "version": "4000.4.1" }, { - "cabal_sha256": "c4733d09f798fc4304e936924a1a7d9fc2425aefad6c46ad4592035254b46051", + "cabal_sha256": "455d863c96cf4b1804772c630a235f535fdb52ca9137a4150967b521ee4734ab", "component": "lib:base-orphans", "flags": [], "package": "base-orphans", "revision": 0, "source": "hackage", - "src_sha256": "5bbf2da382c5b212d6a8be2f8c49edee0eba30f272a15fd32c13e6e4091ef172", - "version": "0.9.1" + "src_sha256": "6211900916955b84687c61b5e4fa98ce110e511a96086b7a93f06dd63c97ba93", + "version": "0.9.2" }, { - "cabal_sha256": "ae22238274c572aa91e90c6c353e7206386708912ac5e6dc40ac61d1dcc553db", + "cabal_sha256": "573f3ab242f75465a0d67ce9d84202650a1606575e6dbd6d31ffcf4767a9a379", "component": "lib:hashable", "flags": [ + "-arch-native", "+integer-gmp", "-random-initial-seed" ], "package": "hashable", - "revision": 1, + "revision": 0, "source": "hackage", - "src_sha256": "1fa3d64548440942b2b38b99c76d8dcaa94fa2ea3912cd7a6354ea4ec4af4758", - "version": "1.4.4.0" + "src_sha256": "3baee4c9027a08830d148ec524cbc0471de645e1e8426d46780ef2758df0e8da", + "version": "1.4.7.0" }, { - "cabal_sha256": "9d5d9e605f52958d099e13a8b8f30ee56cb137c9192996245e3c533adb682cf8", + "cabal_sha256": "cf9e6afba8e01830ca0d32a12b98d481cf389688762c80d1870a1db2061ebf35", "component": "lib:async", "flags": [ "-bench" ], "package": "async", - "revision": 1, + "revision": 2, "source": "hackage", "src_sha256": "1818473ebab9212afad2ed76297aefde5fae8b5d4404daf36939aece6a8f16f7", "version": "2.2.5" @@ -361,17 +362,17 @@ "revision": null, "source": "local", "src_sha256": null, - "version": "3.13.0.0" + "version": "3.15.0.0" }, { - "cabal_sha256": "200d756a7b3bab7ca2bac6eb50ed8252f26de77ac8def490a3ad743f2933acbd", + "cabal_sha256": "acb64f2af52d81b0bb92c266f11d43def726a7a7b74a2c23d219e160b54edec7", "component": "lib:cryptohash-sha256", "flags": [ "-exe", "+use-cbits" ], "package": "cryptohash-sha256", - "revision": 4, + "revision": 5, "source": "hackage", "src_sha256": "73a7dc7163871a80837495039a099967b11f5c4fe70a118277842f7a713c6bf6", "version": "0.11.102.1" @@ -404,70 +405,70 @@ "version": "0.0.5.0" }, { - "cabal_sha256": "17786545dce60c4d5783ba6125c0a6499a1abddd3d7417b15500ccd767c35f07", + "cabal_sha256": "8a3004c2de2a0b5ef0634d3da6eae62ba8d8a734bab9ed8c6cfd749e7ca08997", "component": "lib:lukko", "flags": [ "+ofd-locking" ], "package": "lukko", - "revision": 5, + "revision": 0, "source": "hackage", - "src_sha256": "a80efb60cfa3dae18682c01980d76d5f7e413e191cd186992e1bf7388d48ab1f", - "version": "0.1.1.3" + "src_sha256": "72d86f8aa625b461f4397f737346f78a1700a7ffbff55cf6375c5e18916e986d", + "version": "0.1.2" }, { - "cabal_sha256": "32fa47f8345a2c0662fb602fc42e4b674e41ec48079b68bdecb4b6f68032c24e", + "cabal_sha256": "7699e7ae9bf74d056a62f384ceef8dfb2aa660f3f7c8016e9703f3b995e5e030", "component": "lib:os-string", "flags": [], "package": "os-string", "revision": 0, "source": "hackage", - "src_sha256": "0953126e962966719753c98d71f596f5fea07e100bce191b7453735a1ff2caa1", - "version": "2.0.2" + "src_sha256": "22fcc7d5fc66676b5dfc57b714d2caf93cce2d5a79d242168352f9eb0fe2f18a", + "version": "2.0.6" }, { - "cabal_sha256": "619828cae098a7b6deeb0316e12f55011101d88f756787ed024ceedb81cf1eba", + "cabal_sha256": "e9f151d9999be8953443e730524b2792e9c0a4fb5b1463097fa1a8230870fd8a", "component": "lib:tar-internal", "flags": [], "package": "tar", - "revision": 0, + "revision": 1, "source": "hackage", - "src_sha256": "08c61e82b59ed6fe7e85e9fe7cceaaf853ba54511d1ec57efa511ddc55ef1998", - "version": "0.6.2.0" + "src_sha256": "50bb660feec8a524416d6934251b996eaa7e39d49ae107ad505ab700d43f6814", + "version": "0.6.3.0" }, { - "cabal_sha256": "619828cae098a7b6deeb0316e12f55011101d88f756787ed024ceedb81cf1eba", + "cabal_sha256": "e9f151d9999be8953443e730524b2792e9c0a4fb5b1463097fa1a8230870fd8a", "component": "lib:tar", "flags": [], "package": "tar", - "revision": 0, + "revision": 1, "source": "hackage", - "src_sha256": "08c61e82b59ed6fe7e85e9fe7cceaaf853ba54511d1ec57efa511ddc55ef1998", - "version": "0.6.2.0" + "src_sha256": "50bb660feec8a524416d6934251b996eaa7e39d49ae107ad505ab700d43f6814", + "version": "0.6.3.0" }, { - "cabal_sha256": "64a1925c93e9a26cd4c40c470736950c4b5ea7bae68418cb996c5c7df4873cba", + "cabal_sha256": "bae1c5a6092d65c5e763246f91e04fef3f43e37cb055130725c9a973c88a250f", "component": "lib:zlib", "flags": [ "-bundled-c-zlib", "+non-blocking-ffi", - "-pkg-config" + "+pkg-config" ], "package": "zlib", "revision": 1, "source": "hackage", - "src_sha256": "7e43c205e1e1ff5a4b033086ec8cce82ab658879e977c8ba02a6701946ff7a47", - "version": "0.7.0.0" + "src_sha256": "6edd38b6b81df8d274952aa85affa6968ae86b2231e1d429ce8bc9083e6a55bc", + "version": "0.7.1.0" }, { - "cabal_sha256": "8ff70524314f9ad706f8e5051d7150ee44cb82170147879b245bdab279604b16", + "cabal_sha256": "a7311a70ce2cc820ee430c389f57f82a082f148230b37526c34eac72b7b3ff34", "component": "lib:hackage-security", "flags": [ "+cabal-syntax", "+lukko" ], "package": "hackage-security", - "revision": 1, + "revision": 4, "source": "hackage", "src_sha256": "2e4261576b3e11b9f5175392947f56a638cc1a3584b8acbb962b809d7c69db69", "version": "0.6.2.6" @@ -525,11 +526,11 @@ "version": "0.1.7.4" }, { - "cabal_sha256": "a8f76076a40409a36ee975970c53273c2089aec9d9ece8168dfc736dfec24b9d", + "cabal_sha256": "2de5218cef72b8ef090bd7d0fd930ffa143242a120c62e013b5cf039858f1855", "component": "lib:semaphore-compat", "flags": [], "package": "semaphore-compat", - "revision": 2, + "revision": 3, "source": "hackage", "src_sha256": "1c6e6fab021c2ccee5d86112fb1c0bd016d15e0cf70c489dae5fb5ec156ed9e2", "version": "1.0.0" @@ -545,7 +546,7 @@ "revision": null, "source": "local", "src_sha256": null, - "version": "3.13.0.0" + "version": "3.15.0.0" }, { "cabal_sha256": null, @@ -558,7 +559,7 @@ "revision": null, "source": "local", "src_sha256": null, - "version": "3.13.0.0" + "version": "3.15.0.0" }, { "cabal_sha256": "e4be4a206f5ab6ddb5ae4fbb39101529196e20af5670c5d33326fea6eff886fd", diff --git a/bootstrap/linux-9.2.8.json b/bootstrap/linux-9.2.8.json index 17293e6b197..53a81294887 100644 --- a/bootstrap/linux-9.2.8.json +++ b/bootstrap/linux-9.2.8.json @@ -79,7 +79,17 @@ ], "dependencies": [ { - "cabal_sha256": "d9e181e1acae0ac505d8b217dec3805c68554878f1e32b3d8351b9ce17061623", + "cabal_sha256": "7699e7ae9bf74d056a62f384ceef8dfb2aa660f3f7c8016e9703f3b995e5e030", + "component": "lib:os-string", + "flags": [], + "package": "os-string", + "revision": 0, + "source": "hackage", + "src_sha256": "22fcc7d5fc66676b5dfc57b714d2caf93cce2d5a79d242168352f9eb0fe2f18a", + "version": "2.0.6" + }, + { + "cabal_sha256": "0c64bc9a4f5946c86a8f0527bf40c8ba51e2c02d36eea0e20ea558c8d94166e8", "component": "lib:filepath", "flags": [ "-cpphs" @@ -87,14 +97,14 @@ "package": "filepath", "revision": 0, "source": "hackage", - "src_sha256": "337a0b5bcf0898cb7f51ff327528cf26f4ac38baed7b66b28fbdea334699d8ed", - "version": "1.4.300.1" + "src_sha256": "d807ec44fe53de7c7e0eeb41c9ee9185a09163821cf50549d73d875197931a5a", + "version": "1.5.3.0" }, { "cabal_sha256": "3f702a252a313a7bcb56e3908a14e7f9f1b40e41b7bdc8ae8a9605a1a8686f06", "component": "lib:unix", "flags": [ - "-os-string" + "+os-string" ], "package": "unix", "revision": 0, @@ -103,16 +113,16 @@ "version": "2.8.5.1" }, { - "cabal_sha256": "ae1730011f547153bb52139f217d1d524202b3da730a369660fc539e5dcfff31", + "cabal_sha256": "fbeec9ec346e5272167f63dcb86af513b457a7b9fc36dc818e4c7b81608d612b", "component": "lib:directory", "flags": [ - "-os-string" + "+os-string" ], "package": "directory", "revision": 0, "source": "hackage", - "src_sha256": "a4e798a4e5339a7aa9577515886271386280bfbc1fe4a29fd4aa6464d4792064", - "version": "1.3.8.4" + "src_sha256": "e864ed54ddfc6e15d2eb02c87f4be8edd7719e1f9cea13e0f86909400b6ea768", + "version": "1.3.8.5" }, { "cabal_sha256": "de553eefe0b6548a560e9d8100486310548470a403c1fa21108dd03713da5fc7", @@ -132,17 +142,17 @@ "revision": null, "source": "local", "src_sha256": null, - "version": "3.13.0.0" + "version": "3.15.0.0" }, { - "cabal_sha256": "7785a72bc140ae5a9ef2439f10637b5fd104999832f1d93328d4973f37cb8469", + "cabal_sha256": "684028fb5ac3d1c7657fe516f2a442d95a53ae2fcf6f6151544f3ed5289f6320", "component": "lib:process", "flags": [], "package": "process", "revision": 0, "source": "hackage", - "src_sha256": "b468355ab46966537eb171ed5593a0a1facc8d2eefc38659e43768f68f5dcb96", - "version": "1.6.19.0" + "src_sha256": "a816655978c2527d8d7a6ebfd6f1ca79027f27ac4f2f28888f1581b2d558aea5", + "version": "1.6.23.0" }, { "cabal_sha256": null, @@ -152,7 +162,7 @@ "revision": null, "source": "local", "src_sha256": null, - "version": "3.13.0.0" + "version": "3.15.0.0" }, { "cabal_sha256": null, @@ -177,7 +187,7 @@ "version": "0.68.10" }, { - "cabal_sha256": "25440c1bbd5772fdbbeec068f20138121131e1a56453db0adc113dcdf9044105", + "cabal_sha256": "17b834d2b75df8a8aef05de523280f613bb9c9aa9c31f269d5b90c1431a3749b", "component": "lib:network", "flags": [ "-devel" @@ -185,15 +195,15 @@ "package": "network", "revision": 0, "source": "hackage", - "src_sha256": "c45696744dc437d93a56871a3dd869965b7b50eda3fe3c1a90a35e2fbb9cb9ca", - "version": "3.2.0.0" + "src_sha256": "efb04947946f52cccba802c2a8fc2f4259f0bdfd0bce95094c84e71583647f0c", + "version": "3.2.2.0" }, { - "cabal_sha256": "0a6ee328b71119d7dfcd004f0ec8feb77e6e78d8f6de1a281568edd3d3b6d83f", + "cabal_sha256": "129a59ba3ccfcd06192fd6da899e2711ae276a466915a047bd6727e4a0321d2e", "component": "lib:th-compat", "flags": [], "package": "th-compat", - "revision": 1, + "revision": 2, "source": "hackage", "src_sha256": "81f55fafc7afad7763c09cb8b7b4165ca3765edcf70ffa42c7393043a1382a1e", "version": "0.1.5" @@ -234,36 +244,27 @@ "version": "0.1.0.1" }, { - "cabal_sha256": "32fa47f8345a2c0662fb602fc42e4b674e41ec48079b68bdecb4b6f68032c24e", - "component": "lib:os-string", - "flags": [], - "package": "os-string", - "revision": 0, - "source": "hackage", - "src_sha256": "0953126e962966719753c98d71f596f5fea07e100bce191b7453735a1ff2caa1", - "version": "2.0.2" - }, - { - "cabal_sha256": "ae22238274c572aa91e90c6c353e7206386708912ac5e6dc40ac61d1dcc553db", + "cabal_sha256": "573f3ab242f75465a0d67ce9d84202650a1606575e6dbd6d31ffcf4767a9a379", "component": "lib:hashable", "flags": [ + "-arch-native", "+integer-gmp", "-random-initial-seed" ], "package": "hashable", - "revision": 1, + "revision": 0, "source": "hackage", - "src_sha256": "1fa3d64548440942b2b38b99c76d8dcaa94fa2ea3912cd7a6354ea4ec4af4758", - "version": "1.4.4.0" + "src_sha256": "3baee4c9027a08830d148ec524cbc0471de645e1e8426d46780ef2758df0e8da", + "version": "1.4.7.0" }, { - "cabal_sha256": "9d5d9e605f52958d099e13a8b8f30ee56cb137c9192996245e3c533adb682cf8", + "cabal_sha256": "cf9e6afba8e01830ca0d32a12b98d481cf389688762c80d1870a1db2061ebf35", "component": "lib:async", "flags": [ "-bench" ], "package": "async", - "revision": 1, + "revision": 2, "source": "hackage", "src_sha256": "1818473ebab9212afad2ed76297aefde5fae8b5d4404daf36939aece6a8f16f7", "version": "2.2.5" @@ -331,17 +332,17 @@ "revision": null, "source": "local", "src_sha256": null, - "version": "3.13.0.0" + "version": "3.15.0.0" }, { - "cabal_sha256": "200d756a7b3bab7ca2bac6eb50ed8252f26de77ac8def490a3ad743f2933acbd", + "cabal_sha256": "acb64f2af52d81b0bb92c266f11d43def726a7a7b74a2c23d219e160b54edec7", "component": "lib:cryptohash-sha256", "flags": [ "-exe", "+use-cbits" ], "package": "cryptohash-sha256", - "revision": 4, + "revision": 5, "source": "hackage", "src_sha256": "73a7dc7163871a80837495039a099967b11f5c4fe70a118277842f7a713c6bf6", "version": "0.11.102.1" @@ -374,60 +375,60 @@ "version": "0.0.5.0" }, { - "cabal_sha256": "17786545dce60c4d5783ba6125c0a6499a1abddd3d7417b15500ccd767c35f07", + "cabal_sha256": "8a3004c2de2a0b5ef0634d3da6eae62ba8d8a734bab9ed8c6cfd749e7ca08997", "component": "lib:lukko", "flags": [ "+ofd-locking" ], "package": "lukko", - "revision": 5, + "revision": 0, "source": "hackage", - "src_sha256": "a80efb60cfa3dae18682c01980d76d5f7e413e191cd186992e1bf7388d48ab1f", - "version": "0.1.1.3" + "src_sha256": "72d86f8aa625b461f4397f737346f78a1700a7ffbff55cf6375c5e18916e986d", + "version": "0.1.2" }, { - "cabal_sha256": "619828cae098a7b6deeb0316e12f55011101d88f756787ed024ceedb81cf1eba", + "cabal_sha256": "e9f151d9999be8953443e730524b2792e9c0a4fb5b1463097fa1a8230870fd8a", "component": "lib:tar-internal", "flags": [], "package": "tar", - "revision": 0, + "revision": 1, "source": "hackage", - "src_sha256": "08c61e82b59ed6fe7e85e9fe7cceaaf853ba54511d1ec57efa511ddc55ef1998", - "version": "0.6.2.0" + "src_sha256": "50bb660feec8a524416d6934251b996eaa7e39d49ae107ad505ab700d43f6814", + "version": "0.6.3.0" }, { - "cabal_sha256": "619828cae098a7b6deeb0316e12f55011101d88f756787ed024ceedb81cf1eba", + "cabal_sha256": "e9f151d9999be8953443e730524b2792e9c0a4fb5b1463097fa1a8230870fd8a", "component": "lib:tar", "flags": [], "package": "tar", - "revision": 0, + "revision": 1, "source": "hackage", - "src_sha256": "08c61e82b59ed6fe7e85e9fe7cceaaf853ba54511d1ec57efa511ddc55ef1998", - "version": "0.6.2.0" + "src_sha256": "50bb660feec8a524416d6934251b996eaa7e39d49ae107ad505ab700d43f6814", + "version": "0.6.3.0" }, { - "cabal_sha256": "64a1925c93e9a26cd4c40c470736950c4b5ea7bae68418cb996c5c7df4873cba", + "cabal_sha256": "bae1c5a6092d65c5e763246f91e04fef3f43e37cb055130725c9a973c88a250f", "component": "lib:zlib", "flags": [ "-bundled-c-zlib", "+non-blocking-ffi", - "-pkg-config" + "+pkg-config" ], "package": "zlib", "revision": 1, "source": "hackage", - "src_sha256": "7e43c205e1e1ff5a4b033086ec8cce82ab658879e977c8ba02a6701946ff7a47", - "version": "0.7.0.0" + "src_sha256": "6edd38b6b81df8d274952aa85affa6968ae86b2231e1d429ce8bc9083e6a55bc", + "version": "0.7.1.0" }, { - "cabal_sha256": "8ff70524314f9ad706f8e5051d7150ee44cb82170147879b245bdab279604b16", + "cabal_sha256": "a7311a70ce2cc820ee430c389f57f82a082f148230b37526c34eac72b7b3ff34", "component": "lib:hackage-security", "flags": [ "+cabal-syntax", "+lukko" ], "package": "hackage-security", - "revision": 1, + "revision": 4, "source": "hackage", "src_sha256": "2e4261576b3e11b9f5175392947f56a638cc1a3584b8acbb962b809d7c69db69", "version": "0.6.2.6" @@ -485,11 +486,11 @@ "version": "0.1.7.4" }, { - "cabal_sha256": "a8f76076a40409a36ee975970c53273c2089aec9d9ece8168dfc736dfec24b9d", + "cabal_sha256": "2de5218cef72b8ef090bd7d0fd930ffa143242a120c62e013b5cf039858f1855", "component": "lib:semaphore-compat", "flags": [], "package": "semaphore-compat", - "revision": 2, + "revision": 3, "source": "hackage", "src_sha256": "1c6e6fab021c2ccee5d86112fb1c0bd016d15e0cf70c489dae5fb5ec156ed9e2", "version": "1.0.0" @@ -505,7 +506,7 @@ "revision": null, "source": "local", "src_sha256": null, - "version": "3.13.0.0" + "version": "3.15.0.0" }, { "cabal_sha256": null, @@ -518,7 +519,7 @@ "revision": null, "source": "local", "src_sha256": null, - "version": "3.13.0.0" + "version": "3.15.0.0" }, { "cabal_sha256": "e4be4a206f5ab6ddb5ae4fbb39101529196e20af5670c5d33326fea6eff886fd", diff --git a/bootstrap/linux-9.4.8.json b/bootstrap/linux-9.4.8.json index 8a721f76be7..c538160f393 100644 --- a/bootstrap/linux-9.4.8.json +++ b/bootstrap/linux-9.4.8.json @@ -79,7 +79,17 @@ ], "dependencies": [ { - "cabal_sha256": "d9e181e1acae0ac505d8b217dec3805c68554878f1e32b3d8351b9ce17061623", + "cabal_sha256": "7699e7ae9bf74d056a62f384ceef8dfb2aa660f3f7c8016e9703f3b995e5e030", + "component": "lib:os-string", + "flags": [], + "package": "os-string", + "revision": 0, + "source": "hackage", + "src_sha256": "22fcc7d5fc66676b5dfc57b714d2caf93cce2d5a79d242168352f9eb0fe2f18a", + "version": "2.0.6" + }, + { + "cabal_sha256": "0c64bc9a4f5946c86a8f0527bf40c8ba51e2c02d36eea0e20ea558c8d94166e8", "component": "lib:filepath", "flags": [ "-cpphs" @@ -87,14 +97,14 @@ "package": "filepath", "revision": 0, "source": "hackage", - "src_sha256": "337a0b5bcf0898cb7f51ff327528cf26f4ac38baed7b66b28fbdea334699d8ed", - "version": "1.4.300.1" + "src_sha256": "d807ec44fe53de7c7e0eeb41c9ee9185a09163821cf50549d73d875197931a5a", + "version": "1.5.3.0" }, { "cabal_sha256": "3f702a252a313a7bcb56e3908a14e7f9f1b40e41b7bdc8ae8a9605a1a8686f06", "component": "lib:unix", "flags": [ - "-os-string" + "+os-string" ], "package": "unix", "revision": 0, @@ -103,16 +113,16 @@ "version": "2.8.5.1" }, { - "cabal_sha256": "ae1730011f547153bb52139f217d1d524202b3da730a369660fc539e5dcfff31", + "cabal_sha256": "fbeec9ec346e5272167f63dcb86af513b457a7b9fc36dc818e4c7b81608d612b", "component": "lib:directory", "flags": [ - "-os-string" + "+os-string" ], "package": "directory", "revision": 0, "source": "hackage", - "src_sha256": "a4e798a4e5339a7aa9577515886271386280bfbc1fe4a29fd4aa6464d4792064", - "version": "1.3.8.4" + "src_sha256": "e864ed54ddfc6e15d2eb02c87f4be8edd7719e1f9cea13e0f86909400b6ea768", + "version": "1.3.8.5" }, { "cabal_sha256": "de553eefe0b6548a560e9d8100486310548470a403c1fa21108dd03713da5fc7", @@ -132,17 +142,17 @@ "revision": null, "source": "local", "src_sha256": null, - "version": "3.13.0.0" + "version": "3.15.0.0" }, { - "cabal_sha256": "7785a72bc140ae5a9ef2439f10637b5fd104999832f1d93328d4973f37cb8469", + "cabal_sha256": "684028fb5ac3d1c7657fe516f2a442d95a53ae2fcf6f6151544f3ed5289f6320", "component": "lib:process", "flags": [], "package": "process", "revision": 0, "source": "hackage", - "src_sha256": "b468355ab46966537eb171ed5593a0a1facc8d2eefc38659e43768f68f5dcb96", - "version": "1.6.19.0" + "src_sha256": "a816655978c2527d8d7a6ebfd6f1ca79027f27ac4f2f28888f1581b2d558aea5", + "version": "1.6.23.0" }, { "cabal_sha256": null, @@ -152,7 +162,7 @@ "revision": null, "source": "local", "src_sha256": null, - "version": "3.13.0.0" + "version": "3.15.0.0" }, { "cabal_sha256": null, @@ -177,7 +187,7 @@ "version": "0.68.10" }, { - "cabal_sha256": "25440c1bbd5772fdbbeec068f20138121131e1a56453db0adc113dcdf9044105", + "cabal_sha256": "17b834d2b75df8a8aef05de523280f613bb9c9aa9c31f269d5b90c1431a3749b", "component": "lib:network", "flags": [ "-devel" @@ -185,15 +195,15 @@ "package": "network", "revision": 0, "source": "hackage", - "src_sha256": "c45696744dc437d93a56871a3dd869965b7b50eda3fe3c1a90a35e2fbb9cb9ca", - "version": "3.2.0.0" + "src_sha256": "efb04947946f52cccba802c2a8fc2f4259f0bdfd0bce95094c84e71583647f0c", + "version": "3.2.2.0" }, { - "cabal_sha256": "0a6ee328b71119d7dfcd004f0ec8feb77e6e78d8f6de1a281568edd3d3b6d83f", + "cabal_sha256": "129a59ba3ccfcd06192fd6da899e2711ae276a466915a047bd6727e4a0321d2e", "component": "lib:th-compat", "flags": [], "package": "th-compat", - "revision": 1, + "revision": 2, "source": "hackage", "src_sha256": "81f55fafc7afad7763c09cb8b7b4165ca3765edcf70ffa42c7393043a1382a1e", "version": "0.1.5" @@ -224,36 +234,27 @@ "version": "4000.4.1" }, { - "cabal_sha256": "32fa47f8345a2c0662fb602fc42e4b674e41ec48079b68bdecb4b6f68032c24e", - "component": "lib:os-string", - "flags": [], - "package": "os-string", - "revision": 0, - "source": "hackage", - "src_sha256": "0953126e962966719753c98d71f596f5fea07e100bce191b7453735a1ff2caa1", - "version": "2.0.2" - }, - { - "cabal_sha256": "ae22238274c572aa91e90c6c353e7206386708912ac5e6dc40ac61d1dcc553db", + "cabal_sha256": "573f3ab242f75465a0d67ce9d84202650a1606575e6dbd6d31ffcf4767a9a379", "component": "lib:hashable", "flags": [ + "-arch-native", "+integer-gmp", "-random-initial-seed" ], "package": "hashable", - "revision": 1, + "revision": 0, "source": "hackage", - "src_sha256": "1fa3d64548440942b2b38b99c76d8dcaa94fa2ea3912cd7a6354ea4ec4af4758", - "version": "1.4.4.0" + "src_sha256": "3baee4c9027a08830d148ec524cbc0471de645e1e8426d46780ef2758df0e8da", + "version": "1.4.7.0" }, { - "cabal_sha256": "9d5d9e605f52958d099e13a8b8f30ee56cb137c9192996245e3c533adb682cf8", + "cabal_sha256": "cf9e6afba8e01830ca0d32a12b98d481cf389688762c80d1870a1db2061ebf35", "component": "lib:async", "flags": [ "-bench" ], "package": "async", - "revision": 1, + "revision": 2, "source": "hackage", "src_sha256": "1818473ebab9212afad2ed76297aefde5fae8b5d4404daf36939aece6a8f16f7", "version": "2.2.5" @@ -321,17 +322,17 @@ "revision": null, "source": "local", "src_sha256": null, - "version": "3.13.0.0" + "version": "3.15.0.0" }, { - "cabal_sha256": "200d756a7b3bab7ca2bac6eb50ed8252f26de77ac8def490a3ad743f2933acbd", + "cabal_sha256": "acb64f2af52d81b0bb92c266f11d43def726a7a7b74a2c23d219e160b54edec7", "component": "lib:cryptohash-sha256", "flags": [ "-exe", "+use-cbits" ], "package": "cryptohash-sha256", - "revision": 4, + "revision": 5, "source": "hackage", "src_sha256": "73a7dc7163871a80837495039a099967b11f5c4fe70a118277842f7a713c6bf6", "version": "0.11.102.1" @@ -364,60 +365,60 @@ "version": "0.0.5.0" }, { - "cabal_sha256": "17786545dce60c4d5783ba6125c0a6499a1abddd3d7417b15500ccd767c35f07", + "cabal_sha256": "8a3004c2de2a0b5ef0634d3da6eae62ba8d8a734bab9ed8c6cfd749e7ca08997", "component": "lib:lukko", "flags": [ "+ofd-locking" ], "package": "lukko", - "revision": 5, + "revision": 0, "source": "hackage", - "src_sha256": "a80efb60cfa3dae18682c01980d76d5f7e413e191cd186992e1bf7388d48ab1f", - "version": "0.1.1.3" + "src_sha256": "72d86f8aa625b461f4397f737346f78a1700a7ffbff55cf6375c5e18916e986d", + "version": "0.1.2" }, { - "cabal_sha256": "619828cae098a7b6deeb0316e12f55011101d88f756787ed024ceedb81cf1eba", + "cabal_sha256": "e9f151d9999be8953443e730524b2792e9c0a4fb5b1463097fa1a8230870fd8a", "component": "lib:tar-internal", "flags": [], "package": "tar", - "revision": 0, + "revision": 1, "source": "hackage", - "src_sha256": "08c61e82b59ed6fe7e85e9fe7cceaaf853ba54511d1ec57efa511ddc55ef1998", - "version": "0.6.2.0" + "src_sha256": "50bb660feec8a524416d6934251b996eaa7e39d49ae107ad505ab700d43f6814", + "version": "0.6.3.0" }, { - "cabal_sha256": "619828cae098a7b6deeb0316e12f55011101d88f756787ed024ceedb81cf1eba", + "cabal_sha256": "e9f151d9999be8953443e730524b2792e9c0a4fb5b1463097fa1a8230870fd8a", "component": "lib:tar", "flags": [], "package": "tar", - "revision": 0, + "revision": 1, "source": "hackage", - "src_sha256": "08c61e82b59ed6fe7e85e9fe7cceaaf853ba54511d1ec57efa511ddc55ef1998", - "version": "0.6.2.0" + "src_sha256": "50bb660feec8a524416d6934251b996eaa7e39d49ae107ad505ab700d43f6814", + "version": "0.6.3.0" }, { - "cabal_sha256": "64a1925c93e9a26cd4c40c470736950c4b5ea7bae68418cb996c5c7df4873cba", + "cabal_sha256": "bae1c5a6092d65c5e763246f91e04fef3f43e37cb055130725c9a973c88a250f", "component": "lib:zlib", "flags": [ "-bundled-c-zlib", "+non-blocking-ffi", - "-pkg-config" + "+pkg-config" ], "package": "zlib", "revision": 1, "source": "hackage", - "src_sha256": "7e43c205e1e1ff5a4b033086ec8cce82ab658879e977c8ba02a6701946ff7a47", - "version": "0.7.0.0" + "src_sha256": "6edd38b6b81df8d274952aa85affa6968ae86b2231e1d429ce8bc9083e6a55bc", + "version": "0.7.1.0" }, { - "cabal_sha256": "8ff70524314f9ad706f8e5051d7150ee44cb82170147879b245bdab279604b16", + "cabal_sha256": "a7311a70ce2cc820ee430c389f57f82a082f148230b37526c34eac72b7b3ff34", "component": "lib:hackage-security", "flags": [ "+cabal-syntax", "+lukko" ], "package": "hackage-security", - "revision": 1, + "revision": 4, "source": "hackage", "src_sha256": "2e4261576b3e11b9f5175392947f56a638cc1a3584b8acbb962b809d7c69db69", "version": "0.6.2.6" @@ -475,11 +476,11 @@ "version": "0.1.7.4" }, { - "cabal_sha256": "a8f76076a40409a36ee975970c53273c2089aec9d9ece8168dfc736dfec24b9d", + "cabal_sha256": "2de5218cef72b8ef090bd7d0fd930ffa143242a120c62e013b5cf039858f1855", "component": "lib:semaphore-compat", "flags": [], "package": "semaphore-compat", - "revision": 2, + "revision": 3, "source": "hackage", "src_sha256": "1c6e6fab021c2ccee5d86112fb1c0bd016d15e0cf70c489dae5fb5ec156ed9e2", "version": "1.0.0" @@ -495,7 +496,7 @@ "revision": null, "source": "local", "src_sha256": null, - "version": "3.13.0.0" + "version": "3.15.0.0" }, { "cabal_sha256": null, @@ -508,7 +509,7 @@ "revision": null, "source": "local", "src_sha256": null, - "version": "3.13.0.0" + "version": "3.15.0.0" }, { "cabal_sha256": "e4be4a206f5ab6ddb5ae4fbb39101529196e20af5670c5d33326fea6eff886fd", diff --git a/bootstrap/linux-9.6.4.json b/bootstrap/linux-9.6.4.json index 7e04a3fd91a..c0c138d5110 100644 --- a/bootstrap/linux-9.6.4.json +++ b/bootstrap/linux-9.6.4.json @@ -159,11 +159,11 @@ "version": "3.2.0.0" }, { - "cabal_sha256": "0a6ee328b71119d7dfcd004f0ec8feb77e6e78d8f6de1a281568edd3d3b6d83f", + "cabal_sha256": "129a59ba3ccfcd06192fd6da899e2711ae276a466915a047bd6727e4a0321d2e", "component": "lib:th-compat", "flags": [], "package": "th-compat", - "revision": 1, + "revision": 2, "source": "hackage", "src_sha256": "81f55fafc7afad7763c09cb8b7b4165ca3765edcf70ffa42c7393043a1382a1e", "version": "0.1.5" @@ -194,27 +194,28 @@ "version": "4000.4.1" }, { - "cabal_sha256": "32fa47f8345a2c0662fb602fc42e4b674e41ec48079b68bdecb4b6f68032c24e", + "cabal_sha256": "4d4186bb8d711435765253c7dc076c44a1d52896300689507ba135706ab35866", "component": "lib:os-string", "flags": [], "package": "os-string", "revision": 0, "source": "hackage", - "src_sha256": "0953126e962966719753c98d71f596f5fea07e100bce191b7453735a1ff2caa1", - "version": "2.0.2" + "src_sha256": "f6b388b9f9002622901d3f71437b98f95f54fbf7fe10490d319cb801c2a061ea", + "version": "2.0.3" }, { - "cabal_sha256": "ae22238274c572aa91e90c6c353e7206386708912ac5e6dc40ac61d1dcc553db", + "cabal_sha256": "82503a1ef0a625c210e118f2785c4138f8502aacbbfd4e5d987f6baffbb87115", "component": "lib:hashable", "flags": [ + "-arch-native", "+integer-gmp", "-random-initial-seed" ], "package": "hashable", - "revision": 1, + "revision": 0, "source": "hackage", - "src_sha256": "1fa3d64548440942b2b38b99c76d8dcaa94fa2ea3912cd7a6354ea4ec4af4758", - "version": "1.4.4.0" + "src_sha256": "34652a7a1d2fc9e3d764b150bd35bcd2220761c1d4c6b446b0cfac5ad5b778cb", + "version": "1.4.6.0" }, { "cabal_sha256": "9d5d9e605f52958d099e13a8b8f30ee56cb137c9192996245e3c533adb682cf8", @@ -334,50 +335,50 @@ "version": "0.0.5.0" }, { - "cabal_sha256": "17786545dce60c4d5783ba6125c0a6499a1abddd3d7417b15500ccd767c35f07", + "cabal_sha256": "8a3004c2de2a0b5ef0634d3da6eae62ba8d8a734bab9ed8c6cfd749e7ca08997", "component": "lib:lukko", "flags": [ "+ofd-locking" ], "package": "lukko", - "revision": 5, + "revision": 0, "source": "hackage", - "src_sha256": "a80efb60cfa3dae18682c01980d76d5f7e413e191cd186992e1bf7388d48ab1f", - "version": "0.1.1.3" + "src_sha256": "72d86f8aa625b461f4397f737346f78a1700a7ffbff55cf6375c5e18916e986d", + "version": "0.1.2" }, { - "cabal_sha256": "619828cae098a7b6deeb0316e12f55011101d88f756787ed024ceedb81cf1eba", + "cabal_sha256": "b853b4296cb23386feda17dc0d9065af6709d22d684ec734aab65403d59ed547", "component": "lib:tar-internal", "flags": [], "package": "tar", "revision": 0, "source": "hackage", - "src_sha256": "08c61e82b59ed6fe7e85e9fe7cceaaf853ba54511d1ec57efa511ddc55ef1998", - "version": "0.6.2.0" + "src_sha256": "50bb660feec8a524416d6934251b996eaa7e39d49ae107ad505ab700d43f6814", + "version": "0.6.3.0" }, { - "cabal_sha256": "619828cae098a7b6deeb0316e12f55011101d88f756787ed024ceedb81cf1eba", + "cabal_sha256": "b853b4296cb23386feda17dc0d9065af6709d22d684ec734aab65403d59ed547", "component": "lib:tar", "flags": [], "package": "tar", "revision": 0, "source": "hackage", - "src_sha256": "08c61e82b59ed6fe7e85e9fe7cceaaf853ba54511d1ec57efa511ddc55ef1998", - "version": "0.6.2.0" + "src_sha256": "50bb660feec8a524416d6934251b996eaa7e39d49ae107ad505ab700d43f6814", + "version": "0.6.3.0" }, { - "cabal_sha256": "64a1925c93e9a26cd4c40c470736950c4b5ea7bae68418cb996c5c7df4873cba", + "cabal_sha256": "d6696f2b55ab4a50b8de57947abca308604eb7cf8287c40bf69cfa26133e24d3", "component": "lib:zlib", "flags": [ "-bundled-c-zlib", "+non-blocking-ffi", - "-pkg-config" + "+pkg-config" ], "package": "zlib", - "revision": 1, + "revision": 0, "source": "hackage", - "src_sha256": "7e43c205e1e1ff5a4b033086ec8cce82ab658879e977c8ba02a6701946ff7a47", - "version": "0.7.0.0" + "src_sha256": "6edd38b6b81df8d274952aa85affa6968ae86b2231e1d429ce8bc9083e6a55bc", + "version": "0.7.1.0" }, { "cabal_sha256": "8ff70524314f9ad706f8e5051d7150ee44cb82170147879b245bdab279604b16", @@ -445,11 +446,11 @@ "version": "0.1.7.4" }, { - "cabal_sha256": "a8f76076a40409a36ee975970c53273c2089aec9d9ece8168dfc736dfec24b9d", + "cabal_sha256": "2de5218cef72b8ef090bd7d0fd930ffa143242a120c62e013b5cf039858f1855", "component": "lib:semaphore-compat", "flags": [], "package": "semaphore-compat", - "revision": 2, + "revision": 3, "source": "hackage", "src_sha256": "1c6e6fab021c2ccee5d86112fb1c0bd016d15e0cf70c489dae5fb5ec156ed9e2", "version": "1.0.0" diff --git a/bootstrap/linux-8.10.7.json b/bootstrap/linux-9.6.6.json similarity index 67% rename from bootstrap/linux-8.10.7.json rename to bootstrap/linux-9.6.6.json index 64f1d42ec7c..10227f50ec8 100644 --- a/bootstrap/linux-8.10.7.json +++ b/bootstrap/linux-9.6.6.json @@ -2,35 +2,31 @@ "builtin": [ { "package": "rts", - "version": "1.0.1" + "version": "1.0.2" }, { "package": "ghc-prim", - "version": "0.6.1" + "version": "0.10.0" }, { - "package": "integer-gmp", - "version": "1.0.3.0" + "package": "ghc-bignum", + "version": "1.3" }, { "package": "base", - "version": "4.14.3.0" + "version": "4.18.2.1" }, { "package": "array", - "version": "0.5.4.0" + "version": "0.5.6.0" }, { "package": "deepseq", - "version": "1.4.4.0" - }, - { - "package": "containers", - "version": "0.6.5.1" + "version": "1.4.8.1" }, { "package": "ghc-boot-th", - "version": "8.10.7" + "version": "9.6.6" }, { "package": "pretty", @@ -38,88 +34,66 @@ }, { "package": "template-haskell", - "version": "2.16.0.0" + "version": "2.20.0.0" + }, + { + "package": "containers", + "version": "0.6.7" + }, + { + "package": "bytestring", + "version": "0.11.5.3" }, { "package": "transformers", - "version": "0.5.6.2" + "version": "0.6.1.0" }, { "package": "mtl", - "version": "2.2.2" + "version": "2.3.1" }, { "package": "stm", - "version": "2.5.0.1" + "version": "2.5.1.0" }, { "package": "exceptions", - "version": "0.10.4" + "version": "0.10.7" + }, + { + "package": "filepath", + "version": "1.4.300.1" }, { "package": "time", - "version": "1.9.3" - } - ], - "dependencies": [ + "version": "1.12.2" + }, { - "cabal_sha256": "a4a1975fde77e289b605c45a3ef78d731d8c1834e4cef311152d910a1e94d98c", - "component": "lib:data-array-byte", - "flags": [], - "package": "data-array-byte", - "revision": 3, - "source": "hackage", - "src_sha256": "1bb6eca0b3e02d057fe7f4e14c81ef395216f421ab30fdaa1b18017c9c025600", - "version": "0.1.0.1" + "package": "unix", + "version": "2.8.4.0" }, { - "cabal_sha256": "98e79e1c97117143e4012983509ec95f7e5e4f6adff6914d07812a39f83404b9", - "component": "lib:bytestring", - "flags": [ - "-pure-haskell" - ], - "package": "bytestring", - "revision": 1, - "source": "hackage", - "src_sha256": "ebc3b8a6ef74a5cd6ddbb8d447d1c9a5fd4964c7975ebcae0b8ab0bcc406cc8c", - "version": "0.12.1.0" + "package": "directory", + "version": "1.3.8.5" }, { - "cabal_sha256": "d9e181e1acae0ac505d8b217dec3805c68554878f1e32b3d8351b9ce17061623", - "component": "lib:filepath", - "flags": [ - "-cpphs" - ], - "package": "filepath", - "revision": 0, - "source": "hackage", - "src_sha256": "337a0b5bcf0898cb7f51ff327528cf26f4ac38baed7b66b28fbdea334699d8ed", - "version": "1.4.300.1" + "package": "binary", + "version": "0.8.9.1" }, { - "cabal_sha256": "3f702a252a313a7bcb56e3908a14e7f9f1b40e41b7bdc8ae8a9605a1a8686f06", - "component": "lib:unix", - "flags": [ - "-os-string" - ], - "package": "unix", - "revision": 0, - "source": "hackage", - "src_sha256": "5ab6c346aef2eb9bf80b4d29ca7e22063fc23e52fd69fbc4d18a9f98b154e424", - "version": "2.8.5.1" + "package": "text", + "version": "2.0.2" }, { - "cabal_sha256": "ae1730011f547153bb52139f217d1d524202b3da730a369660fc539e5dcfff31", - "component": "lib:directory", - "flags": [ - "-os-string" - ], - "package": "directory", - "revision": 0, - "source": "hackage", - "src_sha256": "a4e798a4e5339a7aa9577515886271386280bfbc1fe4a29fd4aa6464d4792064", - "version": "1.3.8.4" + "package": "parsec", + "version": "3.1.16.1" }, + { + "package": "process", + "version": "1.6.19.0" + } + ], + "dependencies": [ { "cabal_sha256": "de553eefe0b6548a560e9d8100486310548470a403c1fa21108dd03713da5fc7", "component": "exe:alex", @@ -130,40 +104,6 @@ "src_sha256": "c92efe86f8eb959ee03be6c04ee57ebc7e4abc75a6c4b26551215d7443e92a07", "version": "3.5.1.0" }, - { - "cabal_sha256": "03381e511429c44d13990c6d76281c4fc2468371cede4fe684b0c98d9b7d5f5a", - "component": "lib:binary", - "flags": [], - "package": "binary", - "revision": 0, - "source": "hackage", - "src_sha256": "8437116b4eccdba13cb9badb62331c0d4598c3f0252a587e37d8f5990d9bf74c", - "version": "0.8.9.2" - }, - { - "cabal_sha256": "aa7a5a92fe430a34d24d33878323c8a010021e05e410fe98b7fac3015c88dc74", - "component": "lib:text", - "flags": [ - "-developer", - "-pure-haskell", - "+simdutf" - ], - "package": "text", - "revision": 0, - "source": "hackage", - "src_sha256": "e40cdda8b285f4d72476ed35dc2f5f167d524e6b38bb5ec964d00ee1ff24feab", - "version": "2.1.1" - }, - { - "cabal_sha256": "8407cbd428d7f640a0fff8891bd2f7aca13cebe70a5e654856f8abec9a648b56", - "component": "lib:parsec", - "flags": [], - "package": "parsec", - "revision": 1, - "source": "hackage", - "src_sha256": "58c500bec1ec3c849c8243ddfd675a5983b17a8e5da55acea6adade5ae179d36", - "version": "3.1.17.0" - }, { "cabal_sha256": null, "component": "lib:Cabal-syntax", @@ -172,17 +112,7 @@ "revision": null, "source": "local", "src_sha256": null, - "version": "3.13.0.0" - }, - { - "cabal_sha256": "7785a72bc140ae5a9ef2439f10637b5fd104999832f1d93328d4973f37cb8469", - "component": "lib:process", - "flags": [], - "package": "process", - "revision": 0, - "source": "hackage", - "src_sha256": "b468355ab46966537eb171ed5593a0a1facc8d2eefc38659e43768f68f5dcb96", - "version": "1.6.19.0" + "version": "3.15.0.0" }, { "cabal_sha256": null, @@ -192,7 +122,7 @@ "revision": null, "source": "local", "src_sha256": null, - "version": "3.13.0.0" + "version": "3.15.0.0" }, { "cabal_sha256": null, @@ -217,7 +147,7 @@ "version": "0.68.10" }, { - "cabal_sha256": "25440c1bbd5772fdbbeec068f20138121131e1a56453db0adc113dcdf9044105", + "cabal_sha256": "17b834d2b75df8a8aef05de523280f613bb9c9aa9c31f269d5b90c1431a3749b", "component": "lib:network", "flags": [ "-devel" @@ -225,15 +155,15 @@ "package": "network", "revision": 0, "source": "hackage", - "src_sha256": "c45696744dc437d93a56871a3dd869965b7b50eda3fe3c1a90a35e2fbb9cb9ca", - "version": "3.2.0.0" + "src_sha256": "efb04947946f52cccba802c2a8fc2f4259f0bdfd0bce95094c84e71583647f0c", + "version": "3.2.2.0" }, { - "cabal_sha256": "0a6ee328b71119d7dfcd004f0ec8feb77e6e78d8f6de1a281568edd3d3b6d83f", + "cabal_sha256": "129a59ba3ccfcd06192fd6da899e2711ae276a466915a047bd6727e4a0321d2e", "component": "lib:th-compat", "flags": [], "package": "th-compat", - "revision": 1, + "revision": 2, "source": "hackage", "src_sha256": "81f55fafc7afad7763c09cb8b7b4165ca3765edcf70ffa42c7393043a1382a1e", "version": "0.1.5" @@ -264,36 +194,36 @@ "version": "4000.4.1" }, { - "cabal_sha256": "c4733d09f798fc4304e936924a1a7d9fc2425aefad6c46ad4592035254b46051", - "component": "lib:base-orphans", + "cabal_sha256": "7699e7ae9bf74d056a62f384ceef8dfb2aa660f3f7c8016e9703f3b995e5e030", + "component": "lib:os-string", "flags": [], - "package": "base-orphans", + "package": "os-string", "revision": 0, "source": "hackage", - "src_sha256": "5bbf2da382c5b212d6a8be2f8c49edee0eba30f272a15fd32c13e6e4091ef172", - "version": "0.9.1" + "src_sha256": "22fcc7d5fc66676b5dfc57b714d2caf93cce2d5a79d242168352f9eb0fe2f18a", + "version": "2.0.6" }, { - "cabal_sha256": "ae22238274c572aa91e90c6c353e7206386708912ac5e6dc40ac61d1dcc553db", + "cabal_sha256": "fc68b07d957ade5a0a0beadd560a8d093ceac30b2f35c85eed3bcf7889a25975", "component": "lib:hashable", "flags": [ - "+integer-gmp", + "-arch-native", "-random-initial-seed" ], "package": "hashable", - "revision": 1, + "revision": 0, "source": "hackage", - "src_sha256": "1fa3d64548440942b2b38b99c76d8dcaa94fa2ea3912cd7a6354ea4ec4af4758", - "version": "1.4.4.0" + "src_sha256": "e58b3a8e18da5f6cd7e937e5fd683e500bb1f8276b3768269759119ca0cddb6a", + "version": "1.5.0.0" }, { - "cabal_sha256": "9d5d9e605f52958d099e13a8b8f30ee56cb137c9192996245e3c533adb682cf8", + "cabal_sha256": "cf9e6afba8e01830ca0d32a12b98d481cf389688762c80d1870a1db2061ebf35", "component": "lib:async", "flags": [ "-bench" ], "package": "async", - "revision": 1, + "revision": 2, "source": "hackage", "src_sha256": "1818473ebab9212afad2ed76297aefde5fae8b5d4404daf36939aece6a8f16f7", "version": "2.2.5" @@ -361,17 +291,17 @@ "revision": null, "source": "local", "src_sha256": null, - "version": "3.13.0.0" + "version": "3.15.0.0" }, { - "cabal_sha256": "200d756a7b3bab7ca2bac6eb50ed8252f26de77ac8def490a3ad743f2933acbd", + "cabal_sha256": "acb64f2af52d81b0bb92c266f11d43def726a7a7b74a2c23d219e160b54edec7", "component": "lib:cryptohash-sha256", "flags": [ "-exe", "+use-cbits" ], "package": "cryptohash-sha256", - "revision": 4, + "revision": 5, "source": "hackage", "src_sha256": "73a7dc7163871a80837495039a099967b11f5c4fe70a118277842f7a713c6bf6", "version": "0.11.102.1" @@ -404,70 +334,60 @@ "version": "0.0.5.0" }, { - "cabal_sha256": "17786545dce60c4d5783ba6125c0a6499a1abddd3d7417b15500ccd767c35f07", + "cabal_sha256": "8a3004c2de2a0b5ef0634d3da6eae62ba8d8a734bab9ed8c6cfd749e7ca08997", "component": "lib:lukko", "flags": [ "+ofd-locking" ], "package": "lukko", - "revision": 5, - "source": "hackage", - "src_sha256": "a80efb60cfa3dae18682c01980d76d5f7e413e191cd186992e1bf7388d48ab1f", - "version": "0.1.1.3" - }, - { - "cabal_sha256": "32fa47f8345a2c0662fb602fc42e4b674e41ec48079b68bdecb4b6f68032c24e", - "component": "lib:os-string", - "flags": [], - "package": "os-string", "revision": 0, "source": "hackage", - "src_sha256": "0953126e962966719753c98d71f596f5fea07e100bce191b7453735a1ff2caa1", - "version": "2.0.2" + "src_sha256": "72d86f8aa625b461f4397f737346f78a1700a7ffbff55cf6375c5e18916e986d", + "version": "0.1.2" }, { - "cabal_sha256": "619828cae098a7b6deeb0316e12f55011101d88f756787ed024ceedb81cf1eba", + "cabal_sha256": "e9f151d9999be8953443e730524b2792e9c0a4fb5b1463097fa1a8230870fd8a", "component": "lib:tar-internal", "flags": [], "package": "tar", - "revision": 0, + "revision": 1, "source": "hackage", - "src_sha256": "08c61e82b59ed6fe7e85e9fe7cceaaf853ba54511d1ec57efa511ddc55ef1998", - "version": "0.6.2.0" + "src_sha256": "50bb660feec8a524416d6934251b996eaa7e39d49ae107ad505ab700d43f6814", + "version": "0.6.3.0" }, { - "cabal_sha256": "619828cae098a7b6deeb0316e12f55011101d88f756787ed024ceedb81cf1eba", + "cabal_sha256": "e9f151d9999be8953443e730524b2792e9c0a4fb5b1463097fa1a8230870fd8a", "component": "lib:tar", "flags": [], "package": "tar", - "revision": 0, + "revision": 1, "source": "hackage", - "src_sha256": "08c61e82b59ed6fe7e85e9fe7cceaaf853ba54511d1ec57efa511ddc55ef1998", - "version": "0.6.2.0" + "src_sha256": "50bb660feec8a524416d6934251b996eaa7e39d49ae107ad505ab700d43f6814", + "version": "0.6.3.0" }, { - "cabal_sha256": "64a1925c93e9a26cd4c40c470736950c4b5ea7bae68418cb996c5c7df4873cba", + "cabal_sha256": "bae1c5a6092d65c5e763246f91e04fef3f43e37cb055130725c9a973c88a250f", "component": "lib:zlib", "flags": [ "-bundled-c-zlib", "+non-blocking-ffi", - "-pkg-config" + "+pkg-config" ], "package": "zlib", "revision": 1, "source": "hackage", - "src_sha256": "7e43c205e1e1ff5a4b033086ec8cce82ab658879e977c8ba02a6701946ff7a47", - "version": "0.7.0.0" + "src_sha256": "6edd38b6b81df8d274952aa85affa6968ae86b2231e1d429ce8bc9083e6a55bc", + "version": "0.7.1.0" }, { - "cabal_sha256": "8ff70524314f9ad706f8e5051d7150ee44cb82170147879b245bdab279604b16", + "cabal_sha256": "a7311a70ce2cc820ee430c389f57f82a082f148230b37526c34eac72b7b3ff34", "component": "lib:hackage-security", "flags": [ "+cabal-syntax", "+lukko" ], "package": "hackage-security", - "revision": 1, + "revision": 4, "source": "hackage", "src_sha256": "2e4261576b3e11b9f5175392947f56a638cc1a3584b8acbb962b809d7c69db69", "version": "0.6.2.6" @@ -525,11 +445,11 @@ "version": "0.1.7.4" }, { - "cabal_sha256": "a8f76076a40409a36ee975970c53273c2089aec9d9ece8168dfc736dfec24b9d", + "cabal_sha256": "2de5218cef72b8ef090bd7d0fd930ffa143242a120c62e013b5cf039858f1855", "component": "lib:semaphore-compat", "flags": [], "package": "semaphore-compat", - "revision": 2, + "revision": 3, "source": "hackage", "src_sha256": "1c6e6fab021c2ccee5d86112fb1c0bd016d15e0cf70c489dae5fb5ec156ed9e2", "version": "1.0.0" @@ -545,7 +465,7 @@ "revision": null, "source": "local", "src_sha256": null, - "version": "3.13.0.0" + "version": "3.15.0.0" }, { "cabal_sha256": null, @@ -558,7 +478,7 @@ "revision": null, "source": "local", "src_sha256": null, - "version": "3.13.0.0" + "version": "3.15.0.0" }, { "cabal_sha256": "e4be4a206f5ab6ddb5ae4fbb39101529196e20af5670c5d33326fea6eff886fd", diff --git a/bootstrap/linux-9.8.2.json b/bootstrap/linux-9.8.2.json index 9876089e798..16d252dc833 100644 --- a/bootstrap/linux-9.8.2.json +++ b/bootstrap/linux-9.8.2.json @@ -116,7 +116,7 @@ "revision": null, "source": "local", "src_sha256": null, - "version": "3.13.0.0" + "version": "3.15.0.0" }, { "cabal_sha256": null, @@ -126,7 +126,7 @@ "revision": null, "source": "local", "src_sha256": null, - "version": "3.13.0.0" + "version": "3.15.0.0" }, { "cabal_sha256": null, @@ -151,7 +151,7 @@ "version": "0.68.10" }, { - "cabal_sha256": "25440c1bbd5772fdbbeec068f20138121131e1a56453db0adc113dcdf9044105", + "cabal_sha256": "17b834d2b75df8a8aef05de523280f613bb9c9aa9c31f269d5b90c1431a3749b", "component": "lib:network", "flags": [ "-devel" @@ -159,15 +159,15 @@ "package": "network", "revision": 0, "source": "hackage", - "src_sha256": "c45696744dc437d93a56871a3dd869965b7b50eda3fe3c1a90a35e2fbb9cb9ca", - "version": "3.2.0.0" + "src_sha256": "efb04947946f52cccba802c2a8fc2f4259f0bdfd0bce95094c84e71583647f0c", + "version": "3.2.2.0" }, { - "cabal_sha256": "0a6ee328b71119d7dfcd004f0ec8feb77e6e78d8f6de1a281568edd3d3b6d83f", + "cabal_sha256": "129a59ba3ccfcd06192fd6da899e2711ae276a466915a047bd6727e4a0321d2e", "component": "lib:th-compat", "flags": [], "package": "th-compat", - "revision": 1, + "revision": 2, "source": "hackage", "src_sha256": "81f55fafc7afad7763c09cb8b7b4165ca3765edcf70ffa42c7393043a1382a1e", "version": "0.1.5" @@ -198,36 +198,36 @@ "version": "4000.4.1" }, { - "cabal_sha256": "32fa47f8345a2c0662fb602fc42e4b674e41ec48079b68bdecb4b6f68032c24e", + "cabal_sha256": "7699e7ae9bf74d056a62f384ceef8dfb2aa660f3f7c8016e9703f3b995e5e030", "component": "lib:os-string", "flags": [], "package": "os-string", "revision": 0, "source": "hackage", - "src_sha256": "0953126e962966719753c98d71f596f5fea07e100bce191b7453735a1ff2caa1", - "version": "2.0.2" + "src_sha256": "22fcc7d5fc66676b5dfc57b714d2caf93cce2d5a79d242168352f9eb0fe2f18a", + "version": "2.0.6" }, { - "cabal_sha256": "ae22238274c572aa91e90c6c353e7206386708912ac5e6dc40ac61d1dcc553db", + "cabal_sha256": "fc68b07d957ade5a0a0beadd560a8d093ceac30b2f35c85eed3bcf7889a25975", "component": "lib:hashable", "flags": [ - "+integer-gmp", + "-arch-native", "-random-initial-seed" ], "package": "hashable", - "revision": 1, + "revision": 0, "source": "hackage", - "src_sha256": "1fa3d64548440942b2b38b99c76d8dcaa94fa2ea3912cd7a6354ea4ec4af4758", - "version": "1.4.4.0" + "src_sha256": "e58b3a8e18da5f6cd7e937e5fd683e500bb1f8276b3768269759119ca0cddb6a", + "version": "1.5.0.0" }, { - "cabal_sha256": "9d5d9e605f52958d099e13a8b8f30ee56cb137c9192996245e3c533adb682cf8", + "cabal_sha256": "cf9e6afba8e01830ca0d32a12b98d481cf389688762c80d1870a1db2061ebf35", "component": "lib:async", "flags": [ "-bench" ], "package": "async", - "revision": 1, + "revision": 2, "source": "hackage", "src_sha256": "1818473ebab9212afad2ed76297aefde5fae8b5d4404daf36939aece6a8f16f7", "version": "2.2.5" @@ -295,17 +295,17 @@ "revision": null, "source": "local", "src_sha256": null, - "version": "3.13.0.0" + "version": "3.15.0.0" }, { - "cabal_sha256": "200d756a7b3bab7ca2bac6eb50ed8252f26de77ac8def490a3ad743f2933acbd", + "cabal_sha256": "acb64f2af52d81b0bb92c266f11d43def726a7a7b74a2c23d219e160b54edec7", "component": "lib:cryptohash-sha256", "flags": [ "-exe", "+use-cbits" ], "package": "cryptohash-sha256", - "revision": 4, + "revision": 5, "source": "hackage", "src_sha256": "73a7dc7163871a80837495039a099967b11f5c4fe70a118277842f7a713c6bf6", "version": "0.11.102.1" @@ -338,60 +338,60 @@ "version": "0.0.5.0" }, { - "cabal_sha256": "17786545dce60c4d5783ba6125c0a6499a1abddd3d7417b15500ccd767c35f07", + "cabal_sha256": "8a3004c2de2a0b5ef0634d3da6eae62ba8d8a734bab9ed8c6cfd749e7ca08997", "component": "lib:lukko", "flags": [ "+ofd-locking" ], "package": "lukko", - "revision": 5, + "revision": 0, "source": "hackage", - "src_sha256": "a80efb60cfa3dae18682c01980d76d5f7e413e191cd186992e1bf7388d48ab1f", - "version": "0.1.1.3" + "src_sha256": "72d86f8aa625b461f4397f737346f78a1700a7ffbff55cf6375c5e18916e986d", + "version": "0.1.2" }, { - "cabal_sha256": "619828cae098a7b6deeb0316e12f55011101d88f756787ed024ceedb81cf1eba", + "cabal_sha256": "e9f151d9999be8953443e730524b2792e9c0a4fb5b1463097fa1a8230870fd8a", "component": "lib:tar-internal", "flags": [], "package": "tar", - "revision": 0, + "revision": 1, "source": "hackage", - "src_sha256": "08c61e82b59ed6fe7e85e9fe7cceaaf853ba54511d1ec57efa511ddc55ef1998", - "version": "0.6.2.0" + "src_sha256": "50bb660feec8a524416d6934251b996eaa7e39d49ae107ad505ab700d43f6814", + "version": "0.6.3.0" }, { - "cabal_sha256": "619828cae098a7b6deeb0316e12f55011101d88f756787ed024ceedb81cf1eba", + "cabal_sha256": "e9f151d9999be8953443e730524b2792e9c0a4fb5b1463097fa1a8230870fd8a", "component": "lib:tar", "flags": [], "package": "tar", - "revision": 0, + "revision": 1, "source": "hackage", - "src_sha256": "08c61e82b59ed6fe7e85e9fe7cceaaf853ba54511d1ec57efa511ddc55ef1998", - "version": "0.6.2.0" + "src_sha256": "50bb660feec8a524416d6934251b996eaa7e39d49ae107ad505ab700d43f6814", + "version": "0.6.3.0" }, { - "cabal_sha256": "64a1925c93e9a26cd4c40c470736950c4b5ea7bae68418cb996c5c7df4873cba", + "cabal_sha256": "bae1c5a6092d65c5e763246f91e04fef3f43e37cb055130725c9a973c88a250f", "component": "lib:zlib", "flags": [ "-bundled-c-zlib", "+non-blocking-ffi", - "-pkg-config" + "+pkg-config" ], "package": "zlib", "revision": 1, "source": "hackage", - "src_sha256": "7e43c205e1e1ff5a4b033086ec8cce82ab658879e977c8ba02a6701946ff7a47", - "version": "0.7.0.0" + "src_sha256": "6edd38b6b81df8d274952aa85affa6968ae86b2231e1d429ce8bc9083e6a55bc", + "version": "0.7.1.0" }, { - "cabal_sha256": "8ff70524314f9ad706f8e5051d7150ee44cb82170147879b245bdab279604b16", + "cabal_sha256": "a7311a70ce2cc820ee430c389f57f82a082f148230b37526c34eac72b7b3ff34", "component": "lib:hackage-security", "flags": [ "+cabal-syntax", "+lukko" ], "package": "hackage-security", - "revision": 1, + "revision": 4, "source": "hackage", "src_sha256": "2e4261576b3e11b9f5175392947f56a638cc1a3584b8acbb962b809d7c69db69", "version": "0.6.2.6" @@ -459,7 +459,7 @@ "revision": null, "source": "local", "src_sha256": null, - "version": "3.13.0.0" + "version": "3.15.0.0" }, { "cabal_sha256": null, @@ -472,7 +472,7 @@ "revision": null, "source": "local", "src_sha256": null, - "version": "3.13.0.0" + "version": "3.15.0.0" }, { "cabal_sha256": "e4be4a206f5ab6ddb5ae4fbb39101529196e20af5670c5d33326fea6eff886fd", diff --git a/buildinfo-reference-generator/buildinfo-reference-generator.cabal b/buildinfo-reference-generator/buildinfo-reference-generator.cabal index 667e8346b63..a09fc4dc62c 100644 --- a/buildinfo-reference-generator/buildinfo-reference-generator.cabal +++ b/buildinfo-reference-generator/buildinfo-reference-generator.cabal @@ -8,7 +8,7 @@ executable buildinfo-reference-generator ghc-options: -Wall main-is: Main.hs build-depends: - , base >=4.11 && <4.20 + , base >=4.11 && <4.22 , Cabal , Cabal-described , containers diff --git a/cabal-dev-scripts/cabal-dev-scripts.cabal b/cabal-dev-scripts/cabal-dev-scripts.cabal index 399888dfb8d..5ae899febe1 100644 --- a/cabal-dev-scripts/cabal-dev-scripts.cabal +++ b/cabal-dev-scripts/cabal-dev-scripts.cabal @@ -18,7 +18,7 @@ executable gen-spdx ghc-options: -Wall build-depends: , aeson ^>=1.4.1.0 || ^>=1.5.2.0 || ^>=2.2.1.0 - , base >=4.11 && <4.20 + , base >=4.13 && <4.20 , bytestring , containers , Diff ^>=0.4 @@ -35,7 +35,7 @@ executable gen-spdx-exc ghc-options: -Wall build-depends: , aeson ^>=1.4.1.0 || ^>=1.5.2.0 || ^>=2.2.1.0 - , base >=4.11 && <4.20 + , base >=4.13 && <4.20 , bytestring , containers , Diff ^>=0.4 diff --git a/cabal-dev-scripts/src/GenSPDX.hs b/cabal-dev-scripts/src/GenSPDX.hs index adb3276a1bd..083dbf7c951 100644 --- a/cabal-dev-scripts/src/GenSPDX.hs +++ b/cabal-dev-scripts/src/GenSPDX.hs @@ -36,6 +36,7 @@ main = generate =<< O.execParser opts where <*> licenses "3.10" <*> licenses "3.16" <*> licenses "3.23" + <*> licenses "3.25" template = O.strArgument $ mconcat [ O.metavar "SPDX.LicenseId.template.hs" diff --git a/cabal-dev-scripts/src/GenSPDXExc.hs b/cabal-dev-scripts/src/GenSPDXExc.hs index c85438a828b..a9a08717818 100644 --- a/cabal-dev-scripts/src/GenSPDXExc.hs +++ b/cabal-dev-scripts/src/GenSPDXExc.hs @@ -35,6 +35,7 @@ main = generate =<< O.execParser opts where <*> licenses "3.10" <*> licenses "3.16" <*> licenses "3.23" + <*> licenses "3.25" template = O.strArgument $ mconcat [ O.metavar "SPDX.LicenseExceptionId.template.hs" diff --git a/cabal-dev-scripts/src/GenUtils.hs b/cabal-dev-scripts/src/GenUtils.hs index 7d7b39c2add..17b4669c837 100644 --- a/cabal-dev-scripts/src/GenUtils.hs +++ b/cabal-dev-scripts/src/GenUtils.hs @@ -15,6 +15,7 @@ import Data.Text (Text) import GHC.Generics (Generic) import qualified Data.Algorithm.Diff as Diff +import qualified Data.Char as C import qualified Data.Map as Map import qualified Data.Set as Set import qualified Data.Text as T @@ -33,12 +34,14 @@ data SPDXLicenseListVersion | SPDXLicenseListVersion_3_10 | SPDXLicenseListVersion_3_16 | SPDXLicenseListVersion_3_23 + | SPDXLicenseListVersion_3_25 deriving (Eq, Ord, Show, Enum, Bounded) allVers :: Set.Set SPDXLicenseListVersion allVers = Set.fromList [minBound .. maxBound] prettyVer :: SPDXLicenseListVersion -> Text +prettyVer SPDXLicenseListVersion_3_25 = "SPDX License List 3.25" prettyVer SPDXLicenseListVersion_3_23 = "SPDX License List 3.23" prettyVer SPDXLicenseListVersion_3_16 = "SPDX License List 3.16" prettyVer SPDXLicenseListVersion_3_10 = "SPDX License List 3.10" @@ -48,6 +51,7 @@ prettyVer SPDXLicenseListVersion_3_2 = "SPDX License List 3.2" prettyVer SPDXLicenseListVersion_3_0 = "SPDX License List 3.0" suffixVer :: SPDXLicenseListVersion -> String +suffixVer SPDXLicenseListVersion_3_25 = "_3_25" suffixVer SPDXLicenseListVersion_3_23 = "_3_23" suffixVer SPDXLicenseListVersion_3_16 = "_3_16" suffixVer SPDXLicenseListVersion_3_10 = "_3_10" @@ -60,7 +64,7 @@ suffixVer SPDXLicenseListVersion_3_0 = "_3_0" -- Per version ------------------------------------------------------------------------------- -data PerV a = PerV a a a a a a a +data PerV a = PerV a a a a a a a a deriving (Show, Functor, Foldable, Traversable) class Functor f => Representable i f | f -> i where @@ -68,13 +72,14 @@ class Functor f => Representable i f | f -> i where tabulate :: (i -> a) -> f a instance Representable SPDXLicenseListVersion PerV where - index SPDXLicenseListVersion_3_0 (PerV x _ _ _ _ _ _) = x - index SPDXLicenseListVersion_3_2 (PerV _ x _ _ _ _ _) = x - index SPDXLicenseListVersion_3_6 (PerV _ _ x _ _ _ _) = x - index SPDXLicenseListVersion_3_9 (PerV _ _ _ x _ _ _) = x - index SPDXLicenseListVersion_3_10 (PerV _ _ _ _ x _ _) = x - index SPDXLicenseListVersion_3_16 (PerV _ _ _ _ _ x _) = x - index SPDXLicenseListVersion_3_23 (PerV _ _ _ _ _ _ x) = x + index SPDXLicenseListVersion_3_0 (PerV x _ _ _ _ _ _ _) = x + index SPDXLicenseListVersion_3_2 (PerV _ x _ _ _ _ _ _) = x + index SPDXLicenseListVersion_3_6 (PerV _ _ x _ _ _ _ _) = x + index SPDXLicenseListVersion_3_9 (PerV _ _ _ x _ _ _ _) = x + index SPDXLicenseListVersion_3_10 (PerV _ _ _ _ x _ _ _) = x + index SPDXLicenseListVersion_3_16 (PerV _ _ _ _ _ x _ _) = x + index SPDXLicenseListVersion_3_23 (PerV _ _ _ _ _ _ x _) = x + index SPDXLicenseListVersion_3_25 (PerV _ _ _ _ _ _ _ x) = x tabulate f = PerV (f SPDXLicenseListVersion_3_0) @@ -84,6 +89,7 @@ instance Representable SPDXLicenseListVersion PerV where (f SPDXLicenseListVersion_3_10) (f SPDXLicenseListVersion_3_16) (f SPDXLicenseListVersion_3_23) + (f SPDXLicenseListVersion_3_25) ------------------------------------------------------------------------------- -- Sorting @@ -160,9 +166,10 @@ toConstructorName t = t f c = c special :: Text -> Text - special "0BSD" = "NullBSD" - special "389_exception" = "DS389_exception" - special u = u + special u + | Just (c, _) <- T.uncons u + , C.isDigit c = "N_" <> u + special u = u mkList :: [Text] -> Text mkList [] = " []" diff --git a/cabal-install-solver/ChangeLog.md b/cabal-install-solver/ChangeLog.md index 3bfdd653afe..978ac0f1b07 100644 --- a/cabal-install-solver/ChangeLog.md +++ b/cabal-install-solver/ChangeLog.md @@ -1 +1 @@ -Please see https://github.com/haskell/cabal/blob/master/release-notes/cabal-install-3.10.3.0.md +Please see https://github.com/haskell/cabal/blob/master/release-notes/cabal-install-3.14.0.0.md diff --git a/cabal-install-solver/cabal-install-solver.cabal b/cabal-install-solver/cabal-install-solver.cabal index 6918f739b88..a96b787f55e 100644 --- a/cabal-install-solver/cabal-install-solver.cabal +++ b/cabal-install-solver/cabal-install-solver.cabal @@ -1,9 +1,9 @@ cabal-version: 2.2 name: cabal-install-solver -version: 3.13.0.0 -synopsis: The command-line interface for Cabal and Hackage. +version: 3.15.0.0 +synopsis: The solver component of cabal-install description: - The solver component used in cabal-install command-line program + The solver component used in the cabal-install command-line program. homepage: http://www.haskell.org/cabal/ bug-reports: https://github.com/haskell/cabal/issues @@ -99,10 +99,10 @@ library build-depends: , array >=0.4 && <0.6 - , base >=4.11 && <4.21 + , base >=4.13 && <4.22 , bytestring >=0.10.6.0 && <0.13 - , Cabal ^>=3.13 - , Cabal-syntax ^>=3.13 + , Cabal ^>=3.15 + , Cabal-syntax ^>=3.15 , containers >=0.5.6.2 && <0.8 , edit-distance ^>= 0.2.2 , directory >= 1.3.7.0 && < 1.4 @@ -131,9 +131,9 @@ Test-Suite unit-tests UnitTests.Distribution.Solver.Modular.MessageUtils build-depends: - , base >= 4.11 && <4.21 + , base >= 4.13 && <4.22 , Cabal-syntax , cabal-install-solver , tasty >= 1.2.3 && <1.6 - , tasty-quickcheck + , tasty-quickcheck <0.12 , tasty-hunit >= 0.10 diff --git a/cabal-install-solver/src/Distribution/Solver/Modular.hs b/cabal-install-solver/src/Distribution/Solver/Modular.hs index 2aac240318f..9111b2d78d0 100644 --- a/cabal-install-solver/src/Distribution/Solver/Modular.hs +++ b/cabal-install-solver/src/Distribution/Solver/Modular.hs @@ -116,7 +116,7 @@ modularResolver sc (Platform arch os) cinfo iidx sidx pkgConfigDB pprefs pcs pns solve' :: SolverConfig -> CompilerInfo -> Index - -> PkgConfigDb + -> Maybe PkgConfigDb -> (PN -> PackagePreferences) -> Map PN [LabeledPackageConstraint] -> Set PN diff --git a/cabal-install-solver/src/Distribution/Solver/Modular/Message.hs b/cabal-install-solver/src/Distribution/Solver/Modular/Message.hs index e097d3e081c..70b13cbec5c 100644 --- a/cabal-install-solver/src/Distribution/Solver/Modular/Message.hs +++ b/cabal-install-solver/src/Distribution/Solver/Modular/Message.hs @@ -279,6 +279,7 @@ showFR :: ConflictSet -> FailReason -> String showFR _ (UnsupportedExtension ext) = " (conflict: requires " ++ showUnsupportedExtension ext ++ ")" showFR _ (UnsupportedLanguage lang) = " (conflict: requires " ++ showUnsupportedLanguage lang ++ ")" showFR _ (MissingPkgconfigPackage pn vr) = " (conflict: pkg-config package " ++ prettyShow pn ++ prettyShow vr ++ ", not found in the pkg-config database)" +showFR _ (MissingPkgconfigProgram pn vr) = " (pkg-config package " ++ prettyShow pn ++ prettyShow vr ++ " is needed but no pkg-config executable was found or querying it failed)" showFR _ (NewPackageDoesNotMatchExistingConstraint d) = " (conflict: " ++ showConflictingDep d ++ ")" showFR _ (ConflictingConstraints d1 d2) = " (conflict: " ++ L.intercalate ", " (L.map showConflictingDep [d1, d2]) ++ ")" showFR _ (NewPackageIsMissingRequiredComponent comp dr) = " (does not contain " ++ showExposedComponent comp ++ ", which is required by " ++ showDependencyReason dr ++ ")" diff --git a/cabal-install-solver/src/Distribution/Solver/Modular/Solver.hs b/cabal-install-solver/src/Distribution/Solver/Modular/Solver.hs index 39bd7bf4690..b57f55af1fc 100644 --- a/cabal-install-solver/src/Distribution/Solver/Modular/Solver.hs +++ b/cabal-install-solver/src/Distribution/Solver/Modular/Solver.hs @@ -91,7 +91,7 @@ newtype PruneAfterFirstSuccess = PruneAfterFirstSuccess Bool solve :: SolverConfig -- ^ solver parameters -> CompilerInfo -> Index -- ^ all available packages as an index - -> PkgConfigDb -- ^ available pkg-config pkgs + -> Maybe PkgConfigDb -- ^ available pkg-config pkgs -> (PN -> PackagePreferences) -- ^ preferences -> M.Map PN [LabeledPackageConstraint] -- ^ global constraints -> S.Set PN -- ^ global goals diff --git a/cabal-install-solver/src/Distribution/Solver/Modular/Tree.hs b/cabal-install-solver/src/Distribution/Solver/Modular/Tree.hs index 10d372525b1..62eb964dc01 100644 --- a/cabal-install-solver/src/Distribution/Solver/Modular/Tree.hs +++ b/cabal-install-solver/src/Distribution/Solver/Modular/Tree.hs @@ -102,6 +102,7 @@ data POption = POption I (Maybe PackagePath) data FailReason = UnsupportedExtension Extension | UnsupportedLanguage Language | MissingPkgconfigPackage PkgconfigName PkgconfigVersionRange + | MissingPkgconfigProgram PkgconfigName PkgconfigVersionRange | NewPackageDoesNotMatchExistingConstraint ConflictingDep | ConflictingConstraints ConflictingDep ConflictingDep | NewPackageIsMissingRequiredComponent ExposedComponent (DependencyReason QPN) diff --git a/cabal-install-solver/src/Distribution/Solver/Modular/Validate.hs b/cabal-install-solver/src/Distribution/Solver/Modular/Validate.hs index cbe6282b6d0..4af149b31cf 100644 --- a/cabal-install-solver/src/Distribution/Solver/Modular/Validate.hs +++ b/cabal-install-solver/src/Distribution/Solver/Modular/Validate.hs @@ -90,7 +90,7 @@ import Distribution.Types.PkgconfigVersionRange data ValidateState = VS { supportedExt :: Extension -> Bool, supportedLang :: Language -> Bool, - presentPkgs :: PkgconfigName -> PkgconfigVersionRange -> Bool, + presentPkgs :: Maybe (PkgconfigName -> PkgconfigVersionRange -> Bool), index :: Index, -- Saved, scoped, dependencies. Every time 'validate' makes a package choice, @@ -383,7 +383,7 @@ extractNewDeps v b fa sa = go -- or the successfully extended assignment. extend :: (Extension -> Bool) -- ^ is a given extension supported -> (Language -> Bool) -- ^ is a given language supported - -> (PkgconfigName -> PkgconfigVersionRange -> Bool) -- ^ is a given pkg-config requirement satisfiable + -> Maybe (PkgconfigName -> PkgconfigVersionRange -> Bool) -- ^ is a given pkg-config requirement satisfiable -> [LDep QPN] -> PPreAssignment -> Either Conflict PPreAssignment @@ -398,8 +398,10 @@ extend extSupported langSupported pkgPresent newactives ppa = foldM extendSingle if langSupported lang then Right a else Left (dependencyReasonToConflictSet dr, UnsupportedLanguage lang) extendSingle a (LDep dr (Pkg pn vr)) = - if pkgPresent pn vr then Right a - else Left (dependencyReasonToConflictSet dr, MissingPkgconfigPackage pn vr) + case (\f -> f pn vr) <$> pkgPresent of + Just True -> Right a + Just False -> Left (dependencyReasonToConflictSet dr, MissingPkgconfigPackage pn vr) + Nothing -> Left (dependencyReasonToConflictSet dr, MissingPkgconfigProgram pn vr) extendSingle a (LDep dr (Dep dep@(PkgComponent qpn _) ci)) = let mergedDep = M.findWithDefault (MergedDepConstrained []) qpn a in case (\ x -> M.insert qpn x a) <$> merge mergedDep (PkgDep dr dep ci) of @@ -561,7 +563,7 @@ extendRequiredComponents eqpn available = foldM extendSingle -- | Interface. -validateTree :: CompilerInfo -> Index -> PkgConfigDb -> Tree d c -> Tree d c +validateTree :: CompilerInfo -> Index -> Maybe PkgConfigDb -> Tree d c -> Tree d c validateTree cinfo idx pkgConfigDb t = runValidate (validate t) VS { supportedExt = maybe (const True) -- if compiler has no list of extensions, we assume everything is supported (\ es -> let s = S.fromList es in \ x -> S.member x s) @@ -569,7 +571,7 @@ validateTree cinfo idx pkgConfigDb t = runValidate (validate t) VS { , supportedLang = maybe (const True) (flip L.elem) -- use list lookup because language list is small and no Ord instance (compilerInfoLanguages cinfo) - , presentPkgs = pkgConfigPkgIsPresent pkgConfigDb + , presentPkgs = pkgConfigPkgIsPresent <$> pkgConfigDb , index = idx , saved = M.empty , pa = PA M.empty M.empty M.empty diff --git a/cabal-install-solver/src/Distribution/Solver/Types/ConstraintSource.hs b/cabal-install-solver/src/Distribution/Solver/Types/ConstraintSource.hs index 3fdf64bde89..cb91bc742b4 100644 --- a/cabal-install-solver/src/Distribution/Solver/Types/ConstraintSource.hs +++ b/cabal-install-solver/src/Distribution/Solver/Types/ConstraintSource.hs @@ -41,6 +41,10 @@ data ConstraintSource = -- from Cabal >= 3.11 | ConstraintSourceMultiRepl + -- | Constraint introduced by --enable-profiling-shared, which requires features + -- from Cabal >= 3.13 + | ConstraintSourceProfiledDynamic + -- | The source of the constraint is not specified. | ConstraintSourceUnknown @@ -72,6 +76,8 @@ showConstraintSource ConstraintSourceConfigFlagOrTarget = "config file, command line flag, or user target" showConstraintSource ConstraintSourceMultiRepl = "--enable-multi-repl" +showConstraintSource ConstraintSourceProfiledDynamic = + "--enable-profiling-shared" showConstraintSource ConstraintSourceUnknown = "unknown source" showConstraintSource ConstraintSetupCabalMinVersion = "minimum version of Cabal used by Setup.hs" diff --git a/cabal-install-solver/src/Distribution/Solver/Types/DependencyResolver.hs b/cabal-install-solver/src/Distribution/Solver/Types/DependencyResolver.hs index e773492ae74..139a6d2b33d 100644 --- a/cabal-install-solver/src/Distribution/Solver/Types/DependencyResolver.hs +++ b/cabal-install-solver/src/Distribution/Solver/Types/DependencyResolver.hs @@ -30,7 +30,7 @@ type DependencyResolver loc = Platform -> CompilerInfo -> InstalledPackageIndex -> PackageIndex (SourcePackage loc) - -> PkgConfigDb + -> Maybe PkgConfigDb -> (PackageName -> PackagePreferences) -> [LabeledPackageConstraint] -> Set PackageName diff --git a/cabal-install-solver/src/Distribution/Solver/Types/PkgConfigDb.hs b/cabal-install-solver/src/Distribution/Solver/Types/PkgConfigDb.hs index 21845eafdec..ccf52ea2c8c 100644 --- a/cabal-install-solver/src/Distribution/Solver/Types/PkgConfigDb.hs +++ b/cabal-install-solver/src/Distribution/Solver/Types/PkgConfigDb.hs @@ -47,15 +47,12 @@ import Distribution.Types.PkgconfigVersionRange import Distribution.Verbosity (Verbosity) -- | The list of packages installed in the system visible to --- @pkg-config@. This is an opaque datatype, to be constructed with --- `readPkgConfigDb` and queried with `pkgConfigPkgPresent`. -data PkgConfigDb = PkgConfigDb (M.Map PkgconfigName (Maybe PkgconfigVersion)) - -- ^ If an entry is `Nothing`, this means that the - -- package seems to be present, but we don't know the - -- exact version (because parsing of the version - -- number failed). - | NoPkgConfigDb - -- ^ For when we could not run pkg-config successfully. +-- @pkg-config@. +-- +-- If an entry is `Nothing`, this means that the package seems to be present, +-- but we don't know the exact version (because parsing of the version number +-- failed). +newtype PkgConfigDb = PkgConfigDb (M.Map PkgconfigName (Maybe PkgconfigVersion)) deriving (Show, Generic, Typeable) instance Binary PkgConfigDb @@ -64,11 +61,11 @@ instance Structured PkgConfigDb -- | Query pkg-config for the list of installed packages, together -- with their versions. Return a `PkgConfigDb` encapsulating this -- information. -readPkgConfigDb :: Verbosity -> ProgramDb -> IO PkgConfigDb +readPkgConfigDb :: Verbosity -> ProgramDb -> IO (Maybe PkgConfigDb) readPkgConfigDb verbosity progdb = handle ioErrorHandler $ do mpkgConfig <- needProgram verbosity pkgConfigProgram progdb case mpkgConfig of - Nothing -> noPkgConfig "Cannot find pkg-config program" + Nothing -> noPkgConfig "cannot find pkg-config program" Just (pkgConfig, _) -> do -- To prevent malformed Unicode in the descriptions from crashing cabal, -- read without interpreting any encoding first. (#9608) @@ -106,7 +103,7 @@ readPkgConfigDb verbosity progdb = handle ioErrorHandler $ do (programInvocation pkgConfig ("--modversion" : pkgNames)) let pkgVersions = lines outs if exitCode == ExitSuccess && length pkgVersions == length pkgNames - then (return . pkgConfigDbFromList . zip pkgNames) pkgVersions + then (return . Just . pkgConfigDbFromList . zip pkgNames) pkgVersions else -- if there's a single broken pc file the above fails, so we fall back -- into calling it individually @@ -116,17 +113,17 @@ readPkgConfigDb verbosity progdb = handle ioErrorHandler $ do -- requested one, we fall back to querying one by one. do info verbosity ("call to pkg-config --modversion on all packages failed. Falling back to querying pkg-config individually on each package") - pkgConfigDbFromList . catMaybes <$> mapM (getIndividualVersion pkgConfig) pkgNames + Just . pkgConfigDbFromList . catMaybes <$> mapM (getIndividualVersion pkgConfig) pkgNames where -- For when pkg-config invocation fails (possibly because of a -- too long command line). noPkgConfig extra = do - info verbosity ("Failed to query pkg-config, Cabal will continue" - ++ " without solving for pkg-config constraints: " + info verbosity ("Warning: Failed to query pkg-config, Cabal will backtrack " + ++ "if a package from pkg-config is requested. Error message: " ++ extra) - return NoPkgConfigDb + return Nothing - ioErrorHandler :: IOException -> IO PkgConfigDb + ioErrorHandler :: IOException -> IO (Maybe PkgConfigDb) ioErrorHandler e = noPkgConfig (show e) getIndividualVersion :: ConfiguredProgram -> String -> IO (Maybe (String, String)) @@ -162,13 +159,6 @@ pkgConfigPkgIsPresent (PkgConfigDb db) pn vr = Nothing -> False -- Package not present in the DB. Just Nothing -> True -- Package present, but version unknown. Just (Just v) -> withinPkgconfigVersionRange v vr --- If we could not read the pkg-config database successfully we fail. --- The plan found by the solver can't be executed later, because pkg-config itself --- is going to be called in the build phase to get the library location for linking --- so even if there is a library, it would need to be passed manual flags anyway. -pkgConfigPkgIsPresent NoPkgConfigDb _ _ = False - - -- | Query the version of a package in the @pkg-config@ database. -- @Nothing@ indicates the package is not in the database, while @@ -176,12 +166,6 @@ pkgConfigPkgIsPresent NoPkgConfigDb _ _ = False -- but its version is not known. pkgConfigDbPkgVersion :: PkgConfigDb -> PkgconfigName -> Maybe (Maybe PkgconfigVersion) pkgConfigDbPkgVersion (PkgConfigDb db) pn = M.lookup pn db --- NB: Since the solver allows solving to succeed if there is --- NoPkgConfigDb, we should report that we *guess* that there --- is a matching pkg-config configuration, but that we just --- don't know about it. -pkgConfigDbPkgVersion NoPkgConfigDb _ = Just Nothing - -- | Query pkg-config for the locations of pkg-config's package files. Use this -- to monitor for changes in the pkg-config DB. diff --git a/cabal-install/cabal-install.cabal b/cabal-install/cabal-install.cabal index f00041aa9e3..9782c9dee81 100644 --- a/cabal-install/cabal-install.cabal +++ b/cabal-install/cabal-install.cabal @@ -1,7 +1,7 @@ Cabal-Version: 3.0 Name: cabal-install -Version: 3.13.0.0 +Version: 3.15.0.0 Synopsis: The command-line interface for Cabal and Hackage. Description: The \'cabal\' command-line program simplifies the process of managing @@ -52,16 +52,16 @@ common warnings ghc-options: -Wnoncanonical-monadfail-instances common base-dep - build-depends: base >=4.11 && <4.21 + build-depends: base >=4.13 && <4.22 common cabal-dep - build-depends: Cabal ^>=3.13 + build-depends: Cabal ^>=3.15 common cabal-syntax-dep - build-depends: Cabal-syntax ^>=3.13 + build-depends: Cabal-syntax ^>=3.15 common cabal-install-solver-dep - build-depends: cabal-install-solver ^>=3.13 + build-depends: cabal-install-solver ^>=3.15 library import: warnings, base-dep, cabal-dep, cabal-syntax-dep, cabal-install-solver-dep @@ -158,6 +158,7 @@ library Distribution.Client.ManpageFlags Distribution.Client.Nix Distribution.Client.NixStyleOptions + Distribution.Client.Outdated Distribution.Client.PackageHash Distribution.Client.ParseUtils Distribution.Client.ProjectBuilding @@ -231,7 +232,7 @@ library edit-distance >= 0.2.2 && < 0.3, exceptions >= 0.10.4 && < 0.11, filepath >= 1.4.0.0 && < 1.6, - hashable >= 1.0 && < 1.5, + hashable >= 1.0 && < 1.6, HTTP >= 4000.1.5 && < 4000.5, mtl >= 2.0 && < 2.4, network-uri >= 2.6.0.2 && < 2.7, @@ -350,7 +351,7 @@ test-suite unit-tests zlib, tasty >= 1.2.3 && <1.6, tasty-golden >=2.3.1.1 && <2.4, - tasty-quickcheck, + tasty-quickcheck ^>=0.11, tasty-expected-failure, tasty-hunit >= 0.10, tree-diff, @@ -399,6 +400,7 @@ test-suite integration-tests2 containers, directory, filepath, + process, tasty >= 1.2.3 && <1.6, tasty-hunit >= 0.10, tagged @@ -438,6 +440,6 @@ test-suite long-tests tasty >= 1.2.3 && <1.6, tasty-expected-failure, tasty-hunit >= 0.10, - tasty-quickcheck, + tasty-quickcheck <0.12, QuickCheck >= 2.14 && <2.16, pretty-show >= 1.6.15 diff --git a/cabal-install/changelog b/cabal-install/changelog index 3fe99c798e6..67711276c8f 100644 --- a/cabal-install/changelog +++ b/cabal-install/changelog @@ -1,6 +1,11 @@ -*-change-log-*- -3.10.2.0 Hécate August 2023 +3.14.0.0 Hécate September 2024 + * See https://github.com/haskell/cabal/blob/master/release-notes/cabal-install-3.14.0.0.md + +3.12.1.0 Artem Pelenitsyn June 2024 + * See https://github.com/haskell/cabal/blob/master/release-notes/cabal-install-3.12.1.0.md + 3.10.3.0 Hécate January 2024 * See https://github.com/haskell/cabal/blob/master/release-notes/cabal-install-3.10.3.0.md diff --git a/cabal-install/src/Distribution/Client/CmdClean.hs b/cabal-install/src/Distribution/Client/CmdClean.hs index 2ffda4dce6a..a738f38336a 100644 --- a/cabal-install/src/Distribution/Client/CmdClean.hs +++ b/cabal-install/src/Distribution/Client/CmdClean.hs @@ -52,6 +52,10 @@ import Distribution.Simple.Utils , info , wrapText ) +import Distribution.System + ( OS (Windows) + , buildOS + ) import Distribution.Utils.Path hiding ( (<.>) , () @@ -60,6 +64,9 @@ import Distribution.Verbosity ( normal ) +import Control.Exception + ( throw + ) import Control.Monad ( forM , forM_ @@ -74,10 +81,15 @@ import System.Directory , listDirectory , removeDirectoryRecursive , removeFile + , removePathForcibly ) import System.FilePath ( () ) +import System.IO.Error + ( isPermissionError + ) +import qualified System.Process as Process data CleanFlags = CleanFlags { cleanSaveConfig :: Flag Bool @@ -168,7 +180,18 @@ cleanAction (ProjectFlags{..}, CleanFlags{..}) extraArgs _ = do let distRoot = distDirectory distLayout info verbosity ("Deleting dist-newstyle (" ++ distRoot ++ ")") - handleDoesNotExist () $ removeDirectoryRecursive distRoot + handleDoesNotExist () $ do + if buildOS == Windows + then do + -- Windows can't delete some git files #10182 + void $ + Process.createProcess_ "attrib" $ + Process.shell $ + "attrib -s -h -r " <> distRoot <> "\\*.* /s /d" + catch + (removePathForcibly distRoot) + (\e -> if isPermissionError e then removePathForcibly distRoot else throw e) + else removeDirectoryRecursive distRoot removeEnvFiles $ distProjectRootDirectory distLayout diff --git a/cabal-install/src/Distribution/Client/CmdHaddockProject.hs b/cabal-install/src/Distribution/Client/CmdHaddockProject.hs index 8c0c21a5427..ca8330b3b8d 100644 --- a/cabal-install/src/Distribution/Client/CmdHaddockProject.hs +++ b/cabal-install/src/Distribution/Client/CmdHaddockProject.hs @@ -3,6 +3,7 @@ module Distribution.Client.CmdHaddockProject , haddockProjectAction ) where +import Control.Monad (mapM) import Distribution.Client.Compat.Prelude hiding (get) import Prelude () @@ -11,8 +12,8 @@ import qualified Distribution.Client.CmdHaddock as CmdHaddock import Distribution.Client.DistDirLayout ( CabalDirLayout (..) - , DistDirLayout (..) , StoreDirLayout (..) + , distBuildDirectory ) import Distribution.Client.InstallPlan (foldPlanPackage) import qualified Distribution.Client.InstallPlan as InstallPlan @@ -24,7 +25,6 @@ import Distribution.Client.ProjectOrchestration , ProjectBaseContext (..) , ProjectBuildContext (..) , TargetSelector (..) - , printPlan , pruneInstallPlanToTargets , resolveTargets , runProjectPreBuildPhase @@ -52,6 +52,14 @@ import Distribution.Client.Setup ) import Distribution.Client.TargetProblem (TargetProblem (..)) +import Distribution.Simple.BuildPaths + ( haddockBenchmarkDirPath + , haddockDirName + , haddockLibraryDirPath + , haddockLibraryPath + , haddockPath + , haddockTestDirPath + ) import Distribution.Simple.Command ( CommandUI (..) ) @@ -75,8 +83,8 @@ import Distribution.Simple.Program.Db import Distribution.Simple.Setup ( HaddockFlags (..) , HaddockProjectFlags (..) + , HaddockTarget (..) , Visibility (..) - , defaultCommonSetupFlags , defaultHaddockFlags , haddockProjectCommand ) @@ -84,9 +92,11 @@ import Distribution.Simple.Utils ( copyDirectoryRecursive , createDirectoryIfMissingVerbose , dieWithException + , info , warn ) import Distribution.Types.InstalledPackageInfo (InstalledPackageInfo (..)) +import Distribution.Types.PackageDescription (PackageDescription (benchmarks, subLibraries, testSuites)) import Distribution.Types.PackageId (pkgName) import Distribution.Types.PackageName (unPackageName) import Distribution.Types.UnitId (unUnitId) @@ -98,7 +108,7 @@ import Distribution.Verbosity as Verbosity import Distribution.Client.Errors import System.Directory (doesDirectoryExist, doesFileExist) -import System.FilePath (normalise, takeDirectory, (<.>), ()) +import System.FilePath (normalise, takeDirectory, ()) haddockProjectAction :: HaddockProjectFlags -> [String] -> GlobalFlags -> IO () haddockProjectAction flags _extraArgs globalFlags = do @@ -108,58 +118,6 @@ haddockProjectAction flags _extraArgs globalFlags = do warn verbosity "haddock-project command is experimental, it might break in the future" - -- build all packages with appropriate haddock flags - let commonFlags = - defaultCommonSetupFlags - { setupVerbosity = haddockProjectVerbosity flags - } - haddockFlags = - defaultHaddockFlags - { haddockCommonFlags = commonFlags - , haddockHtml = Flag True - , -- one can either use `--haddock-base-url` or - -- `--haddock-html-location`. - haddockBaseUrl = - if localStyle - then Flag ".." - else NoFlag - , haddockProgramPaths = haddockProjectProgramPaths flags - , haddockProgramArgs = haddockProjectProgramArgs flags - , haddockHtmlLocation = - if fromFlagOrDefault False (haddockProjectHackage flags) - then Flag "https://hackage.haskell.org/package/$pkg-$version/docs" - else haddockProjectHtmlLocation flags - , haddockHoogle = haddockProjectHoogle flags - , haddockExecutables = haddockProjectExecutables flags - , haddockTestSuites = haddockProjectTestSuites flags - , haddockBenchmarks = haddockProjectBenchmarks flags - , haddockForeignLibs = haddockProjectForeignLibs flags - , haddockInternal = haddockProjectInternal flags - , haddockCss = haddockProjectCss flags - , haddockLinkedSource = Flag True - , haddockQuickJump = Flag True - , haddockHscolourCss = haddockProjectHscolourCss flags - , haddockContents = - if localStyle - then Flag (toPathTemplate "../index.html") - else NoFlag - , haddockIndex = - if localStyle - then Flag (toPathTemplate "../doc-index.html") - else NoFlag - , haddockKeepTempFiles = haddockProjectKeepTempFiles flags - , haddockResourcesDir = haddockProjectResourcesDir flags - , haddockOutputDir = haddockProjectOutputDir flags - } - nixFlags = - (commandDefaultFlags CmdHaddock.haddockCommand) - { NixStyleOptions.haddockFlags = haddockFlags - , NixStyleOptions.configFlags = - (NixStyleOptions.configFlags (commandDefaultFlags CmdBuild.buildCommand)) - { configCommonFlags = commonFlags - } - } - -- -- Construct the build plan and infer the list of packages which haddocks -- we need. @@ -199,8 +157,6 @@ haddockProjectAction flags _extraArgs globalFlags = do elaboratedPlan return (elaboratedPlan', targets) - printPlan verbosity baseCtx buildCtx - let elaboratedPlan :: ElaboratedInstallPlan elaboratedPlan = elaboratedPlanOriginal buildCtx @@ -255,61 +211,84 @@ haddockProjectAction flags _extraArgs globalFlags = do packageInfos <- fmap (nub . concat) $ for pkgs $ \pkg -> case pkg of - Left _ - | not localStyle -> - return [] - Left package -> do - -- TODO: this might not work for public packages with sublibraries. - -- Issue #9026. + Left package | localStyle -> do let packageName = unPackageName (pkgName $ sourcePackageId package) destDir = outputDir packageName fmap catMaybes $ for (haddockInterfaces package) $ \interfacePath -> do let docDir = takeDirectory interfacePath a <- doesFileExist interfacePath case a of - True -> + True -> do copyDirectoryRecursive verbosity docDir destDir - >> return - ( Just - ( packageName - , interfacePath - , Hidden - ) - ) + return $ Just $ Right (packageName, interfacePath, Hidden) False -> return Nothing + Left _ -> return [] Right package -> case elabLocalToProject package of True -> do let distDirParams = elabDistDirParams sharedConfig' package - unitId = unUnitId (elabUnitId package) + pkg_descr = elabPkgDescription package + + packageName = pkgName $ elabPkgSourceId package + unitId = elabUnitId package + packageDir = haddockDirName ForDevelopment pkg_descr + destDir = outputDir packageDir + interfacePath = destDir haddockPath pkg_descr + buildDir = distBuildDirectory distLayout distDirParams - packageName = unPackageName (pkgName $ elabPkgSourceId package) - let docDir = + docDir = buildDir "doc" "html" - packageName - destDir = outputDir unitId - interfacePath = - destDir - packageName - <.> "haddock" + packageDir + a <- doesDirectoryExist docDir - case a of - True -> + if a + then do copyDirectoryRecursive verbosity docDir destDir - >> return - [ - ( unitId - , interfacePath - , Visible - ) - ] - False -> do + let infos :: [(String, FilePath, Visibility)] + infos = + (unPackageName packageName, interfacePath, Visible) + : [ (sublibDirPath, sublibInterfacePath, Visible) + | lib <- subLibraries pkg_descr + , let sublibDirPath = haddockLibraryDirPath ForDevelopment pkg_descr lib + sublibInterfacePath = + outputDir + sublibDirPath + haddockLibraryPath pkg_descr lib + ] + ++ [ (testPath, testInterfacePath, Visible) + | test <- testSuites pkg_descr + , let testPath = haddockTestDirPath ForDevelopment pkg_descr test + testInterfacePath = + outputDir + testPath + haddockPath pkg_descr + ] + ++ [ (benchPath, benchInterfacePath, Visible) + | bench <- benchmarks pkg_descr + , let benchPath = haddockBenchmarkDirPath ForDevelopment pkg_descr bench + benchInterfacePath = + outputDir + benchPath + haddockPath pkg_descr + ] + infos' <- + mapM + ( \x@(_, path, _) -> do + e <- doesFileExist path + return $ + if e + then Right x + else Left path + ) + infos + return infos' + else do warn verbosity ( "haddocks of " - ++ show unitId + ++ unUnitId unitId ++ " not found in the store" ) return [] @@ -317,57 +296,53 @@ haddockProjectAction flags _extraArgs globalFlags = do | not localStyle -> return [] False -> do - let packageName = unPackageName (pkgName $ elabPkgSourceId package) + let pkg_descr = elabPkgDescription package unitId = unUnitId (elabUnitId package) packageDir = storePackageDirectory (cabalStoreDirLayout cabalLayout) (pkgConfigCompiler sharedConfig') (elabUnitId package) + -- TODO: use `InstallDirTemplates` docDir = packageDir "share" "doc" "html" - destDir = outputDir packageName - interfacePath = - destDir - packageName - <.> "haddock" + destDir = outputDir haddockDirName ForDevelopment pkg_descr + interfacePath = destDir haddockPath pkg_descr a <- doesDirectoryExist docDir case a of - True -> + True -> do copyDirectoryRecursive verbosity docDir destDir - -- non local packages will be hidden in haddock's - -- generated contents page - >> return - [ - ( unitId - , interfacePath - , Hidden - ) - ] + -- non local packages will be hidden in haddock's + -- generated contents page + return [Right (unitId, interfacePath, Hidden)] False -> do - warn - verbosity - ( "haddocks of " - ++ show unitId - ++ " not found in the store" - ) - return [] + return [Left unitId] -- -- generate index, content, etc. -- + let (missingHaddocks, packageInfos') = partitionEithers packageInfos + when (not (null missingHaddocks)) $ do + warn verbosity "missing haddocks for some packages from the store" + -- Show the package list if `-v1` is passed; it's usually a long list. + -- One needs to add `package` stantza in `cabal.project` file for + -- `cabal` to include a version which has haddocks (or set + -- `documentation: True` in the global config). + info verbosity (intercalate "\n" missingHaddocks) + let flags' = flags { haddockProjectDir = Flag outputDir , haddockProjectInterfaces = Flag [ ( interfacePath - , Just name - , Just name + , Just url + , Just url , visibility ) - | (name, interfacePath, visibility) <- packageInfos + | (url, interfacePath, visibility) <- packageInfos' ] + , haddockProjectUseUnicode = NoFlag } createHaddockIndex verbosity @@ -377,7 +352,62 @@ haddockProjectAction flags _extraArgs globalFlags = do Nothing flags' where - verbosity = fromFlagOrDefault normal (haddockProjectVerbosity flags) + -- build all packages with appropriate haddock flags + commonFlags = haddockProjectCommonFlags flags + + verbosity = fromFlagOrDefault normal (setupVerbosity commonFlags) + + haddockFlags = + defaultHaddockFlags + { haddockCommonFlags = commonFlags + , haddockHtml = Flag True + , -- one can either use `--haddock-base-url` or + -- `--haddock-html-location`. + haddockBaseUrl = + if localStyle + then Flag ".." + else NoFlag + , haddockProgramPaths = haddockProjectProgramPaths flags + , haddockProgramArgs = haddockProjectProgramArgs flags + , haddockHtmlLocation = + if fromFlagOrDefault False (haddockProjectHackage flags) + then Flag "https://hackage.haskell.org/package/$pkg-$version/docs" + else haddockProjectHtmlLocation flags + , haddockHoogle = haddockProjectHoogle flags + , haddockExecutables = haddockProjectExecutables flags + , haddockTestSuites = haddockProjectTestSuites flags + , haddockBenchmarks = haddockProjectBenchmarks flags + , haddockForeignLibs = haddockProjectForeignLibs flags + , haddockInternal = haddockProjectInternal flags + , haddockCss = haddockProjectCss flags + , haddockLinkedSource = Flag True + , haddockQuickJump = Flag True + , haddockHscolourCss = haddockProjectHscolourCss flags + , haddockContents = + if localStyle + then Flag (toPathTemplate "../index.html") + else NoFlag + , haddockIndex = + if localStyle + then Flag (toPathTemplate "../doc-index.html") + else NoFlag + , haddockKeepTempFiles = haddockProjectKeepTempFiles flags + , haddockResourcesDir = haddockProjectResourcesDir flags + , haddockUseUnicode = haddockProjectUseUnicode flags + -- NOTE: we don't pass `haddockOutputDir`. If we do, we'll need to + -- make sure `InstalledPackageInfo` contains the right path to + -- haddock interfaces. Instead we build documentation inside + -- `dist-newstyle` directory and copy it to the output directory. + } + + nixFlags = + (commandDefaultFlags CmdHaddock.haddockCommand) + { NixStyleOptions.haddockFlags = haddockFlags + , NixStyleOptions.configFlags = + (NixStyleOptions.configFlags (commandDefaultFlags CmdBuild.buildCommand)) + { configCommonFlags = commonFlags + } + } -- Build a self contained directory which contains haddocks of all -- transitive dependencies; or depend on `--haddocks-html-location` to diff --git a/cabal-install/src/Distribution/Client/CmdInstall.hs b/cabal-install/src/Distribution/Client/CmdInstall.hs index 1144ff79613..210ac78ca01 100644 --- a/cabal-install/src/Distribution/Client/CmdInstall.hs +++ b/cabal-install/src/Distribution/Client/CmdInstall.hs @@ -131,8 +131,9 @@ import Distribution.Simple.Compiler ( Compiler (..) , CompilerFlavor (..) , CompilerId (..) - , PackageDB (..) - , PackageDBStack + , PackageDBCWD + , PackageDBStackCWD + , PackageDBX (..) ) import Distribution.Simple.Configure ( configCompilerEx @@ -958,10 +959,10 @@ installLibraries -> ProjectBuildContext -> PI.PackageIndex InstalledPackageInfo -> Compiler - -> PackageDBStack + -> PackageDBStackCWD -> FilePath -- ^ Environment file - -> [GhcEnvironmentFileEntry] + -> [GhcEnvironmentFileEntry FilePath] -> Bool -- ^ Whether we need to show a warning (i.e. we created a new environment -- file, and the user did not use --package-env) @@ -1064,9 +1065,9 @@ warnIfNoExes verbosity buildCtx = -- | Return the package specifiers and non-global environment file entries. getEnvSpecsAndNonGlobalEntries :: PI.InstalledPackageIndex - -> [GhcEnvironmentFileEntry] + -> [GhcEnvironmentFileEntry FilePath] -> Bool - -> ([PackageSpecifier a], [(PackageName, GhcEnvironmentFileEntry)]) + -> ([PackageSpecifier a], [(PackageName, GhcEnvironmentFileEntry FilePath)]) getEnvSpecsAndNonGlobalEntries installedIndex entries installLibs = if installLibs then (envSpecs, envEntries') @@ -1076,8 +1077,8 @@ getEnvSpecsAndNonGlobalEntries installedIndex entries installLibs = environmentFileToSpecifiers :: PI.InstalledPackageIndex - -> [GhcEnvironmentFileEntry] - -> ([PackageSpecifier a], [(PackageName, GhcEnvironmentFileEntry)]) + -> [GhcEnvironmentFileEntry FilePath] + -> ([PackageSpecifier a], [(PackageName, GhcEnvironmentFileEntry FilePath)]) environmentFileToSpecifiers ipi = foldMap $ \case (GhcEnvFilePackageId unitId) | Just @@ -1248,7 +1249,7 @@ installBuiltExe overwrite -- | Create 'GhcEnvironmentFileEntry's for packages with exposed libraries. -entriesForLibraryComponents :: TargetsMap -> [GhcEnvironmentFileEntry] +entriesForLibraryComponents :: TargetsMap -> [GhcEnvironmentFileEntry FilePath] entriesForLibraryComponents = Map.foldrWithKey' (\k v -> mappend (go k v)) [] where hasLib :: (ComponentTarget, NonEmpty TargetSelector) -> Bool @@ -1258,7 +1259,7 @@ entriesForLibraryComponents = Map.foldrWithKey' (\k v -> mappend (go k v)) [] go :: UnitId -> [(ComponentTarget, NonEmpty TargetSelector)] - -> [GhcEnvironmentFileEntry] + -> [GhcEnvironmentFileEntry FilePath] go unitId targets | any hasLib targets = [GhcEnvFilePackageId unitId] | otherwise = [] @@ -1290,7 +1291,7 @@ getEnvFile clientInstallFlags platform compilerVersion = do -- | Returns the list of @GhcEnvFilePackageId@ values already existing in the -- environment being operated on. The @Bool@ is @True@ if we took settings -- from an existing file, @False@ otherwise. -getExistingEnvEntries :: Verbosity -> CompilerFlavor -> Bool -> FilePath -> IO (Bool, [GhcEnvironmentFileEntry]) +getExistingEnvEntries :: Verbosity -> CompilerFlavor -> Bool -> FilePath -> IO (Bool, [GhcEnvironmentFileEntry FilePath]) getExistingEnvEntries verbosity compilerFlavor supportsPkgEnvFiles envFile = do envFileExists <- doesFileExist envFile (usedExisting, allEntries) <- @@ -1334,8 +1335,8 @@ getPackageDbStack :: Compiler -> Flag FilePath -> Flag FilePath - -> [Maybe PackageDB] - -> IO PackageDBStack + -> [Maybe PackageDBCWD] + -> IO PackageDBStackCWD getPackageDbStack compiler storeDirFlag logsDirFlag packageDbs = do mstoreDir <- traverse makeAbsolute $ flagToMaybe storeDirFlag let diff --git a/cabal-install/src/Distribution/Client/CmdLegacy.hs b/cabal-install/src/Distribution/Client/CmdLegacy.hs index 128d5fb4251..38873148dc0 100644 --- a/cabal-install/src/Distribution/Client/CmdLegacy.hs +++ b/cabal-install/src/Distribution/Client/CmdLegacy.hs @@ -78,7 +78,7 @@ wrapperAction command getCommonFlags = Nothing command' getCommonFlags - (const flags) + (const (return flags)) (const extraArgs) -- diff --git a/cabal-install/src/Distribution/Client/Compat/Orphans.hs b/cabal-install/src/Distribution/Client/Compat/Orphans.hs index 4a2e28a10fb..bbc44bb5c8a 100644 --- a/cabal-install/src/Distribution/Client/Compat/Orphans.hs +++ b/cabal-install/src/Distribution/Client/Compat/Orphans.hs @@ -4,8 +4,8 @@ module Distribution.Client.Compat.Orphans () where import Control.Exception (SomeException) +import Data.Typeable (typeRep) import Distribution.Compat.Binary (Binary (..)) -import Distribution.Compat.Typeable (typeRep) import Distribution.Utils.Structured (Structure (Nominal), Structured (..)) import Network.URI (URI (..), URIAuth (..)) import Prelude (error, return) diff --git a/cabal-install/src/Distribution/Client/Config.hs b/cabal-install/src/Distribution/Client/Config.hs index d9b91c959d0..c837db7bb08 100644 --- a/cabal-install/src/Distribution/Client/Config.hs +++ b/cabal-install/src/Distribution/Client/Config.hs @@ -160,6 +160,7 @@ import qualified Distribution.Deprecated.ParseUtils as ParseUtils import Distribution.Parsec (ParsecParser, parsecFilePath, parsecOptCommaList, parsecToken) import Distribution.Simple.Command ( CommandUI (commandOptions) + , OptionField , ShowOrParseArgs (..) , commandDefaultFlags ) @@ -490,6 +491,7 @@ instance Semigroup SavedConfig where , configVanillaLib = combine configVanillaLib , configProfLib = combine configProfLib , configProf = combine configProf + , configProfShared = combine configProfShared , configSharedLib = combine configSharedLib , configStaticLib = combine configStaticLib , configDynExe = combine configDynExe @@ -545,6 +547,7 @@ instance Semigroup SavedConfig where , configAllowDependingOnPrivateLibs = combine configAllowDependingOnPrivateLibs , configCoverageFor = combine configCoverageFor + , configIgnoreBuildTools = combine configIgnoreBuildTools } where combine = combine' savedConfigureFlags @@ -632,6 +635,7 @@ instance Semigroup SavedConfig where , haddockBaseUrl = combine haddockBaseUrl , haddockResourcesDir = combine haddockResourcesDir , haddockOutputDir = combine haddockOutputDir + , haddockUseUnicode = combine haddockUseUnicode } where combine = combine' savedHaddockFlags @@ -1311,6 +1315,19 @@ configFieldDescriptions src = ParseArgs ] where + toSavedConfig + :: (FieldDescr a -> FieldDescr SavedConfig) + -- Lifting function. + -> [OptionField a] + -- Option fields. + -> [String] + -- Fields to exclude, by name. + -> [FieldDescr a] + -- Field replacements. + -- + -- If an option is found with the same name as one of these replacement + -- fields, the replacement field is used instead of the option. + -> [FieldDescr SavedConfig] toSavedConfig lift options exclusions replacements = [ lift (fromMaybe field replacement) | opt <- options @@ -1827,7 +1844,7 @@ haddockFlagsFields = , name `notElem` exclusions ] where - exclusions = ["verbose", "builddir", "for-hackage"] + exclusions = ["verbose", "builddir", "cabal-file", "for-hackage"] -- | Fields for the 'init' section. initFlagsFields :: [FieldDescr IT.InitFlags] diff --git a/cabal-install/src/Distribution/Client/Configure.hs b/cabal-install/src/Distribution/Client/Configure.hs index fc7ea49fe31..5f82329eb52 100644 --- a/cabal-install/src/Distribution/Client/Configure.hs +++ b/cabal-install/src/Distribution/Client/Configure.hs @@ -86,8 +86,8 @@ import Distribution.PackageDescription.Configuration import Distribution.Simple.Compiler ( Compiler , CompilerInfo - , PackageDB (..) - , PackageDBStack + , PackageDBStackCWD + , PackageDBX (..) , compilerInfo ) import Distribution.Simple.PackageDescription @@ -116,6 +116,9 @@ import Distribution.Simple.Utils as Utils import Distribution.System ( Platform ) +import Distribution.Types.DependencySatisfaction + ( DependencySatisfaction (..) + ) import Distribution.Types.GivenComponent ( GivenComponent (..) ) @@ -144,7 +147,7 @@ chooseCabalVersion _configExFlags maybeVersion = -- | Configure the package found in the local directory configure :: Verbosity - -> PackageDBStack + -> PackageDBStackCWD -> RepoContext -> Compiler -> Platform @@ -203,7 +206,7 @@ configure Nothing configureCommand configCommonFlags - (const configFlags) + (const (return configFlags)) (const extraArgs) Right installPlan0 -> let installPlan = InstallPlan.configureInstallPlan configFlags installPlan0 @@ -253,7 +256,7 @@ configure logMsg message rest = debug verbosity message >> rest configureSetupScript - :: PackageDBStack + :: PackageDBStackCWD -> Compiler -> Platform -> ProgramDb @@ -308,7 +311,7 @@ configureSetupScript -- finding the Cabal lib when compiling any Setup.hs even if we're doing -- a global install. However we also allow looking in a specific package -- db. - packageDBs' :: PackageDBStack + packageDBs' :: PackageDBStackCWD index' :: Maybe InstalledPackageIndex (packageDBs', index') = case packageDBs of @@ -390,7 +393,7 @@ planLocalPackage -> ConfigExFlags -> InstalledPackageIndex -> SourcePackageDb - -> PkgConfigDb + -> Maybe PkgConfigDb -> IO (Progress String String SolverInstallPlan) planLocalPackage verbosity @@ -505,7 +508,7 @@ configurePackage (Just pkg) configureCommand configCommonFlags - configureFlags + (return . configureFlags) (const extraArgs) where gpkg :: PkgDesc.GenericPackageDescription @@ -555,7 +558,7 @@ configurePackage pkg = case finalizePD flags (enableStanzas stanzas) - (const True) + (const Satisfied) platform comp [] diff --git a/cabal-install/src/Distribution/Client/Dependency.hs b/cabal-install/src/Distribution/Client/Dependency.hs index 66a0a103c23..d59bc611c44 100644 --- a/cabal-install/src/Distribution/Client/Dependency.hs +++ b/cabal-install/src/Distribution/Client/Dependency.hs @@ -64,6 +64,7 @@ module Distribution.Client.Dependency , addDefaultSetupDependencies , addSetupCabalMinVersionConstraint , addSetupCabalMaxVersionConstraint + , addSetupCabalProfiledDynamic ) where import Distribution.Client.Compat.Prelude @@ -126,6 +127,9 @@ import Distribution.System ( Platform ) import Distribution.Types.Dependency +import Distribution.Types.DependencySatisfaction + ( DependencySatisfaction (..) + ) import Distribution.Verbosity ( normal ) @@ -463,6 +467,7 @@ nonReinstallablePackages :: [PackageName] nonReinstallablePackages = [ mkPackageName "base" , mkPackageName "ghc-bignum" + , mkPackageName "ghc-internal" , mkPackageName "ghc-prim" , mkPackageName "ghc" , mkPackageName "integer-gmp" @@ -670,6 +675,22 @@ addSetupCabalMaxVersionConstraint maxVersion = where cabalPkgname = mkPackageName "Cabal" +-- | Add an a lower bound @setup.Cabal >= 3.13@ labeled with 'ConstraintSourceProfiledDynamic' +addSetupCabalProfiledDynamic + :: DepResolverParams + -> DepResolverParams +addSetupCabalProfiledDynamic = + addConstraints + [ LabeledPackageConstraint + ( PackageConstraint + (ScopeAnySetupQualifier cabalPkgname) + (PackagePropertyVersion $ orLaterVersion (mkVersion [3, 13, 0])) + ) + ConstraintSourceProfiledDynamic + ] + where + cabalPkgname = mkPackageName "Cabal" + upgradeDependencies :: DepResolverParams -> DepResolverParams upgradeDependencies = setPreferenceDefault PreferAllLatest @@ -763,7 +784,7 @@ runSolver = modularResolver resolveDependencies :: Platform -> CompilerInfo - -> PkgConfigDb + -> Maybe PkgConfigDb -> DepResolverParams -> Progress String String SolverInstallPlan resolveDependencies platform comp pkgConfigDB params = @@ -1074,7 +1095,7 @@ configuredPackageProblems case finalizePD specifiedFlags compSpec - (const True) + (const Satisfied) platform cinfo [] diff --git a/cabal-install/src/Distribution/Client/DistDirLayout.hs b/cabal-install/src/Distribution/Client/DistDirLayout.hs index 01da7195d51..64140152453 100644 --- a/cabal-install/src/Distribution/Client/DistDirLayout.hs +++ b/cabal-install/src/Distribution/Client/DistDirLayout.hs @@ -43,8 +43,9 @@ import Distribution.Package import Distribution.Simple.Compiler ( Compiler (..) , OptimisationLevel (..) - , PackageDB (..) - , PackageDBStack + , PackageDBCWD + , PackageDBStackCWD + , PackageDBX (..) ) import Distribution.Simple.Configure (interpretPackageDbFlags) import Distribution.System @@ -111,7 +112,7 @@ data DistDirLayout = DistDirLayout , distSdistDirectory :: FilePath , distTempDirectory :: FilePath , distBinDirectory :: FilePath - , distPackageDB :: CompilerId -> PackageDB + , distPackageDB :: CompilerId -> PackageDBCWD , distHaddockOutputDir :: Maybe FilePath -- ^ Is needed when `--haddock-output-dir` flag is used. } @@ -121,8 +122,8 @@ data StoreDirLayout = StoreDirLayout { storeDirectory :: Compiler -> FilePath , storePackageDirectory :: Compiler -> UnitId -> FilePath , storePackageDBPath :: Compiler -> FilePath - , storePackageDB :: Compiler -> PackageDB - , storePackageDBStack :: Compiler -> [Maybe PackageDB] -> PackageDBStack + , storePackageDB :: Compiler -> PackageDBCWD + , storePackageDBStack :: Compiler -> [Maybe PackageDBCWD] -> PackageDBStackCWD , storeIncomingDirectory :: Compiler -> FilePath , storeIncomingLock :: Compiler -> UnitId -> FilePath } @@ -258,7 +259,7 @@ defaultDistDirLayout projectRoot mdistDirectory haddockOutputDir = distPackageDBPath :: CompilerId -> FilePath distPackageDBPath compid = distDirectory "packagedb" prettyShow compid - distPackageDB :: CompilerId -> PackageDB + distPackageDB :: CompilerId -> PackageDBCWD distPackageDB = SpecificPackageDB . distPackageDBPath distHaddockOutputDir :: Maybe FilePath @@ -282,11 +283,11 @@ defaultStoreDirLayout storeRoot = storePackageDBPath compiler = storeDirectory compiler "package.db" - storePackageDB :: Compiler -> PackageDB + storePackageDB :: Compiler -> PackageDBCWD storePackageDB compiler = SpecificPackageDB (storePackageDBPath compiler) - storePackageDBStack :: Compiler -> [Maybe PackageDB] -> PackageDBStack + storePackageDBStack :: Compiler -> [Maybe PackageDBCWD] -> PackageDBStackCWD storePackageDBStack compiler extraPackageDB = (interpretPackageDbFlags False extraPackageDB) ++ [storePackageDB compiler] diff --git a/cabal-install/src/Distribution/Client/Fetch.hs b/cabal-install/src/Distribution/Client/Fetch.hs index 54db5ae607b..033d3a01e14 100644 --- a/cabal-install/src/Distribution/Client/Fetch.hs +++ b/cabal-install/src/Distribution/Client/Fetch.hs @@ -44,10 +44,6 @@ import Distribution.Package ( packageId ) import Distribution.Simple.Compiler - ( Compiler - , PackageDBStack - , compilerInfo - ) import Distribution.Simple.PackageIndex (InstalledPackageIndex) import Distribution.Simple.Program ( ProgramDb @@ -88,7 +84,7 @@ import Distribution.System -- | Fetch a list of packages and their dependencies. fetch :: Verbosity - -> PackageDBStack + -> PackageDBStackCWD -> RepoContext -> Compiler -> Platform @@ -161,7 +157,7 @@ planPackages -> FetchFlags -> InstalledPackageIndex -> SourcePackageDb - -> PkgConfigDb + -> Maybe PkgConfigDb -> [PackageSpecifier UnresolvedSourcePackage] -> IO [UnresolvedSourcePackage] planPackages diff --git a/cabal-install/src/Distribution/Client/FetchUtils.hs b/cabal-install/src/Distribution/Client/FetchUtils.hs index c804040cab7..62da386573d 100644 --- a/cabal-install/src/Distribution/Client/FetchUtils.hs +++ b/cabal-install/src/Distribution/Client/FetchUtils.hs @@ -25,7 +25,7 @@ module Distribution.Client.FetchUtils -- ** specifically for repo packages , checkRepoTarballFetched , fetchRepoTarball - , verifyFetchedTarball + , verifyFetchedTarballs -- ** fetching packages asynchronously , asyncFetchPackages @@ -98,6 +98,7 @@ import System.IO , openTempFile ) +import Control.Monad (forM) import Distribution.Client.Errors import qualified Hackage.Security.Client as Sec import qualified Hackage.Security.Util.Checked as Sec @@ -152,40 +153,66 @@ checkRepoTarballFetched repo pkgid = do then return (Just file) else return Nothing -verifyFetchedTarball :: Verbosity -> RepoContext -> Repo -> PackageId -> IO Bool -verifyFetchedTarball verbosity repoCtxt repo pkgid = - let file = packageFile repo pkgid - handleError :: IO Bool -> IO Bool - handleError act = do - res <- Safe.try act - case res of - Left e -> warn verbosity ("Error verifying fetched tarball " ++ file ++ ", will redownload: " ++ show (e :: SomeException)) >> pure False - Right b -> pure b - in handleError $ do - exists <- doesFileExist file - if not exists - then return True -- if the file does not exist, it vacuously passes validation, since it will be downloaded as necessary with what we will then check is a valid hash. - else case repo of - -- a secure repo has hashes we can compare against to confirm this is the correct file. - RepoSecure{} -> - repoContextWithSecureRepo repoCtxt repo $ \repoSecure -> - Sec.withIndex repoSecure $ \callbacks -> - let warnAndFail s = warn verbosity ("Fetched tarball " ++ file ++ " does not match server, will redownload: " ++ s) >> return False - in -- the do block in parens is due to dealing with the checked exceptions mechanism. - ( do - fileInfo <- Sec.indexLookupFileInfo callbacks pkgid - sz <- Sec.FileLength . fromInteger <$> getFileSize file - if sz /= Sec.fileInfoLength (Sec.trusted fileInfo) - then warnAndFail "file length mismatch" - else do - res <- Sec.compareTrustedFileInfo (Sec.trusted fileInfo) <$> Sec.computeFileInfo (Sec.Path file :: Sec.Path Sec.Absolute) - if res - then pure True - else warnAndFail "file hash mismatch" - ) - `Sec.catchChecked` (\(e :: Sec.InvalidPackageException) -> warnAndFail (show e)) - `Sec.catchChecked` (\(e :: Sec.VerificationError) -> warnAndFail (show e)) - _ -> pure True +verifyFetchedTarballs + :: Verbosity + -> RepoContext + -> Repo + -> [PackageId] + -> IO + ( [ Either + (Repo, PackageId) -- Verified + (Repo, PackageId) -- unverified) + ] + ) +verifyFetchedTarballs verbosity repoCtxt repo pkgids = + -- Establish the context once per repo (see #10110), this codepath is important + -- to be fast as it can happen when no other building happens. + let establishContext k = + case repo of + RepoSecure{} -> + repoContextWithSecureRepo repoCtxt repo $ \repoSecure -> + Sec.withIndex repoSecure $ \callbacks -> k (Just callbacks) + _ -> k Nothing + in do + establishContext $ \mCallbacks -> + forM pkgids $ \pkgid -> do + let file = packageFile repo pkgid + res <- verifyFetchedTarball verbosity file mCallbacks pkgid + return $ if res then Left (repo, pkgid) else Right (repo, pkgid) + +verifyFetchedTarball :: Verbosity -> FilePath -> Maybe Sec.IndexCallbacks -> PackageId -> IO Bool +verifyFetchedTarball verbosity file mCallbacks pkgid = + let + handleError :: IO Bool -> IO Bool + handleError act = do + res <- Safe.try act + case res of + Left e -> warn verbosity ("Error verifying fetched tarball " ++ file ++ ", will redownload: " ++ show (e :: SomeException)) >> pure False + Right b -> pure b + in + handleError $ do + exists <- doesFileExist file + if not exists + then return True -- if the file does not exist, it vacuously passes validation, since it will be downloaded as necessary with what we will then check is a valid hash. + else case mCallbacks of + -- a secure repo has hashes we can compare against to confirm this is the correct file. + Just callbacks -> + let warnAndFail s = warn verbosity ("Fetched tarball " ++ file ++ " does not match server, will redownload: " ++ s) >> return False + in -- the do block in parens is due to dealing with the checked exceptions mechanism. + ( do + fileInfo <- Sec.indexLookupFileInfo callbacks pkgid + sz <- Sec.FileLength . fromInteger <$> getFileSize file + if sz /= Sec.fileInfoLength (Sec.trusted fileInfo) + then warnAndFail "file length mismatch" + else do + res <- Sec.compareTrustedFileInfo (Sec.trusted fileInfo) <$> Sec.computeFileInfo (Sec.Path file :: Sec.Path Sec.Absolute) + if res + then pure True + else warnAndFail "file hash mismatch" + ) + `Sec.catchChecked` (\(e :: Sec.InvalidPackageException) -> warnAndFail (show e)) + `Sec.catchChecked` (\(e :: Sec.VerificationError) -> warnAndFail (show e)) + _ -> pure True -- | Fetch a package if we don't have it already. fetchPackage diff --git a/cabal-install/src/Distribution/Client/FileMonitor.hs b/cabal-install/src/Distribution/Client/FileMonitor.hs index 59742cc1b80..0872a9a9504 100644 --- a/cabal-install/src/Distribution/Client/FileMonitor.hs +++ b/cabal-install/src/Distribution/Client/FileMonitor.hs @@ -1127,12 +1127,9 @@ checkDirectoryModificationTime dir mtime = -- | Run an IO computation, returning the first argument @e@ if there is an 'error' -- call. ('ErrorCall') handleErrorCall :: a -> IO a -> IO a -handleErrorCall e = handle handler where -#if MIN_VERSION_base(4,9,0) +handleErrorCall e = handle handler + where handler (ErrorCallWithLocation _ _) = return e -#else - handler (ErrorCall _) = return e -#endif -- | Run an IO computation, returning @e@ if there is any 'IOException'. -- diff --git a/cabal-install/src/Distribution/Client/Freeze.hs b/cabal-install/src/Distribution/Client/Freeze.hs index 9bc4e3234b5..a03b45b6a2d 100644 --- a/cabal-install/src/Distribution/Client/Freeze.hs +++ b/cabal-install/src/Distribution/Client/Freeze.hs @@ -61,10 +61,6 @@ import Distribution.Package , packageVersion ) import Distribution.Simple.Compiler - ( Compiler - , PackageDBStack - , compilerInfo - ) import Distribution.Simple.PackageIndex (InstalledPackageIndex) import Distribution.Simple.Program ( ProgramDb @@ -98,7 +94,7 @@ import Distribution.Version -- constraining each dependency to an exact version. freeze :: Verbosity - -> PackageDBStack + -> PackageDBStackCWD -> RepoContext -> Compiler -> Platform @@ -146,7 +142,7 @@ freeze -- command. getFreezePkgs :: Verbosity - -> PackageDBStack + -> PackageDBStackCWD -> RepoContext -> Compiler -> Platform @@ -199,7 +195,7 @@ planPackages -> FreezeFlags -> InstalledPackageIndex -> SourcePackageDb - -> PkgConfigDb + -> Maybe PkgConfigDb -> [PackageSpecifier UnresolvedSourcePackage] -> IO [SolverPlanPackage] planPackages diff --git a/cabal-install/src/Distribution/Client/GenBounds.hs b/cabal-install/src/Distribution/Client/GenBounds.hs index ae78b50c004..2603a75d302 100644 --- a/cabal-install/src/Distribution/Client/GenBounds.hs +++ b/cabal-install/src/Distribution/Client/GenBounds.hs @@ -46,10 +46,6 @@ import Distribution.PackageDescription.Configuration ( finalizePD ) import Distribution.Simple.Compiler - ( Compiler - , PackageDBStack - , compilerInfo - ) import Distribution.Simple.PackageDescription ( readGenericPackageDescription ) @@ -67,6 +63,9 @@ import Distribution.Types.ComponentRequestedSpec ( defaultComponentRequestedSpec ) import Distribution.Types.Dependency +import Distribution.Types.DependencySatisfaction + ( DependencySatisfaction (..) + ) import Distribution.Utils.Path (relativeSymbolicPath) import Distribution.Version ( LowerBound (..) @@ -119,7 +118,7 @@ showBounds padTo p = -- | Entry point for the @gen-bounds@ command. genBounds :: Verbosity - -> PackageDBStack + -> PackageDBStackCWD -> RepoContext -> Compiler -> Platform @@ -138,7 +137,7 @@ genBounds verbosity packageDBs repoCtxt comp platform progdb globalFlags freezeF finalizePD mempty defaultComponentRequestedSpec - (const True) + (const Satisfied) platform cinfo [] diff --git a/cabal-install/src/Distribution/Client/HttpUtils.hs b/cabal-install/src/Distribution/Client/HttpUtils.hs index cad511ef9f8..3cdadf9304c 100644 --- a/cabal-install/src/Distribution/Client/HttpUtils.hs +++ b/cabal-install/src/Distribution/Client/HttpUtils.hs @@ -192,7 +192,7 @@ downloadURI transport verbosity uri path = do -- Only use the external http transports if we actually have to -- (or have been told to do so) let transport' - | uriScheme uri == "http:" + | isHttpURI uri , not (transportManuallySelected transport) = plainHttpTransport | otherwise = @@ -251,20 +251,35 @@ downloadURI transport verbosity uri path = do -- Utilities for repo url management -- +-- | If the remote repo is accessed over HTTPS, ensure that the transport +-- supports HTTPS. remoteRepoCheckHttps :: Verbosity -> HttpTransport -> RemoteRepo -> IO () -remoteRepoCheckHttps verbosity transport repo - | uriScheme (remoteRepoURI repo) == "https:" - , not (transportSupportsHttps transport) = - dieWithException verbosity $ RemoteRepoCheckHttps (unRepoName (remoteRepoName repo)) requiresHttpsErrorMessage - | otherwise = return () +remoteRepoCheckHttps verbosity transport repo = + transportCheckHttpsWithError verbosity transport (remoteRepoURI repo) $ + RemoteRepoCheckHttps (unRepoName (remoteRepoName repo)) requiresHttpsErrorMessage +-- | If the URI scheme is HTTPS, ensure the transport supports HTTPS. transportCheckHttps :: Verbosity -> HttpTransport -> URI -> IO () -transportCheckHttps verbosity transport uri - | uriScheme uri == "https:" +transportCheckHttps verbosity transport uri = + transportCheckHttpsWithError verbosity transport uri $ + TransportCheckHttps uri requiresHttpsErrorMessage + +-- | If the URI scheme is HTTPS, ensure the transport supports HTTPS. +-- If not, fail with the given error. +transportCheckHttpsWithError + :: Verbosity -> HttpTransport -> URI -> CabalInstallException -> IO () +transportCheckHttpsWithError verbosity transport uri err + | isHttpsURI uri , not (transportSupportsHttps transport) = - dieWithException verbosity $ TransportCheckHttps uri requiresHttpsErrorMessage + dieWithException verbosity err | otherwise = return () +isHttpsURI :: URI -> Bool +isHttpsURI uri = uriScheme uri == "https:" + +isHttpURI :: URI -> Bool +isHttpURI uri = uriScheme uri == "http:" + requiresHttpsErrorMessage :: String requiresHttpsErrorMessage = "requires HTTPS however the built-in HTTP implementation " @@ -280,12 +295,12 @@ requiresHttpsErrorMessage = remoteRepoTryUpgradeToHttps :: Verbosity -> HttpTransport -> RemoteRepo -> IO RemoteRepo remoteRepoTryUpgradeToHttps verbosity transport repo | remoteRepoShouldTryHttps repo - , uriScheme (remoteRepoURI repo) == "http:" + , isHttpURI (remoteRepoURI repo) , not (transportSupportsHttps transport) , not (transportManuallySelected transport) = dieWithException verbosity $ TryUpgradeToHttps [name | (name, _, True, _) <- supportedTransports] | remoteRepoShouldTryHttps repo - , uriScheme (remoteRepoURI repo) == "http:" + , isHttpURI (remoteRepoURI repo) , transportSupportsHttps transport = return repo @@ -452,7 +467,6 @@ curlTransport prog = where gethttp verbosity uri etag destPath reqHeaders = do withTempFile - (takeDirectory destPath) "curl-headers.txt" $ \tmpFile tmpHandle -> do hClose tmpHandle @@ -505,12 +519,18 @@ curlTransport prog = (Just (Left (uname, passwd)), _) -> Just $ Left (uname ++ ":" ++ passwd) (Nothing, Just a) -> Just $ Left a (Nothing, Nothing) -> Nothing + let authnSchemeArg + -- When using TLS, we can accept Basic authentication. Let curl + -- decide based on the scheme(s) offered by the server. + | isHttpsURI uri = "--anyauth" + -- When not using TLS, force Digest scheme + | otherwise = "--digest" case mbAuthStringToken of Just (Left up) -> progInvocation { progInvokeInput = Just . IODataText . unlines $ - [ "--digest" + [ authnSchemeArg , "--user " ++ up ] , progInvokeArgs = ["--config", "-"] ++ progInvokeArgs progInvocation @@ -654,10 +674,9 @@ wgetTransport prog = posthttpfile verbosity uri path auth = withTempFile - (takeDirectory path) (takeFileName path) $ \tmpFile tmpHandle -> - withTempFile (takeDirectory path) "response" $ + withTempFile "response" $ \responseFile responseHandle -> do hClose responseHandle (body, boundary) <- generateMultipartBody path @@ -681,7 +700,7 @@ wgetTransport prog = evaluate $ force (code, resp) puthttpfile verbosity uri path auth headers = - withTempFile (takeDirectory path) "response" $ + withTempFile "response" $ \responseFile responseHandle -> do hClose responseHandle let args = @@ -803,7 +822,6 @@ powershellTransport prog = posthttpfile verbosity uri path auth = withTempFile - (takeDirectory path) (takeFileName path) $ \tmpFile tmpHandle -> do (body, boundary) <- generateMultipartBody path diff --git a/cabal-install/src/Distribution/Client/IndexUtils.hs b/cabal-install/src/Distribution/Client/IndexUtils.hs index 5958deca553..f66cf0d651c 100644 --- a/cabal-install/src/Distribution/Client/IndexUtils.hs +++ b/cabal-install/src/Distribution/Client/IndexUtils.hs @@ -1,5 +1,6 @@ {-# LANGUAGE BangPatterns #-} {-# LANGUAGE CPP #-} +{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE LambdaCase #-} @@ -82,9 +83,6 @@ import Distribution.PackageDescription , emptyPackageDescription ) import Distribution.Simple.Compiler - ( Compiler - , PackageDBStack - ) import qualified Distribution.Simple.Configure as Configure ( getInstalledPackages , getInstalledPackagesMonitorFiles @@ -149,7 +147,7 @@ import System.FilePath , (<.>) , () ) -import qualified System.FilePath.Posix as FilePath.Posix +import qualified System.FilePath as FilePath import System.IO import System.IO.Error (isDoesNotExistError) import System.IO.Unsafe (unsafeInterleaveIO) @@ -162,11 +160,11 @@ import qualified Hackage.Security.Util.Some as Sec getInstalledPackages :: Verbosity -> Compiler - -> PackageDBStack + -> PackageDBStackCWD -> ProgramDb -> IO InstalledPackageIndex getInstalledPackages verbosity comp packageDbs progdb = - Configure.getInstalledPackages verbosity' comp Nothing packageDbs progdb + Configure.getInstalledPackages verbosity' comp Nothing (coercePackageDBStack packageDbs) progdb where verbosity' = lessVerbose verbosity @@ -928,7 +926,7 @@ withIndexEntries verbosity (RepoIndex _repoCtxt (RepoLocalNoIndex (LocalRepo nam let bs = BS.toStrict contents in ((`CacheGPD` bs) <$> parseGenericPackageDescriptionMaybe bs) where - filename = prettyShow pkgId FilePath.Posix. prettyShow (packageName pkgId) ++ ".cabal" + filename = prettyShow pkgId FilePath. prettyShow (packageName pkgId) ++ ".cabal" readCabalEntry _ _ x = x withIndexEntries verbosity index callback _ = do -- non-secure repositories diff --git a/cabal-install/src/Distribution/Client/Init.hs b/cabal-install/src/Distribution/Client/Init.hs index 1a8be086a3f..f9cd589f2a9 100644 --- a/cabal-install/src/Distribution/Client/Init.hs +++ b/cabal-install/src/Distribution/Client/Init.hs @@ -31,7 +31,7 @@ import System.IO (BufferMode (NoBuffering), hSetBuffering, stdout) -- | This is the main driver for the init script. initCmd :: Verbosity - -> PackageDBStack + -> PackageDBStackCWD -> RepoContext -> Compiler -> ProgramDb @@ -41,8 +41,7 @@ initCmd v packageDBs repoCtxt comp progdb initFlags = do installedPkgIndex <- getInstalledPackages v comp packageDBs progdb sourcePkgDb <- getSourcePackages v repoCtxt hSetBuffering stdout NoBuffering - settings <- createProject v installedPkgIndex sourcePkgDb initFlags - writeProject settings + runPromptIO (writeProject =<< createProject v installedPkgIndex sourcePkgDb initFlags) where -- When no flag is set, default to interactive. -- diff --git a/cabal-install/src/Distribution/Client/Init/Interactive/Command.hs b/cabal-install/src/Distribution/Client/Init/Interactive/Command.hs index 48209d37067..a50df356f60 100644 --- a/cabal-install/src/Distribution/Client/Init/Interactive/Command.hs +++ b/cabal-install/src/Distribution/Client/Init/Interactive/Command.hs @@ -460,14 +460,18 @@ languagePrompt flags pkgType = getLanguage flags $ do ghc2021 = "GHC2021 (requires at least GHC 9.2)" ghc2024 = "GHC2024 (requires at least GHC 9.10)" + lastChosenLanguage <- getLastChosenLanguage + l <- promptList ("Choose a language for your " ++ pkgType) [h2010, h98, ghc2021, ghc2024] - (DefaultPrompt h2010) + (DefaultPrompt (maybe h2010 id lastChosenLanguage)) Nothing True + setLastChosenLanguage (Just l) + if | l == h2010 -> return Haskell2010 | l == h98 -> return Haskell98 diff --git a/cabal-install/src/Distribution/Client/Init/Types.hs b/cabal-install/src/Distribution/Client/Init/Types.hs index ee7d7cbe0c3..0887cb54a71 100644 --- a/cabal-install/src/Distribution/Client/Init/Types.hs +++ b/cabal-install/src/Distribution/Client/Init/Types.hs @@ -1,6 +1,7 @@ {-# LANGUAGE BangPatterns #-} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE DeriveGeneric #-} +{-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} -- | @@ -39,7 +40,11 @@ module Distribution.Client.Init.Types -- * Typeclasses , Interactive (..) , BreakException (..) - , PurePrompt (..) + , PromptIO + , runPromptIO + , Inputs + , PurePrompt + , runPrompt , evalPrompt , Severity (..) @@ -63,9 +68,12 @@ import qualified Distribution.Client.Compat.Prelude as P import Prelude (read) import Control.Monad.Catch +import Control.Monad.IO.Class +import Control.Monad.Reader import Data.List.NonEmpty (fromList) +import qualified Data.IORef import Distribution.CabalSpecVersion import Distribution.Client.Utils as P import Distribution.Fields.Pretty @@ -282,15 +290,33 @@ mkLiterate _ hs = hs -- -------------------------------------------------------------------- -- -- Interactive prompt monad +newtype PromptIO a = PromptIO (ReaderT (Data.IORef.IORef SessionState) IO a) + deriving (Functor, Applicative, Monad, MonadIO) + +sessionState :: PromptIO (Data.IORef.IORef SessionState) +sessionState = PromptIO ask + +runPromptIO :: PromptIO a -> IO a +runPromptIO (PromptIO pio) = + (Data.IORef.newIORef newSessionState) >>= (runReaderT pio) + +type Inputs = NonEmpty String + newtype PurePrompt a = PurePrompt - { _runPrompt - :: NonEmpty String - -> Either BreakException (a, NonEmpty String) + { runPromptState + :: (Inputs, SessionState) + -> Either BreakException (a, (Inputs, SessionState)) } deriving (Functor) -evalPrompt :: PurePrompt a -> NonEmpty String -> a -evalPrompt act s = case _runPrompt act s of +runPrompt :: PurePrompt a -> Inputs -> Either BreakException (a, Inputs) +runPrompt act args = + fmap + (\(a, (s, _)) -> (a, s)) + (runPromptState act (args, newSessionState)) + +evalPrompt :: PurePrompt a -> Inputs -> a +evalPrompt act s = case runPrompt act s of Left e -> error $ show e Right (a, _) -> a @@ -306,7 +332,7 @@ instance Monad PurePrompt where return = pure PurePrompt a >>= k = PurePrompt $ \s -> case a s of Left e -> Left e - Right (a', s') -> _runPrompt (k a') s' + Right (a', s') -> runPromptState (k a') s' class Monad m => Interactive m where -- input functions @@ -341,36 +367,61 @@ class Monad m => Interactive m where break :: m Bool throwPrompt :: BreakException -> m a -instance Interactive IO where - getLine = P.getLine - readFile = P.readFile - getCurrentDirectory = P.getCurrentDirectory - getHomeDirectory = P.getHomeDirectory - getDirectoryContents = P.getDirectoryContents - listDirectory = P.listDirectory - doesDirectoryExist = P.doesDirectoryExist - doesFileExist = P.doesFileExist - canonicalizePathNoThrow = P.canonicalizePathNoThrow - readProcessWithExitCode = Process.readProcessWithExitCode - getEnvironment = P.getEnvironment - getCurrentYear = P.getCurrentYear - listFilesInside = P.listFilesInside - listFilesRecursive = P.listFilesRecursive - - putStr = P.putStr - putStrLn = P.putStrLn - createDirectory = P.createDirectory - removeDirectory = P.removeDirectoryRecursive - writeFile = P.writeFile - removeExistingFile = P.removeExistingFile - copyFile = P.copyFile - renameDirectory = P.renameDirectory - hFlush = System.IO.hFlush + -- session state functions + getLastChosenLanguage :: m (Maybe String) + setLastChosenLanguage :: (Maybe String) -> m () + +newtype SessionState = SessionState + { lastChosenLanguage :: (Maybe String) + } + +newSessionState :: SessionState +newSessionState = SessionState{lastChosenLanguage = Nothing} + +instance Interactive PromptIO where + getLine = liftIO P.getLine + readFile = liftIO <$> P.readFile + getCurrentDirectory = liftIO P.getCurrentDirectory + getHomeDirectory = liftIO P.getHomeDirectory + getDirectoryContents = liftIO <$> P.getDirectoryContents + listDirectory = liftIO <$> P.listDirectory + doesDirectoryExist = liftIO <$> P.doesDirectoryExist + doesFileExist = liftIO <$> P.doesFileExist + canonicalizePathNoThrow = liftIO <$> P.canonicalizePathNoThrow + readProcessWithExitCode a b c = liftIO $ Process.readProcessWithExitCode a b c + getEnvironment = liftIO P.getEnvironment + getCurrentYear = liftIO P.getCurrentYear + listFilesInside test dir = do + -- test is run within a new env and not the current env + -- all usages of listFilesInside are pure functions actually + liftIO $ P.listFilesInside (\f -> liftIO $ runPromptIO (test f)) dir + listFilesRecursive = liftIO <$> P.listFilesRecursive + + putStr = liftIO <$> P.putStr + putStrLn = liftIO <$> P.putStrLn + createDirectory = liftIO <$> P.createDirectory + removeDirectory = liftIO <$> P.removeDirectoryRecursive + writeFile a b = liftIO $ P.writeFile a b + removeExistingFile = liftIO <$> P.removeExistingFile + copyFile a b = liftIO $ P.copyFile a b + renameDirectory a b = liftIO $ P.renameDirectory a b + hFlush = liftIO <$> System.IO.hFlush message q severity msg | q == silent = pure () | otherwise = putStrLn $ "[" ++ displaySeverity severity ++ "] " ++ msg break = return False - throwPrompt = throwM + throwPrompt = liftIO <$> throwM + + getLastChosenLanguage = do + stateRef <- sessionState + liftIO $ lastChosenLanguage <$> Data.IORef.readIORef stateRef + + setLastChosenLanguage value = do + stateRef <- sessionState + liftIO $ + Data.IORef.modifyIORef + stateRef + (\state -> state{lastChosenLanguage = value}) instance Interactive PurePrompt where getLine = pop @@ -411,13 +462,18 @@ instance Interactive PurePrompt where _ -> return () break = return True - throwPrompt (BreakException e) = PurePrompt $ \s -> + throwPrompt (BreakException e) = PurePrompt $ \(i, _) -> Left $ BreakException - ("Error: " ++ e ++ "\nStacktrace: " ++ show s) + ("Error: " ++ e ++ "\nStacktrace: " ++ show i) + + getLastChosenLanguage = PurePrompt $ \(i, s) -> + Right (lastChosenLanguage s, (i, s)) + setLastChosenLanguage l = PurePrompt $ \(i, s) -> + Right ((), (i, s{lastChosenLanguage = l})) pop :: PurePrompt String -pop = PurePrompt $ \(p :| ps) -> Right (p, fromList ps) +pop = PurePrompt $ \(i :| is, s) -> Right (i, (fromList is, s)) popAbsolute :: PurePrompt String popAbsolute = do @@ -429,7 +485,7 @@ popBool = pop >>= \case "True" -> pure True "False" -> pure False - s -> throwPrompt $ BreakException $ "popBool: " ++ s + i -> throwPrompt $ BreakException $ "popBool: " ++ i popList :: PurePrompt [String] popList = diff --git a/cabal-install/src/Distribution/Client/Install.hs b/cabal-install/src/Distribution/Client/Install.hs index a31e4d2ce62..b6a8198ae5c 100644 --- a/cabal-install/src/Distribution/Client/Install.hs +++ b/cabal-install/src/Distribution/Client/Install.hs @@ -57,7 +57,6 @@ import System.FilePath ( equalFilePath , takeDirectory , (<.>) - , () ) import System.IO ( IOMode (AppendMode) @@ -174,8 +173,9 @@ import Distribution.Simple.Compiler ( Compiler (compilerId) , CompilerId (..) , CompilerInfo (..) - , PackageDB (..) - , PackageDBStack + , PackageDBCWD + , PackageDBStackCWD + , PackageDBX (..) , compilerFlavor , compilerInfo ) @@ -222,7 +222,6 @@ import Distribution.Simple.Setup import qualified Distribution.Simple.Setup as Cabal import Distribution.Utils.Path hiding ( (<.>) - , () ) import Distribution.Simple.Utils @@ -245,6 +244,9 @@ import Distribution.System , buildOS , buildPlatform ) +import Distribution.Types.DependencySatisfaction + ( DependencySatisfaction (..) + ) import Distribution.Types.Flag ( FlagAssignment , PackageFlag (..) @@ -301,7 +303,7 @@ import Distribution.Client.Errors -- | Installs the packages needed to satisfy a list of dependencies. install :: Verbosity - -> PackageDBStack + -> PackageDBStackCWD -> RepoContext -> Compiler -> Platform @@ -381,7 +383,7 @@ install type InstallContext = ( InstalledPackageIndex , SourcePackageDb - , PkgConfigDb + , Maybe PkgConfigDb , [UserTarget] , [PackageSpecifier UnresolvedSourcePackage] , HttpTransport @@ -392,7 +394,7 @@ type InstallContext = -- | Initial arguments given to 'install' or 'makeInstallContext'. type InstallArgs = - ( PackageDBStack + ( PackageDBStackCWD , RepoContext , Compiler , Platform @@ -567,7 +569,7 @@ planPackages -> InstallFlags -> InstalledPackageIndex -> SourcePackageDb - -> PkgConfigDb + -> Maybe PkgConfigDb -> [PackageSpecifier UnresolvedSourcePackage] -> Progress String String SolverInstallPlan planPackages @@ -1225,7 +1227,7 @@ storeDetailedBuildReports verbosity logsDir reports = regenerateHaddockIndex :: Verbosity - -> [PackageDB] + -> [PackageDBCWD] -> Compiler -> Platform -> ProgramDb @@ -1677,7 +1679,7 @@ installReadyPackage pkg = case finalizePD flags (enableStanzas stanzas) - (const True) + (const Satisfied) platform cinfo [] @@ -1914,19 +1916,19 @@ installUnpackedPackage -- Configure phase onFailure ConfigureFailed $ do noticeProgress ProgressStarting - setup configureCommand configCommonFlags configureFlags mLogPath + setup configureCommand configCommonFlags (return . configureFlags) mLogPath -- Build phase onFailure BuildFailed $ do noticeProgress ProgressBuilding - setup buildCommand' buildCommonFlags buildFlags mLogPath + setup buildCommand' buildCommonFlags (return . buildFlags) mLogPath -- Doc generation phase docsResult <- if shouldHaddock then ( do - setup haddockCommand haddockCommonFlags haddockFlags' mLogPath + setup haddockCommand haddockCommonFlags (return . haddockFlags') mLogPath return DocsOk ) `catchIO` (\_ -> return DocsFailed) @@ -1936,7 +1938,7 @@ installUnpackedPackage -- Tests phase onFailure TestsFailed $ do when (testsEnabled && PackageDescription.hasTests pkg) $ - setup Cabal.testCommand testCommonFlags testFlags' mLogPath + setup Cabal.testCommand testCommonFlags (return . testFlags') mLogPath let testsResult | testsEnabled = TestsOk @@ -1953,7 +1955,7 @@ installUnpackedPackage platform pkg $ do - setup Cabal.copyCommand copyCommonFlags copyFlags mLogPath + setup Cabal.copyCommand copyCommonFlags (return . copyFlags) mLogPath -- Capture installed package configuration file, so that -- it can be incorporated into the final InstallPlan @@ -2021,7 +2023,7 @@ installUnpackedPackage genPkgConfs flags mLogPath = do tmp <- getTemporaryDirectory withTempDirectory verbosity tmp (tempTemplate "pkgConf") $ \dir -> do - let pkgConfDest = dir "pkgConf" + let pkgConfDest = makeSymbolicPath dir makeRelativePathEx "pkgConf" registerFlags' version = (flags version) { Cabal.regGenPkgConf = toFlag (Just pkgConfDest) @@ -2029,18 +2031,18 @@ installUnpackedPackage setup Cabal.registerCommand registerCommonFlags - registerFlags' + (return . registerFlags') mLogPath - is_dir <- doesDirectoryExist pkgConfDest + is_dir <- doesDirectoryExist (interpretSymbolicPathCWD pkgConfDest) let notHidden = not . isHidden isHidden name = "." `isPrefixOf` name if is_dir then -- Sort so that each prefix of the package -- configurations is well formed - traverse (readPkgConf pkgConfDest) . sort . filter notHidden - =<< getDirectoryContents pkgConfDest - else fmap (: []) $ readPkgConf "." pkgConfDest + traverse (readPkgConf (getSymbolicPath pkgConfDest)) . sort . filter notHidden + =<< getDirectoryContents (getSymbolicPath pkgConfDest) + else fmap (: []) $ readPkgConf "." (getSymbolicPath pkgConfDest) readPkgConf :: FilePath diff --git a/cabal-install/src/Distribution/Client/InstallSymlink.hs b/cabal-install/src/Distribution/Client/InstallSymlink.hs index 1701aa1f652..46e1edaebef 100644 --- a/cabal-install/src/Distribution/Client/InstallSymlink.hs +++ b/cabal-install/src/Distribution/Client/InstallSymlink.hs @@ -74,6 +74,9 @@ import Distribution.Simple.Utils (info, withTempDirectory) import Distribution.System ( Platform ) +import Distribution.Types.DependencySatisfaction + ( DependencySatisfaction (..) + ) import Distribution.Types.UnqualComponentName import System.Directory @@ -99,7 +102,7 @@ import System.IO.Error import Distribution.Client.Compat.Directory (createFileLink, getSymbolicLinkTarget, pathIsSymbolicLink) import Distribution.Client.Init.Prompt (promptYesNo) -import Distribution.Client.Init.Types (DefaultPrompt (MandatoryPrompt)) +import Distribution.Client.Init.Types (DefaultPrompt (MandatoryPrompt), runPromptIO) import Distribution.Client.Types.OverwritePolicy import qualified Data.ByteString as BS @@ -205,7 +208,7 @@ symlinkBinaries case finalizePD flags (enableStanzas stanzas) - (const True) + (const Satisfied) platform cinfo [] @@ -336,7 +339,7 @@ symlinkBinary inputs@Symlink{publicBindir, privateBindir, publicName, privateNam promptRun :: String -> IO Bool -> IO Bool promptRun s m = do - a <- promptYesNo s MandatoryPrompt + a <- runPromptIO $ promptYesNo s MandatoryPrompt if a then m else pure a -- | Check a file path of a symlink that we would like to create to see if it diff --git a/cabal-install/src/Distribution/Client/List.hs b/cabal-install/src/Distribution/Client/List.hs index b03211038de..480e2c46fd7 100644 --- a/cabal-install/src/Distribution/Client/List.hs +++ b/cabal-install/src/Distribution/Client/List.hs @@ -43,9 +43,6 @@ import Distribution.Types.Dependency import Distribution.Types.UnqualComponentName import Distribution.Simple.Compiler - ( Compiler - , PackageDBStack - ) import Distribution.Simple.PackageIndex (InstalledPackageIndex) import qualified Distribution.Simple.PackageIndex as InstalledPackageIndex import Distribution.Simple.Program (ProgramDb) @@ -141,7 +138,7 @@ import qualified Text.Regex.Posix.String as Regex -- | Return a list of packages matching given search strings. getPkgList :: Verbosity - -> PackageDBStack + -> PackageDBStackCWD -> RepoContext -> Maybe (Compiler, ProgramDb) -> ListFlags @@ -213,7 +210,7 @@ getPkgList verbosity packageDBs repoCtxt mcompprogdb listFlags pats = do -- | Show information about packages. list :: Verbosity - -> PackageDBStack + -> PackageDBStackCWD -> RepoContext -> Maybe (Compiler, ProgramDb) -> ListFlags @@ -249,7 +246,7 @@ list verbosity packageDBs repos mcompProgdb listFlags pats = do info :: Verbosity - -> PackageDBStack + -> PackageDBStackCWD -> RepoContext -> Compiler -> ProgramDb diff --git a/cabal-install/src/Distribution/Client/Main.hs b/cabal-install/src/Distribution/Client/Main.hs index de14fc129c9..5fdfc72d847 100644 --- a/cabal-install/src/Distribution/Client/Main.hs +++ b/cabal-install/src/Distribution/Client/Main.hs @@ -137,6 +137,7 @@ import qualified Distribution.Client.CmdRun as CmdRun import qualified Distribution.Client.CmdSdist as CmdSdist import qualified Distribution.Client.CmdTest as CmdTest import qualified Distribution.Client.CmdUpdate as CmdUpdate +import qualified Distribution.Client.Outdated as Outdated import Distribution.Client.Check as Check (check) import Distribution.Client.Configure (configure, writeConfigFlags) @@ -206,7 +207,7 @@ import Distribution.Simple.Command , defaultCommandFallback , hiddenCommand ) -import Distribution.Simple.Compiler (PackageDBStack) +import Distribution.Simple.Compiler (PackageDBStack, interpretPackageDBStack) import Distribution.Simple.Configure ( ConfigStateFileError (..) , configCompilerAuxEx @@ -275,7 +276,7 @@ import System.IO , stderr , stdout ) -import System.Process (createProcess, env, proc) +import System.Process (createProcess, env, proc, waitForProcess) -- | Entry point -- @@ -383,7 +384,7 @@ mainWorker args = do result <- try $ createProcess ((proc exec (name : cmdArgs)){env = Just new_env}) case result of Left ex -> printErrors ["Error executing external command: " ++ show (ex :: SomeException)] - Right _ -> return () + Right (_, _, _, ph) -> waitForProcess ph >>= exitWith printCommandHelp help = do pname <- getProgName @@ -527,7 +528,7 @@ wrapperAction command getCommonFlags = Nothing command getCommonFlags - (const flags) + (const (return flags)) (const extraArgs) configureAction @@ -560,7 +561,7 @@ configureAction (configFlags, configExFlags) extraArgs globalFlags = do withRepoContext verbosity globalFlags' $ \repoContext -> configure verbosity - packageDBs + (interpretPackageDBStack Nothing packageDBs) repoContext comp platform @@ -636,7 +637,7 @@ build verbosity config distPref buildFlags extraArgs = Nothing (Cabal.buildCommand progDb) buildCommonFlags - mkBuildFlags + (return . mkBuildFlags) (const extraArgs) where progDb = defaultProgramDb @@ -729,7 +730,7 @@ replAction replFlags extraArgs globalFlags = do Nothing (Cabal.replCommand progDb) Cabal.replCommonFlags - (const replFlags') + (const (return replFlags')) (const extraArgs) -- No .cabal file in the current directory: just start the REPL (possibly @@ -776,7 +777,7 @@ installAction (configFlags, _, installFlags, _, _, _) _ globalFlags Nothing installCommand (const common) - (const (mempty, mempty, mempty, mempty, mempty, mempty)) + (const (return (mempty, mempty, mempty, mempty, mempty, mempty))) (const []) installAction ( configFlags @@ -853,7 +854,7 @@ installAction withRepoContext verb globalFlags' $ \repoContext -> install verb - (configPackageDB' configFlags') + (interpretPackageDBStack Nothing (configPackageDB' configFlags')) repoContext comp platform @@ -943,7 +944,7 @@ testAction (buildFlags, testFlags) extraArgs globalFlags = do Nothing Cabal.testCommand Cabal.testCommonFlags - (const testFlags') + (const (return testFlags')) (const extraArgs') data ComponentNames @@ -1064,7 +1065,7 @@ benchmarkAction Nothing Cabal.benchmarkCommand Cabal.benchmarkCommonFlags - (const benchmarkFlags') + (const (return benchmarkFlags')) (const extraArgs') haddockAction :: HaddockFlags -> [String] -> Action @@ -1104,7 +1105,7 @@ haddockAction haddockFlags extraArgs globalFlags = do Nothing haddockCommand haddockCommonFlags - (const haddockFlags') + (const (return haddockFlags')) (const extraArgs) when (haddockForHackage haddockFlags == Flag ForHackage) $ do pkg <- fmap LBI.localPkgDescr (getPersistBuildConfig mbWorkDir distPref) @@ -1139,7 +1140,7 @@ cleanAction cleanFlags extraArgs globalFlags = do Nothing cleanCommand cleanCommonFlags - (const cleanFlags') + (const (return cleanFlags')) (const extraArgs) listAction :: ListFlags -> [String] -> Action @@ -1164,7 +1165,7 @@ listAction listFlags extraArgs globalFlags = do withRepoContext verbosity globalFlags' $ \repoContext -> List.list verbosity - (configPackageDB' configFlags) + (interpretPackageDBStack Nothing (configPackageDB' configFlags)) repoContext compProgdb listFlags @@ -1187,7 +1188,7 @@ infoAction infoFlags extraArgs globalFlags = do withRepoContext verbosity globalFlags' $ \repoContext -> List.info verbosity - (configPackageDB' configFlags) + (interpretPackageDBStack Nothing (configPackageDB' configFlags)) repoContext comp progdb @@ -1206,7 +1207,7 @@ fetchAction fetchFlags extraArgs globalFlags = do withRepoContext verbosity globalFlags' $ \repoContext -> fetch verbosity - (configPackageDB' configFlags) + (interpretPackageDBStack Nothing (configPackageDB' configFlags)) repoContext comp platform @@ -1228,7 +1229,7 @@ freezeAction freezeFlags _extraArgs globalFlags = do withRepoContext verbosity globalFlags' $ \repoContext -> freeze verbosity - (configPackageDB' configFlags) + (interpretPackageDBStack Nothing (configPackageDB' configFlags)) repoContext comp platform @@ -1249,7 +1250,7 @@ genBoundsAction freezeFlags _extraArgs globalFlags = do withRepoContext verbosity globalFlags' $ \repoContext -> genBounds verbosity - (configPackageDB' configFlags) + (interpretPackageDBStack Nothing (configPackageDB' configFlags)) repoContext comp platform @@ -1433,7 +1434,7 @@ initAction initFlags extraArgs globalFlags = do withRepoContext verbosity globalFlags' $ \repoContext -> initCmd verbosity - (configPackageDB' confFlags') + (interpretPackageDBStack Nothing (configPackageDB' confFlags')) repoContext comp progdb @@ -1470,8 +1471,8 @@ actAsSetupAction actAsSetupFlags args _globalFlags = in case bt of Simple -> Simple.defaultMainArgs args Configure -> - Simple.defaultMainWithHooksArgs - Simple.autoconfUserHooks + Simple.defaultMainWithSetupHooksArgs + Simple.autoconfSetupHooks args Make -> Make.defaultMainArgs args Hooks -> error "actAsSetupAction Hooks" diff --git a/cabal-install/src/Distribution/Client/CmdOutdated.hs b/cabal-install/src/Distribution/Client/Outdated.hs similarity index 99% rename from cabal-install/src/Distribution/Client/CmdOutdated.hs rename to cabal-install/src/Distribution/Client/Outdated.hs index ed40a1a85e6..c3020d5ccb4 100644 --- a/cabal-install/src/Distribution/Client/CmdOutdated.hs +++ b/cabal-install/src/Distribution/Client/Outdated.hs @@ -13,7 +13,7 @@ -- -- Implementation of the 'outdated' command. Checks for outdated -- dependencies in the package description file or freeze file. -module Distribution.Client.CmdOutdated +module Distribution.Client.Outdated ( outdatedCommand , outdatedAction , ListOutdatedSettings (..) @@ -129,6 +129,9 @@ import Distribution.Types.ComponentRequestedSpec import Distribution.Types.Dependency ( Dependency (..) ) +import Distribution.Types.DependencySatisfaction + ( DependencySatisfaction (..) + ) import Distribution.Types.PackageVersionConstraint ( PackageVersionConstraint (..) , simplifyPackageVersionConstraint @@ -443,7 +446,7 @@ depsFromPkgDesc verbosity comp platform = do finalizePD mempty (ComponentRequestedSpec True True) - (const True) + (const Satisfied) platform cinfo [] diff --git a/cabal-install/src/Distribution/Client/PackageHash.hs b/cabal-install/src/Distribution/Client/PackageHash.hs index 2e7b9320e3d..2c5eb4897e0 100644 --- a/cabal-install/src/Distribution/Client/PackageHash.hs +++ b/cabal-install/src/Distribution/Client/PackageHash.hs @@ -44,7 +44,7 @@ import Distribution.Simple.Compiler , CompilerId , DebugInfoLevel (..) , OptimisationLevel (..) - , PackageDB + , PackageDBCWD , ProfDetailLevel (..) , showProfDetailLevel ) @@ -221,7 +221,7 @@ data PackageHashConfigInputs = PackageHashConfigInputs , pkgHashExtraIncludeDirs :: [FilePath] , pkgHashProgPrefix :: Maybe PathTemplate , pkgHashProgSuffix :: Maybe PathTemplate - , pkgHashPackageDbs :: [Maybe PackageDB] + , pkgHashPackageDbs :: [Maybe PackageDBCWD] , -- Haddock options pkgHashDocumentation :: Bool , pkgHashHaddockHoogle :: Bool @@ -240,6 +240,7 @@ data PackageHashConfigInputs = PackageHashConfigInputs , pkgHashHaddockBaseUrl :: Maybe String , pkgHashHaddockResourcesDir :: Maybe String , pkgHashHaddockOutputDir :: Maybe FilePath + , pkgHashHaddockUseUnicode :: Bool -- TODO: [required eventually] pkgHashToolsVersions ? -- TODO: [required eventually] pkgHashToolsExtraOptions ? } @@ -349,6 +350,7 @@ renderPackageHashInputs , opt "haddock-base-url" Nothing (fromMaybe "") pkgHashHaddockBaseUrl , opt "haddock-resources-dir" Nothing (fromMaybe "") pkgHashHaddockResourcesDir , opt "haddock-output-dir" Nothing (fromMaybe "") pkgHashHaddockOutputDir + , opt "haddock-use-unicode" False prettyShow pkgHashHaddockUseUnicode ] ++ Map.foldrWithKey (\prog args acc -> opt (prog ++ "-options") [] unwords args : acc) [] pkgHashProgramArgs where diff --git a/cabal-install/src/Distribution/Client/ProjectBuilding.hs b/cabal-install/src/Distribution/Client/ProjectBuilding.hs index addc35089c2..4d7bde7fc55 100644 --- a/cabal-install/src/Distribution/Client/ProjectBuilding.hs +++ b/cabal-install/src/Distribution/Client/ProjectBuilding.hs @@ -72,10 +72,6 @@ import Distribution.Client.Types hiding import Distribution.Package import Distribution.Simple.Compiler - ( Compiler - , PackageDB (..) - , jsemSupported - ) import Distribution.Simple.Program import qualified Distribution.Simple.Register as Cabal @@ -478,7 +474,7 @@ createPackageDBIfMissing :: Verbosity -> Compiler -> ProgramDb - -> PackageDB + -> PackageDBCWD -> IO () createPackageDBIfMissing verbosity diff --git a/cabal-install/src/Distribution/Client/ProjectBuilding/PackageFileMonitor.hs b/cabal-install/src/Distribution/Client/ProjectBuilding/PackageFileMonitor.hs index b93064ea7be..71d31cb5926 100644 --- a/cabal-install/src/Distribution/Client/ProjectBuilding/PackageFileMonitor.hs +++ b/cabal-install/src/Distribution/Client/ProjectBuilding/PackageFileMonitor.hs @@ -26,7 +26,7 @@ import Distribution.Simple.LocalBuildInfo ) import qualified Data.Set as Set -import Distribution.Client.Init.Types (removeExistingFile) +import Distribution.Client.Init.Types (removeExistingFile, runPromptIO) ----------------------------- -- Package change detection @@ -291,4 +291,4 @@ updatePackageRegFileMonitor invalidatePackageRegFileMonitor :: PackageFileMonitor -> IO () invalidatePackageRegFileMonitor PackageFileMonitor{pkgFileMonitorReg} = - removeExistingFile (fileMonitorCacheFile pkgFileMonitorReg) + runPromptIO $ removeExistingFile (fileMonitorCacheFile pkgFileMonitorReg) diff --git a/cabal-install/src/Distribution/Client/ProjectBuilding/UnpackedPackage.hs b/cabal-install/src/Distribution/Client/ProjectBuilding/UnpackedPackage.hs index 7d9f34a8e8b..9e3b91d1753 100644 --- a/cabal-install/src/Distribution/Client/ProjectBuilding/UnpackedPackage.hs +++ b/cabal-install/src/Distribution/Client/ProjectBuilding/UnpackedPackage.hs @@ -44,10 +44,14 @@ import Distribution.Client.FileMonitor import Distribution.Client.JobControl import Distribution.Client.Setup ( CommonSetupFlags - , filterCommonFlags + , filterBenchmarkFlags + , filterBuildFlags , filterConfigureFlags + , filterCopyFlags , filterHaddockArgs , filterHaddockFlags + , filterRegisterFlags + , filterReplFlags , filterTestFlags ) import Distribution.Client.SetupWrapper @@ -73,7 +77,8 @@ import qualified Distribution.PackageDescription as PD import Distribution.Simple.BuildPaths (haddockDirName) import Distribution.Simple.Command (CommandUI) import Distribution.Simple.Compiler - ( PackageDBStack + ( PackageDBStackCWD + , coercePackageDBStack ) import qualified Distribution.Simple.InstallDirs as InstallDirs import Distribution.Simple.LocalBuildInfo @@ -99,7 +104,7 @@ import qualified Data.ByteString.Lazy as LBS import qualified Data.ByteString.Lazy.Char8 as LBS.Char8 import qualified Data.List.NonEmpty as NE -import Control.Exception (ErrorCall, Handler (..), SomeAsyncException, assert, catches) +import Control.Exception (ErrorCall, Handler (..), SomeAsyncException, assert, catches, onException) import System.Directory (canonicalizePath, createDirectoryIfMissing, doesDirectoryExist, doesFileExist, removeFile) import System.FilePath (dropDrive, normalise, takeDirectory, (<.>), ()) import System.IO (Handle, IOMode (AppendMode), withFile) @@ -133,7 +138,7 @@ data PackageBuildingPhase | PBInstallPhase { runCopy :: FilePath -> IO () , runRegister - :: PackageDBStack + :: PackageDBStackCWD -> Cabal.RegisterOptions -> IO InstalledPackageInfo } @@ -191,21 +196,21 @@ buildAndRegisterUnpackedPackage delegate $ PBBuildPhase $ annotateFailure mlogFile BuildFailed $ do - setup buildCommand Cabal.buildCommonFlags buildFlags buildArgs + setup buildCommand Cabal.buildCommonFlags (return . buildFlags) buildArgs -- Haddock phase whenHaddock $ delegate $ PBHaddockPhase $ annotateFailure mlogFile HaddocksFailed $ do - setup haddockCommand Cabal.haddockCommonFlags haddockFlags haddockArgs + setup haddockCommand Cabal.haddockCommonFlags (return . haddockFlags) haddockArgs -- Install phase delegate $ PBInstallPhase { runCopy = \destdir -> annotateFailure mlogFile InstallFailed $ - setup Cabal.copyCommand Cabal.copyCommonFlags (copyFlags destdir) copyArgs + setup Cabal.copyCommand Cabal.copyCommonFlags (return . copyFlags destdir) copyArgs , runRegister = \pkgDBStack registerOpts -> annotateFailure mlogFile InstallFailed $ do -- We register ourselves rather than via Setup.hs. We need to @@ -219,7 +224,7 @@ buildAndRegisterUnpackedPackage compiler progdb Nothing - pkgDBStack + (coercePackageDBStack pkgDBStack) ipkg registerOpts return ipkg @@ -230,14 +235,14 @@ buildAndRegisterUnpackedPackage delegate $ PBTestPhase $ annotateFailure mlogFile TestsFailed $ - setup testCommand Cabal.testCommonFlags testFlags testArgs + setup testCommand Cabal.testCommonFlags (return . testFlags) testArgs -- Bench phase whenBench $ delegate $ PBBenchPhase $ annotateFailure mlogFile BenchFailed $ - setup benchCommand Cabal.benchmarkCommonFlags benchFlags benchArgs + setup benchCommand Cabal.benchmarkCommonFlags (return . benchFlags) benchArgs -- Repl phase whenRepl $ @@ -271,30 +276,36 @@ buildAndRegisterUnpackedPackage | otherwise = return () mbWorkDir = useWorkingDir scriptOptions - commonFlags v = - flip filterCommonFlags v $ - setupHsCommonFlags verbosity mbWorkDir builddir + commonFlags = setupHsCommonFlags verbosity mbWorkDir builddir configureCommand = Cabal.configureCommand defaultProgramDb configureFlags v = - flip filterConfigureFlags v $ - setupHsConfigureFlags + flip filterConfigureFlags v + <$> setupHsConfigureFlags + (\p -> makeSymbolicPath <$> canonicalizePath p) plan rpkg pkgshared - (commonFlags v) + commonFlags configureArgs _ = setupHsConfigureArgs pkg buildCommand = Cabal.buildCommand defaultProgramDb - buildFlags v = setupHsBuildFlags comp_par_strat pkg pkgshared $ commonFlags v + buildFlags v = + flip filterBuildFlags v $ + setupHsBuildFlags + comp_par_strat + pkg + pkgshared + commonFlags buildArgs _ = setupHsBuildArgs pkg copyFlags destdir v = - setupHsCopyFlags - pkg - pkgshared - (commonFlags v) - destdir + flip filterCopyFlags v $ + setupHsCopyFlags + pkg + pkgshared + commonFlags + destdir -- In theory, we could want to copy less things than those that were -- built, but instead, we simply copy the targets that were built. copyArgs = buildArgs @@ -304,23 +315,25 @@ buildAndRegisterUnpackedPackage flip filterTestFlags v $ setupHsTestFlags pkg - (commonFlags v) + commonFlags testArgs _ = setupHsTestArgs pkg benchCommand = Cabal.benchmarkCommand benchFlags v = - setupHsBenchFlags - pkg - pkgshared - (commonFlags v) + flip filterBenchmarkFlags v $ + setupHsBenchFlags + pkg + pkgshared + commonFlags benchArgs _ = setupHsBenchArgs pkg replCommand = Cabal.replCommand defaultProgramDb replFlags v = - setupHsReplFlags - pkg - pkgshared - (commonFlags v) + flip filterReplFlags v $ + setupHsReplFlags + pkg + pkgshared + commonFlags replArgs _ = setupHsReplArgs pkg haddockCommand = Cabal.haddockCommand @@ -330,7 +343,7 @@ buildAndRegisterUnpackedPackage pkg pkgshared buildTimeSettings - (commonFlags v) + commonFlags haddockArgs v = flip filterHaddockArgs v $ setupHsHaddockArgs pkg @@ -349,11 +362,11 @@ buildAndRegisterUnpackedPackage setup :: CommandUI flags -> (flags -> CommonSetupFlags) - -> (Version -> flags) + -> (Version -> IO flags) -> (Version -> [String]) -> IO () setup cmd getCommonFlags flags args = - withLogging $ \mLogFileHandle -> + withLogging $ \mLogFileHandle -> do setupWrapper verbosity scriptOptions @@ -382,7 +395,7 @@ buildAndRegisterUnpackedPackage (Just (elabPkgDescription pkg)) cmd getCommonFlags - flags + (\v -> return (flags v)) args generateInstalledPackageInfo :: IO InstalledPackageInfo @@ -392,12 +405,13 @@ buildAndRegisterUnpackedPackage distTempDirectory $ \pkgConfDest -> do let registerFlags v = - setupHsRegisterFlags - pkg - pkgshared - (commonFlags v) - pkgConfDest - setup (Cabal.registerCommand) Cabal.registerCommonFlags registerFlags (const []) + flip filterRegisterFlags v $ + setupHsRegisterFlags + pkg + pkgshared + commonFlags + pkgConfDest + setup (Cabal.registerCommand) Cabal.registerCommonFlags (\v -> return (registerFlags v)) (const []) withLogging :: (Maybe Handle -> IO r) -> IO r withLogging action = @@ -480,6 +494,10 @@ buildInplaceUnpackedPackage whenRebuild $ do timestamp <- beginUpdateFileMonitor runBuild + -- Be sure to invalidate the cache if building throws an exception! + -- If not, we'll abort execution with a stale recompilation cache. + -- See ghc#24926 for an example of how this can go wrong. + `onException` invalidatePackageRegFileMonitor packageFileMonitor let listSimple = execRebuild (getSymbolicPath srcdir) (needElaboratedConfiguredPackage pkg) diff --git a/cabal-install/src/Distribution/Client/ProjectConfig.hs b/cabal-install/src/Distribution/Client/ProjectConfig.hs index 99dde932037..aabb318e9d9 100644 --- a/cabal-install/src/Distribution/Client/ProjectConfig.hs +++ b/cabal-install/src/Distribution/Client/ProjectConfig.hs @@ -3,6 +3,7 @@ {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE RecordWildCards #-} +{-# LANGUAGE TypeApplications #-} -- | Handling project configuration. module Distribution.Client.ProjectConfig @@ -18,8 +19,10 @@ module Distribution.Client.ProjectConfig -- * Project root , findProjectRoot + , getProjectRootUsability , ProjectRoot (..) - , BadProjectRoot + , BadProjectRoot (..) + , ProjectRootUsability (..) -- * Project config files , readProjectConfig @@ -102,9 +105,8 @@ import Distribution.Client.HttpUtils import Distribution.Client.Types import Distribution.Client.Utils.Parsec (renderParseError) +import Distribution.Solver.Types.ConstraintSource import Distribution.Solver.Types.PackageConstraint - ( PackageProperty (..) - ) import Distribution.Solver.Types.Settings import Distribution.Solver.Types.SourcePackage @@ -116,6 +118,7 @@ import Distribution.Client.Setup import Distribution.Client.SrcDist ( packageDirToSdist ) +import Distribution.Client.Targets import Distribution.Client.Types.SourceRepo ( SourceRepoList , SourceRepositoryPackage (..) @@ -136,11 +139,6 @@ import Distribution.Fields , showPWarning ) import Distribution.Package - ( PackageId - , PackageName - , UnitId - , packageId - ) import Distribution.PackageDescription.Parsec ( parseGenericPackageDescription ) @@ -195,14 +193,13 @@ import Distribution.Verbosity , verbose ) import Distribution.Version - ( Version - ) import qualified Codec.Archive.Tar as Tar import qualified Codec.Archive.Tar.Entry as Tar import qualified Distribution.Client.GZipUtils as GZipUtils import qualified Distribution.Client.Tar as Tar +import Control.Exception (handle) import Control.Monad.Trans (liftIO) import qualified Data.ByteString as BS import qualified Data.ByteString.Lazy as LBS @@ -222,9 +219,11 @@ import System.Directory ( canonicalizePath , doesDirectoryExist , doesFileExist + , doesPathExist , getCurrentDirectory , getDirectoryContents , getHomeDirectory + , pathIsSymbolicLink ) import System.FilePath hiding (combine) import System.IO @@ -317,9 +316,34 @@ resolveSolverSettings where -- TODO: [required eventually] some of these settings need validation, e.g. -- the flag assignments need checking. + cabalPkgname = mkPackageName "Cabal" + + profilingDynamicConstraint = + ( UserConstraint + (UserAnySetupQualifier cabalPkgname) + (PackagePropertyVersion $ orLaterVersion (mkVersion [3, 13, 0])) + , ConstraintSourceProfiledDynamic + ) + + profDynEnabledGlobally = fromFlagOrDefault False (packageConfigProfShared projectConfigLocalPackages) + + profDynEnabledAnyLocally = + or + [ fromFlagOrDefault False (packageConfigProfShared ppc) + | (_, ppc) <- Map.toList (getMapMappend projectConfigSpecificPackage) + ] + + -- Add a setup.Cabal >= 3.13 constraint if prof+dyn is enabled globally + -- or any package in the project enables it. + -- Ideally we'd apply this constraint only on the closure of packages requiring prof+dyn, + -- but that would require another solver run for marginal advantages that + -- will further shrink as 3.13 is adopted. + solverCabalLibConstraints = + [profilingDynamicConstraint | profDynEnabledGlobally || profDynEnabledAnyLocally] + solverSettingRemoteRepos = fromNubList projectConfigRemoteRepos solverSettingLocalNoIndexRepos = fromNubList projectConfigLocalNoIndexRepos - solverSettingConstraints = projectConfigConstraints + solverSettingConstraints = solverCabalLibConstraints ++ projectConfigConstraints solverSettingPreferences = projectConfigPreferences solverSettingFlagAssignment = packageConfigFlagAssignment projectConfigLocalPackages solverSettingFlagAssignments = @@ -511,6 +535,24 @@ resolveBuildTimeSettings -- Reading and writing project config files -- +-- | Get @ProjectRootUsability@ of a given file +getProjectRootUsability :: FilePath -> IO ProjectRootUsability +getProjectRootUsability filePath = do + exists <- doesFileExist filePath + if exists + then return ProjectRootUsabilityPresentAndUsable + else do + let isUsableAction = + handle @IOException + -- NOTE: if any IOException is raised, we assume the file does not exist. + -- That is what happen when we call @pathIsSymbolicLink@ on a @FilePath@ that does not exist. + (const $ pure False) + ((||) <$> pathIsSymbolicLink filePath <*> doesPathExist filePath) + isUnusable <- isUsableAction + if isUnusable + then return ProjectRootUsabilityPresentAndUnusable + else return ProjectRootUsabilityNotPresent + -- | Find the root of this project. -- -- The project directory will be one of the following: @@ -534,13 +576,18 @@ findProjectRoot verbosity mprojectDir mprojectFile = do "Specifying an absolute path to the project file is deprecated." <> " Use --project-dir to set the project's directory." - doesFileExist file >>= \case - False -> left (BadProjectRootExplicitFile file) - True -> uncurry projectRoot =<< first dropTrailingPathSeparator . splitFileName <$> canonicalizePath file + getProjectRootUsability file >>= \case + ProjectRootUsabilityPresentAndUsable -> + uncurry projectRoot + =<< first dropTrailingPathSeparator . splitFileName <$> canonicalizePath file + ProjectRootUsabilityNotPresent -> + left (BadProjectRootExplicitFileNotFound file) + ProjectRootUsabilityPresentAndUnusable -> + left (BadProjectRootFileBroken file) | otherwise -> probeProjectRoot mprojectFile Just dir -> doesDirectoryExist dir >>= \case - False -> left (BadProjectRootDir dir) + False -> left (BadProjectRootDirNotFound dir) True -> do projectDir <- canonicalizePath dir @@ -548,13 +595,21 @@ findProjectRoot verbosity mprojectDir mprojectFile = do Nothing -> pure $ Right (ProjectRootExplicit projectDir defaultProjectFile) Just projectFile | isAbsolute projectFile -> - doesFileExist projectFile >>= \case - False -> left (BadProjectRootAbsoluteFile projectFile) - True -> Right . ProjectRootExplicitAbsolute dir <$> canonicalizePath projectFile + getProjectRootUsability projectFile >>= \case + ProjectRootUsabilityNotPresent -> + left (BadProjectRootAbsoluteFileNotFound projectFile) + ProjectRootUsabilityPresentAndUsable -> + Right . ProjectRootExplicitAbsolute dir <$> canonicalizePath projectFile + ProjectRootUsabilityPresentAndUnusable -> + left (BadProjectRootFileBroken projectFile) | otherwise -> - doesFileExist (projectDir projectFile) >>= \case - False -> left (BadProjectRootDirFile dir projectFile) - True -> projectRoot projectDir projectFile + getProjectRootUsability (projectDir projectFile) >>= \case + ProjectRootUsabilityNotPresent -> + left (BadProjectRootDirFileNotFound dir projectFile) + ProjectRootUsabilityPresentAndUsable -> + projectRoot projectDir projectFile + ProjectRootUsabilityPresentAndUnusable -> + left (BadProjectRootFileBroken projectFile) where left = pure . Left @@ -579,45 +634,50 @@ probeProjectRoot mprojectFile = do go dir | isDrive dir || dir == homedir = case mprojectFile of Nothing -> return (Right (ProjectRootImplicit startdir)) - Just file -> return (Left (BadProjectRootExplicitFile file)) + Just file -> return (Left (BadProjectRootExplicitFileNotFound file)) go dir = do - exists <- doesFileExist (dir projectFileName) - if exists - then return (Right (ProjectRootExplicit dir projectFileName)) - else go (takeDirectory dir) + getProjectRootUsability (dir projectFileName) >>= \case + ProjectRootUsabilityNotPresent -> + go (takeDirectory dir) + ProjectRootUsabilityPresentAndUsable -> + return (Right $ ProjectRootExplicit dir projectFileName) + ProjectRootUsabilityPresentAndUnusable -> + return (Left $ BadProjectRootFileBroken projectFileName) -- | Errors returned by 'findProjectRoot'. data BadProjectRoot - = BadProjectRootExplicitFile FilePath - | BadProjectRootDir FilePath - | BadProjectRootAbsoluteFile FilePath - | BadProjectRootDirFile FilePath FilePath -#if MIN_VERSION_base(4,8,0) - deriving (Show, Typeable) -#else - deriving (Typeable) - -instance Show BadProjectRoot where - show = renderBadProjectRoot -#endif + = BadProjectRootExplicitFileNotFound FilePath + | BadProjectRootDirNotFound FilePath + | BadProjectRootAbsoluteFileNotFound FilePath + | BadProjectRootDirFileNotFound FilePath FilePath + | BadProjectRootFileBroken FilePath + deriving (Show, Typeable, Eq) -#if MIN_VERSION_base(4,8,0) instance Exception BadProjectRoot where displayException = renderBadProjectRoot -#else -instance Exception BadProjectRoot -#endif renderBadProjectRoot :: BadProjectRoot -> String renderBadProjectRoot = \case - BadProjectRootExplicitFile projectFile -> + BadProjectRootExplicitFileNotFound projectFile -> "The given project file '" ++ projectFile ++ "' does not exist." - BadProjectRootDir dir -> + BadProjectRootDirNotFound dir -> "The given project directory '" <> dir <> "' does not exist." - BadProjectRootAbsoluteFile file -> + BadProjectRootAbsoluteFileNotFound file -> "The given project file '" <> file <> "' does not exist." - BadProjectRootDirFile dir file -> + BadProjectRootDirFileNotFound dir file -> "The given project directory/file combination '" <> dir file <> "' does not exist." + BadProjectRootFileBroken file -> + "The given project file '" <> file <> "' is broken. Is it a broken symbolic link?" + +-- | State of the project file, encodes if the file can be used +data ProjectRootUsability + = -- | The file is present and can be used + ProjectRootUsabilityPresentAndUsable + | -- | The file is present but can't be used (e.g. broken symlink) + ProjectRootUsabilityPresentAndUnusable + | -- | The file is not present + ProjectRootUsabilityNotPresent + deriving (Eq, Show) withGlobalConfig :: Verbosity @@ -826,21 +886,11 @@ data ProjectPackageLocation -- | Exception thrown by 'findProjectPackages'. data BadPackageLocations = BadPackageLocations (Set ProjectConfigProvenance) [BadPackageLocation] -#if MIN_VERSION_base(4,8,0) deriving (Show, Typeable) -#else - deriving (Typeable) - -instance Show BadPackageLocations where - show = renderBadPackageLocations -#endif -#if MIN_VERSION_base(4,8,0) instance Exception BadPackageLocations where displayException = renderBadPackageLocations -#else -instance Exception BadPackageLocations -#endif + -- TODO: [nice to have] custom exception subclass for Doc rendering, colour etc data BadPackageLocation @@ -1512,11 +1562,8 @@ instance Show CabalFileParseError where . showChar ' ' . showsPrec 11 ws -instance Exception CabalFileParseError -#if MIN_VERSION_base(4,8,0) - where +instance Exception CabalFileParseError where displayException = renderCabalFileParseError -#endif renderCabalFileParseError :: CabalFileParseError -> String renderCabalFileParseError (CabalFileParseError filePath contents errors _ warnings) = @@ -1658,21 +1705,11 @@ truncateString n s data BadPerPackageCompilerPaths = BadPerPackageCompilerPaths [(PackageName, String)] -#if MIN_VERSION_base(4,8,0) deriving (Show, Typeable) -#else - deriving (Typeable) -instance Show BadPerPackageCompilerPaths where - show = renderBadPerPackageCompilerPaths -#endif - -#if MIN_VERSION_base(4,8,0) instance Exception BadPerPackageCompilerPaths where displayException = renderBadPerPackageCompilerPaths -#else -instance Exception BadPerPackageCompilerPaths -#endif + -- TODO: [nice to have] custom exception subclass for Doc rendering, colour etc renderBadPerPackageCompilerPaths :: BadPerPackageCompilerPaths -> String diff --git a/cabal-install/src/Distribution/Client/ProjectConfig/Legacy.hs b/cabal-install/src/Distribution/Client/ProjectConfig/Legacy.hs index ddb6f615264..7ed13df1232 100644 --- a/cabal-install/src/Distribution/Client/ProjectConfig/Legacy.hs +++ b/cabal-install/src/Distribution/Client/ProjectConfig/Legacy.hs @@ -85,6 +85,7 @@ import Distribution.Simple.Compiler ( CompilerInfo (..) , DebugInfoLevel (..) , OptimisationLevel (..) + , interpretPackageDB ) import Distribution.Simple.InstallDirs (CopyDest (NoCopyDest)) import Distribution.Simple.LocalBuildInfo @@ -508,6 +509,7 @@ commandLineFlagsToProjectConfig globalFlags NixStyleFlags{..} clientInstallFlags , packageConfigHaddockInternal = packageConfigHaddockInternal pc , packageConfigHaddockQuickJump = packageConfigHaddockQuickJump pc , packageConfigHaddockLinkedSource = packageConfigHaddockLinkedSource pc + , packageConfigHaddockUseUnicode = packageConfigHaddockUseUnicode pc } ) @@ -684,6 +686,8 @@ convertLegacyAllPackageFlags globalFlags configFlags configExFlags installFlags , globalStoreDir = projectConfigStoreDir } = globalFlags + projectConfigPackageDBs = (fmap . fmap) (interpretPackageDB Nothing) projectConfigPackageDBs_ + ConfigFlags { configCommonFlags = commonFlags , configHcFlavor = projectConfigHcFlavor @@ -692,7 +696,7 @@ convertLegacyAllPackageFlags globalFlags configFlags configExFlags installFlags , -- configProgramPathExtra = projectConfigProgPathExtra DELETE ME configInstallDirs = projectConfigInstallDirs , -- configUserInstall = projectConfigUserInstall, - configPackageDBs = projectConfigPackageDBs + configPackageDBs = projectConfigPackageDBs_ } = configFlags CommonSetupFlags @@ -768,6 +772,7 @@ convertLegacyPerPackageFlags , configFullyStaticExe = packageConfigFullyStaticExe , configProfExe = packageConfigProfExe , configProf = packageConfigProf + , configProfShared = packageConfigProfShared , configProfDetail = packageConfigProfDetail , configProfLibDetail = packageConfigProfLibDetail , configConfigureArgs = packageConfigConfigureArgs @@ -823,6 +828,7 @@ convertLegacyPerPackageFlags , haddockBaseUrl = packageConfigHaddockBaseUrl , haddockResourcesDir = packageConfigHaddockResourcesDir , haddockOutputDir = packageConfigHaddockOutputDir + , haddockUseUnicode = packageConfigHaddockUseUnicode } = haddockFlags TestFlags @@ -856,8 +862,8 @@ convertLegacyBuildOnlyFlags installFlags clientInstallFlags haddockFlags - _ - _ = + _testFlags + _benchmarkFlags = ProjectConfigBuildOnly{..} where projectConfigClientInstallFlags = clientInstallFlags @@ -974,7 +980,7 @@ convertToLegacySharedConfig configFlags = mempty { configCommonFlags = commonFlags - , configPackageDBs = projectConfigPackageDBs + , configPackageDBs = fmap (fmap (fmap unsafeMakeSymbolicPath)) projectConfigPackageDBs , configInstallDirs = projectConfigInstallDirs } @@ -1074,6 +1080,7 @@ convertToLegacyAllPackageConfig , configFullyStaticExe = mempty , configProfExe = mempty , configProf = mempty + , configProfShared = mempty , configProfDetail = mempty , configProfLibDetail = mempty , configConfigureArgs = mempty @@ -1112,6 +1119,7 @@ convertToLegacyAllPackageConfig , configDumpBuildInfo = mempty , configAllowDependingOnPrivateLibs = mempty , configCoverageFor = mempty + , configIgnoreBuildTools = mempty } haddockFlags = @@ -1150,6 +1158,7 @@ convertToLegacyPerPackageConfig PackageConfig{..} = , configFullyStaticExe = packageConfigFullyStaticExe , configProfExe = packageConfigProfExe , configProf = packageConfigProf + , configProfShared = packageConfigProfShared , configProfDetail = packageConfigProfDetail , configProfLibDetail = packageConfigProfLibDetail , configConfigureArgs = packageConfigConfigureArgs @@ -1188,6 +1197,7 @@ convertToLegacyPerPackageConfig PackageConfig{..} = , configDumpBuildInfo = packageConfigDumpBuildInfo , configAllowDependingOnPrivateLibs = mempty , configCoverageFor = mempty + , configIgnoreBuildTools = mempty } installFlags = @@ -1220,6 +1230,7 @@ convertToLegacyPerPackageConfig PackageConfig{..} = , haddockBaseUrl = packageConfigHaddockBaseUrl , haddockResourcesDir = packageConfigHaddockResourcesDir , haddockOutputDir = packageConfigHaddockOutputDir + , haddockUseUnicode = packageConfigHaddockUseUnicode } testFlags = @@ -1545,11 +1556,13 @@ legacyPackageConfigFieldDescrs = , "program-suffix" , "library-vanilla" , "library-profiling" + , "library-vanilla" , "shared" , "static" , "executable-dynamic" , "executable-static" , "profiling" + , "profiling-shared" , "executable-profiling" , "profiling-detail" , "library-profiling-detail" @@ -1621,6 +1634,7 @@ legacyPackageConfigFieldDescrs = , "base-url" , "resources-dir" , "output-dir" + , "use-unicode" ] . commandOptionsToFields ) diff --git a/cabal-install/src/Distribution/Client/ProjectConfig/Types.hs b/cabal-install/src/Distribution/Client/ProjectConfig/Types.hs index 2a6f9589cbb..a2826390de6 100644 --- a/cabal-install/src/Distribution/Client/ProjectConfig/Types.hs +++ b/cabal-install/src/Distribution/Client/ProjectConfig/Types.hs @@ -69,7 +69,7 @@ import Distribution.Simple.Compiler , CompilerFlavor , DebugInfoLevel (..) , OptimisationLevel (..) - , PackageDB + , PackageDBCWD , ProfDetailLevel ) import Distribution.Simple.InstallDirs @@ -198,7 +198,7 @@ data ProjectConfigShared = ProjectConfigShared -- projectConfigUserInstall :: Flag Bool, projectConfigInstallDirs :: InstallDirs (Flag PathTemplate) - , projectConfigPackageDBs :: [Maybe PackageDB] + , projectConfigPackageDBs :: [Maybe PackageDBCWD] , -- configuration used both by the solver and other phases projectConfigRemoteRepos :: NubList RemoteRepo -- ^ Available Hackage servers. @@ -265,6 +265,7 @@ data PackageConfig = PackageConfig , packageConfigFullyStaticExe :: Flag Bool , packageConfigProf :: Flag Bool -- TODO: [code cleanup] sort out , packageConfigProfLib :: Flag Bool -- this duplication + , packageConfigProfShared :: Flag Bool , packageConfigProfExe :: Flag Bool -- and consistency , packageConfigProfDetail :: Flag ProfDetailLevel , packageConfigProfLibDetail :: Flag ProfDetailLevel @@ -307,6 +308,7 @@ data PackageConfig = PackageConfig , packageConfigHaddockBaseUrl :: Flag String -- TODO: [required eventually] use this , packageConfigHaddockResourcesDir :: Flag String -- TODO: [required eventually] use this , packageConfigHaddockOutputDir :: Flag FilePath -- TODO: [required eventually] use this + , packageConfigHaddockUseUnicode :: Flag Bool -- TODO: [required eventually] use this , packageConfigHaddockForHackage :: Flag HaddockTarget , -- Test options packageConfigTestHumanLog :: Flag PathTemplate diff --git a/cabal-install/src/Distribution/Client/ProjectOrchestration.hs b/cabal-install/src/Distribution/Client/ProjectOrchestration.hs index 2d963b0e07f..77573944a19 100644 --- a/cabal-install/src/Distribution/Client/ProjectOrchestration.hs +++ b/cabal-install/src/Distribution/Client/ProjectOrchestration.hs @@ -1049,11 +1049,14 @@ printPlan Nothing -- omit working directory (makeSymbolicPath "$builddir") fullConfigureFlags = - setupHsConfigureFlags - elaboratedPlan - (ReadyPackage elab) - elaboratedShared - commonFlags + runIdentity $ + ( setupHsConfigureFlags + (\_ -> return (error "unused")) + elaboratedPlan + (ReadyPackage elab) + elaboratedShared + commonFlags + ) -- \| Given a default value @x@ for a flag, nub @Flag x@ -- into @NoFlag@. This gives us a tidier command line -- rendering. @@ -1061,7 +1064,7 @@ printPlan nubFlag x (Setup.Flag x') | x == x' = Setup.NoFlag nubFlag _ f = f - (tryLibProfiling, tryExeProfiling) = + (tryLibProfiling, tryLibProfilingShared, tryExeProfiling) = computeEffectiveProfiling fullConfigureFlags partialConfigureFlags = @@ -1072,7 +1075,8 @@ printPlan nubFlag tryExeProfiling (configProfExe fullConfigureFlags) , configProfLib = nubFlag tryLibProfiling (configProfLib fullConfigureFlags) - -- Maybe there are more we can add + , configProfShared = + nubFlag tryLibProfilingShared (configProfShared fullConfigureFlags) } in -- Not necessary to "escape" it, it's just for user output unwords . ("" :) $ @@ -1411,11 +1415,7 @@ dieOnBuildFailures verbosity currentCommand plan buildOutcomes " The build process terminated with exit code " ++ show n _ -> " The exception was:\n " -#if MIN_VERSION_base(4,8,0) ++ displayException e -#else - ++ show e -#endif buildFailureException :: BuildFailureReason -> Maybe SomeException buildFailureException reason = diff --git a/cabal-install/src/Distribution/Client/ProjectPlanOutput.hs b/cabal-install/src/Distribution/Client/ProjectPlanOutput.hs index d38f07037a6..6a39694ab56 100644 --- a/cabal-install/src/Distribution/Client/ProjectPlanOutput.hs +++ b/cabal-install/src/Distribution/Client/ProjectPlanOutput.hs @@ -40,7 +40,6 @@ import qualified Distribution.Solver.Types.ComponentDeps as ComponentDeps import qualified Distribution.Compat.Binary as Binary import Distribution.Compat.Graph (Graph, Node) import qualified Distribution.Compat.Graph as Graph -import Distribution.Compiler (CompilerFlavor (GHC, GHCJS)) import Distribution.InstalledPackageInfo (InstalledPackageInfo) import Distribution.Package import qualified Distribution.PackageDescription as PD @@ -50,15 +49,6 @@ import Distribution.Simple.BuildPaths , exeExtension ) import Distribution.Simple.Compiler - ( Compiler - , CompilerId (..) - , PackageDB (..) - , PackageDBStack - , compilerFlavor - , compilerId - , compilerVersion - , showCompilerId - ) import Distribution.Simple.GHC ( GhcEnvironmentFileEntry (..) , GhcImplInfo (supportsPkgEnvFiles) @@ -871,7 +861,7 @@ renderGhcEnvironmentFile :: FilePath -> ElaboratedInstallPlan -> PostBuildProjectStatus - -> [GhcEnvironmentFileEntry] + -> [GhcEnvironmentFileEntry FilePath] renderGhcEnvironmentFile projectRootDir elaboratedInstallPlan @@ -977,7 +967,7 @@ selectGhcEnvironmentFileLibraries PostBuildProjectStatus{..} = elabRequiresRegistration pkg && installedUnitId pkg `Set.member` packagesProbablyUpToDate -selectGhcEnvironmentFilePackageDbs :: ElaboratedInstallPlan -> PackageDBStack +selectGhcEnvironmentFilePackageDbs :: ElaboratedInstallPlan -> PackageDBStackCWD selectGhcEnvironmentFilePackageDbs elaboratedInstallPlan = -- If we have any inplace packages then their package db stack is the -- one we should use since it'll include the store + the local db but @@ -987,7 +977,7 @@ selectGhcEnvironmentFilePackageDbs elaboratedInstallPlan = ([], pkgs) -> checkSamePackageDBs pkgs (pkgs, _) -> checkSamePackageDBs pkgs where - checkSamePackageDBs :: [ElaboratedConfiguredPackage] -> PackageDBStack + checkSamePackageDBs :: [ElaboratedConfiguredPackage] -> PackageDBStackCWD checkSamePackageDBs pkgs = case ordNub (map elabBuildPackageDBStack pkgs) of [packageDbs] -> packageDbs @@ -1019,10 +1009,10 @@ selectGhcEnvironmentFilePackageDbs elaboratedInstallPlan = InstallPlan.PreExisting _ -> Nothing ] -relativePackageDBPaths :: FilePath -> PackageDBStack -> PackageDBStack +relativePackageDBPaths :: FilePath -> PackageDBStackCWD -> PackageDBStackCWD relativePackageDBPaths relroot = map (relativePackageDBPath relroot) -relativePackageDBPath :: FilePath -> PackageDB -> PackageDB +relativePackageDBPath :: FilePath -> PackageDBCWD -> PackageDBCWD relativePackageDBPath relroot pkgdb = case pkgdb of GlobalPackageDB -> GlobalPackageDB diff --git a/cabal-install/src/Distribution/Client/ProjectPlanning.hs b/cabal-install/src/Distribution/Client/ProjectPlanning.hs index 43c835f7a0d..93baa8bf78f 100644 --- a/cabal-install/src/Distribution/Client/ProjectPlanning.hs +++ b/cabal-install/src/Distribution/Client/ProjectPlanning.hs @@ -127,7 +127,7 @@ import Distribution.Client.SetupWrapper import Distribution.Client.Store import Distribution.Client.Targets (userToPackageConstraint) import Distribution.Client.Types -import Distribution.Client.Utils (incVersion) +import Distribution.Client.Utils (concatMapM, incVersion) import qualified Distribution.Client.BuildReports.Storage as BuildReports import qualified Distribution.Client.IndexUtils as IndexUtils @@ -165,6 +165,8 @@ import Distribution.Simple.LocalBuildInfo , componentName , pkgComponents ) + +import Distribution.Simple.BuildWay import Distribution.Simple.PackageIndex (InstalledPackageIndex) import Distribution.Simple.Program import Distribution.Simple.Program.Db @@ -174,6 +176,9 @@ import Distribution.System import Distribution.Types.AnnotatedId import Distribution.Types.ComponentInclude import Distribution.Types.ComponentName +import Distribution.Types.DependencySatisfaction + ( DependencySatisfaction (..) + ) import Distribution.Types.DumpBuildInfo import Distribution.Types.GivenComponent import Distribution.Types.LibraryName @@ -206,7 +211,7 @@ import qualified Distribution.Solver.Types.ComponentDeps as CD import qualified Distribution.Compat.Graph as Graph import Control.Exception (assert) -import Control.Monad (forM, sequence) +import Control.Monad (sequence) import Control.Monad.IO.Class (liftIO) import Control.Monad.State as State (State, execState, runState, state) import Data.Foldable (fold) @@ -483,7 +488,7 @@ configureCompiler let extraPath = fromNubList packageConfigProgramPathExtra progdb <- liftIO $ prependProgramSearchPath verbosity extraPath [] defaultProgramDb let progdb' = userSpecifyPaths (Map.toList (getMapLast packageConfigProgramPaths)) progdb - result@(_, _, progdb'') <- + (comp, plat, progdb'') <- liftIO $ Cabal.configCompilerEx hcFlavor @@ -500,7 +505,12 @@ configureCompiler -- programs it cares about, and those are the ones we monitor here. monitorFiles (programsMonitorFiles progdb'') - return result + -- Configure the unconfigured programs in the program database, + -- as we can't serialise unconfigured programs. + -- See also #2241 and #9840. + finalProgDb <- liftIO $ configureAllKnownPrograms verbosity progdb'' + + return (comp, plat, finalProgDb) where hcFlavor = flagToMaybe projectConfigHcFlavor hcPath = flagToMaybe projectConfigHcPath @@ -657,7 +667,7 @@ rebuildInstallPlan -> (Compiler, Platform, ProgramDb) -> [PackageSpecifier UnresolvedSourcePackage] -> InstalledPackageIndex - -> Rebuild (SolverInstallPlan, PkgConfigDb, IndexUtils.TotalIndexState, IndexUtils.ActiveRepos) + -> Rebuild (SolverInstallPlan, Maybe PkgConfigDb, IndexUtils.TotalIndexState, IndexUtils.ActiveRepos) phaseRunSolver projectConfig@ProjectConfig { projectConfigShared @@ -717,7 +727,7 @@ rebuildInstallPlan dieWithException verbosity $ PhaseRunSolverErr msg Right plan -> return (plan, pkgConfigDB, tis, ar) where - corePackageDbs :: [PackageDB] + corePackageDbs :: PackageDBStackCWD corePackageDbs = Cabal.interpretPackageDbFlags False (projectConfigPackageDBs projectConfigShared) @@ -769,7 +779,7 @@ rebuildInstallPlan phaseElaboratePlan :: ProjectConfig -> (Compiler, Platform, ProgramDb) - -> PkgConfigDb + -> Maybe PkgConfigDb -> SolverInstallPlan -> [PackageSpecifier (SourcePackage (PackageLocation loc))] -> Rebuild @@ -948,7 +958,7 @@ getInstalledPackages -> Compiler -> ProgramDb -> Platform - -> PackageDBStack + -> PackageDBStackCWD -> Rebuild InstalledPackageIndex getInstalledPackages verbosity compiler progdb platform packagedbs = do monitorFiles . map monitorFileOrDirectory @@ -957,7 +967,7 @@ getInstalledPackages verbosity compiler progdb platform packagedbs = do verbosity compiler Nothing -- use ambient working directory - packagedbs + (coercePackageDBStack packagedbs) progdb platform ) @@ -1003,7 +1013,7 @@ getSourcePackages verbosity withRepoCtx idxState activeRepos = do $ repos return sourcePkgDbWithTIS -getPkgConfigDb :: Verbosity -> ProgramDb -> Rebuild PkgConfigDb +getPkgConfigDb :: Verbosity -> ProgramDb -> Rebuild (Maybe PkgConfigDb) getPkgConfigDb verbosity progdb = do dirs <- liftIO $ getPkgConfigDbDirs verbosity progdb -- Just monitor the dirs so we'll notice new .pc files. @@ -1064,25 +1074,29 @@ getPackageSourceHashes verbosity withRepoCtx solverPlan = do -- Tarballs from repositories, either where the repository provides -- hashes as part of the repo metadata, or where we will have to -- download and hash the tarball. - repoTarballPkgsWithMetadataUnvalidated :: [(PackageId, Repo)] - repoTarballPkgsWithoutMetadata :: [(PackageId, Repo)] + repoTarballPkgsWithMetadataUnvalidated :: [(Repo, [PackageId])] + repoTarballPkgsWithoutMetadata :: [(Repo, PackageId)] ( repoTarballPkgsWithMetadataUnvalidated , repoTarballPkgsWithoutMetadata ) = partitionEithers [ case repo of - RepoSecure{} -> Left (pkgid, repo) - _ -> Right (pkgid, repo) + RepoSecure{} -> Left (repo, [pkgid]) + _ -> Right (repo, pkgid) | (pkgid, RepoTarballPackage repo _ _) <- allPkgLocations ] + -- Group up the unvalidated packages by repo so we only read the remote + -- index once per repo (see #10110). The packages are ungrouped here and then regrouped + -- below, it would be better in future to refactor this whole code path so that we don't + -- repeatedly group and ungroup. + repoTarballPkgsWithMetadataUnvalidatedMap = Map.fromListWith (++) repoTarballPkgsWithMetadataUnvalidated + (repoTarballPkgsWithMetadata, repoTarballPkgsToDownloadWithMeta) <- fmap partitionEithers $ liftIO $ - withRepoCtx $ \repoctx -> forM repoTarballPkgsWithMetadataUnvalidated $ - \x@(pkg, repo) -> - verifyFetchedTarball verbosity repoctx repo pkg >>= \b -> case b of - True -> return $ Left x - False -> return $ Right x + withRepoCtx $ \repoctx -> flip concatMapM (Map.toList repoTarballPkgsWithMetadataUnvalidatedMap) $ + \(repo, pkgids) -> + verifyFetchedTarballs verbosity repoctx repo pkgids -- For tarballs from repos that do not have hashes available we now have -- to check if the packages were downloaded already. @@ -1096,9 +1110,9 @@ getPackageSourceHashes verbosity withRepoCtx solverPlan = do [ do mtarball <- checkRepoTarballFetched repo pkgid case mtarball of - Nothing -> return (Left (pkgid, repo)) + Nothing -> return (Left (repo, pkgid)) Just tarball -> return (Right (pkgid, tarball)) - | (pkgid, repo) <- repoTarballPkgsWithoutMetadata + | (repo, pkgid) <- repoTarballPkgsWithoutMetadata ] let repoTarballPkgsToDownload = repoTarballPkgsToDownloadWithMeta ++ repoTarballPkgsToDownloadWithNoMeta @@ -1134,9 +1148,9 @@ getPackageSourceHashes verbosity withRepoCtx solverPlan = do | pkgid <- pkgids ] | (repo, pkgids) <- - map (\grp@((_, repo) :| _) -> (repo, map fst (NE.toList grp))) - . NE.groupBy ((==) `on` (remoteRepoName . repoRemote . snd)) - . sortBy (compare `on` (remoteRepoName . repoRemote . snd)) + map (\grp@((repo, _) :| _) -> (repo, map snd (NE.toList grp))) + . NE.groupBy ((==) `on` (remoteRepoName . repoRemote . fst)) + . sortBy (compare `on` (remoteRepoName . repoRemote . fst)) $ repoTarballPkgsWithMetadata ] @@ -1148,7 +1162,7 @@ getPackageSourceHashes verbosity withRepoCtx solverPlan = do [ do tarball <- fetchRepoTarball verbosity repoctx repo pkgid return (pkgid, tarball) - | (pkgid, repo) <- repoTarballPkgsToDownload + | (repo, pkgid) <- repoTarballPkgsToDownload ] return @@ -1199,7 +1213,7 @@ planPackages -> SolverSettings -> InstalledPackageIndex -> SourcePackageDb - -> PkgConfigDb + -> Maybe PkgConfigDb -> [PackageSpecifier UnresolvedSourcePackage] -> Map PackageName (Map OptionalStanza Bool) -> Progress String String SolverInstallPlan @@ -1522,7 +1536,7 @@ elaborateInstallPlan -> Platform -> Compiler -> ProgramDb - -> PkgConfigDb + -> Maybe PkgConfigDb -> DistDirLayout -> StoreDirLayout -> SolverInstallPlan @@ -1618,13 +1632,18 @@ elaborateInstallPlan (map fst src_comps) let whyNotPerComp = why_not_per_component src_comps case NE.nonEmpty whyNotPerComp of - Nothing -> return comps + Nothing -> do + elaborationWarnings + return comps Just notPerCompReasons -> do checkPerPackageOk comps notPerCompReasons - return - [ elaborateSolverToPackage notPerCompReasons spkg g $ - comps ++ maybeToList setupComponent - ] + pkgComp <- + elaborateSolverToPackage + notPerCompReasons + spkg + g + (comps ++ maybeToList setupComponent) + return [pkgComp] Left cns -> dieProgress $ hang @@ -1687,7 +1706,7 @@ elaborateInstallPlan <+> fsep (punctuate comma $ map (text . whyNotPerComponent) $ toList reasons) -- TODO: Maybe exclude Backpack too - elab0 = elaborateSolverToCommon spkg + (elab0, elaborationWarnings) = elaborateSolverToCommon spkg pkgid = elabPkgSourceId elab0 pd = elabPkgDescription elab0 @@ -1921,7 +1940,7 @@ elaborateInstallPlan ++ " from " ++ prettyShow (elabPkgSourceId elab0) ) - (pkgConfigDbPkgVersion pkgConfigDB pn) + (pkgConfigDB >>= \db -> pkgConfigDbPkgVersion db pn) ) | PkgconfigDependency pn _ <- PD.pkgconfigDepends @@ -1983,7 +2002,7 @@ elaborateInstallPlan -> SolverPackage UnresolvedPkgLoc -> ComponentsGraph -> [ElaboratedConfiguredPackage] - -> ElaboratedConfiguredPackage + -> LogProgress ElaboratedConfiguredPackage elaborateSolverToPackage pkgWhyNotPerComponent pkg@( SolverPackage @@ -1994,13 +2013,14 @@ elaborateInstallPlan _exe_deps0 ) compGraph - comps = + comps = do -- Knot tying: the final elab includes the -- pkgInstalledId, which is calculated by hashing many -- of the other fields of the elaboratedPackage. - elab + elaborationWarnings + return elab where - elab0@ElaboratedConfiguredPackage{..} = + (elab0@ElaboratedConfiguredPackage{..}, elaborationWarnings) = elaborateSolverToCommon pkg elab1 = @@ -2086,7 +2106,7 @@ elaborateInstallPlan elaborateSolverToCommon :: SolverPackage UnresolvedPkgLoc - -> ElaboratedConfiguredPackage + -> (ElaboratedConfiguredPackage, LogProgress ()) elaborateSolverToCommon pkg@( SolverPackage (SourcePackage pkgid gdesc srcloc descOverride) @@ -2095,7 +2115,7 @@ elaborateInstallPlan deps0 _exe_deps0 ) = - elaboratedPackage + (elaboratedPackage, wayWarnings pkgid) where elaboratedPackage = ElaboratedConfiguredPackage{..} @@ -2113,7 +2133,7 @@ elaborateInstallPlan elabPkgDescription = case PD.finalizePD flags elabEnabledSpec - (const True) + (const Satisfied) platform (compilerInfo compiler) [] @@ -2203,13 +2223,14 @@ elaborateInstallPlan elabBuildOptions = LBC.BuildOptions { withVanillaLib = perPkgOptionFlag pkgid True packageConfigVanillaLib -- TODO: [required feature]: also needs to be handled recursively - , withSharedLib = pkgid `Set.member` pkgsUseSharedLibrary + , withSharedLib = canBuildSharedLibs && pkgid `Set.member` pkgsUseSharedLibrary , withStaticLib = perPkgOptionFlag pkgid False packageConfigStaticLib , withDynExe = perPkgOptionFlag pkgid False packageConfigDynExe , withFullyStaticExe = perPkgOptionFlag pkgid False packageConfigFullyStaticExe , withGHCiLib = perPkgOptionFlag pkgid False packageConfigGHCiLib -- TODO: [required feature] needs to default to enabled on windows still , withProfExe = perPkgOptionFlag pkgid False packageConfigProf - , withProfLib = pkgid `Set.member` pkgsUseProfilingLibrary + , withProfLib = canBuildProfilingLibs && pkgid `Set.member` pkgsUseProfilingLibrary + , withProfLibShared = canBuildProfilingSharedLibs && pkgid `Set.member` pkgsUseProfilingLibraryShared , exeCoverage = perPkgOptionFlag pkgid False packageConfigCoverage , libCoverage = perPkgOptionFlag pkgid False packageConfigCoverage , withOptimization = perPkgOptionFlag pkgid NormalOptimisation packageConfigOptimization @@ -2280,6 +2301,7 @@ elaborateInstallPlan elabHaddockBaseUrl = perPkgOptionMaybe pkgid packageConfigHaddockBaseUrl elabHaddockResourcesDir = perPkgOptionMaybe pkgid packageConfigHaddockResourcesDir elabHaddockOutputDir = perPkgOptionMaybe pkgid packageConfigHaddockOutputDir + elabHaddockUseUnicode = perPkgOptionFlag pkgid False packageConfigHaddockUseUnicode elabTestMachineLog = perPkgOptionMaybe pkgid packageConfigTestMachineLog elabTestHumanLog = perPkgOptionMaybe pkgid packageConfigTestHumanLog @@ -2368,35 +2390,112 @@ elaborateInstallPlan pkgsUseSharedLibrary :: Set PackageId pkgsUseSharedLibrary = packagesWithLibDepsDownwardClosedProperty needsSharedLib + + needsSharedLib pkgid = + fromMaybe + compilerShouldUseSharedLibByDefault + -- Case 1: --enable-shared or --disable-shared is passed explicitly, honour that. + ( case pkgSharedLib of + Just v -> Just v + Nothing -> case pkgDynExe of + -- case 2: If --enable-executable-dynamic is passed then turn on + -- shared library generation. + Just True -> + -- Case 3: If --enable-profiling is passed, then we are going to + -- build profiled dynamic, so no need for shared libraries. + case pkgProf of + Just True -> if canBuildProfilingSharedLibs then Nothing else Just True + _ -> Just True + -- But don't necessarily turn off shared library generation if + -- --disable-executable-dynamic is passed. The shared objects might + -- be needed for something different. + _ -> Nothing + ) where - needsSharedLib pkg = - fromMaybe - compilerShouldUseSharedLibByDefault - (liftM2 (||) pkgSharedLib pkgDynExe) - where - pkgid = packageId pkg - pkgSharedLib = perPkgOptionMaybe pkgid packageConfigSharedLib - pkgDynExe = perPkgOptionMaybe pkgid packageConfigDynExe + pkgSharedLib = perPkgOptionMaybe pkgid packageConfigSharedLib + pkgDynExe = perPkgOptionMaybe pkgid packageConfigDynExe + pkgProf = perPkgOptionMaybe pkgid packageConfigProf -- TODO: [code cleanup] move this into the Cabal lib. It's currently open -- coded in Distribution.Simple.Configure, but should be made a proper -- function of the Compiler or CompilerInfo. compilerShouldUseSharedLibByDefault = case compilerFlavor compiler of - GHC -> GHC.isDynamic compiler + GHC -> GHC.compilerBuildWay compiler == DynWay && canBuildSharedLibs GHCJS -> GHCJS.isDynamic compiler _ -> False + compilerShouldUseProfilingLibByDefault = + case compilerFlavor compiler of + GHC -> GHC.compilerBuildWay compiler == ProfWay && canBuildProfilingLibs + _ -> False + + compilerShouldUseProfilingSharedLibByDefault = + case compilerFlavor compiler of + GHC -> GHC.compilerBuildWay compiler == ProfDynWay && canBuildProfilingSharedLibs + _ -> False + + -- Returns False if we definitely can't build shared libs + canBuildWayLibs predicate = case predicate compiler of + Just can_build -> can_build + -- If we don't know for certain, just assume we can + -- which matches behaviour in previous cabal releases + Nothing -> True + + canBuildSharedLibs = canBuildWayLibs dynamicSupported + canBuildProfilingLibs = canBuildWayLibs profilingVanillaSupported + canBuildProfilingSharedLibs = canBuildWayLibs profilingDynamicSupported + + wayWarnings pkg = do + when + (needsProfilingLib pkg && not canBuildProfilingLibs) + (warnProgress (text "Compiler does not support building p libraries, profiling is disabled")) + when + (needsSharedLib pkg && not canBuildSharedLibs) + (warnProgress (text "Compiler does not support building dyn libraries, dynamic libraries are disabled")) + when + (needsProfilingLibShared pkg && not canBuildProfilingSharedLibs) + (warnProgress (text "Compiler does not support building p_dyn libraries, profiling dynamic libraries are disabled.")) + pkgsUseProfilingLibrary :: Set PackageId pkgsUseProfilingLibrary = packagesWithLibDepsDownwardClosedProperty needsProfilingLib + + needsProfilingLib pkg = + fromFlagOrDefault compilerShouldUseProfilingLibByDefault (profBothFlag <> profLibFlag) where - needsProfilingLib pkg = - fromFlagOrDefault False (profBothFlag <> profLibFlag) - where - pkgid = packageId pkg - profBothFlag = lookupPerPkgOption pkgid packageConfigProf - profLibFlag = lookupPerPkgOption pkgid packageConfigProfLib + pkgid = packageId pkg + profBothFlag = lookupPerPkgOption pkgid packageConfigProf + profLibFlag = lookupPerPkgOption pkgid packageConfigProfLib + + pkgsUseProfilingLibraryShared :: Set PackageId + pkgsUseProfilingLibraryShared = + packagesWithLibDepsDownwardClosedProperty needsProfilingLibShared + + needsProfilingLibShared pkg = + fromMaybe + compilerShouldUseProfilingSharedLibByDefault + -- case 1: If --enable-profiling-shared is passed explicitly, honour that + ( case profLibSharedFlag of + Just v -> Just v + Nothing -> case pkgDynExe of + Just True -> + case pkgProf of + -- case 2: --enable-executable-dynamic + --enable-profiling + -- turn on shared profiling libraries + Just True -> if canBuildProfilingSharedLibs then Just True else Nothing + _ -> Nothing + -- But don't necessarily turn off shared library generation is + -- --disable-executable-dynamic is passed. The shared objects might + -- be needed for something different. + _ -> Nothing + ) + where + pkgid = packageId pkg + profLibSharedFlag = perPkgOptionMaybe pkgid packageConfigProfShared + pkgDynExe = perPkgOptionMaybe pkgid packageConfigDynExe + pkgProf = perPkgOptionMaybe pkgid packageConfigProf + -- TODO: [code cleanup] unused: the old deprecated packageConfigProfExe libDepGraph = @@ -2413,7 +2512,7 @@ elaborateInstallPlan libDepGraph [ Graph.nodeKey pkg | pkg <- SolverInstallPlan.toList solverPlan - , property pkg -- just the packages that satisfy the property + , property (packageId pkg) -- just the packages that satisfy the property -- TODO: [nice to have] this does not check the config consistency, -- e.g. a package explicitly turning off profiling, but something -- depending on it that needs profiling. This really needs a separate @@ -3813,22 +3912,31 @@ computeInstallDirs storeDirLayout defaultInstallDirs elaboratedShared elab -- TODO: [code cleanup] perhaps reorder this code -- based on the ElaboratedInstallPlan + ElaboratedSharedConfig, -- make the various Setup.hs {configure,build,copy} flags - setupHsConfigureFlags - :: ElaboratedInstallPlan + :: Monad m + => (FilePath -> m (SymbolicPath Pkg (Dir PkgDB))) + -- ^ How to transform a path which is relative to cabal-install cwd to one which + -- is relative to the route of the package about to be compiled. The simplest way + -- to do this is to convert the potentially relative path into an absolute path. + -> ElaboratedInstallPlan -> ElaboratedReadyPackage -> ElaboratedSharedConfig -> Cabal.CommonSetupFlags - -> Cabal.ConfigFlags + -> m Cabal.ConfigFlags setupHsConfigureFlags + mkSymbolicPath plan (ReadyPackage elab@ElaboratedConfiguredPackage{..}) sharedConfig@ElaboratedSharedConfig{..} - configCommonFlags = - sanityCheckElaboratedConfiguredPackage - sharedConfig - elab - (Cabal.ConfigFlags{..}) + configCommonFlags = do + -- explicitly clear, then our package db stack + -- TODO: [required eventually] have to do this differently for older Cabal versions + configPackageDBs <- (traverse . traverse . traverse) mkSymbolicPath (Nothing : map Just elabBuildPackageDBStack) + return $ + sanityCheckElaboratedConfiguredPackage + sharedConfig + elab + Cabal.ConfigFlags{..} where Cabal.ConfigFlags { configVanillaLib @@ -3839,6 +3947,7 @@ setupHsConfigureFlags , configGHCiLib , -- , configProfExe -- overridden configProfLib + , configProfShared , -- , configProf -- overridden configProfDetail , configProfLibDetail @@ -3920,7 +4029,7 @@ setupHsConfigureFlags ] configPromisedDependencies = - [ cidToGivenComponent cid + [ cidToPromisedComponent cid | (cid, is_internal) <- elabLibDependencies elab , is_internal ] @@ -3933,10 +4042,6 @@ setupHsConfigureFlags ] ElabComponent _ -> [] - -- explicitly clear, then our package db stack - -- TODO: [required eventually] have to do this differently for older Cabal versions - configPackageDBs = Nothing : map Just elabBuildPackageDBStack - configTests = case elabPkgOrComp of ElabPackage pkg -> toFlag (TestStanzas `optStanzaSetMember` pkgStanzasEnabled pkg) ElabComponent _ -> mempty @@ -3951,6 +4056,7 @@ setupHsConfigureFlags configPrograms_ = mempty -- never use, shouldn't exist configUseResponseFiles = mempty configAllowDependingOnPrivateLibs = Flag $ not $ libraryVisibilitySupported pkgConfigCompiler + configIgnoreBuildTools = mempty cidToGivenComponent :: ConfiguredId -> GivenComponent cidToGivenComponent (ConfiguredId srcid mb_cn cid) = GivenComponent (packageName srcid) ln cid @@ -3960,7 +4066,16 @@ setupHsConfigureFlags Just _ -> error "non-library dependency" Nothing -> LMainLibName - configCoverageFor = determineCoverageFor elabPkgSourceId plan + configCoverageFor = determineCoverageFor elab plan + + cidToPromisedComponent :: ConfiguredId -> PromisedComponent + cidToPromisedComponent (ConfiguredId srcid mb_cn cid) = + PromisedComponent srcid ln cid + where + ln = case mb_cn of + Just (CLibName lname) -> lname + Just _ -> error "non-library dependency" + Nothing -> LMainLibName setupHsConfigureArgs :: ElaboratedConfiguredPackage @@ -4098,7 +4213,7 @@ setupHsRegisterFlags { registerCommonFlags = common , regPackageDB = mempty -- misfeature , regGenScript = mempty -- never use - , regGenPkgConf = toFlag (Just pkgConfFile) + , regGenPkgConf = toFlag (Just (makeSymbolicPath pkgConfFile)) , regInPlace = case elabBuildStyle of BuildInplaceOnly{} -> toFlag True BuildAndInstall -> toFlag False @@ -4147,6 +4262,7 @@ setupHsHaddockFlags , haddockBaseUrl = maybe mempty toFlag elabHaddockBaseUrl , haddockResourcesDir = maybe mempty toFlag elabHaddockResourcesDir , haddockOutputDir = maybe mempty toFlag elabHaddockOutputDir + , haddockUseUnicode = toFlag elabHaddockUseUnicode } setupHsHaddockArgs :: ElaboratedConfiguredPackage -> [String] @@ -4305,6 +4421,7 @@ packageHashConfigInputs shared@ElaboratedSharedConfig{..} pkg = , pkgHashHaddockBaseUrl = elabHaddockBaseUrl , pkgHashHaddockResourcesDir = elabHaddockResourcesDir , pkgHashHaddockOutputDir = elabHaddockOutputDir + , pkgHashHaddockUseUnicode = elabHaddockUseUnicode } where ElaboratedConfiguredPackage{..} = normaliseConfiguredPackage shared pkg @@ -4369,13 +4486,14 @@ inplaceBinRoot layout config package = -- The list of non-pre-existing libraries without module holes, i.e. the -- main library and sub-libraries components of all the local packages in --- the project that do not require instantiations or are instantiations. +-- the project that are dependencies of the components being built and that do +-- not require instantiations or are instantiations. determineCoverageFor - :: PackageId - -- ^ The 'PackageId' of the package or component being configured + :: ElaboratedConfiguredPackage + -- ^ The package or component being configured -> ElaboratedInstallPlan -> Flag [UnitId] -determineCoverageFor configuredPkgSourceId plan = +determineCoverageFor configuredPkg plan = Flag $ mapMaybe ( \case @@ -4388,15 +4506,18 @@ determineCoverageFor configuredPkgSourceId plan = $ Graph.toList $ InstallPlan.toGraph plan where - shouldCoverPkg elab@ElaboratedConfiguredPackage{elabModuleShape, elabPkgSourceId, elabLocalToProject} = + libDeps = elabLibDependencies configuredPkg + shouldCoverPkg elab@ElaboratedConfiguredPackage{elabModuleShape, elabPkgSourceId = pkgSID, elabLocalToProject} = elabLocalToProject && not (isIndefiniteOrInstantiation elabModuleShape) -- TODO(#9493): We can only cover libraries in the same package -- as the testsuite - && configuredPkgSourceId == elabPkgSourceId + && elabPkgSourceId configuredPkg == pkgSID -- Libraries only! We don't cover testsuite modules, so we never need -- the paths to their mix dirs. Furthermore, we do not install testsuites... && maybe False (\case CLibName{} -> True; CNotLibName{} -> False) (elabComponentName elab) + -- We only want coverage for libraries which are dependencies of the given one + && pkgSID `elem` map (confSrcId . fst) libDeps isIndefiniteOrInstantiation :: ModuleShape -> Bool isIndefiniteOrInstantiation = not . Set.null . modShapeRequires diff --git a/cabal-install/src/Distribution/Client/ProjectPlanning/Types.hs b/cabal-install/src/Distribution/Client/ProjectPlanning/Types.hs index 352e35d4150..31a0d5df248 100644 --- a/cabal-install/src/Distribution/Client/ProjectPlanning/Types.hs +++ b/cabal-install/src/Distribution/Client/ProjectPlanning/Types.hs @@ -262,13 +262,13 @@ data ElaboratedConfiguredPackage = ElaboratedConfiguredPackage -- that a user enabled tests globally, and some local packages -- just happen not to have any tests. (But perhaps we should -- warn if ALL local packages don't have any tests.) - , elabPackageDbs :: [Maybe PackageDB] - , elabSetupPackageDBStack :: PackageDBStack - , elabBuildPackageDBStack :: PackageDBStack - , elabRegisterPackageDBStack :: PackageDBStack - , elabInplaceSetupPackageDBStack :: PackageDBStack - , elabInplaceBuildPackageDBStack :: PackageDBStack - , elabInplaceRegisterPackageDBStack :: PackageDBStack + , elabPackageDbs :: [Maybe PackageDBCWD] + , elabSetupPackageDBStack :: PackageDBStackCWD + , elabBuildPackageDBStack :: PackageDBStackCWD + , elabRegisterPackageDBStack :: PackageDBStackCWD + , elabInplaceSetupPackageDBStack :: PackageDBStackCWD + , elabInplaceBuildPackageDBStack :: PackageDBStackCWD + , elabInplaceRegisterPackageDBStack :: PackageDBStackCWD , elabPkgDescriptionOverride :: Maybe CabalFileText , -- TODO: make per-component variants of these flags elabBuildOptions :: LBC.BuildOptions @@ -302,6 +302,7 @@ data ElaboratedConfiguredPackage = ElaboratedConfiguredPackage , elabHaddockBaseUrl :: Maybe String , elabHaddockResourcesDir :: Maybe String , elabHaddockOutputDir :: Maybe FilePath + , elabHaddockUseUnicode :: Bool , elabTestMachineLog :: Maybe PathTemplate , elabTestHumanLog :: Maybe PathTemplate , elabTestShowDetails :: Maybe TestShowDetails diff --git a/cabal-install/src/Distribution/Client/Run.hs b/cabal-install/src/Distribution/Client/Run.hs index 0c3e5c89e8a..7ff4c8bb5e8 100644 --- a/cabal-install/src/Distribution/Client/Run.hs +++ b/cabal-install/src/Distribution/Client/Run.hs @@ -27,7 +27,7 @@ import Distribution.PackageDescription , PackageDescription (..) , TestSuite (..) ) -import Distribution.Simple (PackageDB (..)) +import Distribution.Simple (PackageDBX (..)) import Distribution.Simple.Build (addInternalBuildTools) import Distribution.Simple.BuildPaths (exeExtension) import Distribution.Simple.Compiler (CompilerFlavor (..), compilerFlavor) @@ -148,7 +148,7 @@ run verbosity lbi exe exeArgs = do pkg_descr = localPkgDescr lbi i = interpretSymbolicPathLBI lbi -- See Note [Symbolic paths] in Distribution.Utils.Path mbWorkDir = mbWorkDirLBI lbi - internalPkgDb = i $ internalPackageDBPath lbi distPref + internalPkgDb = internalPackageDBPath lbi distPref lbiForExe = lbi { withPackageDB = withPackageDB lbi ++ [SpecificPackageDB internalPkgDb] diff --git a/cabal-install/src/Distribution/Client/Security/HTTP.hs b/cabal-install/src/Distribution/Client/Security/HTTP.hs index f433c61ab21..941d0b28dab 100644 --- a/cabal-install/src/Distribution/Client/Security/HTTP.hs +++ b/cabal-install/src/Distribution/Client/Security/HTTP.hs @@ -189,13 +189,8 @@ instance HC.Pretty UnexpectedResponse where ++ " for " ++ show uri -#if MIN_VERSION_base(4,8,0) deriving instance Show UnexpectedResponse instance Exception UnexpectedResponse where displayException = HC.pretty -#else -instance Show UnexpectedResponse where show = HC.pretty -instance Exception UnexpectedResponse -#endif wrapCustomEx :: ( ( HC.Throws UnexpectedResponse diff --git a/cabal-install/src/Distribution/Client/Setup.hs b/cabal-install/src/Distribution/Client/Setup.hs index 8fea76bae3b..aebba9462c0 100644 --- a/cabal-install/src/Distribution/Client/Setup.hs +++ b/cabal-install/src/Distribution/Client/Setup.hs @@ -35,12 +35,15 @@ module Distribution.Client.Setup , defaultConfigExFlags , buildCommand , BuildFlags (..) + , filterBuildFlags , filterTestFlags , replCommand + , filterReplFlags , testCommand , benchmarkCommand , testOptions , benchmarkOptions + , filterBenchmarkFlags , configureExOptions , reconfigureCommand , installCommand @@ -87,7 +90,9 @@ module Distribution.Client.Setup , haddockCommand , cleanCommand , copyCommand + , filterCopyFlags , registerCommand + , filterRegisterFlags , liftOptions , yesNoOpt ) where @@ -183,7 +188,7 @@ import Distribution.Simple.InstallDirs ) import Distribution.Simple.Program (ProgramDb, defaultProgramDb) import Distribution.Simple.Setup - ( BenchmarkFlags + ( BenchmarkFlags (benchmarkCommonFlags) , BooleanFlag (..) , BuildFlags (..) , CleanFlags (..) @@ -192,7 +197,7 @@ import Distribution.Simple.Setup , CopyFlags (..) , HaddockFlags (..) , RegisterFlags (..) - , ReplFlags + , ReplFlags (..) , TestFlags , boolOpt , boolOpt' @@ -210,7 +215,9 @@ import Distribution.Simple.Utils import Distribution.System (Platform) import Distribution.Types.GivenComponent ( GivenComponent (..) + , PromisedComponent (..) ) +import Distribution.Types.PackageId import Distribution.Types.PackageVersionConstraint ( PackageVersionConstraint (..) ) @@ -226,6 +233,7 @@ import Distribution.Verbosity import Distribution.Version ( Version , mkVersion + , nullVersion ) import Control.Exception @@ -679,7 +687,7 @@ filterConfigureFlags' :: ConfigFlags -> Version -> ConfigFlags filterConfigureFlags' flags cabalLibVersion -- NB: we expect the latest version to be the most common case, -- so test it first. - | cabalLibVersion >= mkVersion [3, 11, 0] = flags_latest + | cabalLibVersion >= mkVersion [3, 13, 0] = flags_latest -- The naming convention is that flags_version gives flags with -- all flags *introduced* in version eliminated. -- It is NOT the latest version of Cabal library that @@ -701,6 +709,7 @@ filterConfigureFlags' flags cabalLibVersion | cabalLibVersion < mkVersion [2, 5, 0] = flags_2_5_0 | cabalLibVersion < mkVersion [3, 7, 0] = flags_3_7_0 | cabalLibVersion < mkVersion [3, 11, 0] = flags_3_11_0 + | cabalLibVersion < mkVersion [3, 13, 0] = flags_3_13_0 | otherwise = error "the impossible just happened" -- see first guard where flags_latest = @@ -712,8 +721,26 @@ filterConfigureFlags' flags cabalLibVersion configConstraints = [] } + flags_3_13_0 = + let scrubVersion pc = + pc + { promisedComponentPackage = + (promisedComponentPackage pc){pkgVersion = nullVersion} + } + in -- Earlier Cabal versions don't understand about .. + flags_latest + { -- Building profiled shared libraries + configProfShared = NoFlag + , configIgnoreBuildTools = NoFlag + , -- Older versions of Cabal don't include the package version in the + -- --promised-dependency flag, by setting the version to nullVersion, + -- it won't be printed. + configPromisedDependencies = + map scrubVersion (configPromisedDependencies flags) + } + flags_3_11_0 = - flags_latest + flags_3_13_0 { -- It's too late to convert configPromisedDependencies to anything -- meaningful, so we just assert that it's empty. -- We add a Cabal>=3.11 constraint before solving when multi-repl is @@ -783,7 +810,7 @@ filterConfigureFlags' flags cabalLibVersion -- Cabal < 1.23 doesn't know about '--profiling-detail'. -- Cabal < 1.23 has a hacked up version of 'enable-profiling' -- which we shouldn't use. - (tryLibProfiling, tryExeProfiling) = computeEffectiveProfiling flags + (tryLibProfiling, _tryLibProfilingShared, tryExeProfiling) = computeEffectiveProfiling flags flags_1_23_0 = flags_1_25_0 { configProfDetail = NoFlag @@ -1122,6 +1149,21 @@ buildCommand = where parent = Cabal.buildCommand defaultProgramDb +-- | Given some 'BuildFlags' for the version of @Cabal@ that +-- @cabal-install@ was built with, and a target older 'Version' of +-- @Cabal@ that we want to pass these flags to, convert the +-- flags into a form that will be accepted by the older +-- @Setup@ script. Generally speaking, this just means filtering +-- out flags that the old @Cabal@ library doesn't understand, but +-- in some cases it may also mean "emulating" a feature using +-- some more legacy flags. +filterBuildFlags :: BuildFlags -> Version -> BuildFlags +filterBuildFlags flags cabalLibVersion = + flags + { buildCommonFlags = + filterCommonFlags (buildCommonFlags flags) cabalLibVersion + } + -- ------------------------------------------------------------ -- * Test flags @@ -1214,6 +1256,21 @@ replCommand = where parent = Cabal.replCommand defaultProgramDb +-- | Given some 'ReplFlags' for the version of @Cabal@ that +-- @cabal-install@ was built with, and a target older 'Version' of +-- @Cabal@ that we want to pass these flags to, convert the +-- flags into a form that will be accepted by the older +-- @Setup@ script. Generally speaking, this just means filtering +-- out flags that the old @Cabal@ library doesn't understand, but +-- in some cases it may also mean "emulating" a feature using +-- some more legacy flags. +filterReplFlags :: ReplFlags -> Version -> ReplFlags +filterReplFlags flags cabalLibVersion = + flags + { replCommonFlags = + filterCommonFlags (replCommonFlags flags) cabalLibVersion + } + -- ------------------------------------------------------------ -- * Test command @@ -1309,6 +1366,21 @@ benchmarkCommand = parent = Cabal.benchmarkCommand progDb = defaultProgramDb +-- | Given some 'BenchmarkFlags' for the version of @Cabal@ that +-- @cabal-install@ was built with, and a target older 'Version' of +-- @Cabal@ that we want to pass these flags to, convert the +-- flags into a form that will be accepted by the older +-- @Setup@ script. Generally speaking, this just means filtering +-- out flags that the old @Cabal@ library doesn't understand, but +-- in some cases it may also mean "emulating" a feature using +-- some more legacy flags. +filterBenchmarkFlags :: BenchmarkFlags -> Version -> BenchmarkFlags +filterBenchmarkFlags flags cabalLibVersion = + flags + { benchmarkCommonFlags = + filterCommonFlags (benchmarkCommonFlags flags) cabalLibVersion + } + -- ------------------------------------------------------------ -- * Fetch command @@ -2382,21 +2454,25 @@ filterHaddockArgs args cabalLibVersion -- Cabal < 2.3 doesn't know about per-component haddock args_2_3_0 = [] +-- | Given some 'HaddockFlags' for the version of @Cabal@ that +-- @cabal-install@ was built with, and a target older 'Version' of +-- @Cabal@ that we want to pass these flags to, convert the +-- flags into a form that will be accepted by the older +-- @Setup@ script. Generally speaking, this just means filtering +-- out flags that the old @Cabal@ library doesn't understand, but +-- in some cases it may also mean "emulating" a feature using +-- some more legacy flags. filterHaddockFlags :: HaddockFlags -> Version -> HaddockFlags -filterHaddockFlags flags cabalLibVersion = - let flags' = filterHaddockFlags' flags cabalLibVersion - in flags' - { haddockCommonFlags = - filterCommonFlags (haddockCommonFlags flags') cabalLibVersion - } - -filterHaddockFlags' :: HaddockFlags -> Version -> HaddockFlags -filterHaddockFlags' flags cabalLibVersion +filterHaddockFlags flags cabalLibVersion | cabalLibVersion >= mkVersion [2, 3, 0] = flags_latest | cabalLibVersion < mkVersion [2, 3, 0] = flags_2_3_0 | otherwise = flags_latest where - flags_latest = flags + flags_latest = + flags + { haddockCommonFlags = + filterCommonFlags (haddockCommonFlags flags) cabalLibVersion + } flags_2_3_0 = flags_latest @@ -2437,6 +2513,7 @@ haddockOptions showOrParseArgs = , "base-url" , "resources-dir" , "output-dir" + , "use-unicode" ] ] @@ -2467,6 +2544,9 @@ testOptions showOrParseArgs = | "test-" `isPrefixOf` name = name | otherwise = "test-" ++ name +-- | Options for the @bench@ command. +-- +-- Not to be confused with the @benchmarkOptions@ field of the `BenchmarkFlags` record! benchmarkOptions :: ShowOrParseArgs -> [OptionField BenchmarkFlags] benchmarkOptions showOrParseArgs = [ opt @@ -3294,6 +3374,35 @@ registerCommand = { commandUsage = \pname -> "Usage: " ++ pname ++ " v1-register [FLAGS]\n" } +-- | Given some 'RegisterFlags' for the version of @Cabal@ that +-- @cabal-install@ was built with, and a target older 'Version' of +-- @Cabal@ that we want to pass these flags to, convert the +-- flags into a form that will be accepted by the older +-- @Setup@ script. Generally speaking, this just means filtering +-- out flags that the old @Cabal@ library doesn't understand, but +-- in some cases it may also mean "emulating" a feature using +-- some more legacy flags. +filterRegisterFlags :: RegisterFlags -> Version -> RegisterFlags +filterRegisterFlags flags cabalLibVersion = + flags + { registerCommonFlags = + filterCommonFlags (registerCommonFlags flags) cabalLibVersion + } + +-- | Given some 'CopyFlags' for the version of @Cabal@ that +-- @cabal-install@ was built with, and a target older 'Version' of +-- @Cabal@ that we want to pass these flags to, convert the +-- flags into a form that will be accepted by the older +-- @Setup@ script. Generally speaking, this just means filtering +-- out flags that the old @Cabal@ library doesn't understand, but +-- in some cases it may also mean "emulating" a feature using +-- some more legacy flags. +filterCopyFlags :: CopyFlags -> Version -> CopyFlags +filterCopyFlags flags cabalLibVersion = + flags + { copyCommonFlags = filterCommonFlags (copyCommonFlags flags) cabalLibVersion + } + -- ------------------------------------------------------------ -- * ActAsSetup flags diff --git a/cabal-install/src/Distribution/Client/SetupWrapper.hs b/cabal-install/src/Distribution/Client/SetupWrapper.hs index 4040c26bcea..1b401ff6f7c 100644 --- a/cabal-install/src/Distribution/Client/SetupWrapper.hs +++ b/cabal-install/src/Distribution/Client/SetupWrapper.hs @@ -34,10 +34,6 @@ import Prelude () import qualified Distribution.Backpack as Backpack import Distribution.CabalSpecVersion (cabalSpecMinimumLibraryVersion) -import Distribution.Compiler - ( CompilerFlavor (GHC, GHCJS) - , buildCompilerId - ) import qualified Distribution.Make as Make import Distribution.Package ( ComponentId @@ -65,11 +61,6 @@ import Distribution.Simple.BuildPaths , exeExtension ) import Distribution.Simple.Compiler - ( Compiler (compilerId) - , PackageDB (..) - , PackageDBStack - , compilerFlavor - ) import Distribution.Simple.Configure ( configCompilerEx ) @@ -90,7 +81,8 @@ import Distribution.Simple.Program , runDbProgramCwd ) import Distribution.Simple.Program.Db - ( prependProgramSearchPath + ( configureAllKnownPrograms + , prependProgramSearchPath , progOverrideEnv ) import Distribution.Simple.Program.Find @@ -125,6 +117,7 @@ import Distribution.Client.JobControl import Distribution.Client.Types import Distribution.Client.Utils ( existsAndIsMoreRecentThan + , makeRelativeToDirS #ifdef mingw32_HOST_OS , canonicalizePathNoThrow #endif @@ -257,7 +250,7 @@ data SetupScriptOptions = SetupScriptOptions -- if needed. , useCompiler :: Maybe Compiler , usePlatform :: Maybe Platform - , usePackageDB :: PackageDBStack + , usePackageDB :: PackageDBStackCWD , usePackageIndex :: Maybe InstalledPackageIndex , useProgramDb :: ProgramDb , useDistPref :: SymbolicPath Pkg (Dir Dist) @@ -510,15 +503,15 @@ setupWrapper -> Maybe PackageDescription -> CommandUI flags -> (flags -> CommonSetupFlags) - -> (Version -> flags) + -> (Version -> IO flags) -- ^ produce command flags given the Cabal library version -> (Version -> [String]) -> IO () setupWrapper verbosity options mpkg cmd getCommonFlags getFlags getExtraArgs = do setup <- getSetup verbosity options mpkg let version = setupVersion setup - flags = getFlags version extraArgs = getExtraArgs version + flags <- getFlags version runSetupCommand verbosity setup @@ -557,8 +550,8 @@ internalSetupMethod verbosity options bt args = do buildTypeAction :: BuildType -> ([String] -> IO ()) buildTypeAction Simple = Simple.defaultMainArgs buildTypeAction Configure = - Simple.defaultMainWithHooksArgs - Simple.autoconfUserHooks + Simple.defaultMainWithSetupHooksArgs + Simple.autoconfSetupHooks buildTypeAction Make = Make.defaultMainArgs buildTypeAction Hooks = error "buildTypeAction Hooks" buildTypeAction Custom = error "buildTypeAction Custom" @@ -862,10 +855,18 @@ getExternalSetupMethod verbosity options pkg bt = do buildTypeScript cabalLibVersion = "{-# LANGUAGE NoImplicitPrelude #-}\n" <> case bt of Simple -> "import Distribution.Simple; main = defaultMain\n" Configure - | cabalLibVersion >= mkVersion [1, 3, 10] -> "import Distribution.Simple; main = defaultMainWithHooks autoconfUserHooks\n" - | otherwise -> "import Distribution.Simple; main = defaultMainWithHooks defaultUserHooks\n" + | cabalLibVersion >= mkVersion [3, 13, 0] + -> "import Distribution.Simple; main = defaultMainWithSetupHooks autoconfSetupHooks\n" + | cabalLibVersion >= mkVersion [1, 3, 10] + -> "import Distribution.Simple; main = defaultMainWithHooks autoconfUserHooks\n" + | otherwise + -> "import Distribution.Simple; main = defaultMainWithHooks defaultUserHooks\n" Make -> "import Distribution.Make; main = defaultMain\n" - Hooks -> "import Distribution.Simple; import SetupHooks; main = defaultMainWithSetupHooks setupHooks\n" + Hooks + | cabalLibVersion >= mkVersion [3, 13, 0] + -> "import Distribution.Simple; import SetupHooks; main = defaultMainWithSetupHooks setupHooks\n" + | otherwise + -> error "buildTypeScript Hooks with Cabal < 3.13" Custom -> error "buildTypeScript Custom" installedCabalVersion @@ -1027,11 +1028,19 @@ getExternalSetupMethod verbosity options pkg bt = do createDirectoryIfMissingVerbose verbosity True setupCacheDir installExecutableFile verbosity src cachedSetupProgFile -- Do not strip if we're using GHCJS, since the result may be a script - when (maybe True ((/= GHCJS) . compilerFlavor) $ useCompiler options') $ + when (maybe True ((/= GHCJS) . compilerFlavor) $ useCompiler options') $ do + -- Add the relevant PATH overrides for the package to the + -- program database. + setupProgDb + <- prependProgramSearchPath verbosity + (useExtraPathEnv options) + (useExtraEnvOverrides options) + (useProgramDb options') + >>= configureAllKnownPrograms verbosity Strip.stripExe verbosity platform - (useProgramDb options') + setupProgDb cachedSetupProgFile return cachedSetupProgFile where @@ -1056,6 +1065,7 @@ getExternalSetupMethod verbosity options pkg bt = do when (outOfDate || forceCompile) $ do debug verbosity "Setup executable needs to be updated, compiling..." (compiler, progdb, options'') <- configureCompiler options' + pkgDbs <- traverse (traverse (makeRelativeToDirS mbWorkDir)) (coercePackageDBStack (usePackageDB options'')) let cabalPkgid = PackageIdentifier (mkPackageName "Cabal") cabalLibVersion (program, extraOpts) = case compilerFlavor compiler of @@ -1101,7 +1111,7 @@ getExternalSetupMethod verbosity options pkg bt = do Custom -> toNubListR [sameDirectory] Hooks -> toNubListR [sameDirectory] _ -> mempty - , ghcOptPackageDBs = usePackageDB options'' + , ghcOptPackageDBs = pkgDbs , ghcOptHideAllPackages = Flag (useDependenciesExclusive options') , ghcOptCabal = Flag (useDependenciesExclusive options') , ghcOptPackages = toNubListR $ map addRenaming selectedDeps diff --git a/cabal-install/src/Distribution/Client/Store.hs b/cabal-install/src/Distribution/Client/Store.hs index a8358ec2f18..9ffe6099c7f 100644 --- a/cabal-install/src/Distribution/Client/Store.hs +++ b/cabal-install/src/Distribution/Client/Store.hs @@ -48,10 +48,8 @@ import Lukko #else import System.IO (openFile, IOMode(ReadWriteMode), hClose) import GHC.IO.Handle.Lock (hLock, hTryLock, LockMode(ExclusiveLock)) -#if MIN_VERSION_base(4,11,0) import GHC.IO.Handle.Lock (hUnlock) #endif -#endif -- $concurrency -- diff --git a/cabal-install/src/Distribution/Client/Utils.hs b/cabal-install/src/Distribution/Client/Utils.hs index 87378da7f10..b1ad7bd9a37 100644 --- a/cabal-install/src/Distribution/Client/Utils.hs +++ b/cabal-install/src/Distribution/Client/Utils.hs @@ -19,6 +19,7 @@ module Distribution.Client.Utils , makeAbsoluteToCwd , makeRelativeToCwd , makeRelativeToDir + , makeRelativeToDirS , makeRelativeCanonical , filePathToByteString , byteStringToFilePath @@ -38,6 +39,7 @@ module Distribution.Client.Utils , listFilesInside , safeRead , hasElem + , concatMapM , occursOnlyOrBefore , giveRTSWarning ) where @@ -75,8 +77,11 @@ import Distribution.Utils.Path , Pkg , RelativePath , SymbolicPath + , getSymbolicPath , makeSymbolicPath , relativeSymbolicPath + , sameDirectory + , symbolicPathRelative_maybe ) import Distribution.Version @@ -263,6 +268,16 @@ makeRelativeToDir :: FilePath -> FilePath -> IO FilePath makeRelativeToDir path dir = makeRelativeCanonical <$> canonicalizePath path <*> canonicalizePath dir +-- | makeRelativeToDir for SymbolicPath +makeRelativeToDirS :: Maybe (SymbolicPath CWD (Dir dir)) -> SymbolicPath CWD to -> IO (SymbolicPath dir to) +makeRelativeToDirS Nothing s = makeRelativeToDirS (Just sameDirectory) s +makeRelativeToDirS (Just root) p = + case symbolicPathRelative_maybe p of + -- TODO: Use AbsolutePath + Nothing -> return $ makeSymbolicPath (getSymbolicPath p) + Just rel_path -> + makeSymbolicPath <$> makeRelativeToDir (getSymbolicPath root) (getSymbolicPath rel_path) + -- | Given a canonical absolute path and canonical absolute dir, make the path -- relative to the directory, including using @../..@ if necessary. Returns -- the original absolute path if it is not on the same drive as the given dir. diff --git a/cabal-install/src/Distribution/Client/VCS.hs b/cabal-install/src/Distribution/Client/VCS.hs index 2f2686c6ae2..57c0a82376e 100644 --- a/cabal-install/src/Distribution/Client/VCS.hs +++ b/cabal-install/src/Distribution/Client/VCS.hs @@ -64,6 +64,10 @@ import Distribution.Simple.Program import Distribution.Simple.Program.Db ( prependProgramSearchPath ) +import Distribution.System + ( OS (Windows) + , buildOS + ) import Distribution.Types.SourceRepo ( KnownRepoType (..) , RepoType (..) @@ -93,6 +97,7 @@ import qualified Data.Map as Map import System.Directory ( doesDirectoryExist , removeDirectoryRecursive + , removePathForcibly ) import System.FilePath ( takeDirectory @@ -100,7 +105,9 @@ import System.FilePath ) import System.IO.Error ( isDoesNotExistError + , isPermissionError ) +import qualified System.Process as Process -- | A driver for a version control system, e.g. git, darcs etc. data VCS program = VCS @@ -509,7 +516,19 @@ vcsGit = git localDir ["submodule", "deinit", "--force", "--all"] let gitModulesDir = localDir ".git" "modules" gitModulesExists <- doesDirectoryExist gitModulesDir - when gitModulesExists $ removeDirectoryRecursive gitModulesDir + when gitModulesExists $ + if buildOS == Windows + then do + -- Windows can't delete some git files #10182 + void $ + Process.createProcess_ "attrib" $ + Process.shell $ + "attrib -s -h -r " <> gitModulesDir <> "\\*.* /s /d" + + catch + (removePathForcibly gitModulesDir) + (\e -> if isPermissionError e then removePathForcibly gitModulesDir else throw e) + else removeDirectoryRecursive gitModulesDir git localDir resetArgs git localDir $ ["submodule", "sync", "--recursive"] ++ verboseArg git localDir $ ["submodule", "update", "--force", "--init", "--recursive"] ++ verboseArg diff --git a/cabal-install/src/Distribution/Deprecated/ParseUtils.hs b/cabal-install/src/Distribution/Deprecated/ParseUtils.hs index b3b5f8bab9d..e1d389ac9aa 100644 --- a/cabal-install/src/Distribution/Deprecated/ParseUtils.hs +++ b/cabal-install/src/Distribution/Deprecated/ParseUtils.hs @@ -121,19 +121,12 @@ instance Applicative ParseResult where pure = ParseOk [] (<*>) = ap -{- FOURMOLU_DISABLE -} instance Monad ParseResult where return = pure ParseFailed err >>= _ = ParseFailed err ParseOk ws x >>= f = case f x of ParseFailed err -> ParseFailed err ParseOk ws' x' -> ParseOk (ws' ++ ws) x' -#if !(MIN_VERSION_base(4,9,0)) - fail = parseResultFail -#elif !(MIN_VERSION_base(4,13,0)) - fail = Fail.fail -#endif -{- FOURMOLU_ENABLE -} instance Foldable ParseResult where foldMap _ (ParseFailed _) = mempty diff --git a/cabal-install/src/Distribution/Deprecated/ReadP.hs b/cabal-install/src/Distribution/Deprecated/ReadP.hs index f0626d5cfe7..2e6f9c189b8 100644 --- a/cabal-install/src/Distribution/Deprecated/ReadP.hs +++ b/cabal-install/src/Distribution/Deprecated/ReadP.hs @@ -119,12 +119,6 @@ instance Monad (P s) where (Result x p) >>= k = k x `mplus` (p >>= k) (Final r) >>= k = final [ys' | (x, s) <- r, ys' <- run (k x) s] -#if !(MIN_VERSION_base(4,9,0)) - fail _ = Fail -#elif !(MIN_VERSION_base(4,13,0)) - fail = Fail.fail -#endif - instance Fail.MonadFail (P s) where fail _ = Fail @@ -180,12 +174,6 @@ instance Monad (Parser r s) where return = pure R m >>= f = R (\k -> m (\a -> let R m' = f a in m' k)) -#if !(MIN_VERSION_base(4,9,0)) - fail _ = R (const Fail) -#elif !(MIN_VERSION_base(4,13,0)) - fail = Fail.fail -#endif - instance Fail.MonadFail (Parser r s) where fail _ = R (const Fail) diff --git a/cabal-install/tests/IntegrationTests2.hs b/cabal-install/tests/IntegrationTests2.hs index b5b49053b6d..113b025e280 100644 --- a/cabal-install/tests/IntegrationTests2.hs +++ b/cabal-install/tests/IntegrationTests2.hs @@ -49,7 +49,7 @@ import qualified Distribution.Client.CmdListBin as CmdListBin import Distribution.Package import Distribution.PackageDescription import Distribution.InstalledPackageInfo (InstalledPackageInfo) -import Distribution.Simple.Setup (toFlag, HaddockFlags(..), defaultHaddockFlags) +import Distribution.Simple.Setup (toFlag, CommonSetupFlags(..), HaddockFlags(..), defaultHaddockFlags, defaultCommonSetupFlags) import Distribution.Client.Setup (globalCommand) import Distribution.Client.Config (loadConfig, SavedConfig(savedGlobalFlags), createDefaultConfigFile) import Distribution.Simple.Compiler @@ -74,7 +74,9 @@ import Control.Concurrent (threadDelay) import Control.Exception hiding (assert) import System.FilePath import System.Directory +import System.Environment (setEnv) import System.IO (hPutStrLn, stderr) +import System.Process (callProcess) import Test.Tasty import Test.Tasty.HUnit @@ -93,7 +95,18 @@ removePathForcibly = removeDirectoryRecursive #endif main :: IO () -main = +main = do + -- this is needed to ensure tests aren't affected by the user's cabal config + cwd <- getCurrentDirectory + let configDir = cwd basedir "config" "cabal-config" + setEnv "CABAL_DIR" configDir + removeDirectoryRecursive configDir <|> return () + createDirectoryIfMissing True configDir + -- sigh + -- NOTE: This is running the `cabal` from the user environment, which is + -- generally not the `cabal` being tested! + callProcess "cabal" ["-v0", "user-config", "init", "-f"] + callProcess "cabal" ["update"] defaultMainWithIngredients (defaultIngredients ++ [includingOptions projectConfigOptionDescriptions]) (withProjectConfig $ \config -> @@ -1971,229 +1984,272 @@ testNixFlags = do -- Tests whether config options are commented or not testConfigOptionComments :: Assertion testConfigOptionComments = do - _ <- createDefaultConfigFile verbosity [] (basedir "config/default-config") - defaultConfigFile <- readFile (basedir "config/default-config") - - " url" @=? findLineWith False "url" defaultConfigFile - " -- secure" @=? findLineWith True "secure" defaultConfigFile - " -- root-keys" @=? findLineWith True "root-keys" defaultConfigFile - " -- key-threshold" @=? findLineWith True "key-threshold" defaultConfigFile - - "-- ignore-expiry" @=? findLineWith True "ignore-expiry" defaultConfigFile - "-- http-transport" @=? findLineWith True "http-transport" defaultConfigFile - "-- nix" @=? findLineWith True "nix" defaultConfigFile - "-- store-dir" @=? findLineWith True "store-dir" defaultConfigFile - "-- active-repositories" @=? findLineWith True "active-repositories" defaultConfigFile - "-- local-no-index-repo" @=? findLineWith True "local-no-index-repo" defaultConfigFile - "remote-repo-cache" @=? findLineWith False "remote-repo-cache" defaultConfigFile - "-- logs-dir" @=? findLineWith True "logs-dir" defaultConfigFile - "-- default-user-config" @=? findLineWith True "default-user-config" defaultConfigFile - "-- verbose" @=? findLineWith True "verbose" defaultConfigFile - "-- compiler" @=? findLineWith True "compiler" defaultConfigFile - "-- cabal-file" @=? findLineWith True "cabal-file" defaultConfigFile - "-- with-compiler" @=? findLineWith True "with-compiler" defaultConfigFile - "-- with-hc-pkg" @=? findLineWith True "with-hc-pkg" defaultConfigFile - "-- program-prefix" @=? findLineWith True "program-prefix" defaultConfigFile - "-- program-suffix" @=? findLineWith True "program-suffix" defaultConfigFile - "-- library-vanilla" @=? findLineWith True "library-vanilla" defaultConfigFile - "-- library-profiling" @=? findLineWith True "library-profiling" defaultConfigFile - "-- shared" @=? findLineWith True "shared" defaultConfigFile - "-- static" @=? findLineWith True "static" defaultConfigFile - "-- executable-dynamic" @=? findLineWith True "executable-dynamic" defaultConfigFile - "-- executable-static" @=? findLineWith True "executable-static" defaultConfigFile - "-- profiling" @=? findLineWith True "profiling" defaultConfigFile - "-- executable-profiling" @=? findLineWith True "executable-profiling" defaultConfigFile - "-- profiling-detail" @=? findLineWith True "profiling-detail" defaultConfigFile - "-- library-profiling-detail" @=? findLineWith True "library-profiling-detail" defaultConfigFile - "-- optimization" @=? findLineWith True "optimization" defaultConfigFile - "-- debug-info" @=? findLineWith True "debug-info" defaultConfigFile - "-- build-info" @=? findLineWith True "build-info" defaultConfigFile - "-- library-for-ghci" @=? findLineWith True "library-for-ghci" defaultConfigFile - "-- split-sections" @=? findLineWith True "split-sections" defaultConfigFile - "-- split-objs" @=? findLineWith True "split-objs" defaultConfigFile - "-- executable-stripping" @=? findLineWith True "executable-stripping" defaultConfigFile - "-- library-stripping" @=? findLineWith True "library-stripping" defaultConfigFile - "-- configure-option" @=? findLineWith True "configure-option" defaultConfigFile - "-- user-install" @=? findLineWith True "user-install" defaultConfigFile - "-- package-db" @=? findLineWith True "package-db" defaultConfigFile - "-- flags" @=? findLineWith True "flags" defaultConfigFile - "-- extra-include-dirs" @=? findLineWith True "extra-include-dirs" defaultConfigFile - "-- deterministic" @=? findLineWith True "deterministic" defaultConfigFile - "-- cid" @=? findLineWith True "cid" defaultConfigFile - "-- extra-lib-dirs" @=? findLineWith True "extra-lib-dirs" defaultConfigFile - "-- extra-lib-dirs-static" @=? findLineWith True "extra-lib-dirs-static" defaultConfigFile - "-- extra-framework-dirs" @=? findLineWith True "extra-framework-dirs" defaultConfigFile - "-- extra-prog-path" @=? findLineWith False "extra-prog-path" defaultConfigFile - "-- instantiate-with" @=? findLineWith True "instantiate-with" defaultConfigFile - "-- tests" @=? findLineWith True "tests" defaultConfigFile - "-- coverage" @=? findLineWith True "coverage" defaultConfigFile - "-- library-coverage" @=? findLineWith True "library-coverage" defaultConfigFile - "-- exact-configuration" @=? findLineWith True "exact-configuration" defaultConfigFile - "-- benchmarks" @=? findLineWith True "benchmarks" defaultConfigFile - "-- relocatable" @=? findLineWith True "relocatable" defaultConfigFile - "-- response-files" @=? findLineWith True "response-files" defaultConfigFile - "-- allow-depending-on-private-libs" @=? findLineWith True "allow-depending-on-private-libs" defaultConfigFile - "-- cabal-lib-version" @=? findLineWith True "cabal-lib-version" defaultConfigFile - "-- append" @=? findLineWith True "append" defaultConfigFile - "-- backup" @=? findLineWith True "backup" defaultConfigFile - "-- constraint" @=? findLineWith True "constraint" defaultConfigFile - "-- preference" @=? findLineWith True "preference" defaultConfigFile - "-- solver" @=? findLineWith True "solver" defaultConfigFile - "-- allow-older" @=? findLineWith True "allow-older" defaultConfigFile - "-- allow-newer" @=? findLineWith True "allow-newer" defaultConfigFile - "-- write-ghc-environment-files" @=? findLineWith True "write-ghc-environment-files" defaultConfigFile - "-- documentation" @=? findLineWith True "documentation" defaultConfigFile - "-- doc-index-file" @=? findLineWith True "doc-index-file" defaultConfigFile - "-- only-download" @=? findLineWith True "only-download" defaultConfigFile - "-- target-package-db" @=? findLineWith True "target-package-db" defaultConfigFile - "-- max-backjumps" @=? findLineWith True "max-backjumps" defaultConfigFile - "-- reorder-goals" @=? findLineWith True "reorder-goals" defaultConfigFile - "-- count-conflicts" @=? findLineWith True "count-conflicts" defaultConfigFile - "-- fine-grained-conflicts" @=? findLineWith True "fine-grained-conflicts" defaultConfigFile - "-- minimize-conflict-set" @=? findLineWith True "minimize-conflict-set" defaultConfigFile - "-- independent-goals" @=? findLineWith True "independent-goals" defaultConfigFile - "-- prefer-oldest" @=? findLineWith True "prefer-oldest" defaultConfigFile - "-- shadow-installed-packages" @=? findLineWith True "shadow-installed-packages" defaultConfigFile - "-- strong-flags" @=? findLineWith True "strong-flags" defaultConfigFile - "-- allow-boot-library-installs" @=? findLineWith True "allow-boot-library-installs" defaultConfigFile - "-- reject-unconstrained-dependencies" @=? findLineWith True "reject-unconstrained-dependencies" defaultConfigFile - "-- reinstall" @=? findLineWith True "reinstall" defaultConfigFile - "-- avoid-reinstalls" @=? findLineWith True "avoid-reinstalls" defaultConfigFile - "-- force-reinstalls" @=? findLineWith True "force-reinstalls" defaultConfigFile - "-- upgrade-dependencies" @=? findLineWith True "upgrade-dependencies" defaultConfigFile - "-- index-state" @=? findLineWith True "index-state" defaultConfigFile - "-- root-cmd" @=? findLineWith True "root-cmd" defaultConfigFile - "-- symlink-bindir" @=? findLineWith True "symlink-bindir" defaultConfigFile - "build-summary" @=? findLineWith False "build-summary" defaultConfigFile - "-- build-log" @=? findLineWith True "build-log" defaultConfigFile - "remote-build-reporting" @=? findLineWith False "remote-build-reporting" defaultConfigFile - "-- report-planning-failure" @=? findLineWith True "report-planning-failure" defaultConfigFile - "-- per-component" @=? findLineWith True "per-component" defaultConfigFile - "-- run-tests" @=? findLineWith True "run-tests" defaultConfigFile - "jobs" @=? findLineWith False "jobs" defaultConfigFile - "-- keep-going" @=? findLineWith True "keep-going" defaultConfigFile - "-- offline" @=? findLineWith True "offline" defaultConfigFile - "-- lib" @=? findLineWith True "lib" defaultConfigFile - "-- package-env" @=? findLineWith True "package-env" defaultConfigFile - "-- overwrite-policy" @=? findLineWith True "overwrite-policy" defaultConfigFile - "-- install-method" @=? findLineWith True "install-method" defaultConfigFile - "installdir" @=? findLineWith False "installdir" defaultConfigFile - "-- token" @=? findLineWith True "token" defaultConfigFile - "-- username" @=? findLineWith True "username" defaultConfigFile - "-- password" @=? findLineWith True "password" defaultConfigFile - "-- password-command" @=? findLineWith True "password-command" defaultConfigFile - "-- builddir" @=? findLineWith True "builddir" defaultConfigFile - - " -- keep-temp-files" @=? findLineWith True "keep-temp-files" defaultConfigFile - " -- hoogle" @=? findLineWith True "hoogle" defaultConfigFile - " -- html" @=? findLineWith True "html" defaultConfigFile - " -- html-location" @=? findLineWith True "html-location" defaultConfigFile - " -- executables" @=? findLineWith True "executables" defaultConfigFile - " -- foreign-libraries" @=? findLineWith True "foreign-libraries" defaultConfigFile - " -- all" @=? findLineWith True "all" defaultConfigFile - " -- internal" @=? findLineWith True "internal" defaultConfigFile - " -- css" @=? findLineWith True "css" defaultConfigFile - " -- hyperlink-source" @=? findLineWith True "hyperlink-source" defaultConfigFile - " -- quickjump" @=? findLineWith True "quickjump" defaultConfigFile - " -- hscolour-css" @=? findLineWith True "hscolour-css" defaultConfigFile - " -- contents-location" @=? findLineWith True "contents-location" defaultConfigFile - " -- index-location" @=? findLineWith True "index-location" defaultConfigFile - " -- base-url" @=? findLineWith True "base-url" defaultConfigFile - " -- resources-dir" @=? findLineWith True "resources-dir" defaultConfigFile - " -- output-dir" @=? findLineWith True "output-dir" defaultConfigFile - - " -- interactive" @=? findLineWith True "interactive" defaultConfigFile - " -- quiet" @=? findLineWith True "quiet" defaultConfigFile - " -- no-comments" @=? findLineWith True "no-comments" defaultConfigFile - " -- minimal" @=? findLineWith True "minimal" defaultConfigFile - " -- cabal-version" @=? findLineWith True "cabal-version" defaultConfigFile - " -- license" @=? findLineWith True "license" defaultConfigFile - " -- extra-doc-file" @=? findLineWith True "extra-doc-file" defaultConfigFile - " -- test-dir" @=? findLineWith True "test-dir" defaultConfigFile - " -- simple" @=? findLineWith True "simple" defaultConfigFile - " -- language" @=? findLineWith True "language" defaultConfigFile - " -- application-dir" @=? findLineWith True "application-dir" defaultConfigFile - " -- source-dir" @=? findLineWith True "source-dir" defaultConfigFile - - " -- prefix" @=? findLineWith True "prefix" defaultConfigFile - " -- bindir"@=? findLineWith True "bindir" defaultConfigFile - " -- libdir" @=? findLineWith True "libdir" defaultConfigFile - " -- libsubdir" @=? findLineWith True "libsubdir" defaultConfigFile - " -- dynlibdir" @=? findLineWith True "dynlibdir" defaultConfigFile - " -- libexecdir" @=? findLineWith True "libexecdir" defaultConfigFile - " -- libexecsubdir" @=? findLineWith True "libexecsubdir" defaultConfigFile - " -- datadir" @=? findLineWith True "datadir" defaultConfigFile - " -- datasubdir" @=? findLineWith True "datasubdir" defaultConfigFile - " -- docdir" @=? findLineWith True "docdir" defaultConfigFile - " -- htmldir" @=? findLineWith True "htmldir" defaultConfigFile - " -- haddockdir" @=? findLineWith True "haddockdir" defaultConfigFile - " -- sysconfdir" @=? findLineWith True "sysconfdir" defaultConfigFile - - " -- alex-location" @=? findLineWith True "alex-location" defaultConfigFile - " -- ar-location" @=? findLineWith True "ar-location" defaultConfigFile - " -- c2hs-location" @=? findLineWith True "c2hs-location" defaultConfigFile - " -- cpphs-location" @=? findLineWith True "cpphs-location" defaultConfigFile - " -- doctest-location" @=? findLineWith True "doctest-location" defaultConfigFile - " -- gcc-location" @=? findLineWith True "gcc-location" defaultConfigFile - " -- ghc-location" @=? findLineWith True "ghc-location" defaultConfigFile - " -- ghc-pkg-location" @=? findLineWith True "ghc-pkg-location" defaultConfigFile - " -- ghcjs-location" @=? findLineWith True "ghcjs-location" defaultConfigFile - " -- ghcjs-pkg-location" @=? findLineWith True "ghcjs-pkg-location" defaultConfigFile - " -- greencard-location" @=? findLineWith True "greencard-location" defaultConfigFile - " -- haddock-location" @=? findLineWith True "haddock-location" defaultConfigFile - " -- happy-location" @=? findLineWith True "happy-location" defaultConfigFile - " -- haskell-suite-location" @=? findLineWith True "haskell-suite-location" defaultConfigFile - " -- haskell-suite-pkg-location" @=? findLineWith True "haskell-suite-pkg-location" defaultConfigFile - " -- hmake-location" @=? findLineWith True "hmake-location" defaultConfigFile - " -- hpc-location" @=? findLineWith True "hpc-location" defaultConfigFile - " -- hscolour-location" @=? findLineWith True "hscolour-location" defaultConfigFile - " -- jhc-location" @=? findLineWith True "jhc-location" defaultConfigFile - " -- ld-location" @=? findLineWith True "ld-location" defaultConfigFile - " -- pkg-config-location" @=? findLineWith True "pkg-config-location" defaultConfigFile - " -- runghc-location" @=? findLineWith True "runghc-location" defaultConfigFile - " -- strip-location" @=? findLineWith True "strip-location" defaultConfigFile - " -- tar-location" @=? findLineWith True "tar-location" defaultConfigFile - " -- uhc-location" @=? findLineWith True "uhc-location" defaultConfigFile - - " -- alex-options" @=? findLineWith True "alex-options" defaultConfigFile - " -- ar-options" @=? findLineWith True "ar-options" defaultConfigFile - " -- c2hs-options" @=? findLineWith True "c2hs-options" defaultConfigFile - " -- cpphs-options" @=? findLineWith True "cpphs-options" defaultConfigFile - " -- doctest-options" @=? findLineWith True "doctest-options" defaultConfigFile - " -- gcc-options" @=? findLineWith True "gcc-options" defaultConfigFile - " -- ghc-options" @=? findLineWith True "ghc-options" defaultConfigFile - " -- ghc-pkg-options" @=? findLineWith True "ghc-pkg-options" defaultConfigFile - " -- ghcjs-options" @=? findLineWith True "ghcjs-options" defaultConfigFile - " -- ghcjs-pkg-options" @=? findLineWith True "ghcjs-pkg-options" defaultConfigFile - " -- greencard-options" @=? findLineWith True "greencard-options" defaultConfigFile - " -- haddock-options" @=? findLineWith True "haddock-options" defaultConfigFile - " -- happy-options" @=? findLineWith True "happy-options" defaultConfigFile - " -- haskell-suite-options" @=? findLineWith True "haskell-suite-options" defaultConfigFile - " -- haskell-suite-pkg-options" @=? findLineWith True "haskell-suite-pkg-options" defaultConfigFile - " -- hmake-options" @=? findLineWith True "hmake-options" defaultConfigFile - " -- hpc-options" @=? findLineWith True "hpc-options" defaultConfigFile - " -- hsc2hs-options" @=? findLineWith True "hsc2hs-options" defaultConfigFile - " -- hscolour-options" @=? findLineWith True "hscolour-options" defaultConfigFile - " -- jhc-options" @=? findLineWith True "jhc-options" defaultConfigFile - " -- ld-options" @=? findLineWith True "ld-options" defaultConfigFile - " -- pkg-config-options" @=? findLineWith True "pkg-config-options" defaultConfigFile - " -- runghc-options" @=? findLineWith True "runghc-options" defaultConfigFile - " -- strip-options" @=? findLineWith True "strip-options" defaultConfigFile - " -- tar-options" @=? findLineWith True "tar-options" defaultConfigFile - " -- uhc-options" @=? findLineWith True "uhc-options" defaultConfigFile - where - -- | Find lines containing a target string. + let + -- | Find the first line containing a target setting name. + -- + -- If `isComment` is set, only comment lines will be found. findLineWith :: Bool -> String -> String -> String findLineWith isComment target text = case findLinesWith isComment target text of [] -> text - (l : _) -> removeCommentValue l + (l : _) -> removeColonAndAfter l + + -- | Find lines containing a target setting name. findLinesWith :: Bool -> String -> String -> [String] findLinesWith isComment target - | isComment = filter (isInfixOf (" " ++ target ++ ":")) . lines + | isComment = filter (isInfixOf ("-- " ++ target ++ ":")) . lines | otherwise = filter (isInfixOf (target ++ ":")) . lines - removeCommentValue :: String -> String - removeCommentValue = takeWhile (/= ':') + + -- | Transform @-- puppy: doggy@ into @-- puppy@. + removeColonAndAfter :: String -> String + removeColonAndAfter = takeWhile (/= ':') + + cwd <- getCurrentDirectory + let configFile = cwd basedir "config" "default-config" + _ <- createDefaultConfigFile verbosity [] configFile + defaultConfigFile <- readFile configFile + + let + -- TODO: These assertions are fairly weak. Potential improvements: + -- + -- - Include the section name in the assertion, so that (e.g.) a + -- `keep-temp-files` setting in the `haddock` section won't be confused + -- with a `keep-temp-files` setting in the `init` section. + -- + -- - Check all matching lines to confirm that settings are not listed + -- multiple times. For example, `cabal-file` is listed twice right now, + -- once under the `haddock` settings! + -- + -- - Consume the file as we go, ensuring that the settings are in a given + -- order. + -- + -- - Check the generated config file into Git (replacing e.g. `$HOME` with + -- a sentinel value) so changes show up in PR diffs. + assertHasLine' :: Bool -> String -> String -> Assertion + assertHasLine' isComment expected settingName = + let actual = findLineWith isComment settingName defaultConfigFile + messagePrefix = + "Did not find expected line for setting " + <> show settingName + <> " in configuration file " + <> configFile + in assertEqual messagePrefix expected actual + + assertHasLine :: String -> String -> Assertion + assertHasLine = assertHasLine' False + + assertHasCommentLine :: String -> String -> Assertion + assertHasCommentLine = assertHasLine' True + + + " url" `assertHasLine` "url" + " -- secure" `assertHasCommentLine` "secure" + " -- root-keys" `assertHasCommentLine` "root-keys" + " -- key-threshold" `assertHasCommentLine` "key-threshold" + + "-- ignore-expiry" `assertHasCommentLine` "ignore-expiry" + "-- http-transport" `assertHasCommentLine` "http-transport" + "-- nix" `assertHasCommentLine` "nix" + "-- store-dir" `assertHasCommentLine` "store-dir" + "-- active-repositories" `assertHasCommentLine` "active-repositories" + "-- local-no-index-repo" `assertHasCommentLine` "local-no-index-repo" + "remote-repo-cache" `assertHasLine` "remote-repo-cache" + "-- logs-dir" `assertHasCommentLine` "logs-dir" + "-- default-user-config" `assertHasCommentLine` "default-user-config" + "-- verbose" `assertHasCommentLine` "verbose" + "-- compiler" `assertHasCommentLine` "compiler" + "-- cabal-file" `assertHasCommentLine` "cabal-file" + "-- with-compiler" `assertHasCommentLine` "with-compiler" + "-- with-hc-pkg" `assertHasCommentLine` "with-hc-pkg" + "-- program-prefix" `assertHasCommentLine` "program-prefix" + "-- program-suffix" `assertHasCommentLine` "program-suffix" + "-- library-vanilla" `assertHasCommentLine` "library-vanilla" + "-- library-profiling" `assertHasCommentLine` "library-profiling" + "-- shared" `assertHasCommentLine` "shared" + "-- static" `assertHasCommentLine` "static" + "-- executable-dynamic" `assertHasCommentLine` "executable-dynamic" + "-- executable-static" `assertHasCommentLine` "executable-static" + "-- profiling" `assertHasCommentLine` "profiling" + "-- executable-profiling" `assertHasCommentLine` "executable-profiling" + "-- profiling-detail" `assertHasCommentLine` "profiling-detail" + "-- library-profiling-detail" `assertHasCommentLine` "library-profiling-detail" + "-- optimization" `assertHasCommentLine` "optimization" + "-- debug-info" `assertHasCommentLine` "debug-info" + "-- build-info" `assertHasCommentLine` "build-info" + "-- library-for-ghci" `assertHasCommentLine` "library-for-ghci" + "-- split-sections" `assertHasCommentLine` "split-sections" + "-- split-objs" `assertHasCommentLine` "split-objs" + "-- executable-stripping" `assertHasCommentLine` "executable-stripping" + "-- library-stripping" `assertHasCommentLine` "library-stripping" + "-- configure-option" `assertHasCommentLine` "configure-option" + "-- user-install" `assertHasCommentLine` "user-install" + "-- package-db" `assertHasCommentLine` "package-db" + "-- flags" `assertHasCommentLine` "flags" + "-- extra-include-dirs" `assertHasCommentLine` "extra-include-dirs" + "-- deterministic" `assertHasCommentLine` "deterministic" + "-- cid" `assertHasCommentLine` "cid" + "-- extra-lib-dirs" `assertHasCommentLine` "extra-lib-dirs" + "-- extra-lib-dirs-static" `assertHasCommentLine` "extra-lib-dirs-static" + "-- extra-framework-dirs" `assertHasCommentLine` "extra-framework-dirs" + "-- extra-prog-path" `assertHasLine` "extra-prog-path" + "-- instantiate-with" `assertHasCommentLine` "instantiate-with" + "-- tests" `assertHasCommentLine` "tests" + "-- coverage" `assertHasCommentLine` "coverage" + "-- library-coverage" `assertHasCommentLine` "library-coverage" + "-- exact-configuration" `assertHasCommentLine` "exact-configuration" + "-- benchmarks" `assertHasCommentLine` "benchmarks" + "-- relocatable" `assertHasCommentLine` "relocatable" + "-- response-files" `assertHasCommentLine` "response-files" + "-- allow-depending-on-private-libs" `assertHasCommentLine` "allow-depending-on-private-libs" + "-- cabal-lib-version" `assertHasCommentLine` "cabal-lib-version" + "-- append" `assertHasCommentLine` "append" + "-- backup" `assertHasCommentLine` "backup" + "-- constraint" `assertHasCommentLine` "constraint" + "-- preference" `assertHasCommentLine` "preference" + "-- solver" `assertHasCommentLine` "solver" + "-- allow-older" `assertHasCommentLine` "allow-older" + "-- allow-newer" `assertHasCommentLine` "allow-newer" + "-- write-ghc-environment-files" `assertHasCommentLine` "write-ghc-environment-files" + "-- documentation" `assertHasCommentLine` "documentation" + "-- doc-index-file" `assertHasCommentLine` "doc-index-file" + "-- only-download" `assertHasCommentLine` "only-download" + "-- target-package-db" `assertHasCommentLine` "target-package-db" + "-- max-backjumps" `assertHasCommentLine` "max-backjumps" + "-- reorder-goals" `assertHasCommentLine` "reorder-goals" + "-- count-conflicts" `assertHasCommentLine` "count-conflicts" + "-- fine-grained-conflicts" `assertHasCommentLine` "fine-grained-conflicts" + "-- minimize-conflict-set" `assertHasCommentLine` "minimize-conflict-set" + "-- independent-goals" `assertHasCommentLine` "independent-goals" + "-- prefer-oldest" `assertHasCommentLine` "prefer-oldest" + "-- shadow-installed-packages" `assertHasCommentLine` "shadow-installed-packages" + "-- strong-flags" `assertHasCommentLine` "strong-flags" + "-- allow-boot-library-installs" `assertHasCommentLine` "allow-boot-library-installs" + "-- reject-unconstrained-dependencies" `assertHasCommentLine` "reject-unconstrained-dependencies" + "-- reinstall" `assertHasCommentLine` "reinstall" + "-- avoid-reinstalls" `assertHasCommentLine` "avoid-reinstalls" + "-- force-reinstalls" `assertHasCommentLine` "force-reinstalls" + "-- upgrade-dependencies" `assertHasCommentLine` "upgrade-dependencies" + "-- index-state" `assertHasCommentLine` "index-state" + "-- root-cmd" `assertHasCommentLine` "root-cmd" + "-- symlink-bindir" `assertHasCommentLine` "symlink-bindir" + "build-summary" `assertHasLine` "build-summary" + "-- build-log" `assertHasCommentLine` "build-log" + "remote-build-reporting" `assertHasLine` "remote-build-reporting" + "-- report-planning-failure" `assertHasCommentLine` "report-planning-failure" + "-- per-component" `assertHasCommentLine` "per-component" + "-- run-tests" `assertHasCommentLine` "run-tests" + "jobs" `assertHasLine` "jobs" + "-- keep-going" `assertHasCommentLine` "keep-going" + "-- offline" `assertHasCommentLine` "offline" + "-- lib" `assertHasCommentLine` "lib" + "-- package-env" `assertHasCommentLine` "package-env" + "-- overwrite-policy" `assertHasCommentLine` "overwrite-policy" + "-- install-method" `assertHasCommentLine` "install-method" + "installdir" `assertHasLine` "installdir" + "-- token" `assertHasCommentLine` "token" + "-- username" `assertHasCommentLine` "username" + "-- password" `assertHasCommentLine` "password" + "-- password-command" `assertHasCommentLine` "password-command" + "-- builddir" `assertHasCommentLine` "builddir" + + " -- keep-temp-files" `assertHasCommentLine` "keep-temp-files" + " -- hoogle" `assertHasCommentLine` "hoogle" + " -- html" `assertHasCommentLine` "html" + " -- html-location" `assertHasCommentLine` "html-location" + " -- executables" `assertHasCommentLine` "executables" + " -- foreign-libraries" `assertHasCommentLine` "foreign-libraries" + " -- all" `assertHasCommentLine` "all" + " -- internal" `assertHasCommentLine` "internal" + " -- css" `assertHasCommentLine` "css" + " -- hyperlink-source" `assertHasCommentLine` "hyperlink-source" + " -- quickjump" `assertHasCommentLine` "quickjump" + " -- hscolour-css" `assertHasCommentLine` "hscolour-css" + " -- contents-location" `assertHasCommentLine` "contents-location" + " -- index-location" `assertHasCommentLine` "index-location" + " -- base-url" `assertHasCommentLine` "base-url" + " -- resources-dir" `assertHasCommentLine` "resources-dir" + " -- output-dir" `assertHasCommentLine` "output-dir" + " -- use-unicode" `assertHasCommentLine` "use-unicode" + + " -- interactive" `assertHasCommentLine` "interactive" + " -- quiet" `assertHasCommentLine` "quiet" + " -- no-comments" `assertHasCommentLine` "no-comments" + " -- minimal" `assertHasCommentLine` "minimal" + " -- cabal-version" `assertHasCommentLine` "cabal-version" + " -- license" `assertHasCommentLine` "license" + " -- extra-doc-file" `assertHasCommentLine` "extra-doc-file" + " -- test-dir" `assertHasCommentLine` "test-dir" + " -- simple" `assertHasCommentLine` "simple" + " -- language" `assertHasCommentLine` "language" + " -- application-dir" `assertHasCommentLine` "application-dir" + " -- source-dir" `assertHasCommentLine` "source-dir" + + " -- prefix" `assertHasCommentLine` "prefix" + " -- bindir" `assertHasCommentLine` "bindir" + " -- libdir" `assertHasCommentLine` "libdir" + " -- libsubdir" `assertHasCommentLine` "libsubdir" + " -- dynlibdir" `assertHasCommentLine` "dynlibdir" + " -- libexecdir" `assertHasCommentLine` "libexecdir" + " -- libexecsubdir" `assertHasCommentLine` "libexecsubdir" + " -- datadir" `assertHasCommentLine` "datadir" + " -- datasubdir" `assertHasCommentLine` "datasubdir" + " -- docdir" `assertHasCommentLine` "docdir" + " -- htmldir" `assertHasCommentLine` "htmldir" + " -- haddockdir" `assertHasCommentLine` "haddockdir" + " -- sysconfdir" `assertHasCommentLine` "sysconfdir" + + " -- alex-location" `assertHasCommentLine` "alex-location" + " -- ar-location" `assertHasCommentLine` "ar-location" + " -- c2hs-location" `assertHasCommentLine` "c2hs-location" + " -- cpphs-location" `assertHasCommentLine` "cpphs-location" + " -- doctest-location" `assertHasCommentLine` "doctest-location" + " -- gcc-location" `assertHasCommentLine` "gcc-location" + " -- ghc-location" `assertHasCommentLine` "ghc-location" + " -- ghc-pkg-location" `assertHasCommentLine` "ghc-pkg-location" + " -- ghcjs-location" `assertHasCommentLine` "ghcjs-location" + " -- ghcjs-pkg-location" `assertHasCommentLine` "ghcjs-pkg-location" + " -- greencard-location" `assertHasCommentLine` "greencard-location" + " -- haddock-location" `assertHasCommentLine` "haddock-location" + " -- happy-location" `assertHasCommentLine` "happy-location" + " -- haskell-suite-location" `assertHasCommentLine` "haskell-suite-location" + " -- haskell-suite-pkg-location" `assertHasCommentLine` "haskell-suite-pkg-location" + " -- hmake-location" `assertHasCommentLine` "hmake-location" + " -- hpc-location" `assertHasCommentLine` "hpc-location" + " -- hscolour-location" `assertHasCommentLine` "hscolour-location" + " -- jhc-location" `assertHasCommentLine` "jhc-location" + " -- ld-location" `assertHasCommentLine` "ld-location" + " -- pkg-config-location" `assertHasCommentLine` "pkg-config-location" + " -- runghc-location" `assertHasCommentLine` "runghc-location" + " -- strip-location" `assertHasCommentLine` "strip-location" + " -- tar-location" `assertHasCommentLine` "tar-location" + " -- uhc-location" `assertHasCommentLine` "uhc-location" + + " -- alex-options" `assertHasCommentLine` "alex-options" + " -- ar-options" `assertHasCommentLine` "ar-options" + " -- c2hs-options" `assertHasCommentLine` "c2hs-options" + " -- cpphs-options" `assertHasCommentLine` "cpphs-options" + " -- doctest-options" `assertHasCommentLine` "doctest-options" + " -- gcc-options" `assertHasCommentLine` "gcc-options" + " -- ghc-options" `assertHasCommentLine` "ghc-options" + " -- ghc-pkg-options" `assertHasCommentLine` "ghc-pkg-options" + " -- ghcjs-options" `assertHasCommentLine` "ghcjs-options" + " -- ghcjs-pkg-options" `assertHasCommentLine` "ghcjs-pkg-options" + " -- greencard-options" `assertHasCommentLine` "greencard-options" + " -- haddock-options" `assertHasCommentLine` "haddock-options" + " -- happy-options" `assertHasCommentLine` "happy-options" + " -- haskell-suite-options" `assertHasCommentLine` "haskell-suite-options" + " -- haskell-suite-pkg-options" `assertHasCommentLine` "haskell-suite-pkg-options" + " -- hmake-options" `assertHasCommentLine` "hmake-options" + " -- hpc-options" `assertHasCommentLine` "hpc-options" + " -- hsc2hs-options" `assertHasCommentLine` "hsc2hs-options" + " -- hscolour-options" `assertHasCommentLine` "hscolour-options" + " -- jhc-options" `assertHasCommentLine` "jhc-options" + " -- ld-options" `assertHasCommentLine` "ld-options" + " -- pkg-config-options" `assertHasCommentLine` "pkg-config-options" + " -- runghc-options" `assertHasCommentLine` "runghc-options" + " -- strip-options" `assertHasCommentLine` "strip-options" + " -- tar-options" `assertHasCommentLine` "tar-options" + " -- uhc-options" `assertHasCommentLine` "uhc-options" testIgnoreProjectFlag :: Assertion testIgnoreProjectFlag = do @@ -2233,7 +2289,12 @@ testHaddockProjectDependencies config = do cleanHaddockProject testdir withCurrentDirectory dir $ do CmdHaddockProject.haddockProjectAction - defaultHaddockProjectFlags { haddockProjectVerbosity = Flag verbosity } + defaultHaddockProjectFlags + { haddockProjectCommonFlags = + defaultCommonSetupFlags + { setupVerbosity = Flag verbosity + } + } ["all"] defaultGlobalFlags { globalStoreDir = Flag "store" } diff --git a/cabal-install/tests/UnitTests/Distribution/Client/FileMonitor.hs b/cabal-install/tests/UnitTests/Distribution/Client/FileMonitor.hs index f3c8145bc49..88901d17cb7 100644 --- a/cabal-install/tests/UnitTests/Distribution/Client/FileMonitor.hs +++ b/cabal-install/tests/UnitTests/Distribution/Client/FileMonitor.hs @@ -88,17 +88,10 @@ tests mtimeChange = Windows -> expectFailBecause msg _ -> id fingerprintStateGlob1, fingerprintStateGlob2, fingerprintStateFileSet1, fingerprintStateFileSet2 :: Word64 -#if MIN_VERSION_base(4,19,0) - fingerprintStateGlob1 = 0x4ebc6a7d12bb2132 - fingerprintStateGlob2 = 0x2c2292eeda0a9319 - fingerprintStateFileSet1 = 0x01df5796f9030851 - fingerprintStateFileSet2 = 0x2f5c472be17bee98 -#else - fingerprintStateGlob1 = 0xf32c0d1644dd9ee5 - fingerprintStateGlob2 = 0x0f2494f7b6031fb6 - fingerprintStateFileSet1 = 0x06d4a13275c24282 - fingerprintStateFileSet2 = 0x791b2a88684b5f37 -#endif + fingerprintStateGlob1 = 0x8d6292a27f48ab78 + fingerprintStateGlob2 = 0xa69393cf17cb6c71 + fingerprintStateFileSet1 = 0x441fcb5eaf403013 + fingerprintStateFileSet2 = 0x129db82bba47f56f -- Check the file system behaves the way we expect it to diff --git a/cabal-install/tests/UnitTests/Distribution/Client/Init.hs b/cabal-install/tests/UnitTests/Distribution/Client/Init.hs index b06faef5312..ce33e9ab302 100644 --- a/cabal-install/tests/UnitTests/Distribution/Client/Init.hs +++ b/cabal-install/tests/UnitTests/Distribution/Client/Init.hs @@ -17,6 +17,7 @@ import Distribution.Client.IndexUtils import Distribution.Client.Init.Types import Distribution.Client.Sandbox import Distribution.Client.Setup +import Distribution.Simple.Compiler import Distribution.Verbosity tests :: IO [TestTree] @@ -32,7 +33,7 @@ tests = do withRepoContext v globalFlags' $ \repoCtx -> do let pkgDb = configPackageDB' confFlags' - pkgIx <- getInstalledPackages v comp pkgDb progdb + pkgIx <- getInstalledPackages v comp (interpretPackageDBStack Nothing pkgDb) progdb srcDb <- getSourcePackages v repoCtx return diff --git a/cabal-install/tests/UnitTests/Distribution/Client/Init/FileCreators.hs b/cabal-install/tests/UnitTests/Distribution/Client/Init/FileCreators.hs index 38c488dd3a7..63a5774acb1 100644 --- a/cabal-install/tests/UnitTests/Distribution/Client/Init/FileCreators.hs +++ b/cabal-install/tests/UnitTests/Distribution/Client/Init/FileCreators.hs @@ -81,7 +81,7 @@ tests _v _initFlags comp pkgIx srcDb = "False" ] - case flip _runPrompt inputs $ do + case flip runPrompt inputs $ do projSettings <- createProject comp silent pkgIx srcDb dummyFlags' writeProject projSettings of Left (BreakException ex) -> assertFailure $ show ex diff --git a/cabal-install/tests/UnitTests/Distribution/Client/Init/Golden.hs b/cabal-install/tests/UnitTests/Distribution/Client/Init/Golden.hs index 19efe2eea1a..78387d404da 100644 --- a/cabal-install/tests/UnitTests/Distribution/Client/Init/Golden.hs +++ b/cabal-install/tests/UnitTests/Distribution/Client/Init/Golden.hs @@ -105,7 +105,7 @@ goldenPkgDescTests v srcDb pkgDir pkgName = ] where runPkgDesc opts flags args = do - case _runPrompt (genPkgDescription flags srcDb) args of + case runPrompt (genPkgDescription flags srcDb) args of Left e -> assertFailure $ show e Right (pkg, _) -> mkStanza $ mkPkgDescription opts pkg @@ -146,7 +146,7 @@ goldenExeTests v pkgIx pkgDir pkgName = ] where runGoldenExe opts args flags = - case _runPrompt (genExeTarget flags pkgIx) args of + case runPrompt (genExeTarget flags pkgIx) args of Right (t, _) -> mkStanza [mkExeStanza opts $ t{_exeDependencies = mangleBaseDep t _exeDependencies}] Left e -> assertFailure $ show e @@ -192,7 +192,7 @@ goldenLibTests v pkgIx pkgDir pkgName = ] where runGoldenLib opts args flags = - case _runPrompt (genLibTarget flags pkgIx) args of + case runPrompt (genLibTarget flags pkgIx) args of Right (t, _) -> mkStanza [mkLibStanza opts $ t{_libDependencies = mangleBaseDep t _libDependencies}] Left e -> assertFailure $ show e @@ -243,7 +243,7 @@ goldenTestTests v pkgIx pkgDir pkgName = ] where runGoldenTest opts args flags = - case _runPrompt (genTestTarget flags pkgIx) args of + case runPrompt (genTestTarget flags pkgIx) args of Left e -> assertFailure $ show e Right (Nothing, _) -> assertFailure @@ -286,7 +286,7 @@ goldenCabalTests v pkgIx srcDb = ] where runGoldenTest args flags = - case _runPrompt (createProject v pkgIx srcDb flags) args of + case runPrompt (createProject v pkgIx srcDb flags) args of Left e -> assertFailure $ show e (Right (ProjectSettings opts pkgDesc (Just libTarget) (Just exeTarget) (Just testTarget), _)) -> do let pkgFields = mkPkgDescription opts pkgDesc diff --git a/cabal-install/tests/UnitTests/Distribution/Client/Init/Interactive.hs b/cabal-install/tests/UnitTests/Distribution/Client/Init/Interactive.hs index 15714bba952..9ba237cbadc 100644 --- a/cabal-install/tests/UnitTests/Distribution/Client/Init/Interactive.hs +++ b/cabal-install/tests/UnitTests/Distribution/Client/Init/Interactive.hs @@ -76,7 +76,7 @@ createProjectTest pkgIx srcDb = , dependencies = Flag [] } - case (_runPrompt $ createProject silent pkgIx srcDb dummyFlags') (fromList ["[]", "3", "quxTest/Main.hs"]) of + case (runPrompt $ createProject silent pkgIx srcDb dummyFlags') (fromList ["[]", "3", "quxTest/Main.hs"]) of Right (ProjectSettings opts desc (Just lib) (Just exe) (Just test), _) -> do _optOverwrite opts @?= False _optMinimal opts @?= False @@ -186,7 +186,7 @@ createProjectTest pkgIx srcDb = "y" ] - case (_runPrompt $ createProject silent pkgIx srcDb emptyFlags) inputs of + case (runPrompt $ createProject silent pkgIx srcDb emptyFlags) inputs of Right (ProjectSettings opts desc (Just lib) (Just exe) (Just test), _) -> do _optOverwrite opts @?= False _optMinimal opts @?= False @@ -286,7 +286,7 @@ createProjectTest pkgIx srcDb = "y" ] - case (_runPrompt $ createProject silent pkgIx srcDb emptyFlags) inputs of + case (runPrompt $ createProject silent pkgIx srcDb emptyFlags) inputs of Right (ProjectSettings opts desc (Just lib) Nothing (Just test), _) -> do _optOverwrite opts @?= False _optMinimal opts @?= False @@ -372,7 +372,7 @@ createProjectTest pkgIx srcDb = "y" ] - case (_runPrompt $ createProject silent pkgIx srcDb emptyFlags) inputs of + case (runPrompt $ createProject silent pkgIx srcDb emptyFlags) inputs of Right (ProjectSettings opts desc Nothing Nothing (Just test), _) -> do _optOverwrite opts @?= False _optMinimal opts @?= False @@ -460,7 +460,7 @@ createProjectTest pkgIx srcDb = "y" ] - case (_runPrompt $ createProject silent pkgIx srcDb emptyFlags) inputs of + case (runPrompt $ createProject silent pkgIx srcDb emptyFlags) inputs of Right (ProjectSettings opts desc (Just lib) (Just exe) Nothing, _) -> do _optOverwrite opts @?= False _optMinimal opts @?= False @@ -546,7 +546,7 @@ createProjectTest pkgIx srcDb = "y" ] - case (_runPrompt $ createProject silent pkgIx srcDb emptyFlags) inputs of + case (runPrompt $ createProject silent pkgIx srcDb emptyFlags) inputs of Right (ProjectSettings opts desc (Just lib) Nothing Nothing, _) -> do _optOverwrite opts @?= False _optMinimal opts @?= False @@ -631,7 +631,7 @@ createProjectTest pkgIx srcDb = , extraSrc = Flag ["README.md"] } - case (_runPrompt $ createProject silent pkgIx srcDb flags) inputs of + case (runPrompt $ createProject silent pkgIx srcDb flags) inputs of Right (ProjectSettings opts desc (Just lib) Nothing Nothing, _) -> do _optOverwrite opts @?= False _optMinimal opts @?= False @@ -709,7 +709,7 @@ createProjectTest pkgIx srcDb = "y" ] - case (_runPrompt $ createProject silent pkgIx srcDb emptyFlags) inputs of + case (runPrompt $ createProject silent pkgIx srcDb emptyFlags) inputs of Right (ProjectSettings opts desc Nothing (Just exe) Nothing, _) -> do _optOverwrite opts @?= False _optMinimal opts @?= False @@ -809,7 +809,7 @@ fileCreatorTests pkgIx srcDb _pkgName = ] ] where - runGenTest inputs go = case _runPrompt go inputs of + runGenTest inputs go = case runPrompt go inputs of Left e -> assertFailure $ show e Right{} -> return () @@ -1030,6 +1030,20 @@ interactiveTests srcDb = , "Lang_TS!" ] ] + , testGroup + "Check languagePrompt session state" + [ testSimplePrompt + "Use last language" + ( \flags -> do + a <- languagePrompt flags "first language" + b <- languagePrompt flags "second language" + pure (a, b) + ) + (GHC2024, GHC2024) + [ "4" + , "" -- default + ] + ] , testGroup "Check srcDirsPrompt output" [ testNumberedPrompt @@ -1113,7 +1127,7 @@ testPrompt -> [String] -> TestTree testPrompt label f g h input = testCase label $ - case (_runPrompt $ f emptyFlags) (fromList input) of + case (runPrompt $ f emptyFlags) (fromList input) of Left x -> g x -- :: BreakException Right x -> h x -- :: (a, other inputs) diff --git a/cabal-install/tests/UnitTests/Distribution/Client/Init/NonInteractive.hs b/cabal-install/tests/UnitTests/Distribution/Client/Init/NonInteractive.hs index cd618622201..711d50c8e3b 100644 --- a/cabal-install/tests/UnitTests/Distribution/Client/Init/NonInteractive.hs +++ b/cabal-install/tests/UnitTests/Distribution/Client/Init/NonInteractive.hs @@ -93,7 +93,7 @@ driverFunctionTest pkgIx srcDb comp = , "[\"quxTest/Main.hs\"]" ] - case (_runPrompt $ createProject comp silent pkgIx srcDb dummyFlags') inputs of + case (runPrompt $ createProject comp silent pkgIx srcDb dummyFlags') inputs of Right (ProjectSettings opts desc (Just lib) (Just exe) (Just test), _) -> do _optOverwrite opts @?= False _optMinimal opts @?= False @@ -180,7 +180,7 @@ driverFunctionTest pkgIx srcDb comp = "False" ] - case (_runPrompt $ createProject comp silent pkgIx srcDb dummyFlags') inputs of + case (runPrompt $ createProject comp silent pkgIx srcDb dummyFlags') inputs of Right (ProjectSettings opts desc (Just lib) (Just exe) (Just test), _) -> do _optOverwrite opts @?= False _optMinimal opts @?= False @@ -356,7 +356,7 @@ driverFunctionTest pkgIx srcDb comp = , "[\"test/Main.hs\", \"test/Foo.hs\", \"test/bar.y\"]" ] - case ( _runPrompt $ + case ( runPrompt $ createProject comp silent @@ -508,7 +508,7 @@ driverFunctionTest pkgIx srcDb comp = , "[\"test/Main.hs\", \"test/Foo.hs\", \"test/bar.y\"]" ] - case ( _runPrompt $ + case ( runPrompt $ createProject comp silent @@ -664,7 +664,7 @@ driverFunctionTest pkgIx srcDb comp = , "[\"app/Main.hs\", \"src/Foo.hs\", \"src/bar.y\"]" ] - case (_runPrompt $ createProject comp silent pkgIx srcDb emptyFlags) inputs of + case (runPrompt $ createProject comp silent pkgIx srcDb emptyFlags) inputs of Right (ProjectSettings opts desc (Just lib) (Just exe) Nothing, _) -> do _optOverwrite opts @?= False _optMinimal opts @?= False @@ -774,7 +774,7 @@ driverFunctionTest pkgIx srcDb comp = , "[\"app/Main.hs\", \"src/Foo.hs\", \"src/bar.y\"]" ] - case (_runPrompt $ createProject comp silent pkgIx srcDb emptyFlags) inputs of + case (runPrompt $ createProject comp silent pkgIx srcDb emptyFlags) inputs of Right (ProjectSettings opts desc (Just lib) Nothing Nothing, _) -> do _optOverwrite opts @?= False _optMinimal opts @?= False @@ -865,7 +865,7 @@ driverFunctionTest pkgIx srcDb comp = , "[\"app/Main.hs\", \"src/Foo.hs\", \"src/bar.y\"]" ] - case (_runPrompt $ createProject comp silent pkgIx srcDb emptyFlags) inputs of + case (runPrompt $ createProject comp silent pkgIx srcDb emptyFlags) inputs of Right (ProjectSettings opts desc Nothing (Just exe) Nothing, _) -> do _optOverwrite opts @?= False _optMinimal opts @?= False @@ -931,7 +931,7 @@ fileCreatorTests pkgIx srcDb comp = , "[]" ] - case (_runPrompt $ genPkgDescription emptyFlags srcDb) inputs of + case (runPrompt $ genPkgDescription emptyFlags srcDb) inputs of Left e -> assertFailure $ show e Right{} -> return () ] @@ -980,7 +980,7 @@ fileCreatorTests pkgIx srcDb comp = , "[\"app/Main.hs\", \"src/Foo.hs\", \"src/bar.y\"]" ] - case (_runPrompt $ genLibTarget emptyFlags comp pkgIx defaultCabalVersion) inputs of + case (runPrompt $ genLibTarget emptyFlags comp pkgIx defaultCabalVersion) inputs of Left e -> assertFailure $ show e Right{} -> return () ] @@ -1021,7 +1021,7 @@ fileCreatorTests pkgIx srcDb comp = , "[\"app/Main.hs\", \"src/Foo.hs\", \"src/bar.y\"]" ] - case (_runPrompt $ genExeTarget emptyFlags comp pkgIx defaultCabalVersion) inputs of + case (runPrompt $ genExeTarget emptyFlags comp pkgIx defaultCabalVersion) inputs of Left e -> assertFailure $ show e Right{} -> return () ] @@ -1058,7 +1058,7 @@ fileCreatorTests pkgIx srcDb comp = ] flags = emptyFlags{initializeTestSuite = Flag True} - case (_runPrompt $ genTestTarget flags comp pkgIx defaultCabalVersion) inputs of + case (runPrompt $ genTestTarget flags comp pkgIx defaultCabalVersion) inputs of Left e -> assertFailure $ show e Right{} -> return () ] @@ -1403,7 +1403,7 @@ testGo -> [String] -> TestTree testGo label f g h inputs = testCase label $ - case (_runPrompt $ f emptyFlags) (NEL.fromList inputs) of + case (runPrompt $ f emptyFlags) (NEL.fromList inputs) of Left x -> g x Right x -> h x diff --git a/cabal-install/tests/UnitTests/Distribution/Client/Init/Simple.hs b/cabal-install/tests/UnitTests/Distribution/Client/Init/Simple.hs index 13a12ba0827..bbe3c0401bb 100644 --- a/cabal-install/tests/UnitTests/Distribution/Client/Init/Simple.hs +++ b/cabal-install/tests/UnitTests/Distribution/Client/Init/Simple.hs @@ -69,7 +69,7 @@ simpleCreateProjectTests v pkgIx srcDb pkgName = Nothing Nothing - case _runPrompt (createProject v pkgIx srcDb flags) inputs of + case runPrompt (createProject v pkgIx srcDb flags) inputs of Left e -> assertFailure $ "Failed to create simple lib project: " ++ show e Right (settings', _) -> settings @=? settings' , testCase "Simple lib createProject - with tests" $ do @@ -83,7 +83,7 @@ simpleCreateProjectTests v pkgIx srcDb pkgName = Nothing (Just $ simpleTestTarget (Just pkgName) baseDep) - case _runPrompt (createProject v pkgIx srcDb flags) inputs of + case runPrompt (createProject v pkgIx srcDb flags) inputs of Left e -> assertFailure $ "Failed to create simple lib (with tests)project: " ++ show e Right (settings', _) -> settings @=? settings' , testCase "Simple exe createProject" $ do @@ -97,7 +97,7 @@ simpleCreateProjectTests v pkgIx srcDb pkgName = (Just $ simpleExeTarget Nothing baseDep) Nothing - case _runPrompt (createProject v pkgIx srcDb flags) inputs of + case runPrompt (createProject v pkgIx srcDb flags) inputs of Left e -> assertFailure $ "Failed to create simple exe project: " ++ show e Right (settings', _) -> settings @=? settings' , testCase "Simple lib+exe createProject - no tests" $ do @@ -111,7 +111,7 @@ simpleCreateProjectTests v pkgIx srcDb pkgName = (Just $ simpleExeTarget (Just pkgName) baseDep) Nothing - case _runPrompt (createProject v pkgIx srcDb flags) inputs of + case runPrompt (createProject v pkgIx srcDb flags) inputs of Left e -> assertFailure $ "Failed to create simple lib+exe project: " ++ show e Right (settings', _) -> settings @=? settings' , testCase "Simple lib+exe createProject - with tests" $ do @@ -125,7 +125,7 @@ simpleCreateProjectTests v pkgIx srcDb pkgName = (Just $ simpleExeTarget (Just pkgName) baseDep) (Just $ simpleTestTarget (Just pkgName) baseDep) - case _runPrompt (createProject v pkgIx srcDb flags) inputs of + case runPrompt (createProject v pkgIx srcDb flags) inputs of Left e -> assertFailure $ "Failed to create simple lib+exe (with tests) project: " ++ show e Right (settings', _) -> settings @=? settings' , testCase "Simple standalone tests" $ do @@ -139,12 +139,12 @@ simpleCreateProjectTests v pkgIx srcDb pkgName = Nothing (Just $ simpleTestTarget Nothing baseDep) - case _runPrompt (createProject v pkgIx srcDb flags) inputs of + case runPrompt (createProject v pkgIx srcDb flags) inputs of Left e -> assertFailure $ "Failed to create simple standalone test project: " ++ show e Right (settings', _) -> settings @=? settings' ] where - baseDep = case _runPrompt (getBaseDep pkgIx emptyFlags) $ fromList [] of + baseDep = case runPrompt (getBaseDep pkgIx emptyFlags) $ fromList [] of Left e -> error $ show e Right a -> fst a diff --git a/cabal-install/tests/UnitTests/Distribution/Client/ProjectConfig.hs b/cabal-install/tests/UnitTests/Distribution/Client/ProjectConfig.hs index 946e0bf48fd..1996dab1a1d 100644 --- a/cabal-install/tests/UnitTests/Distribution/Client/ProjectConfig.hs +++ b/cabal-install/tests/UnitTests/Distribution/Client/ProjectConfig.hs @@ -10,10 +10,6 @@ module UnitTests.Distribution.Client.ProjectConfig (tests) where -#if !MIN_VERSION_base(4,8,0) -import Data.Monoid -import Control.Applicative -#endif import Control.Monad import Data.Either (isRight) import Data.Foldable (for_) @@ -102,6 +98,7 @@ tests = , testProperty "specific" prop_roundtrip_printparse_specific , testProperty "all" prop_roundtrip_printparse_all ] + , testGetProjectRootUsability , testFindProjectRoot ] where @@ -110,6 +107,31 @@ tests = CompilerId GHC v -> v < mkVersion [7, 7] _ -> False +testGetProjectRootUsability :: TestTree +testGetProjectRootUsability = + testGroup + "getProjectRootUsability" + [ test "relative path" file ProjectRootUsabilityPresentAndUsable + , test "absolute path" absFile ProjectRootUsabilityPresentAndUsable + , test "symbolic link" fileSymlink ProjectRootUsabilityPresentAndUsable + , test "file not present" fileNotPresent ProjectRootUsabilityNotPresent + , test "directory" brokenDirCabalProject ProjectRootUsabilityPresentAndUnusable + , test "broken symbolic link" fileSymlinkBroken ProjectRootUsabilityPresentAndUnusable + ] + where + dir = fixturesDir "project-root" + file = defaultProjectFile + absFile = dir file + fileNotPresent = file <.> "not-present" + fileSymlink = file <.> "symlink" + fileSymlinkBroken = fileSymlink <.> "broken" + brokenDirCabalProject = "cabal" <.> "project" <.> "dir" <.> "broken" + test name fileName expectedState = + testCase name $ + withCurrentDirectory dir $ + getProjectRootUsability fileName + >>= (@?= expectedState) + testFindProjectRoot :: TestTree testFindProjectRoot = testGroup @@ -120,6 +142,10 @@ testFindProjectRoot = , test "explicit file in lib" (cd libDir) Nothing (Just file) (succeeds dir file) , test "other file" (cd dir) Nothing (Just fileOther) (succeeds dir fileOther) , test "other file in lib" (cd libDir) Nothing (Just fileOther) (succeeds dir fileOther) + , test "symbolic link" (cd dir) Nothing (Just fileSymlink) (succeeds dir fileSymlink) + , test "symbolic link in lib" (cd libDir) Nothing (Just fileSymlink) (succeeds dir fileSymlink) + , test "broken symbolic link" (cd dir) Nothing (Just fileSymlinkBroken) (failsWith $ BadProjectRootFileBroken fileSymlinkBroken) + , test "broken symbolic link in lib" (cd libDir) Nothing (Just fileSymlinkBroken) (failsWith $ BadProjectRootFileBroken fileSymlinkBroken) , -- Deprecated use-case test "absolute file" Nothing Nothing (Just absFile) (succeeds dir file) , test "nested file" (cd dir) Nothing (Just nixFile) (succeeds dir nixFile) @@ -141,6 +167,9 @@ testFindProjectRoot = nixFile = "nix" file nixOther = nixFile <.> "other" + fileSymlink = file <.> "symlink" + fileSymlinkBroken = fileSymlink <.> "broken" + missing path = Just (path <.> "does_not_exist") test name wrap projectDir projectFile validate = @@ -169,6 +198,18 @@ testFindProjectRoot = Left _ -> pure () Right x -> assertFailure $ "Expected an error, but found " <> show x + failsWith expectedError result = case result of + Left actualError -> + if actualError == expectedError + then pure () + else + assertFailure $ + "Expected an error " + <> show expectedError + <> ", but found " + <> show actualError + Right x -> assertFailure $ "Expected an error, but found " <> show x + fixturesDir :: FilePath fixturesDir = unsafePerformIO $ @@ -683,6 +724,7 @@ instance Arbitrary PackageConfig where <*> arbitrary <*> arbitrary <*> arbitrary + <*> arbitrary <*> shortListOf 5 arbitraryShortToken <*> arbitrary <*> arbitrary @@ -726,6 +768,7 @@ instance Arbitrary PackageConfig where <*> arbitrary <*> arbitrary <*> arbitrary + <*> arbitrary <*> arbitraryFlag arbitraryShortToken <*> arbitrary <*> shortListOf 5 arbitrary @@ -751,6 +794,7 @@ instance Arbitrary PackageConfig where , packageConfigFullyStaticExe = x50 , packageConfigProf = x07 , packageConfigProfLib = x08 + , packageConfigProfShared = x08_1 , packageConfigProfExe = x09 , packageConfigProfDetail = x10 , packageConfigProfLibDetail = x11 @@ -793,6 +837,7 @@ instance Arbitrary PackageConfig where , packageConfigHaddockBaseUrl = x55 , packageConfigHaddockResourcesDir = x56 , packageConfigHaddockOutputDir = x57 + , packageConfigHaddockUseUnicode = x58 , packageConfigTestHumanLog = x44 , packageConfigTestMachineLog = x45 , packageConfigTestShowDetails = x46 @@ -814,6 +859,7 @@ instance Arbitrary PackageConfig where , packageConfigFullyStaticExe = x50' , packageConfigProf = x07' , packageConfigProfLib = x08' + , packageConfigProfShared = x08_1' , packageConfigProfExe = x09' , packageConfigProfDetail = x10' , packageConfigProfLibDetail = x11' @@ -856,6 +902,7 @@ instance Arbitrary PackageConfig where , packageConfigHaddockBaseUrl = x55' , packageConfigHaddockResourcesDir = x56' , packageConfigHaddockOutputDir = x57' + , packageConfigHaddockUseUnicode = x58' , packageConfigTestHumanLog = x44' , packageConfigTestMachineLog = x45' , packageConfigTestShowDetails = x46' @@ -866,7 +913,7 @@ instance Arbitrary PackageConfig where , packageConfigBenchmarkOptions = x52' } | ( ( (x00', x01', x02', x03', x04') - , (x05', x42', x06', x50', x07', x08', x09') + , (x05', x42', x06', x50', x07', x08', x08_1', x09') , (x10', x11', x12', x13', x14') , (x15', x16', x53', x17', x18', x19') ) @@ -878,12 +925,13 @@ instance Arbitrary PackageConfig where , (x44', x45', x46', x47', x48', x49', x51', x52', x54', x55') , x56' , x57' + , x58' ) ) <- shrink ( ( (preShrink_Paths x00, preShrink_Args x01, x02, x03, x04) - , (x05, x42, x06, x50, x07, x08, x09) + , (x05, x42, x06, x50, x07, x08, x08_1, x09) , (x10, x11, map NonEmpty x12, x13, x14) , ( x15 @@ -903,6 +951,7 @@ instance Arbitrary PackageConfig where , (x44, x45, x46, x47, x48, x49, x51, x52, x54, x55) , x56 , x57 + , x58 ) ) ] diff --git a/cabal-install/tests/UnitTests/Distribution/Client/TreeDiffInstances.hs b/cabal-install/tests/UnitTests/Distribution/Client/TreeDiffInstances.hs index 0dede72858a..da9bd8ad90d 100644 --- a/cabal-install/tests/UnitTests/Distribution/Client/TreeDiffInstances.hs +++ b/cabal-install/tests/UnitTests/Distribution/Client/TreeDiffInstances.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -fno-warn-orphans #-} @@ -21,7 +22,7 @@ import Distribution.Client.Types import Distribution.Client.Types.OverwritePolicy (OverwritePolicy) import Distribution.Client.Types.SourceRepo (SourceRepositoryPackage) -import Distribution.Simple.Compiler (PackageDB) +import Distribution.Simple.Compiler (PackageDBX) import Data.TreeDiff.Class import Data.TreeDiff.Instances.Cabal () @@ -54,7 +55,7 @@ instance ToExpr OptionalStanza instance ToExpr Outcome instance ToExpr OverwritePolicy instance ToExpr PackageConfig -instance ToExpr PackageDB +instance ToExpr (PackageDBX FilePath) instance ToExpr PackageProperty instance ToExpr PreferOldest instance ToExpr PreSolver diff --git a/cabal-install/tests/UnitTests/Distribution/Client/UserConfig.hs b/cabal-install/tests/UnitTests/Distribution/Client/UserConfig.hs index 17adc1b75b4..91ed61c86cd 100644 --- a/cabal-install/tests/UnitTests/Distribution/Client/UserConfig.hs +++ b/cabal-install/tests/UnitTests/Distribution/Client/UserConfig.hs @@ -7,9 +7,6 @@ module UnitTests.Distribution.Client.UserConfig import Control.Exception (bracket) import Control.Monad (replicateM_) import Data.List (nub, sort) -#if !MIN_VERSION_base(4,8,0) -import Data.Monoid -#endif import System.Directory ( doesFileExist , getCurrentDirectory diff --git a/cabal-install/tests/UnitTests/Distribution/Client/VCS.hs b/cabal-install/tests/UnitTests/Distribution/Client/VCS.hs index 0bd49355913..a76dd39b082 100644 --- a/cabal-install/tests/UnitTests/Distribution/Client/VCS.hs +++ b/cabal-install/tests/UnitTests/Distribution/Client/VCS.hs @@ -847,7 +847,7 @@ vcsTestDriverGit -> VCSTestDriver vcsTestDriverGit verbosity vcs submoduleDir repoRoot = VCSTestDriver - { vcsVCS = vcs + { vcsVCS = vcs' , vcsRepoRoot = repoRoot , vcsIgnoreFiles = Set.empty , vcsInit = @@ -872,7 +872,7 @@ vcsTestDriverGit verbosity vcs submoduleDir repoRoot = , vcsTagState = \_ tagname -> git ["tag", "--force", "--no-sign", tagname] , vcsSubmoduleDriver = - pure . vcsTestDriverGit verbosity vcs submoduleDir . (submoduleDir ) + pure . vcsTestDriverGit verbosity vcs' submoduleDir . (submoduleDir ) , vcsAddSubmodule = \_ source dest -> do destExists <- (||) @@ -897,8 +897,26 @@ vcsTestDriverGit verbosity vcs submoduleDir repoRoot = updateSubmodulesAndCleanup } where + -- Git 2.38.1 and newer fails to clone from local paths with `fatal: transport 'file' + -- not allowed` unless `protocol.file.allow=always` is set. + -- + -- This is not safe in general, but it's fine in the test suite. + -- + -- See: https://github.blog/open-source/git/git-security-vulnerabilities-announced/#fn-67904-1 + -- See: https://git-scm.com/docs/git-config#Documentation/git-config.txt-protocolallow + vcs' = + vcs + { vcsProgram = + (vcsProgram vcs) + { programDefaultArgs = + programDefaultArgs (vcsProgram vcs) + ++ [ "-c" + , "protocol.file.allow=always" + ] + } + } gitInvocation args = - (programInvocation (vcsProgram vcs) args) + (programInvocation (vcsProgram vcs') args) { progInvokeCwd = Just repoRoot } git = runProgramInvocation verbosity . gitInvocation diff --git a/cabal-install/tests/UnitTests/Distribution/Solver/Modular/DSL.hs b/cabal-install/tests/UnitTests/Distribution/Solver/Modular/DSL.hs index 991c5cafa0e..08e1d7fb141 100644 --- a/cabal-install/tests/UnitTests/Distribution/Solver/Modular/DSL.hs +++ b/cabal-install/tests/UnitTests/Distribution/Solver/Modular/DSL.hs @@ -783,7 +783,7 @@ exResolve -> Maybe [Extension] -- List of languages supported by the compiler, or Nothing if unknown. -> Maybe [Language] - -> PC.PkgConfigDb + -> Maybe PC.PkgConfigDb -> [ExamplePkgName] -> Maybe Int -> CountConflicts diff --git a/cabal-install/tests/UnitTests/Distribution/Solver/Modular/DSL/TestCaseUtils.hs b/cabal-install/tests/UnitTests/Distribution/Solver/Modular/DSL/TestCaseUtils.hs index 91ec541f976..afd1419d30c 100644 --- a/cabal-install/tests/UnitTests/Distribution/Solver/Modular/DSL/TestCaseUtils.hs +++ b/cabal-install/tests/UnitTests/Distribution/Solver/Modular/DSL/TestCaseUtils.hs @@ -130,7 +130,7 @@ data SolverTest = SolverTest , testDb :: ExampleDb , testSupportedExts :: Maybe [Extension] , testSupportedLangs :: Maybe [Language] - , testPkgConfigDb :: PkgConfigDb + , testPkgConfigDb :: Maybe PkgConfigDb , testEnableAllTests :: EnableAllTests } @@ -233,7 +233,7 @@ mkTestExtLangPC exts langs mPkgConfigDb db label targets result = , testDb = db , testSupportedExts = exts , testSupportedLangs = langs - , testPkgConfigDb = maybe NoPkgConfigDb pkgConfigDbFromList mPkgConfigDb + , testPkgConfigDb = pkgConfigDbFromList <$> mPkgConfigDb , testEnableAllTests = EnableAllTests False } diff --git a/cabal-install/tests/UnitTests/Distribution/Solver/Modular/QuickCheck.hs b/cabal-install/tests/UnitTests/Distribution/Solver/Modular/QuickCheck.hs index 114db775f21..c891f60692b 100644 --- a/cabal-install/tests/UnitTests/Distribution/Solver/Modular/QuickCheck.hs +++ b/cabal-install/tests/UnitTests/Distribution/Solver/Modular/QuickCheck.hs @@ -52,7 +52,20 @@ import UnitTests.Distribution.Solver.Modular.QuickCheck.Utils tests :: [TestTree] tests = - [ -- This test checks that certain solver parameters do not affect the + [ testPropertyWithSeed "solver does not throw exceptions" $ + \test goalOrder reorderGoals indepGoals prefOldest -> + let r = + solve + (EnableBackjumping True) + (FineGrainedConflicts True) + reorderGoals + (CountConflicts True) + indepGoals + prefOldest + (getBlind <$> goalOrder) + test + in resultPlan r `seq` () + , -- This test checks that certain solver parameters do not affect the -- existence of a solution. It runs the solver twice, and only sets those -- parameters on the second run. The test also applies parameters that -- can affect the existence of a solution to both runs. @@ -227,7 +240,7 @@ solve enableBj fineGrainedConflicts reorder countConflicts indep prefOldest goal (unTestDb (testDb test)) Nothing Nothing - (pkgConfigDbFromList []) + (Just $ pkgConfigDbFromList []) (map unPN (testTargets test)) -- The backjump limit prevents individual tests from using -- too much time and memory. @@ -516,6 +529,11 @@ instance Arbitrary IndependentGoals where shrink (IndependentGoals indep) = [IndependentGoals False | indep] +instance Arbitrary PreferOldest where + arbitrary = PreferOldest <$> arbitrary + + shrink (PreferOldest prefOldest) = [PreferOldest False | prefOldest] + instance Arbitrary Component where arbitrary = oneof diff --git a/cabal-install/tests/UnitTests/Distribution/Solver/Modular/QuickCheck/Utils.hs b/cabal-install/tests/UnitTests/Distribution/Solver/Modular/QuickCheck/Utils.hs index 72283639cd9..c1882bc659a 100644 --- a/cabal-install/tests/UnitTests/Distribution/Solver/Modular/QuickCheck/Utils.hs +++ b/cabal-install/tests/UnitTests/Distribution/Solver/Modular/QuickCheck/Utils.hs @@ -31,7 +31,7 @@ instance IsTest QCWithSeed where run options (QCWithSeed test) progress = do replay <- case lookupOption options of - QuickCheckReplay (Just override) -> return override - QuickCheckReplay Nothing -> getStdRandom random + QuickCheckReplayLegacy override -> return override + _ -> getStdRandom random notice normal $ "Using --quickcheck-replay=" ++ show replay - run (setOption (QuickCheckReplay (Just replay)) options) test progress + run (setOption (QuickCheckReplayLegacy replay) options) test progress diff --git a/cabal-install/tests/UnitTests/Distribution/Solver/Types/OptionalStanza.hs b/cabal-install/tests/UnitTests/Distribution/Solver/Types/OptionalStanza.hs index 8f068d2ae53..3e2959b01f2 100644 --- a/cabal-install/tests/UnitTests/Distribution/Solver/Types/OptionalStanza.hs +++ b/cabal-install/tests/UnitTests/Distribution/Solver/Types/OptionalStanza.hs @@ -10,10 +10,6 @@ import UnitTests.Distribution.Client.ArbitraryInstances () import Test.Tasty import Test.Tasty.QuickCheck -#if !MIN_VERSION_base(4,8,0) -import Data.Monoid -#endif - tests :: [TestTree] tests = [ testProperty "fromList . toList = id" $ \xs -> diff --git a/cabal-install/tests/fixtures/project-root/cabal.project.dir.broken/.gitkeep b/cabal-install/tests/fixtures/project-root/cabal.project.dir.broken/.gitkeep new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cabal-install/tests/fixtures/project-root/cabal.project.symlink b/cabal-install/tests/fixtures/project-root/cabal.project.symlink new file mode 120000 index 00000000000..b4c9ceac597 --- /dev/null +++ b/cabal-install/tests/fixtures/project-root/cabal.project.symlink @@ -0,0 +1 @@ +cabal.project \ No newline at end of file diff --git a/cabal-install/tests/fixtures/project-root/cabal.project.symlink.broken b/cabal-install/tests/fixtures/project-root/cabal.project.symlink.broken new file mode 120000 index 00000000000..cfa0a46515b --- /dev/null +++ b/cabal-install/tests/fixtures/project-root/cabal.project.symlink.broken @@ -0,0 +1 @@ +does-not-exist \ No newline at end of file diff --git a/cabal-testsuite/PackageTests/AutoconfBadPaths/cabal.test.hs b/cabal-testsuite/PackageTests/AutoconfBadPaths/cabal.test.hs index 93ce9825a36..544764affcd 100644 --- a/cabal-testsuite/PackageTests/AutoconfBadPaths/cabal.test.hs +++ b/cabal-testsuite/PackageTests/AutoconfBadPaths/cabal.test.hs @@ -2,36 +2,38 @@ import Test.Cabal.Prelude import Data.Foldable (traverse_) import Distribution.Simple.Utils import System.Directory -main = cabalTest $ do - -- Test the forbidden characters except NUL. Reference: - -- https://www.gnu.org/software/autoconf/manual/autoconf.html#File-System-Conventions +main = do -- Most of these are magic on Windows, so don't bother testing there. - -- - -- Note: we bundle the configure script so no need to autoreconf - -- while building - skipIfWindows - traverse_ check - [ "foo bar" - , "foo\tbar" - , "foo\nbar" - , "foo\"bar" - , "foo#bar" - , "foo$bar" - , "foo&bar" - , "foo'bar" - , "foo(bar" - , "foo)bar" - , "foo*bar" - , "foo;bar" - , "foobar" - , "foo?bar" - , "foo[bar" - , "foo\\bar" - , "foo`bar" - , "foo|bar" - ] + skipIfWindows "uninteresting" + cabalTest $ + -- Test the forbidden characters except NUL. Reference: + -- https://www.gnu.org/software/autoconf/manual/autoconf.html#File-System-Conventions + -- + -- Note: we bundle the configure script so no need to autoreconf + -- while building + + traverse_ check + [ "foo bar" + , "foo\tbar" + , "foo\nbar" + , "foo\"bar" + , "foo#bar" + , "foo$bar" + , "foo&bar" + , "foo'bar" + , "foo(bar" + , "foo)bar" + , "foo*bar" + , "foo;bar" + , "foobar" + , "foo?bar" + , "foo[bar" + , "foo\\bar" + , "foo`bar" + , "foo|bar" + ] where setup dir = do env <- getTestEnv diff --git a/cabal-testsuite/PackageTests/Backpack/Includes2/Includes2.cabal b/cabal-testsuite/PackageTests/Backpack/Includes2/I.cabal similarity index 92% rename from cabal-testsuite/PackageTests/Backpack/Includes2/Includes2.cabal rename to cabal-testsuite/PackageTests/Backpack/Includes2/I.cabal index e6aa6169e68..efaa83b4837 100644 --- a/cabal-testsuite/PackageTests/Backpack/Includes2/Includes2.cabal +++ b/cabal-testsuite/PackageTests/Backpack/Includes2/I.cabal @@ -1,4 +1,4 @@ -name: Includes2 +name: I version: 0.1.0.0 license: BSD3 author: Edward Z. Yang @@ -35,14 +35,14 @@ library default-language: Haskell2010 executable exe - build-depends: base, Includes2 + build-depends: base, I main-is: Main.hs hs-source-dirs: exe default-language: Haskell2010 test-suite includes2-test type: exitcode-stdio-1.0 - build-depends: base, Includes2 + build-depends: base, I main-is: test.hs hs-source-dirs: test default-language: Haskell2010 diff --git a/cabal-testsuite/PackageTests/Backpack/Includes2/Includes2-fail/Includes2.cabal b/cabal-testsuite/PackageTests/Backpack/Includes2/I.cabal.fail similarity index 100% rename from cabal-testsuite/PackageTests/Backpack/Includes2/Includes2-fail/Includes2.cabal rename to cabal-testsuite/PackageTests/Backpack/Includes2/I.cabal.fail diff --git a/cabal-testsuite/PackageTests/Backpack/Includes2/Includes2.cabal.fail b/cabal-testsuite/PackageTests/Backpack/Includes2/Includes2-fail/I.cabal similarity index 100% rename from cabal-testsuite/PackageTests/Backpack/Includes2/Includes2.cabal.fail rename to cabal-testsuite/PackageTests/Backpack/Includes2/Includes2-fail/I.cabal diff --git a/cabal-testsuite/PackageTests/Backpack/Includes2/Includes2/Includes2.cabal b/cabal-testsuite/PackageTests/Backpack/Includes2/Includes2/I.cabal similarity index 93% rename from cabal-testsuite/PackageTests/Backpack/Includes2/Includes2/Includes2.cabal rename to cabal-testsuite/PackageTests/Backpack/Includes2/Includes2/I.cabal index 7a02fcd961c..793f6a31979 100644 --- a/cabal-testsuite/PackageTests/Backpack/Includes2/Includes2/Includes2.cabal +++ b/cabal-testsuite/PackageTests/Backpack/Includes2/Includes2/I.cabal @@ -1,4 +1,4 @@ -name: Includes2 +name: I version: 0.1.0.0 license: BSD3 author: Edward Z. Yang @@ -35,7 +35,7 @@ library default-language: Haskell2010 executable exe - build-depends: base, Includes2 + build-depends: base, I main-is: Main.hs hs-source-dirs: exe default-language: Haskell2010 diff --git a/cabal-testsuite/PackageTests/Backpack/Includes2/cabal-external.test.hs b/cabal-testsuite/PackageTests/Backpack/Includes2/cabal-external.test.hs index 7197786ff2a..432911b1714 100644 --- a/cabal-testsuite/PackageTests/Backpack/Includes2/cabal-external.test.hs +++ b/cabal-testsuite/PackageTests/Backpack/Includes2/cabal-external.test.hs @@ -1,8 +1,8 @@ import Test.Cabal.Prelude -main = cabalTest $ do +main = do + cabalTest $ do skipUnlessGhcVersion ">= 8.1" - skipIfWindows -- TODO: https://github.com/haskell/cabal/issues/6271 withProjectFile "cabal.external.project" $ do cabal "v2-build" ["exe"] withPlan $ do diff --git a/cabal-testsuite/PackageTests/Backpack/Includes2/cabal-internal-target.out b/cabal-testsuite/PackageTests/Backpack/Includes2/cabal-internal-target.out index 8b63d59d82c..2a91ccc557a 100644 --- a/cabal-testsuite/PackageTests/Backpack/Includes2/cabal-internal-target.out +++ b/cabal-testsuite/PackageTests/Backpack/Includes2/cabal-internal-target.out @@ -2,8 +2,8 @@ Resolving dependencies... Build profile: -w ghc- -O1 In order, the following will be built: - - Includes2-0.1.0.0 (lib:mylib) (first run) -Configuring library 'mylib' for Includes2-0.1.0.0... -Preprocessing library 'mylib' for Includes2-0.1.0.0... + - I-0.1.0.0 (lib:mylib) (first run) +Configuring library 'mylib' for I-0.1.0.0... +Preprocessing library 'mylib' for I-0.1.0.0... Building library 'mylib' instantiated with Database = -for Includes2-0.1.0.0... +for I-0.1.0.0... diff --git a/cabal-testsuite/PackageTests/Backpack/Includes2/cabal-internal.out b/cabal-testsuite/PackageTests/Backpack/Includes2/cabal-internal.out index f8dfb64d9e6..42f77888c8c 100644 --- a/cabal-testsuite/PackageTests/Backpack/Includes2/cabal-internal.out +++ b/cabal-testsuite/PackageTests/Backpack/Includes2/cabal-internal.out @@ -2,42 +2,42 @@ Resolving dependencies... Build profile: -w ghc- -O1 In order, the following will be built: - - Includes2-0.1.0.0 (lib:mylib) (first run) - - Includes2-0.1.0.0 (lib:mysql) (first run) - - Includes2-0.1.0.0 (lib:postgresql) (first run) - - Includes2-0.1.0.0 (lib:mylib with Database=Includes2-0.1.0.0-inplace-mysql:Database.MySQL) (first run) - - Includes2-0.1.0.0 (lib:mylib with Database=Includes2-0.1.0.0-inplace-postgresql:Database.PostgreSQL) (first run) - - Includes2-0.1.0.0 (lib) (first run) - - Includes2-0.1.0.0 (exe:exe) (first run) -Configuring library 'mylib' for Includes2-0.1.0.0... -Preprocessing library 'mylib' for Includes2-0.1.0.0... + - I-0.1.0.0 (lib:mylib) (first run) + - I-0.1.0.0 (lib:mysql) (first run) + - I-0.1.0.0 (lib:postgresql) (first run) + - I-0.1.0.0 (lib:mylib with Database=I-0.1.0.0-inplace-mysql:Database.MySQL) (first run) + - I-0.1.0.0 (lib:mylib with Database=I-0.1.0.0-inplace-postgresql:Database.PostgreSQL) (first run) + - I-0.1.0.0 (lib) (first run) + - I-0.1.0.0 (exe:exe) (first run) +Configuring library 'mylib' for I-0.1.0.0... +Preprocessing library 'mylib' for I-0.1.0.0... Building library 'mylib' instantiated with Database = -for Includes2-0.1.0.0... -Configuring library 'mysql' for Includes2-0.1.0.0... -Preprocessing library 'mysql' for Includes2-0.1.0.0... -Building library 'mysql' for Includes2-0.1.0.0... -Configuring library 'postgresql' for Includes2-0.1.0.0... -Preprocessing library 'postgresql' for Includes2-0.1.0.0... -Building library 'postgresql' for Includes2-0.1.0.0... +for I-0.1.0.0... +Configuring library 'mysql' for I-0.1.0.0... +Preprocessing library 'mysql' for I-0.1.0.0... +Building library 'mysql' for I-0.1.0.0... +Configuring library 'postgresql' for I-0.1.0.0... +Preprocessing library 'postgresql' for I-0.1.0.0... +Building library 'postgresql' for I-0.1.0.0... Configuring library 'mylib' instantiated with - Database = Includes2-0.1.0.0-inplace-mysql:Database.MySQL -for Includes2-0.1.0.0... -Preprocessing library 'mylib' for Includes2-0.1.0.0... + Database = I-0.1.0.0-inplace-mysql:Database.MySQL +for I-0.1.0.0... +Preprocessing library 'mylib' for I-0.1.0.0... Building library 'mylib' instantiated with - Database = Includes2-0.1.0.0-inplace-mysql:Database.MySQL -for Includes2-0.1.0.0... + Database = I-0.1.0.0-inplace-mysql:Database.MySQL +for I-0.1.0.0... Configuring library 'mylib' instantiated with - Database = Includes2-0.1.0.0-inplace-postgresql:Database.PostgreSQL -for Includes2-0.1.0.0... -Preprocessing library 'mylib' for Includes2-0.1.0.0... + Database = I-0.1.0.0-inplace-postgresql:Database.PostgreSQL +for I-0.1.0.0... +Preprocessing library 'mylib' for I-0.1.0.0... Building library 'mylib' instantiated with - Database = Includes2-0.1.0.0-inplace-postgresql:Database.PostgreSQL -for Includes2-0.1.0.0... -Configuring library for Includes2-0.1.0.0... -Preprocessing library for Includes2-0.1.0.0... -Building library for Includes2-0.1.0.0... -Configuring executable 'exe' for Includes2-0.1.0.0... -Preprocessing executable 'exe' for Includes2-0.1.0.0... -Building executable 'exe' for Includes2-0.1.0.0... -# Includes2 exe + Database = I-0.1.0.0-inplace-postgresql:Database.PostgreSQL +for I-0.1.0.0... +Configuring library for I-0.1.0.0... +Preprocessing library for I-0.1.0.0... +Building library for I-0.1.0.0... +Configuring executable 'exe' for I-0.1.0.0... +Preprocessing executable 'exe' for I-0.1.0.0... +Building executable 'exe' for I-0.1.0.0... +# I exe "minemysql minepostgresql" diff --git a/cabal-testsuite/PackageTests/Backpack/Includes2/cabal-internal.test.hs b/cabal-testsuite/PackageTests/Backpack/Includes2/cabal-internal.test.hs index a04fdd4987a..1413f66dcdc 100644 --- a/cabal-testsuite/PackageTests/Backpack/Includes2/cabal-internal.test.hs +++ b/cabal-testsuite/PackageTests/Backpack/Includes2/cabal-internal.test.hs @@ -2,9 +2,8 @@ import Test.Cabal.Prelude main = cabalTest $ do skipUnlessGhcVersion ">= 8.1" - skipIfWindows -- TODO: https://github.com/haskell/cabal/issues/6271 withProjectFile "cabal.internal.project" $ do cabal "v2-build" ["exe"] withPlan $ do - r <- runPlanExe' "Includes2" "exe" [] + r <- runPlanExe' "I" "exe" [] assertOutputContains "minemysql minepostgresql" r diff --git a/cabal-testsuite/PackageTests/Backpack/Includes2/cov.out b/cabal-testsuite/PackageTests/Backpack/Includes2/cov.out index 784baff09e7..0d1b2c027b5 100644 --- a/cabal-testsuite/PackageTests/Backpack/Includes2/cov.out +++ b/cabal-testsuite/PackageTests/Backpack/Includes2/cov.out @@ -2,47 +2,47 @@ Resolving dependencies... Build profile: -w ghc- -O1 In order, the following will be built: - - Includes2-0.1.0.0 (lib:mylib) (first run) - - Includes2-0.1.0.0 (lib:mysql) (first run) - - Includes2-0.1.0.0 (lib:postgresql) (first run) - - Includes2-0.1.0.0 (lib:mylib with Database=Includes2-0.1.0.0-inplace-mysql:Database.MySQL) (first run) - - Includes2-0.1.0.0 (lib:mylib with Database=Includes2-0.1.0.0-inplace-postgresql:Database.PostgreSQL) (first run) - - Includes2-0.1.0.0 (lib) (first run) - - Includes2-0.1.0.0 (test:includes2-test) (first run) -Configuring library 'mylib' for Includes2-0.1.0.0... -Preprocessing library 'mylib' for Includes2-0.1.0.0... + - I-0.1.0.0 (lib:mylib) (first run) + - I-0.1.0.0 (lib:mysql) (first run) + - I-0.1.0.0 (lib:postgresql) (first run) + - I-0.1.0.0 (lib:mylib with Database=I-0.1.0.0-inplace-mysql:Database.MySQL) (first run) + - I-0.1.0.0 (lib:mylib with Database=I-0.1.0.0-inplace-postgresql:Database.PostgreSQL) (first run) + - I-0.1.0.0 (lib) (first run) + - I-0.1.0.0 (test:includes2-test) (first run) +Configuring library 'mylib' for I-0.1.0.0... +Preprocessing library 'mylib' for I-0.1.0.0... Building library 'mylib' instantiated with Database = -for Includes2-0.1.0.0... -Configuring library 'mysql' for Includes2-0.1.0.0... -Preprocessing library 'mysql' for Includes2-0.1.0.0... -Building library 'mysql' for Includes2-0.1.0.0... -Configuring library 'postgresql' for Includes2-0.1.0.0... -Preprocessing library 'postgresql' for Includes2-0.1.0.0... -Building library 'postgresql' for Includes2-0.1.0.0... +for I-0.1.0.0... +Configuring library 'mysql' for I-0.1.0.0... +Preprocessing library 'mysql' for I-0.1.0.0... +Building library 'mysql' for I-0.1.0.0... +Configuring library 'postgresql' for I-0.1.0.0... +Preprocessing library 'postgresql' for I-0.1.0.0... +Building library 'postgresql' for I-0.1.0.0... Configuring library 'mylib' instantiated with - Database = Includes2-0.1.0.0-inplace-mysql:Database.MySQL -for Includes2-0.1.0.0... -Preprocessing library 'mylib' for Includes2-0.1.0.0... + Database = I-0.1.0.0-inplace-mysql:Database.MySQL +for I-0.1.0.0... +Preprocessing library 'mylib' for I-0.1.0.0... Building library 'mylib' instantiated with - Database = Includes2-0.1.0.0-inplace-mysql:Database.MySQL -for Includes2-0.1.0.0... + Database = I-0.1.0.0-inplace-mysql:Database.MySQL +for I-0.1.0.0... Configuring library 'mylib' instantiated with - Database = Includes2-0.1.0.0-inplace-postgresql:Database.PostgreSQL -for Includes2-0.1.0.0... -Preprocessing library 'mylib' for Includes2-0.1.0.0... + Database = I-0.1.0.0-inplace-postgresql:Database.PostgreSQL +for I-0.1.0.0... +Preprocessing library 'mylib' for I-0.1.0.0... Building library 'mylib' instantiated with - Database = Includes2-0.1.0.0-inplace-postgresql:Database.PostgreSQL -for Includes2-0.1.0.0... -Configuring library for Includes2-0.1.0.0... -Preprocessing library for Includes2-0.1.0.0... -Building library for Includes2-0.1.0.0... -Configuring test suite 'includes2-test' for Includes2-0.1.0.0... -Preprocessing test suite 'includes2-test' for Includes2-0.1.0.0... -Building test suite 'includes2-test' for Includes2-0.1.0.0... + Database = I-0.1.0.0-inplace-postgresql:Database.PostgreSQL +for I-0.1.0.0... +Configuring library for I-0.1.0.0... +Preprocessing library for I-0.1.0.0... +Building library for I-0.1.0.0... +Configuring test suite 'includes2-test' for I-0.1.0.0... +Preprocessing test suite 'includes2-test' for I-0.1.0.0... +Building test suite 'includes2-test' for I-0.1.0.0... Running 1 test suites... Test suite includes2-test: RUNNING... Test suite includes2-test: PASS -Test suite logged to: /cov.dist/work/./dist/build//ghc-/Includes2-0.1.0.0/t/includes2-test/test/Includes2-0.1.0.0-includes2-test.log -Package coverage report written to /cov.dist/work/./dist/build//ghc-/Includes2-0.1.0.0/t/includes2-test/hpc/vanilla/html/hpc_index.html +Test suite logged to: /cov.dist/work/./dist/build//ghc-/I-0.1.0.0/t/includes2-test/test/I-0.1.0.0-includes2-test.log +Package coverage report written to /cov.dist/work/./dist/build//ghc-/I-0.1.0.0/t/includes2-test/hpc/vanilla/html/hpc_index.html 1 of 1 test suites (1 of 1 test cases) passed. -Package coverage report written to /cov.dist/work/./dist/build//ghc-/Includes2-0.1.0.0/t/includes2-test/hpc/vanilla/html/hpc_index.html +Package coverage report written to /cov.dist/work/./dist/build//ghc-/I-0.1.0.0/t/includes2-test/hpc/vanilla/html/hpc_index.html diff --git a/cabal-testsuite/PackageTests/Backpack/Includes2/cov.test.hs b/cabal-testsuite/PackageTests/Backpack/Includes2/cov.test.hs index 24c1662c375..40079c0e787 100644 --- a/cabal-testsuite/PackageTests/Backpack/Includes2/cov.test.hs +++ b/cabal-testsuite/PackageTests/Backpack/Includes2/cov.test.hs @@ -1,6 +1,5 @@ import Test.Cabal.Prelude main = cabalTest $ do skipUnlessGhcVersion ">= 8.1" - skipIfWindows -- TODO: https://github.com/haskell/cabal/issues/6271 -- #6397 cabal "test" ["--enable-coverage", "includes2-test"] diff --git a/cabal-testsuite/PackageTests/Backpack/Includes2/setup-external.cabal.out b/cabal-testsuite/PackageTests/Backpack/Includes2/setup-external.cabal.out index cb4f8288291..127f860bd87 100644 --- a/cabal-testsuite/PackageTests/Backpack/Includes2/setup-external.cabal.out +++ b/cabal-testsuite/PackageTests/Backpack/Includes2/setup-external.cabal.out @@ -8,7 +8,7 @@ for mylib-0.1.0.0... Preprocessing library for mylib-0.1.0.0... Running Haddock on library instantiated with Database = for mylib-0.1.0.0... -Documentation created: ../setup-external.cabal.dist/work/mylib/dist/doc/html/mylib/ +Documentation created: ./mylib/../setup-external.cabal.dist/work/mylib/dist/doc/html/mylib # Setup copy Installing library in # Setup register @@ -22,7 +22,7 @@ Building library for mysql-0.1.0.0... # Setup haddock Preprocessing library for mysql-0.1.0.0... Running Haddock on library for mysql-0.1.0.0... -Documentation created: ../setup-external.cabal.dist/work/mysql/dist/doc/html/mysql/ +Documentation created: ./mysql/../setup-external.cabal.dist/work/mysql/dist/doc/html/mysql # Setup copy Installing library in # Setup register @@ -35,7 +35,7 @@ Building library for postgresql-0.1.0.0... # Setup haddock Preprocessing library for postgresql-0.1.0.0... Running Haddock on library for postgresql-0.1.0.0... -Documentation created: ../setup-external.cabal.dist/work/postgresql/dist/doc/html/postgresql/ +Documentation created: ./postgresql/../setup-external.cabal.dist/work/postgresql/dist/doc/html/postgresql # Setup copy Installing library in # Setup register @@ -51,7 +51,7 @@ Preprocessing library for mylib-0.1.0.0... Running Haddock on library instantiated with Database = mysql-0.1.0.0:Database.MySQL for mylib-0.1.0.0... -Documentation created: ../setup-external.cabal.dist/work/mylib/dist/doc/html/mylib/ +Documentation created: ./mylib/../setup-external.cabal.dist/work/mylib/dist/doc/html/mylib # Setup copy Installing library in # Setup register @@ -69,7 +69,7 @@ Preprocessing library for mylib-0.1.0.0... Running Haddock on library instantiated with Database = postgresql-0.1.0.0:Database.PostgreSQL for mylib-0.1.0.0... -Documentation created: ../setup-external.cabal.dist/work/mylib/dist/doc/html/mylib/ +Documentation created: ./mylib/../setup-external.cabal.dist/work/mylib/dist/doc/html/mylib # Setup copy Installing library in # Setup register @@ -84,7 +84,7 @@ Building library for src-0.1.0.0... # Setup haddock Preprocessing library for src-0.1.0.0... Running Haddock on library for src-0.1.0.0... -Documentation created: ../setup-external.cabal.dist/work/src/dist/doc/html/src/ +Documentation created: ./src/../setup-external.cabal.dist/work/src/dist/doc/html/src # Setup copy Installing library in # Setup register diff --git a/cabal-testsuite/PackageTests/Backpack/Includes2/setup-external.out b/cabal-testsuite/PackageTests/Backpack/Includes2/setup-external.out index 299d6a831b3..f363c456afd 100644 --- a/cabal-testsuite/PackageTests/Backpack/Includes2/setup-external.out +++ b/cabal-testsuite/PackageTests/Backpack/Includes2/setup-external.out @@ -8,7 +8,7 @@ for mylib-0.1.0.0... Preprocessing library for mylib-0.1.0.0... Running Haddock on library instantiated with Database = for mylib-0.1.0.0... -Documentation created: ../setup-external.dist/work/mylib/dist/doc/html/mylib/ +Documentation created: ./mylib/../setup-external.dist/work/mylib/dist/doc/html/mylib # Setup copy Installing library in # Setup register @@ -22,7 +22,7 @@ Building library for mysql-0.1.0.0... # Setup haddock Preprocessing library for mysql-0.1.0.0... Running Haddock on library for mysql-0.1.0.0... -Documentation created: ../setup-external.dist/work/mysql/dist/doc/html/mysql/ +Documentation created: ./mysql/../setup-external.dist/work/mysql/dist/doc/html/mysql # Setup copy Installing library in # Setup register @@ -35,7 +35,7 @@ Building library for postgresql-0.1.0.0... # Setup haddock Preprocessing library for postgresql-0.1.0.0... Running Haddock on library for postgresql-0.1.0.0... -Documentation created: ../setup-external.dist/work/postgresql/dist/doc/html/postgresql/ +Documentation created: ./postgresql/../setup-external.dist/work/postgresql/dist/doc/html/postgresql # Setup copy Installing library in # Setup register @@ -51,7 +51,7 @@ Preprocessing library for mylib-0.1.0.0... Running Haddock on library instantiated with Database = mysql-0.1.0.0:Database.MySQL for mylib-0.1.0.0... -Documentation created: ../setup-external.dist/work/mylib/dist/doc/html/mylib/ +Documentation created: ./mylib/../setup-external.dist/work/mylib/dist/doc/html/mylib # Setup copy Installing library in # Setup register @@ -69,7 +69,7 @@ Preprocessing library for mylib-0.1.0.0... Running Haddock on library instantiated with Database = postgresql-0.1.0.0:Database.PostgreSQL for mylib-0.1.0.0... -Documentation created: ../setup-external.dist/work/mylib/dist/doc/html/mylib/ +Documentation created: ./mylib/../setup-external.dist/work/mylib/dist/doc/html/mylib # Setup copy Installing library in # Setup register @@ -84,7 +84,7 @@ Building library for src-0.1.0.0... # Setup haddock Preprocessing library for src-0.1.0.0... Running Haddock on library for src-0.1.0.0... -Documentation created: ../setup-external.dist/work/src/dist/doc/html/src/ +Documentation created: ./src/../setup-external.dist/work/src/dist/doc/html/src # Setup copy Installing library in # Setup register diff --git a/cabal-testsuite/PackageTests/Backpack/Includes2/setup-external.test.hs b/cabal-testsuite/PackageTests/Backpack/Includes2/setup-external.test.hs index 3e4577aecfa..87ab998b3b0 100644 --- a/cabal-testsuite/PackageTests/Backpack/Includes2/setup-external.test.hs +++ b/cabal-testsuite/PackageTests/Backpack/Includes2/setup-external.test.hs @@ -1,8 +1,7 @@ import Test.Cabal.Prelude main = setupAndCabalTest $ do skipUnlessGhcVersion ">= 8.1" - ghc <- isGhcVersion "== 9.0.2 || == 9.2.* || == 9.4.* || == 9.6.*" - expectBrokenIf ghc 7987 $ do + expectBrokenIfGhc "== 9.0.2 || == 9.2.* || == 9.4.* || == 9.6.*" 7987 $ do withPackageDb $ do withDirectory "mylib" $ setup_install_with_docs ["--ipid", "mylib-0.1.0.0"] withDirectory "mysql" $ setup_install_with_docs ["--ipid", "mysql-0.1.0.0"] diff --git a/cabal-testsuite/PackageTests/Backpack/Includes2/setup-internal.cabal.out b/cabal-testsuite/PackageTests/Backpack/Includes2/setup-internal.cabal.out index 12dc4aecc6c..e8f2fa18d85 100644 --- a/cabal-testsuite/PackageTests/Backpack/Includes2/setup-internal.cabal.out +++ b/cabal-testsuite/PackageTests/Backpack/Includes2/setup-internal.cabal.out @@ -1,25 +1,25 @@ # Setup configure -Configuring Includes2-0.1.0.0... +Configuring I-0.1.0.0... # Setup build -Preprocessing library 'postgresql' for Includes2-0.1.0.0... -Building library 'postgresql' for Includes2-0.1.0.0... -Preprocessing library 'mysql' for Includes2-0.1.0.0... -Building library 'mysql' for Includes2-0.1.0.0... -Preprocessing library 'mylib' for Includes2-0.1.0.0... +Preprocessing library 'postgresql' for I-0.1.0.0... +Building library 'postgresql' for I-0.1.0.0... +Preprocessing library 'mysql' for I-0.1.0.0... +Building library 'mysql' for I-0.1.0.0... +Preprocessing library 'mylib' for I-0.1.0.0... Building library 'mylib' instantiated with Database = -for Includes2-0.1.0.0... -Preprocessing library 'mylib' for Includes2-0.1.0.0... +for I-0.1.0.0... +Preprocessing library 'mylib' for I-0.1.0.0... Building library 'mylib' instantiated with - Database = Includes2-0.1.0.0-mysql:Database.MySQL -for Includes2-0.1.0.0... -Preprocessing library 'mylib' for Includes2-0.1.0.0... + Database = I-0.1.0.0-postgresql:Database.PostgreSQL +for I-0.1.0.0... +Preprocessing library 'mylib' for I-0.1.0.0... Building library 'mylib' instantiated with - Database = Includes2-0.1.0.0-postgresql:Database.PostgreSQL -for Includes2-0.1.0.0... -Preprocessing library for Includes2-0.1.0.0... -Building library for Includes2-0.1.0.0... -Preprocessing executable 'exe' for Includes2-0.1.0.0... -Building executable 'exe' for Includes2-0.1.0.0... + Database = I-0.1.0.0-mysql:Database.MySQL +for I-0.1.0.0... +Preprocessing library for I-0.1.0.0... +Building library for I-0.1.0.0... +Preprocessing executable 'exe' for I-0.1.0.0... +Building executable 'exe' for I-0.1.0.0... # Setup copy Installing internal library postgresql in Installing internal library mysql in @@ -30,16 +30,16 @@ Installing library in Installing executable exe in Warning: The directory /setup-internal.cabal.dist/usr/bin is not in the system search path. # Setup register -Registering library 'postgresql' for Includes2-0.1.0.0... -Registering library 'mysql' for Includes2-0.1.0.0... +Registering library 'postgresql' for I-0.1.0.0... +Registering library 'mysql' for I-0.1.0.0... Registering library 'mylib' instantiated with Database = -for Includes2-0.1.0.0... +for I-0.1.0.0... Registering library 'mylib' instantiated with - Database = Includes2-0.1.0.0-mysql:Database.MySQL -for Includes2-0.1.0.0... + Database = I-0.1.0.0-postgresql:Database.PostgreSQL +for I-0.1.0.0... Registering library 'mylib' instantiated with - Database = Includes2-0.1.0.0-postgresql:Database.PostgreSQL -for Includes2-0.1.0.0... -Registering library for Includes2-0.1.0.0... + Database = I-0.1.0.0-mysql:Database.MySQL +for I-0.1.0.0... +Registering library for I-0.1.0.0... # exe "minemysql minepostgresql" diff --git a/cabal-testsuite/PackageTests/Backpack/Includes2/setup-internal.out b/cabal-testsuite/PackageTests/Backpack/Includes2/setup-internal.out index 700f1b2fbfc..0cb3b8768c3 100644 --- a/cabal-testsuite/PackageTests/Backpack/Includes2/setup-internal.out +++ b/cabal-testsuite/PackageTests/Backpack/Includes2/setup-internal.out @@ -1,25 +1,25 @@ # Setup configure -Configuring Includes2-0.1.0.0... +Configuring I-0.1.0.0... # Setup build -Preprocessing library 'postgresql' for Includes2-0.1.0.0... -Building library 'postgresql' for Includes2-0.1.0.0... -Preprocessing library 'mysql' for Includes2-0.1.0.0... -Building library 'mysql' for Includes2-0.1.0.0... -Preprocessing library 'mylib' for Includes2-0.1.0.0... +Preprocessing library 'postgresql' for I-0.1.0.0... +Building library 'postgresql' for I-0.1.0.0... +Preprocessing library 'mysql' for I-0.1.0.0... +Building library 'mysql' for I-0.1.0.0... +Preprocessing library 'mylib' for I-0.1.0.0... Building library 'mylib' instantiated with Database = -for Includes2-0.1.0.0... -Preprocessing library 'mylib' for Includes2-0.1.0.0... +for I-0.1.0.0... +Preprocessing library 'mylib' for I-0.1.0.0... Building library 'mylib' instantiated with - Database = Includes2-0.1.0.0-mysql:Database.MySQL -for Includes2-0.1.0.0... -Preprocessing library 'mylib' for Includes2-0.1.0.0... + Database = I-0.1.0.0-postgresql:Database.PostgreSQL +for I-0.1.0.0... +Preprocessing library 'mylib' for I-0.1.0.0... Building library 'mylib' instantiated with - Database = Includes2-0.1.0.0-postgresql:Database.PostgreSQL -for Includes2-0.1.0.0... -Preprocessing library for Includes2-0.1.0.0... -Building library for Includes2-0.1.0.0... -Preprocessing executable 'exe' for Includes2-0.1.0.0... -Building executable 'exe' for Includes2-0.1.0.0... + Database = I-0.1.0.0-mysql:Database.MySQL +for I-0.1.0.0... +Preprocessing library for I-0.1.0.0... +Building library for I-0.1.0.0... +Preprocessing executable 'exe' for I-0.1.0.0... +Building executable 'exe' for I-0.1.0.0... # Setup copy Installing internal library postgresql in Installing internal library mysql in @@ -30,16 +30,16 @@ Installing library in Installing executable exe in Warning: The directory /setup-internal.dist/usr/bin is not in the system search path. # Setup register -Registering library 'postgresql' for Includes2-0.1.0.0... -Registering library 'mysql' for Includes2-0.1.0.0... +Registering library 'postgresql' for I-0.1.0.0... +Registering library 'mysql' for I-0.1.0.0... Registering library 'mylib' instantiated with Database = -for Includes2-0.1.0.0... +for I-0.1.0.0... Registering library 'mylib' instantiated with - Database = Includes2-0.1.0.0-mysql:Database.MySQL -for Includes2-0.1.0.0... + Database = I-0.1.0.0-postgresql:Database.PostgreSQL +for I-0.1.0.0... Registering library 'mylib' instantiated with - Database = Includes2-0.1.0.0-postgresql:Database.PostgreSQL -for Includes2-0.1.0.0... -Registering library for Includes2-0.1.0.0... + Database = I-0.1.0.0-mysql:Database.MySQL +for I-0.1.0.0... +Registering library for I-0.1.0.0... # exe "minemysql minepostgresql" diff --git a/cabal-testsuite/PackageTests/Backpack/Includes2/setup-per-component.out b/cabal-testsuite/PackageTests/Backpack/Includes2/setup-per-component.out index 01888faed97..3eaa739df55 100644 --- a/cabal-testsuite/PackageTests/Backpack/Includes2/setup-per-component.out +++ b/cabal-testsuite/PackageTests/Backpack/Includes2/setup-per-component.out @@ -1,107 +1,107 @@ # Setup configure -Configuring library 'mylib' for Includes2-0.1.0.0... +Configuring library 'mylib' for I-0.1.0.0... # Setup build -Preprocessing library 'mylib' for Includes2-0.1.0.0... +Preprocessing library 'mylib' for I-0.1.0.0... Building library 'mylib' instantiated with Database = -for Includes2-0.1.0.0... +for I-0.1.0.0... # Setup haddock -Preprocessing library 'mylib' for Includes2-0.1.0.0... +Preprocessing library 'mylib' for I-0.1.0.0... Running Haddock on library 'mylib' instantiated with Database = -for Includes2-0.1.0.0... -Documentation created: ../setup-per-component.dist/work/Includes2/dist/doc/html/Includes2/ +for I-0.1.0.0... +Documentation created: ./Includes2/../setup-per-component.dist/work/Includes2/dist/doc/html/I/mylib # Setup copy Installing internal library mylib in # Setup register Registering library 'mylib' instantiated with Database = -for Includes2-0.1.0.0... +for I-0.1.0.0... # Setup configure -Configuring library 'mysql' for Includes2-0.1.0.0... +Configuring library 'mysql' for I-0.1.0.0... # Setup build -Preprocessing library 'mysql' for Includes2-0.1.0.0... -Building library 'mysql' for Includes2-0.1.0.0... +Preprocessing library 'mysql' for I-0.1.0.0... +Building library 'mysql' for I-0.1.0.0... # Setup haddock -Preprocessing library 'mysql' for Includes2-0.1.0.0... -Running Haddock on library 'mysql' for Includes2-0.1.0.0... -Documentation created: ../setup-per-component.dist/work/Includes2/dist/doc/html/Includes2/ +Preprocessing library 'mysql' for I-0.1.0.0... +Running Haddock on library 'mysql' for I-0.1.0.0... +Documentation created: ./Includes2/../setup-per-component.dist/work/Includes2/dist/doc/html/I/mysql # Setup copy Installing internal library mysql in # Setup register -Registering library 'mysql' for Includes2-0.1.0.0... +Registering library 'mysql' for I-0.1.0.0... # Setup configure -Configuring library 'postgresql' for Includes2-0.1.0.0... +Configuring library 'postgresql' for I-0.1.0.0... # Setup build -Preprocessing library 'postgresql' for Includes2-0.1.0.0... -Building library 'postgresql' for Includes2-0.1.0.0... +Preprocessing library 'postgresql' for I-0.1.0.0... +Building library 'postgresql' for I-0.1.0.0... # Setup haddock -Preprocessing library 'postgresql' for Includes2-0.1.0.0... -Running Haddock on library 'postgresql' for Includes2-0.1.0.0... -Documentation created: ../setup-per-component.dist/work/Includes2/dist/doc/html/Includes2/ +Preprocessing library 'postgresql' for I-0.1.0.0... +Running Haddock on library 'postgresql' for I-0.1.0.0... +Documentation created: ./Includes2/../setup-per-component.dist/work/Includes2/dist/doc/html/I/postgresql # Setup copy Installing internal library postgresql in # Setup register -Registering library 'postgresql' for Includes2-0.1.0.0... +Registering library 'postgresql' for I-0.1.0.0... # Setup configure Configuring library 'mylib' instantiated with Database = mysql-0.1.0.0:Database.MySQL -for Includes2-0.1.0.0... +for I-0.1.0.0... # Setup build -Preprocessing library 'mylib' for Includes2-0.1.0.0... +Preprocessing library 'mylib' for I-0.1.0.0... Building library 'mylib' instantiated with Database = mysql-0.1.0.0:Database.MySQL -for Includes2-0.1.0.0... +for I-0.1.0.0... # Setup haddock -Preprocessing library 'mylib' for Includes2-0.1.0.0... +Preprocessing library 'mylib' for I-0.1.0.0... Running Haddock on library 'mylib' instantiated with Database = mysql-0.1.0.0:Database.MySQL -for Includes2-0.1.0.0... -Documentation created: ../setup-per-component.dist/work/Includes2/dist/doc/html/Includes2/ +for I-0.1.0.0... +Documentation created: ./Includes2/../setup-per-component.dist/work/Includes2/dist/doc/html/I/mylib # Setup copy Installing internal library mylib in # Setup register Registering library 'mylib' instantiated with Database = mysql-0.1.0.0:Database.MySQL -for Includes2-0.1.0.0... +for I-0.1.0.0... # Setup configure Configuring library 'mylib' instantiated with Database = postgresql-0.1.0.0:Database.PostgreSQL -for Includes2-0.1.0.0... +for I-0.1.0.0... # Setup build -Preprocessing library 'mylib' for Includes2-0.1.0.0... +Preprocessing library 'mylib' for I-0.1.0.0... Building library 'mylib' instantiated with Database = postgresql-0.1.0.0:Database.PostgreSQL -for Includes2-0.1.0.0... +for I-0.1.0.0... # Setup haddock -Preprocessing library 'mylib' for Includes2-0.1.0.0... +Preprocessing library 'mylib' for I-0.1.0.0... Running Haddock on library 'mylib' instantiated with Database = postgresql-0.1.0.0:Database.PostgreSQL -for Includes2-0.1.0.0... -Documentation created: ../setup-per-component.dist/work/Includes2/dist/doc/html/Includes2/ +for I-0.1.0.0... +Documentation created: ./Includes2/../setup-per-component.dist/work/Includes2/dist/doc/html/I/mylib # Setup copy Installing internal library mylib in # Setup register Registering library 'mylib' instantiated with Database = postgresql-0.1.0.0:Database.PostgreSQL -for Includes2-0.1.0.0... +for I-0.1.0.0... # Setup configure -Configuring library for Includes2-0.1.0.0... +Configuring library for I-0.1.0.0... # Setup build -Preprocessing library for Includes2-0.1.0.0... -Building library for Includes2-0.1.0.0... +Preprocessing library for I-0.1.0.0... +Building library for I-0.1.0.0... # Setup haddock -Preprocessing library for Includes2-0.1.0.0... -Running Haddock on library for Includes2-0.1.0.0... -Documentation created: ../setup-per-component.dist/work/Includes2/dist/doc/html/Includes2/ +Preprocessing library for I-0.1.0.0... +Running Haddock on library for I-0.1.0.0... +Documentation created: ./Includes2/../setup-per-component.dist/work/Includes2/dist/doc/html/I # Setup copy Installing library in # Setup register -Registering library for Includes2-0.1.0.0... +Registering library for I-0.1.0.0... # Setup configure -Configuring executable 'exe' for Includes2-0.1.0.0... +Configuring executable 'exe' for I-0.1.0.0... # Setup build -Preprocessing executable 'exe' for Includes2-0.1.0.0... -Building executable 'exe' for Includes2-0.1.0.0... +Preprocessing executable 'exe' for I-0.1.0.0... +Building executable 'exe' for I-0.1.0.0... # Setup haddock -Preprocessing executable 'exe' for Includes2-0.1.0.0... +Preprocessing executable 'exe' for I-0.1.0.0... # Setup copy Installing executable exe in Warning: The directory /setup-per-component.dist/usr/bin is not in the system search path. diff --git a/cabal-testsuite/PackageTests/Backpack/Includes2/setup-per-component.test.hs b/cabal-testsuite/PackageTests/Backpack/Includes2/setup-per-component.test.hs index 5bbb1b02af2..80990b1136c 100644 --- a/cabal-testsuite/PackageTests/Backpack/Includes2/setup-per-component.test.hs +++ b/cabal-testsuite/PackageTests/Backpack/Includes2/setup-per-component.test.hs @@ -2,8 +2,7 @@ import Test.Cabal.Prelude main = setupTest $ do -- No cabal test because per-component is broken with it skipUnlessGhcVersion ">= 8.1" - ghc <- isGhcVersion "== 9.0.2 || == 9.2.* || == 9.4.* || == 9.6.*" - expectBrokenIf ghc 7987 $ + expectBrokenIfGhc "== 9.0.2 || == 9.2.* || == 9.4.* || == 9.6.*" 7987 $ withPackageDb $ withDirectory "Includes2" $ do let setup_install' args = setup_install_with_docs args @@ -14,6 +13,6 @@ main = setupTest $ do "--instantiate-with", "Database=mysql-0.1.0.0:Database.MySQL"] setup_install' ["mylib", "--cid", "mylib-0.1.0.0", "--instantiate-with", "Database=postgresql-0.1.0.0:Database.PostgreSQL"] - setup_install' ["Includes2"] + setup_install' ["I"] setup_install' ["exe"] runExe' "exe" [] >>= assertOutputContains "minemysql minepostgresql" diff --git a/cabal-testsuite/PackageTests/Backpack/Includes3/Includes3.cabal b/cabal-testsuite/PackageTests/Backpack/Includes3/I.cabal similarity index 95% rename from cabal-testsuite/PackageTests/Backpack/Includes3/Includes3.cabal rename to cabal-testsuite/PackageTests/Backpack/Includes3/I.cabal index 7016e221218..ca17845e21d 100644 --- a/cabal-testsuite/PackageTests/Backpack/Includes3/Includes3.cabal +++ b/cabal-testsuite/PackageTests/Backpack/Includes3/I.cabal @@ -1,4 +1,4 @@ -name: Includes3 +name: I version: 0.1.0.0 license: BSD3 author: Edward Z. Yang diff --git a/cabal-testsuite/PackageTests/Backpack/Includes3/cabal-external.test.hs b/cabal-testsuite/PackageTests/Backpack/Includes3/cabal-external.test.hs index 80a4c47d068..a974254fc98 100644 --- a/cabal-testsuite/PackageTests/Backpack/Includes3/cabal-external.test.hs +++ b/cabal-testsuite/PackageTests/Backpack/Includes3/cabal-external.test.hs @@ -2,7 +2,6 @@ import Test.Cabal.Prelude main = cabalTest $ do skipUnlessGhcVersion ">= 8.1" - skipIfWindows -- TODO: https://github.com/haskell/cabal/issues/6271 withProjectFile "cabal.external.project" $ do cabal "v2-build" ["exe"] withPlan $ do diff --git a/cabal-testsuite/PackageTests/Backpack/Includes3/cabal-internal.out b/cabal-testsuite/PackageTests/Backpack/Includes3/cabal-internal.out index 88b36e02c50..f7e2f2d75ef 100644 --- a/cabal-testsuite/PackageTests/Backpack/Includes3/cabal-internal.out +++ b/cabal-testsuite/PackageTests/Backpack/Includes3/cabal-internal.out @@ -2,27 +2,27 @@ Resolving dependencies... Build profile: -w ghc- -O1 In order, the following will be built: - - Includes3-0.1.0.0 (lib:sigs) (first run) - - Includes3-0.1.0.0 (lib:indef) (first run) - - Includes3-0.1.0.0 (lib:indef with Data.Map=containers-:Data.Map) (first run) - - Includes3-0.1.0.0 (exe:exe) (first run) -Configuring library 'sigs' for Includes3-0.1.0.0... -Preprocessing library 'sigs' for Includes3-0.1.0.0... + - I-0.1.0.0 (lib:sigs) (first run) + - I-0.1.0.0 (lib:indef) (first run) + - I-0.1.0.0 (lib:indef with Data.Map=containers-:Data.Map) (first run) + - I-0.1.0.0 (exe:exe) (first run) +Configuring library 'sigs' for I-0.1.0.0... +Preprocessing library 'sigs' for I-0.1.0.0... Building library 'sigs' instantiated with Data.Map = -for Includes3-0.1.0.0... -Configuring library 'indef' for Includes3-0.1.0.0... -Preprocessing library 'indef' for Includes3-0.1.0.0... +for I-0.1.0.0... +Configuring library 'indef' for I-0.1.0.0... +Preprocessing library 'indef' for I-0.1.0.0... Building library 'indef' instantiated with Data.Map = -for Includes3-0.1.0.0... +for I-0.1.0.0... Configuring library 'indef' instantiated with Data.Map = containers-:Data.Map -for Includes3-0.1.0.0... -Preprocessing library 'indef' for Includes3-0.1.0.0... +for I-0.1.0.0... +Preprocessing library 'indef' for I-0.1.0.0... Building library 'indef' instantiated with Data.Map = containers-:Data.Map -for Includes3-0.1.0.0... -Configuring executable 'exe' for Includes3-0.1.0.0... -Preprocessing executable 'exe' for Includes3-0.1.0.0... -Building executable 'exe' for Includes3-0.1.0.0... -# Includes3 exe +for I-0.1.0.0... +Configuring executable 'exe' for I-0.1.0.0... +Preprocessing executable 'exe' for I-0.1.0.0... +Building executable 'exe' for I-0.1.0.0... +# I exe fromList [(0,2),(2,4)] diff --git a/cabal-testsuite/PackageTests/Backpack/Includes3/cabal-internal.test.hs b/cabal-testsuite/PackageTests/Backpack/Includes3/cabal-internal.test.hs index b247e56259a..81f3fcb0027 100644 --- a/cabal-testsuite/PackageTests/Backpack/Includes3/cabal-internal.test.hs +++ b/cabal-testsuite/PackageTests/Backpack/Includes3/cabal-internal.test.hs @@ -2,9 +2,8 @@ import Test.Cabal.Prelude main = cabalTest $ do skipUnlessGhcVersion ">= 8.1" - skipIfWindows -- TODO: https://github.com/haskell/cabal/issues/6271 withProjectFile "cabal.internal.project" $ do cabal "v2-build" ["exe"] withPlan $ do - r <- runPlanExe' "Includes3" "exe" [] + r <- runPlanExe' "I" "exe" [] assertOutputContains "fromList [(0,2),(2,4)]" r diff --git a/cabal-testsuite/PackageTests/Backpack/Includes3/cabal-repo.test.hs b/cabal-testsuite/PackageTests/Backpack/Includes3/cabal-repo.test.hs index 00e2aff3c84..03b74a01b9a 100644 --- a/cabal-testsuite/PackageTests/Backpack/Includes3/cabal-repo.test.hs +++ b/cabal-testsuite/PackageTests/Backpack/Includes3/cabal-repo.test.hs @@ -1,7 +1,6 @@ import Test.Cabal.Prelude main = cabalTest $ withShorterPathForNewBuildStore $ do skipUnlessGhcVersion ">= 8.1" - skipIfWindows -- TODO: https://github.com/haskell/cabal/issues/6271 withProjectFile "cabal.repo.project" $ do withRepo "repo" $ do cabal "v2-build" ["exe"] diff --git a/cabal-testsuite/PackageTests/Backpack/Includes3/setup-external-explicit.out b/cabal-testsuite/PackageTests/Backpack/Includes3/setup-external-explicit.out index b27b2d8eb1a..3697155460a 100644 --- a/cabal-testsuite/PackageTests/Backpack/Includes3/setup-external-explicit.out +++ b/cabal-testsuite/PackageTests/Backpack/Includes3/setup-external-explicit.out @@ -8,7 +8,7 @@ for sigs-0.1.0.0... Preprocessing library for sigs-0.1.0.0... Running Haddock on library instantiated with Data.Map = for sigs-0.1.0.0... -Documentation created: ../../setup-external-explicit.dist/work/repo/sigs-0.1.0.0/dist/doc/html/sigs/ +Documentation created: ./repo/sigs-0.1.0.0/../../setup-external-explicit.dist/work/repo/sigs-0.1.0.0/dist/doc/html/sigs # Setup copy Installing library in # Setup register @@ -24,7 +24,7 @@ for indef-0.1.0.0... Preprocessing library for indef-0.1.0.0... Running Haddock on library instantiated with Data.Map = for indef-0.1.0.0... -Documentation created: ../../setup-external-explicit.dist/work/repo/indef-0.1.0.0/dist/doc/html/indef/ +Documentation created: ./repo/indef-0.1.0.0/../../setup-external-explicit.dist/work/repo/indef-0.1.0.0/dist/doc/html/indef # Setup copy Installing library in # Setup register diff --git a/cabal-testsuite/PackageTests/Backpack/Includes3/setup-external-ok.cabal.out b/cabal-testsuite/PackageTests/Backpack/Includes3/setup-external-ok.cabal.out index 6d0abf817af..e57a01ca56e 100644 --- a/cabal-testsuite/PackageTests/Backpack/Includes3/setup-external-ok.cabal.out +++ b/cabal-testsuite/PackageTests/Backpack/Includes3/setup-external-ok.cabal.out @@ -8,7 +8,7 @@ for sigs-0.1.0.0... Preprocessing library for sigs-0.1.0.0... Running Haddock on library instantiated with Data.Map = for sigs-0.1.0.0... -Documentation created: ../../setup-external-ok.cabal.dist/work/repo/sigs-0.1.0.0/dist/doc/html/sigs/ +Documentation created: ./repo/sigs-0.1.0.0/../../setup-external-ok.cabal.dist/work/repo/sigs-0.1.0.0/dist/doc/html/sigs # Setup copy Installing library in # Setup register @@ -24,7 +24,7 @@ for indef-0.1.0.0... Preprocessing library for indef-0.1.0.0... Running Haddock on library instantiated with Data.Map = for indef-0.1.0.0... -Documentation created: ../../setup-external-ok.cabal.dist/work/repo/indef-0.1.0.0/dist/doc/html/indef/ +Documentation created: ./repo/indef-0.1.0.0/../../setup-external-ok.cabal.dist/work/repo/indef-0.1.0.0/dist/doc/html/indef # Setup copy Installing library in # Setup register @@ -41,11 +41,12 @@ Preprocessing library for sigs-0.1.0.0... Running Haddock on library instantiated with Data.Map = containers-:Data.Map for sigs-0.1.0.0... -Documentation created: ../../setup-external-ok.cabal.dist/work/repo/sigs-0.1.0.0/dist/doc/html/sigs/ +Documentation created: ./repo/sigs-0.1.0.0/../../setup-external-ok.cabal.dist/work/repo/sigs-0.1.0.0/dist/doc/html/sigs # Setup copy Installing library in # Setup register -Registering library instantiated with Data.Map = containers-:Data.Map +Registering library instantiated with + Data.Map = containers-:Data.Map for sigs-0.1.0.0... # Setup configure Configuring indef-0.1.0.0... @@ -58,11 +59,12 @@ Preprocessing library for indef-0.1.0.0... Running Haddock on library instantiated with Data.Map = containers-:Data.Map for indef-0.1.0.0... -Documentation created: ../../setup-external-ok.cabal.dist/work/repo/indef-0.1.0.0/dist/doc/html/indef/ +Documentation created: ./repo/indef-0.1.0.0/../../setup-external-ok.cabal.dist/work/repo/indef-0.1.0.0/dist/doc/html/indef # Setup copy Installing library in # Setup register -Registering library instantiated with Data.Map = containers-:Data.Map +Registering library instantiated with + Data.Map = containers-:Data.Map for indef-0.1.0.0... # Setup configure Configuring exe-0.1.0.0... diff --git a/cabal-testsuite/PackageTests/Backpack/Includes3/setup-external-ok.out b/cabal-testsuite/PackageTests/Backpack/Includes3/setup-external-ok.out index 8fc173d40f0..2d4e65cb2cd 100644 --- a/cabal-testsuite/PackageTests/Backpack/Includes3/setup-external-ok.out +++ b/cabal-testsuite/PackageTests/Backpack/Includes3/setup-external-ok.out @@ -8,7 +8,7 @@ for sigs-0.1.0.0... Preprocessing library for sigs-0.1.0.0... Running Haddock on library instantiated with Data.Map = for sigs-0.1.0.0... -Documentation created: ../../setup-external-ok.dist/work/repo/sigs-0.1.0.0/dist/doc/html/sigs/ +Documentation created: ./repo/sigs-0.1.0.0/../../setup-external-ok.dist/work/repo/sigs-0.1.0.0/dist/doc/html/sigs # Setup copy Installing library in # Setup register @@ -24,7 +24,7 @@ for indef-0.1.0.0... Preprocessing library for indef-0.1.0.0... Running Haddock on library instantiated with Data.Map = for indef-0.1.0.0... -Documentation created: ../../setup-external-ok.dist/work/repo/indef-0.1.0.0/dist/doc/html/indef/ +Documentation created: ./repo/indef-0.1.0.0/../../setup-external-ok.dist/work/repo/indef-0.1.0.0/dist/doc/html/indef # Setup copy Installing library in # Setup register @@ -41,11 +41,12 @@ Preprocessing library for sigs-0.1.0.0... Running Haddock on library instantiated with Data.Map = containers-:Data.Map for sigs-0.1.0.0... -Documentation created: ../../setup-external-ok.dist/work/repo/sigs-0.1.0.0/dist/doc/html/sigs/ +Documentation created: ./repo/sigs-0.1.0.0/../../setup-external-ok.dist/work/repo/sigs-0.1.0.0/dist/doc/html/sigs # Setup copy Installing library in # Setup register -Registering library instantiated with Data.Map = containers-:Data.Map +Registering library instantiated with + Data.Map = containers-:Data.Map for sigs-0.1.0.0... # Setup configure Configuring indef-0.1.0.0... @@ -58,11 +59,12 @@ Preprocessing library for indef-0.1.0.0... Running Haddock on library instantiated with Data.Map = containers-:Data.Map for indef-0.1.0.0... -Documentation created: ../../setup-external-ok.dist/work/repo/indef-0.1.0.0/dist/doc/html/indef/ +Documentation created: ./repo/indef-0.1.0.0/../../setup-external-ok.dist/work/repo/indef-0.1.0.0/dist/doc/html/indef # Setup copy Installing library in # Setup register -Registering library instantiated with Data.Map = containers-:Data.Map +Registering library instantiated with + Data.Map = containers-:Data.Map for indef-0.1.0.0... # Setup configure Configuring exe-0.1.0.0... diff --git a/cabal-testsuite/PackageTests/Backpack/Includes3/setup-external-ok.test.hs b/cabal-testsuite/PackageTests/Backpack/Includes3/setup-external-ok.test.hs index d7ae9a1921d..a905e873cac 100644 --- a/cabal-testsuite/PackageTests/Backpack/Includes3/setup-external-ok.test.hs +++ b/cabal-testsuite/PackageTests/Backpack/Includes3/setup-external-ok.test.hs @@ -3,8 +3,7 @@ import Data.List import qualified Data.Char as Char main = setupAndCabalTest $ do skipUnlessGhcVersion ">= 8.1" - ghc <- isGhcVersion "== 9.0.2 || == 9.2.* || == 9.4.* || == 9.6.*" - expectBrokenIf ghc 7987 $ + expectBrokenIfGhc "== 9.0.2 || == 9.2.* || == 9.4.* || == 9.6.*" 7987 $ withPackageDb $ do containers_id <- getIPID "containers" withDirectory "repo/sigs-0.1.0.0" $ setup_install_with_docs ["--ipid", "sigs-0.1.0.0"] @@ -21,4 +20,3 @@ main = setupAndCabalTest $ do withDirectory "repo/exe-0.1.0.0" $ do setup_install [] runExe' "exe" [] >>= assertOutputContains "fromList [(0,2),(2,4)]" - diff --git a/cabal-testsuite/PackageTests/Backpack/Includes3/setup-internal.cabal.out b/cabal-testsuite/PackageTests/Backpack/Includes3/setup-internal.cabal.out index ea300c9286d..9ac4463aa6e 100644 --- a/cabal-testsuite/PackageTests/Backpack/Includes3/setup-internal.cabal.out +++ b/cabal-testsuite/PackageTests/Backpack/Includes3/setup-internal.cabal.out @@ -1,18 +1,18 @@ # Setup configure -Configuring Includes3-0.1.0.0... +Configuring I-0.1.0.0... # Setup build -Preprocessing library 'sigs' for Includes3-0.1.0.0... +Preprocessing library 'sigs' for I-0.1.0.0... Building library 'sigs' instantiated with Data.Map = -for Includes3-0.1.0.0... -Preprocessing library 'indef' for Includes3-0.1.0.0... +for I-0.1.0.0... +Preprocessing library 'indef' for I-0.1.0.0... Building library 'indef' instantiated with Data.Map = -for Includes3-0.1.0.0... -Preprocessing library 'indef' for Includes3-0.1.0.0... +for I-0.1.0.0... +Preprocessing library 'indef' for I-0.1.0.0... Building library 'indef' instantiated with Data.Map = containers-:Data.Map -for Includes3-0.1.0.0... -Preprocessing executable 'exe' for Includes3-0.1.0.0... -Building executable 'exe' for Includes3-0.1.0.0... +for I-0.1.0.0... +Preprocessing executable 'exe' for I-0.1.0.0... +Building executable 'exe' for I-0.1.0.0... # Setup copy Installing internal library sigs in Installing internal library indef in @@ -21,24 +21,24 @@ Installing executable exe in Warning: The directory /setup-internal.cabal.dist/usr/bin is not in the system search path. # Setup register Registering library 'sigs' instantiated with Data.Map = -for Includes3-0.1.0.0... +for I-0.1.0.0... Registering library 'indef' instantiated with Data.Map = -for Includes3-0.1.0.0... +for I-0.1.0.0... Registering library 'indef' instantiated with Data.Map = containers-:Data.Map -for Includes3-0.1.0.0... +for I-0.1.0.0... # Setup build -Preprocessing library 'sigs' for Includes3-0.1.0.0... +Preprocessing library 'sigs' for I-0.1.0.0... Building library 'sigs' instantiated with Data.Map = -for Includes3-0.1.0.0... -Preprocessing library 'indef' for Includes3-0.1.0.0... +for I-0.1.0.0... +Preprocessing library 'indef' for I-0.1.0.0... Building library 'indef' instantiated with Data.Map = -for Includes3-0.1.0.0... -Preprocessing library 'indef' for Includes3-0.1.0.0... +for I-0.1.0.0... +Preprocessing library 'indef' for I-0.1.0.0... Building library 'indef' instantiated with Data.Map = containers-:Data.Map -for Includes3-0.1.0.0... -Preprocessing executable 'exe' for Includes3-0.1.0.0... -Building executable 'exe' for Includes3-0.1.0.0... +for I-0.1.0.0... +Preprocessing executable 'exe' for I-0.1.0.0... +Building executable 'exe' for I-0.1.0.0... # exe fromList [(0,2),(2,4)] diff --git a/cabal-testsuite/PackageTests/Backpack/Includes3/setup-internal.out b/cabal-testsuite/PackageTests/Backpack/Includes3/setup-internal.out index cb9caef57a7..6912ab117cd 100644 --- a/cabal-testsuite/PackageTests/Backpack/Includes3/setup-internal.out +++ b/cabal-testsuite/PackageTests/Backpack/Includes3/setup-internal.out @@ -1,18 +1,18 @@ # Setup configure -Configuring Includes3-0.1.0.0... +Configuring I-0.1.0.0... # Setup build -Preprocessing library 'sigs' for Includes3-0.1.0.0... +Preprocessing library 'sigs' for I-0.1.0.0... Building library 'sigs' instantiated with Data.Map = -for Includes3-0.1.0.0... -Preprocessing library 'indef' for Includes3-0.1.0.0... +for I-0.1.0.0... +Preprocessing library 'indef' for I-0.1.0.0... Building library 'indef' instantiated with Data.Map = -for Includes3-0.1.0.0... -Preprocessing library 'indef' for Includes3-0.1.0.0... +for I-0.1.0.0... +Preprocessing library 'indef' for I-0.1.0.0... Building library 'indef' instantiated with Data.Map = containers-:Data.Map -for Includes3-0.1.0.0... -Preprocessing executable 'exe' for Includes3-0.1.0.0... -Building executable 'exe' for Includes3-0.1.0.0... +for I-0.1.0.0... +Preprocessing executable 'exe' for I-0.1.0.0... +Building executable 'exe' for I-0.1.0.0... # Setup copy Installing internal library sigs in Installing internal library indef in @@ -21,24 +21,24 @@ Installing executable exe in Warning: The directory /setup-internal.dist/usr/bin is not in the system search path. # Setup register Registering library 'sigs' instantiated with Data.Map = -for Includes3-0.1.0.0... +for I-0.1.0.0... Registering library 'indef' instantiated with Data.Map = -for Includes3-0.1.0.0... +for I-0.1.0.0... Registering library 'indef' instantiated with Data.Map = containers-:Data.Map -for Includes3-0.1.0.0... +for I-0.1.0.0... # Setup build -Preprocessing library 'sigs' for Includes3-0.1.0.0... +Preprocessing library 'sigs' for I-0.1.0.0... Building library 'sigs' instantiated with Data.Map = -for Includes3-0.1.0.0... -Preprocessing library 'indef' for Includes3-0.1.0.0... +for I-0.1.0.0... +Preprocessing library 'indef' for I-0.1.0.0... Building library 'indef' instantiated with Data.Map = -for Includes3-0.1.0.0... -Preprocessing library 'indef' for Includes3-0.1.0.0... +for I-0.1.0.0... +Preprocessing library 'indef' for I-0.1.0.0... Building library 'indef' instantiated with Data.Map = containers-:Data.Map -for Includes3-0.1.0.0... -Preprocessing executable 'exe' for Includes3-0.1.0.0... -Building executable 'exe' for Includes3-0.1.0.0... +for I-0.1.0.0... +Preprocessing executable 'exe' for I-0.1.0.0... +Building executable 'exe' for I-0.1.0.0... # exe fromList [(0,2),(2,4)] diff --git a/cabal-testsuite/PackageTests/Backpack/Reexport1/setup.cabal.out b/cabal-testsuite/PackageTests/Backpack/Reexport1/setup.cabal.out index 1c8de306e5d..d36358ef31e 100644 --- a/cabal-testsuite/PackageTests/Backpack/Reexport1/setup.cabal.out +++ b/cabal-testsuite/PackageTests/Backpack/Reexport1/setup.cabal.out @@ -6,7 +6,7 @@ Building library for p-0.1.0.0... # Setup haddock Preprocessing library for p-0.1.0.0... Running Haddock on library for p-0.1.0.0... -Documentation created: ../setup.cabal.dist/work/p/dist/doc/html/p/ +Documentation created: ./p/../setup.cabal.dist/work/p/dist/doc/html/p # Setup copy Installing library in # Setup register @@ -19,4 +19,4 @@ Building library for q-0.1.0.0... # Setup haddock Preprocessing library for q-0.1.0.0... Running Haddock on library for q-0.1.0.0... -Documentation created: ../setup.cabal.dist/work/q/dist/doc/html/q/ +Documentation created: ./q/../setup.cabal.dist/work/q/dist/doc/html/q diff --git a/cabal-testsuite/PackageTests/Backpack/Reexport1/setup.out b/cabal-testsuite/PackageTests/Backpack/Reexport1/setup.out index ee41d01148b..78312c7bcbb 100644 --- a/cabal-testsuite/PackageTests/Backpack/Reexport1/setup.out +++ b/cabal-testsuite/PackageTests/Backpack/Reexport1/setup.out @@ -6,7 +6,7 @@ Building library for p-0.1.0.0... # Setup haddock Preprocessing library for p-0.1.0.0... Running Haddock on library for p-0.1.0.0... -Documentation created: ../setup.dist/work/p/dist/doc/html/p/ +Documentation created: ./p/../setup.dist/work/p/dist/doc/html/p # Setup copy Installing library in # Setup register @@ -19,4 +19,4 @@ Building library for q-0.1.0.0... # Setup haddock Preprocessing library for q-0.1.0.0... Running Haddock on library for q-0.1.0.0... -Documentation created: ../setup.dist/work/q/dist/doc/html/q/ +Documentation created: ./q/../setup.dist/work/q/dist/doc/html/q diff --git a/cabal-testsuite/PackageTests/Backpack/T4754/setup.test.hs b/cabal-testsuite/PackageTests/Backpack/T4754/setup.test.hs index 97dae2b597c..4931cd33c99 100644 --- a/cabal-testsuite/PackageTests/Backpack/T4754/setup.test.hs +++ b/cabal-testsuite/PackageTests/Backpack/T4754/setup.test.hs @@ -1,6 +1,6 @@ import Test.Cabal.Prelude main = setupAndCabalTest $ do skipUnlessGhcVersion ">= 8.1" - skipUnless "no profiling libs" =<< hasProfiledLibraries + skipIfNoProfiledLibraries setup "configure" ["--enable-profiling"] setup "build" [] diff --git a/cabal-testsuite/PackageTests/Backpack/T6385/cabal.test.hs b/cabal-testsuite/PackageTests/Backpack/T6385/cabal.test.hs index 0a31702615c..5048e09d56b 100644 --- a/cabal-testsuite/PackageTests/Backpack/T6385/cabal.test.hs +++ b/cabal-testsuite/PackageTests/Backpack/T6385/cabal.test.hs @@ -2,6 +2,5 @@ import Test.Cabal.Prelude main = cabalTest $ withShorterPathForNewBuildStore $ do skipUnlessGhcVersion ">= 8.1" - skipIfWindows -- TODO: https://github.com/haskell/cabal/issues/6271 withRepo "repo" $ do cabal "v2-build" ["T6385"] diff --git a/cabal-testsuite/PackageTests/Backpack/bkpcabal01/bkpcabal01.cabal b/cabal-testsuite/PackageTests/Backpack/bkpcabal01/b.cabal similarity index 96% rename from cabal-testsuite/PackageTests/Backpack/bkpcabal01/bkpcabal01.cabal rename to cabal-testsuite/PackageTests/Backpack/bkpcabal01/b.cabal index f10d1aad151..f1e92112a1f 100644 --- a/cabal-testsuite/PackageTests/Backpack/bkpcabal01/bkpcabal01.cabal +++ b/cabal-testsuite/PackageTests/Backpack/bkpcabal01/b.cabal @@ -1,5 +1,5 @@ cabal-version: 2.0 -name: bkpcabal01 +name: b version: 0.1.0.0 description: This test also exists in GHC's test-suite under the same name and was ported over to cabal's testsuite as it exposed a diff --git a/cabal-testsuite/PackageTests/Backpack/bkpcabal01/cabal.out b/cabal-testsuite/PackageTests/Backpack/bkpcabal01/cabal.out index 4630087ccc2..3ebec1cc5c1 100644 --- a/cabal-testsuite/PackageTests/Backpack/bkpcabal01/cabal.out +++ b/cabal-testsuite/PackageTests/Backpack/bkpcabal01/cabal.out @@ -2,33 +2,33 @@ Resolving dependencies... Build profile: -w ghc- -O1 In order, the following will be built: - - bkpcabal01-0.1.0.0 (lib:impl) (first run) - - bkpcabal01-0.1.0.0 (lib:p) (first run) - - bkpcabal01-0.1.0.0 (lib:p with H=bkpcabal01-0.1.0.0-inplace-impl:H) (first run) - - bkpcabal01-0.1.0.0 (lib:q) (first run) - - bkpcabal01-0.1.0.0 (lib:q with I=bkpcabal01-0.1.0.0-inplace-impl:I) (first run) - - bkpcabal01-0.1.0.0 (exe:exe) (first run) -Configuring library 'impl' for bkpcabal01-0.1.0.0... -Preprocessing library 'impl' for bkpcabal01-0.1.0.0... -Building library 'impl' for bkpcabal01-0.1.0.0... -Configuring library 'p' for bkpcabal01-0.1.0.0... -Preprocessing library 'p' for bkpcabal01-0.1.0.0... + - b-0.1.0.0 (lib:impl) (first run) + - b-0.1.0.0 (lib:p) (first run) + - b-0.1.0.0 (lib:p with H=b-0.1.0.0-inplace-impl:H) (first run) + - b-0.1.0.0 (lib:q) (first run) + - b-0.1.0.0 (lib:q with I=b-0.1.0.0-inplace-impl:I) (first run) + - b-0.1.0.0 (exe:exe) (first run) +Configuring library 'impl' for b-0.1.0.0... +Preprocessing library 'impl' for b-0.1.0.0... +Building library 'impl' for b-0.1.0.0... +Configuring library 'p' for b-0.1.0.0... +Preprocessing library 'p' for b-0.1.0.0... Building library 'p' instantiated with H = -for bkpcabal01-0.1.0.0... -Configuring library 'p' instantiated with H = bkpcabal01-0.1.0.0-inplace-impl:H -for bkpcabal01-0.1.0.0... -Preprocessing library 'p' for bkpcabal01-0.1.0.0... -Building library 'p' instantiated with H = bkpcabal01-0.1.0.0-inplace-impl:H -for bkpcabal01-0.1.0.0... -Configuring library 'q' for bkpcabal01-0.1.0.0... -Preprocessing library 'q' for bkpcabal01-0.1.0.0... +for b-0.1.0.0... +Configuring library 'p' instantiated with H = b-0.1.0.0-inplace-impl:H +for b-0.1.0.0... +Preprocessing library 'p' for b-0.1.0.0... +Building library 'p' instantiated with H = b-0.1.0.0-inplace-impl:H +for b-0.1.0.0... +Configuring library 'q' for b-0.1.0.0... +Preprocessing library 'q' for b-0.1.0.0... Building library 'q' instantiated with I = -for bkpcabal01-0.1.0.0... -Configuring library 'q' instantiated with I = bkpcabal01-0.1.0.0-inplace-impl:I -for bkpcabal01-0.1.0.0... -Preprocessing library 'q' for bkpcabal01-0.1.0.0... -Building library 'q' instantiated with I = bkpcabal01-0.1.0.0-inplace-impl:I -for bkpcabal01-0.1.0.0... -Configuring executable 'exe' for bkpcabal01-0.1.0.0... -Preprocessing executable 'exe' for bkpcabal01-0.1.0.0... -Building executable 'exe' for bkpcabal01-0.1.0.0... +for b-0.1.0.0... +Configuring library 'q' instantiated with I = b-0.1.0.0-inplace-impl:I +for b-0.1.0.0... +Preprocessing library 'q' for b-0.1.0.0... +Building library 'q' instantiated with I = b-0.1.0.0-inplace-impl:I +for b-0.1.0.0... +Configuring executable 'exe' for b-0.1.0.0... +Preprocessing executable 'exe' for b-0.1.0.0... +Building executable 'exe' for b-0.1.0.0... diff --git a/cabal-testsuite/PackageTests/Backpack/bkpcabal01/cabal.test.hs b/cabal-testsuite/PackageTests/Backpack/bkpcabal01/cabal.test.hs index 5a30f6a867a..0f1b7544e07 100644 --- a/cabal-testsuite/PackageTests/Backpack/bkpcabal01/cabal.test.hs +++ b/cabal-testsuite/PackageTests/Backpack/bkpcabal01/cabal.test.hs @@ -1,6 +1,6 @@ import Test.Cabal.Prelude -main = cabalTest $ do +main = do + cabalTest $ do -- GHC 8.2.2 had a regression ("unknown package: hole"), see also #4908 skipUnlessGhcVersion ">= 8.2 && <8.2.2 || >8.2.2" - skipIfWindows -- TODO: https://github.com/haskell/cabal/issues/6271 cabal "v2-build" ["all"] diff --git a/cabal-testsuite/PackageTests/BuildToolPaths/cabal.test.hs b/cabal-testsuite/PackageTests/BuildToolPaths/cabal.test.hs index 60df6ca1ac2..dc2559eb12f 100644 --- a/cabal-testsuite/PackageTests/BuildToolPaths/cabal.test.hs +++ b/cabal-testsuite/PackageTests/BuildToolPaths/cabal.test.hs @@ -10,16 +10,19 @@ main = cabalTest $ do -- shipped with a version of Cabal with SetupHooks). -- Ever since 716b109c4ae908458b16af5d75c233c7d9fdfc06, we use --intree-cabal-lib in -- CI, so we should always take the "Just" case which actually runs the test. + -- + -- NB: be sure to use v2 commands, as otherwise the testsuite driver will not + -- pass --package-db flags. Nothing -> skip "Cabal-hooks library unavailable." - Just pkgdb -> recordMode DoNotRecord $ do + Just _pkgdb -> recordMode DoNotRecord $ do -- At build-time: -- -- - in a pre-build hook -- - in a Template Haskell splice - cabal "build" [ "all", "--enable-tests", "--enable-benchmarks", "--package-db=" ++ pkgdb ] + cabal "v2-build" [ "all", "--enable-tests", "--enable-benchmarks"] -- At runtime of a test-suite - cabal "test" [ "pbts", "--package-db=" ++ pkgdb ] + cabal "v2-test" [ "pbts" ] -- At runtime of a benchmark - cabal "bench" [ "pbts", "--package-db=" ++ pkgdb ] + cabal "v2-bench" [ "pbts" ] -- At runtime of an executable - cabal "run" [ "pbts-exe", "--package-db=" ++ pkgdb ] + cabal "v2-run" [ "pbts-exe" ] diff --git a/cabal-testsuite/PackageTests/BuildTools/Foreign/A.hs b/cabal-testsuite/PackageTests/BuildTools/Foreign/A.hs index eae7f4476f3..45fc0ecfe9e 100644 --- a/cabal-testsuite/PackageTests/BuildTools/Foreign/A.hs +++ b/cabal-testsuite/PackageTests/BuildTools/Foreign/A.hs @@ -1,4 +1,9 @@ +{-# LANGUAGE CPP #-} +#if mingw32_HOST_OS +{-# OPTIONS_GHC -F -pgmF my-foreign-preprocessor.bat #-} +#else {-# OPTIONS_GHC -F -pgmF my-foreign-preprocessor #-} +#endif module A where a :: String diff --git a/cabal-testsuite/PackageTests/BuildTools/Foreign/my-foreign-preprocessor.bat b/cabal-testsuite/PackageTests/BuildTools/Foreign/my-foreign-preprocessor.bat new file mode 100644 index 00000000000..51e58f1b40c --- /dev/null +++ b/cabal-testsuite/PackageTests/BuildTools/Foreign/my-foreign-preprocessor.bat @@ -0,0 +1,2 @@ +echo @off +pwsh my-foreign-preprocessor.ps1 %1 %2 %3 diff --git a/cabal-testsuite/PackageTests/BuildTools/Foreign/my-foreign-preprocessor.ps1 b/cabal-testsuite/PackageTests/BuildTools/Foreign/my-foreign-preprocessor.ps1 new file mode 100644 index 00000000000..1bb89bcc1b8 --- /dev/null +++ b/cabal-testsuite/PackageTests/BuildTools/Foreign/my-foreign-preprocessor.ps1 @@ -0,0 +1 @@ +get-content $args[1] | %{$_ -replace "0","1"} > $args[2] diff --git a/cabal-testsuite/PackageTests/BuildTools/Foreign/setup.test.hs b/cabal-testsuite/PackageTests/BuildTools/Foreign/setup.test.hs index 9860683f7b0..b698f579f93 100644 --- a/cabal-testsuite/PackageTests/BuildTools/Foreign/setup.test.hs +++ b/cabal-testsuite/PackageTests/BuildTools/Foreign/setup.test.hs @@ -5,9 +5,7 @@ import Control.Monad.IO.Class import System.Environment -- Test PATH-munging --- TODO: Enable this test on Windows main = setupAndCabalTest $ do - skipIfWindows path <- liftIO $ getEnv "PATH" cwd <- testCurrentDir <$> getTestEnv r <- withEnv [("PATH", Just $ cwd ++ ":" ++ path)] $ setup_build [] diff --git a/cabal-testsuite/PackageTests/BuildWays/p/CHANGELOG.md b/cabal-testsuite/PackageTests/BuildWays/p/CHANGELOG.md new file mode 100644 index 00000000000..9ede8b27d4f --- /dev/null +++ b/cabal-testsuite/PackageTests/BuildWays/p/CHANGELOG.md @@ -0,0 +1,5 @@ +# Revision history for p + +## 0.1.0.0 -- YYYY-mm-dd + +* First version. Released on an unsuspecting world. diff --git a/cabal-testsuite/PackageTests/BuildWays/p/p.cabal b/cabal-testsuite/PackageTests/BuildWays/p/p.cabal new file mode 100644 index 00000000000..687cf16bc0c --- /dev/null +++ b/cabal-testsuite/PackageTests/BuildWays/p/p.cabal @@ -0,0 +1,18 @@ +cabal-version: 3.12 +name: p +version: 0.1.0.0 +license: NONE +author: Matthew Pickering +maintainer: matthewtpickering@gmail.com +build-type: Simple +extra-doc-files: CHANGELOG.md + +common warnings + ghc-options: -Wall + +library + import: warnings + exposed-modules: MyLib + build-depends: base + hs-source-dirs: src + default-language: Haskell2010 diff --git a/cabal-testsuite/PackageTests/BuildWays/p/src/MyLib.hs b/cabal-testsuite/PackageTests/BuildWays/p/src/MyLib.hs new file mode 100644 index 00000000000..e657c4403f6 --- /dev/null +++ b/cabal-testsuite/PackageTests/BuildWays/p/src/MyLib.hs @@ -0,0 +1,4 @@ +module MyLib (someFunc) where + +someFunc :: IO () +someFunc = putStrLn "someFunc" diff --git a/cabal-testsuite/PackageTests/BuildWays/q/CHANGELOG.md b/cabal-testsuite/PackageTests/BuildWays/q/CHANGELOG.md new file mode 100644 index 00000000000..62632c53766 --- /dev/null +++ b/cabal-testsuite/PackageTests/BuildWays/q/CHANGELOG.md @@ -0,0 +1,5 @@ +# Revision history for q + +## 0.1.0.0 -- YYYY-mm-dd + +* First version. Released on an unsuspecting world. diff --git a/cabal-testsuite/PackageTests/BuildWays/q/app/Main.hs b/cabal-testsuite/PackageTests/BuildWays/q/app/Main.hs new file mode 100644 index 00000000000..642b418a547 --- /dev/null +++ b/cabal-testsuite/PackageTests/BuildWays/q/app/Main.hs @@ -0,0 +1,7 @@ +{-# LANGUAGE TemplateHaskell #-} +module Main where + +import MyLib + +main :: IO () +main = someFunc diff --git a/cabal-testsuite/PackageTests/BuildWays/q/q.cabal b/cabal-testsuite/PackageTests/BuildWays/q/q.cabal new file mode 100644 index 00000000000..a4f2a1d65d7 --- /dev/null +++ b/cabal-testsuite/PackageTests/BuildWays/q/q.cabal @@ -0,0 +1,19 @@ +cabal-version: 3.12 +name: q +version: 0.1.0.0 +license: NONE +author: Matthew Pickering +maintainer: matthewtpickering@gmail.com +build-type: Simple +extra-doc-files: CHANGELOG.md + +common warnings + ghc-options: -Wall + +executable q + import: warnings + main-is: Main.hs + build-depends: p, base + hs-source-dirs: app + ghc-options: -dynamic-too + default-language: Haskell2010 diff --git a/cabal-testsuite/PackageTests/BuildWays/setup.test.hs b/cabal-testsuite/PackageTests/BuildWays/setup.test.hs new file mode 100644 index 00000000000..dd4531599e4 --- /dev/null +++ b/cabal-testsuite/PackageTests/BuildWays/setup.test.hs @@ -0,0 +1,10 @@ +import Test.Cabal.Prelude + +opts = ["--enable-shared", "--enable-library-vanilla", "--enable-library-profiling"] + +-- See #10418 +main = setupTest $ recordMode DoNotRecord $ withPackageDb $ do + skipIfNoSharedLibraries + skipIfNoProfiledLibraries + withDirectory "p" $ setup_install opts + withDirectory "q" $ setup_install opts diff --git a/cabal-testsuite/PackageTests/CCompilerOverride/custom-cc-clang.bat b/cabal-testsuite/PackageTests/CCompilerOverride/custom-cc-clang.bat index a2e60a9c592..63221f54528 100644 --- a/cabal-testsuite/PackageTests/CCompilerOverride/custom-cc-clang.bat +++ b/cabal-testsuite/PackageTests/CCompilerOverride/custom-cc-clang.bat @@ -1,11 +1,7 @@ @echo OFF -where /q clang.exe - -IF %ERRORLEVEL% EQU 0 ( - call clang.exe -DNOERROR6 %* - EXIT /B %ERRORLEVEL% -) - -ECHO "Cannot find C compiler" -EXIT /B 1 +REM replace the libdir with the path to the compiler +FOR /f "delims=" %%A in ('call ghc.exe --print-libdir') do set "var=%%A" +setlocal EnableDelayedExpansion +CALL !var:lib=mingw\bin\clang.exe! -DNOERROR6 %* +EXIT /B %ERRORLEVEL% diff --git a/cabal-testsuite/PackageTests/CCompilerOverride/custom-cc.bat b/cabal-testsuite/PackageTests/CCompilerOverride/custom-cc.bat index 504f6b800cd..560845174d8 100644 --- a/cabal-testsuite/PackageTests/CCompilerOverride/custom-cc.bat +++ b/cabal-testsuite/PackageTests/CCompilerOverride/custom-cc.bat @@ -1,11 +1,7 @@ @echo OFF -where /q gcc.exe - -IF %ERRORLEVEL% EQU 0 ( - call gcc.exe -DNOERROR6 %* - EXIT /B %ERRORLEVEL% -) - -ECHO "Cannot find C compiler" -EXIT /B 1 +REM replace the libdir with the path to the compiler +FOR /f "delims=" %%A in ('call ghc.exe --print-libdir') do set "var=%%A" +setlocal EnableDelayedExpansion +CALL !var:lib=mingw\bin\gcc.exe! -DNOERROR6 %* +EXIT /B %ERRORLEVEL% diff --git a/cabal-testsuite/PackageTests/CCompilerOverride/setup.test.hs b/cabal-testsuite/PackageTests/CCompilerOverride/setup.test.hs index b4f7f04ddb1..7cdb7c75287 100644 --- a/cabal-testsuite/PackageTests/CCompilerOverride/setup.test.hs +++ b/cabal-testsuite/PackageTests/CCompilerOverride/setup.test.hs @@ -9,13 +9,12 @@ import Test.Cabal.Prelude -- https://gitlab.haskell.org/ghc/ghc/-/commit/8ff3134ed4aa323b0199ad683f72165e51a59ab6 main = setupAndCabalTest $ do skipUnlessGhcVersion ">= 8.8" - isWin <- isWindows ghc94 <- isGhcVersion ">= 9.4.1" env <- getTestEnv let pwd = testCurrentDir env win_suffix = if ghc94 then "-clang.bat" else ".bat" customCC = - pwd ++ "/custom-cc" ++ if isWin then win_suffix else "" + pwd ++ "/custom-cc" ++ if isWindows then win_suffix else "" setup "configure" [ "--ghc-option=-optc=-DNOERROR2" diff --git a/cabal-testsuite/PackageTests/CustomDep/client/Setup.hs b/cabal-testsuite/PackageTests/CMain/10168/Setup.hs similarity index 100% rename from cabal-testsuite/PackageTests/CustomDep/client/Setup.hs rename to cabal-testsuite/PackageTests/CMain/10168/Setup.hs diff --git a/cabal-testsuite/PackageTests/CMain/10168/app/Main.hs b/cabal-testsuite/PackageTests/CMain/10168/app/Main.hs new file mode 100644 index 00000000000..718f1d5a74c --- /dev/null +++ b/cabal-testsuite/PackageTests/CMain/10168/app/Main.hs @@ -0,0 +1,6 @@ +module Main ( main ) where + +import Lib ( myMax ) + +main :: IO () +main = print $ myMax 10 100 diff --git a/cabal-testsuite/PackageTests/CMain/10168/c-app/main.c b/cabal-testsuite/PackageTests/CMain/10168/c-app/main.c new file mode 100644 index 00000000000..2cf1d456e33 --- /dev/null +++ b/cabal-testsuite/PackageTests/CMain/10168/c-app/main.c @@ -0,0 +1,12 @@ +#include +#include +#ifdef __GLASGOW_HASKELL__ +#include "Lib_stub.h" +#endif + +int main(int argc, char *argv[]) { + hs_init(&argc, &argv); + printf("%lld\n", myMax(10,100)); + hs_exit(); + return 0; +} diff --git a/cabal-testsuite/PackageTests/CMain/10168/haskell-c-tests.cabal b/cabal-testsuite/PackageTests/CMain/10168/haskell-c-tests.cabal new file mode 100644 index 00000000000..9f5f9e1dff2 --- /dev/null +++ b/cabal-testsuite/PackageTests/CMain/10168/haskell-c-tests.cabal @@ -0,0 +1,27 @@ +cabal-version: 2.0 + +name: haskell-c-tests +version: 0.1.0.0 +build-type: Simple + +library + exposed-modules: Lib + hs-source-dirs: src + ghc-options: -stubdir autogen-stubs + build-depends: base + default-language: Haskell2010 + +executable c-exe + main-is: main.c + hs-source-dirs: c-app + ghc-options: -no-hs-main + include-dirs: autogen-stubs + build-depends: base, haskell-c-tests + default-language: Haskell2010 + +executable haskell-exe + main-is: Main.hs + hs-source-dirs: app + ghc-options: -threaded -rtsopts -with-rtsopts=-N + build-depends: base, haskell-c-tests + default-language: Haskell2010 diff --git a/cabal-testsuite/PackageTests/CMain/10168/setup.out b/cabal-testsuite/PackageTests/CMain/10168/setup.out new file mode 100644 index 00000000000..bb075774c77 --- /dev/null +++ b/cabal-testsuite/PackageTests/CMain/10168/setup.out @@ -0,0 +1,10 @@ +# Setup configure +Configuring haskell-c-tests-0.1.0.0... +Warning: [unknown-directory] 'include-dirs: autogen-stubs' specifies a directory which does not exist. +# Setup build +Preprocessing library for haskell-c-tests-0.1.0.0... +Building library for haskell-c-tests-0.1.0.0... +Preprocessing executable 'c-exe' for haskell-c-tests-0.1.0.0... +Building executable 'c-exe' for haskell-c-tests-0.1.0.0... +Preprocessing executable 'haskell-exe' for haskell-c-tests-0.1.0.0... +Building executable 'haskell-exe' for haskell-c-tests-0.1.0.0... diff --git a/cabal-testsuite/PackageTests/CMain/10168/setup.test.hs b/cabal-testsuite/PackageTests/CMain/10168/setup.test.hs new file mode 100644 index 00000000000..bcefa0b29be --- /dev/null +++ b/cabal-testsuite/PackageTests/CMain/10168/setup.test.hs @@ -0,0 +1,7 @@ +import Test.Cabal.Prelude +-- Test building an executable whose main-is is a C source found in the hs-source-dirs. +-- It is a bit counter intuitive that we look for non-haskell sources in +-- `hs-source-dirs`, but that is a behaviour that users rely on (see #10168) +-- and there's no good reason to break it. +main = setupTest $ do + setup_build [] diff --git a/cabal-testsuite/PackageTests/CMain/10168/src/Lib.hs b/cabal-testsuite/PackageTests/CMain/10168/src/Lib.hs new file mode 100644 index 00000000000..ba1bcce7ab9 --- /dev/null +++ b/cabal-testsuite/PackageTests/CMain/10168/src/Lib.hs @@ -0,0 +1,6 @@ +module Lib ( myMax ) where + +myMax :: Int -> Int -> Int +myMax x1 x2 = if x1 > x2 then x1 else x2 + +foreign export ccall myMax :: Int -> Int -> Int diff --git a/cabal-testsuite/PackageTests/CMain/Bar.hs b/cabal-testsuite/PackageTests/CMain/Simple/Bar.hs similarity index 100% rename from cabal-testsuite/PackageTests/CMain/Bar.hs rename to cabal-testsuite/PackageTests/CMain/Simple/Bar.hs diff --git a/cabal-testsuite/PackageTests/CMain/foo.c b/cabal-testsuite/PackageTests/CMain/Simple/foo.c similarity index 100% rename from cabal-testsuite/PackageTests/CMain/foo.c rename to cabal-testsuite/PackageTests/CMain/Simple/foo.c diff --git a/cabal-testsuite/PackageTests/CMain/my.cabal b/cabal-testsuite/PackageTests/CMain/Simple/my.cabal similarity index 100% rename from cabal-testsuite/PackageTests/CMain/my.cabal rename to cabal-testsuite/PackageTests/CMain/Simple/my.cabal diff --git a/cabal-testsuite/PackageTests/CMain/setup.cabal.out b/cabal-testsuite/PackageTests/CMain/Simple/setup.cabal.out similarity index 100% rename from cabal-testsuite/PackageTests/CMain/setup.cabal.out rename to cabal-testsuite/PackageTests/CMain/Simple/setup.cabal.out diff --git a/cabal-testsuite/PackageTests/CMain/setup.out b/cabal-testsuite/PackageTests/CMain/Simple/setup.out similarity index 100% rename from cabal-testsuite/PackageTests/CMain/setup.out rename to cabal-testsuite/PackageTests/CMain/Simple/setup.out diff --git a/cabal-testsuite/PackageTests/CMain/setup.test.hs b/cabal-testsuite/PackageTests/CMain/Simple/setup.test.hs similarity index 100% rename from cabal-testsuite/PackageTests/CMain/setup.test.hs rename to cabal-testsuite/PackageTests/CMain/Simple/setup.test.hs diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Paths/InvalidWin/cabal.test.hs b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Paths/InvalidWin/cabal.test.hs index 2201d7c73dc..12398950ed9 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Paths/InvalidWin/cabal.test.hs +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Paths/InvalidWin/cabal.test.hs @@ -3,11 +3,12 @@ import Test.Cabal.Prelude import System.Directory (createDirectoryIfMissing) -- Invalid Windows filepath. -main = cabalTest $ do - skipIfWindows - cwd <- testCurrentDir <$> getTestEnv - liftIO $ createDirectoryIfMissing False $ cwd "n?ul" - liftIO $ writeFile (cwd "n?ul" "test.a") "" - -- A directory named like `n?ul` on Windows will make external - -- tools like git — and hence the whole testsuite — error. - fails $ cabal "check" [] +main = do + -- A directory named like `n?ul` on Windows will make external + -- tools like git — and hence the whole testsuite — error. + skipIfWindows "uninteresting" + cabalTest $ do + cwd <- testCurrentDir <$> getTestEnv + liftIO $ createDirectoryIfMissing False $ cwd "n?ul" + liftIO $ writeFile (cwd "n?ul" "test.a") "" + fails $ cabal "check" [] diff --git a/cabal-testsuite/PackageTests/Check/GitProtocol/cabal.out b/cabal-testsuite/PackageTests/Check/GitProtocol/cabal.out new file mode 100644 index 00000000000..eb61b32ab3e --- /dev/null +++ b/cabal-testsuite/PackageTests/Check/GitProtocol/cabal.out @@ -0,0 +1,6 @@ +# cabal check +The following errors are likely to affect your build negatively: +Error: [git-protocol] Cloning over git:// might lead to an arbitrary code +execution vulnerability. Furthermore, popular forges like GitHub do not +support it. Use https:// or ssh:// instead. +Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/GitProtocol/cabal.test.hs b/cabal-testsuite/PackageTests/Check/GitProtocol/cabal.test.hs new file mode 100644 index 00000000000..d57f8e16590 --- /dev/null +++ b/cabal-testsuite/PackageTests/Check/GitProtocol/cabal.test.hs @@ -0,0 +1,3 @@ +import Test.Cabal.Prelude + +main = cabalTest $ fails $ cabal "check" [] diff --git a/cabal-testsuite/PackageTests/Check/GitProtocol/pkg.cabal b/cabal-testsuite/PackageTests/Check/GitProtocol/pkg.cabal new file mode 100644 index 00000000000..5622d522ac3 --- /dev/null +++ b/cabal-testsuite/PackageTests/Check/GitProtocol/pkg.cabal @@ -0,0 +1,16 @@ +cabal-version: 3.0 +name: pkg +version: 0 +category: example +maintainer: me@example.com +synopsis: small synopsis +description: longer description +license: GPL-3.0-only + +library + exposed-modules: Foo + default-language: Haskell2010 + +source-repository head + type: git + location: git://www.example.org/my-repo/ diff --git a/cabal-testsuite/PackageTests/CmmSourcesDyn/cabal.test.hs b/cabal-testsuite/PackageTests/CmmSourcesDyn/cabal.test.hs index ee8aa155ac2..0e39257c843 100644 --- a/cabal-testsuite/PackageTests/CmmSourcesDyn/cabal.test.hs +++ b/cabal-testsuite/PackageTests/CmmSourcesDyn/cabal.test.hs @@ -1,7 +1,7 @@ import Test.Cabal.Prelude main = cabalTest $ do - skipIfWindows + skipIfNoSharedLibraries res <- cabal' "v2-run" ["demo"] assertOutputContains "= Post common block elimination =" res assertOutputContains "In Box we have 0x" res diff --git a/cabal-testsuite/PackageTests/CmmSourcesDyn/setup.test.hs b/cabal-testsuite/PackageTests/CmmSourcesDyn/setup.test.hs index 800a540696a..d0d9a11057c 100644 --- a/cabal-testsuite/PackageTests/CmmSourcesDyn/setup.test.hs +++ b/cabal-testsuite/PackageTests/CmmSourcesDyn/setup.test.hs @@ -1,7 +1,7 @@ import Test.Cabal.Prelude main = setupTest $ do - skipIf "ghc < 7.8" =<< isGhcVersion "< 7.8" + skipIfGhcVersion "< 7.8" setup "configure" [] res <- setup' "build" [] assertOutputContains "= Post common block elimination =" res diff --git a/cabal-testsuite/PackageTests/ConditionalAndImport/cabal.test.hs b/cabal-testsuite/PackageTests/ConditionalAndImport/cabal.test.hs index f0ba4299c7a..c1aea47ce85 100644 --- a/cabal-testsuite/PackageTests/ConditionalAndImport/cabal.test.hs +++ b/cabal-testsuite/PackageTests/ConditionalAndImport/cabal.test.hs @@ -1,5 +1,8 @@ import Test.Cabal.Prelude +normalizeWindowsOutput :: String -> String +normalizeWindowsOutput = if isWindows then map (\x -> case x of '/' -> '\\'; _ -> x) else id + main = cabalTest . withRepo "repo" . recordMode RecordMarked $ do let log = recordHeader . pure @@ -76,7 +79,7 @@ main = cabalTest . withRepo "repo" . recordMode RecordMarked $ do -- +-- etc log "checking that cyclical check catches a same file name that imports itself" cyclical4a <- fails $ cabal' "v2-build" [ "--project-file=cyclical-same-filename-out-out-self.project" ] - assertOutputContains "cyclical import of same-filename/cyclical-same-filename-out-out-self.config" cyclical4a + assertOutputContains (normalizeWindowsOutput "cyclical import of same-filename/cyclical-same-filename-out-out-self.config") cyclical4a -- +-- cyclical-same-filename-out-out-backback.project -- +-- cyclical-same-filename-out-out-backback.config @@ -112,31 +115,31 @@ main = cabalTest . withRepo "repo" . recordMode RecordMarked $ do assertOutputContains "- hops-0.project" hopping assertOutputContains - "- hops-2.config \ + (normalizeWindowsOutput "- hops-2.config \ \ imported by: hops/hops-1.config \ - \ imported by: hops-0.project" + \ imported by: hops-0.project") hopping assertOutputContains - "- hops-4.config \ + (normalizeWindowsOutput "- hops-4.config \ \ imported by: hops/hops-3.config \ \ imported by: hops-2.config \ \ imported by: hops/hops-1.config \ - \ imported by: hops-0.project" + \ imported by: hops-0.project") hopping assertOutputContains - "- hops-6.config \ + (normalizeWindowsOutput "- hops-6.config \ \ imported by: hops/hops-5.config \ \ imported by: hops-4.config \ \ imported by: hops/hops-3.config \ \ imported by: hops-2.config \ \ imported by: hops/hops-1.config \ - \ imported by: hops-0.project" + \ imported by: hops-0.project") hopping assertOutputContains - "- hops-8.config \ + (normalizeWindowsOutput "- hops-8.config \ \ imported by: hops/hops-7.config \ \ imported by: hops-6.config \ \ imported by: hops/hops-5.config \ @@ -144,43 +147,43 @@ main = cabalTest . withRepo "repo" . recordMode RecordMarked $ do \ imported by: hops/hops-3.config \ \ imported by: hops-2.config \ \ imported by: hops/hops-1.config \ - \ imported by: hops-0.project" + \ imported by: hops-0.project") hopping assertOutputContains - "- hops/hops-1.config \ - \ imported by: hops-0.project" + (normalizeWindowsOutput "- hops/hops-1.config \ + \ imported by: hops-0.project") hopping assertOutputContains - "- hops/hops-3.config \ + (normalizeWindowsOutput "- hops/hops-3.config \ \ imported by: hops-2.config \ \ imported by: hops/hops-1.config \ - \ imported by: hops-0.project" + \ imported by: hops-0.project") hopping assertOutputContains - "- hops/hops-5.config \ + (normalizeWindowsOutput "- hops/hops-5.config \ \ imported by: hops-4.config \ \ imported by: hops/hops-3.config \ \ imported by: hops-2.config \ \ imported by: hops/hops-1.config \ - \ imported by: hops-0.project" + \ imported by: hops-0.project") hopping assertOutputContains - "- hops/hops-7.config \ + (normalizeWindowsOutput "- hops/hops-7.config \ \ imported by: hops-6.config \ \ imported by: hops/hops-5.config \ \ imported by: hops-4.config \ \ imported by: hops/hops-3.config \ \ imported by: hops-2.config \ \ imported by: hops/hops-1.config \ - \ imported by: hops-0.project" + \ imported by: hops-0.project") hopping assertOutputContains - "- hops/hops-9.config \ + (normalizeWindowsOutput "- hops/hops-9.config \ \ imported by: hops-8.config \ \ imported by: hops/hops-7.config \ \ imported by: hops-6.config \ @@ -189,7 +192,7 @@ main = cabalTest . withRepo "repo" . recordMode RecordMarked $ do \ imported by: hops/hops-3.config \ \ imported by: hops-2.config \ \ imported by: hops/hops-1.config \ - \ imported by: hops-0.project" + \ imported by: hops-0.project") hopping -- The project is named oops as it is like hops but has conflicting constraints. @@ -210,7 +213,7 @@ main = cabalTest . withRepo "repo" . recordMode RecordMarked $ do assertOutputContains "(constraint from oops-0.project requires ==1.4.3.0)" oopsing assertOutputContains - " (constraint from oops/oops-9.config requires ==1.4.2.0) \ + (normalizeWindowsOutput " (constraint from oops/oops-9.config requires ==1.4.2.0) \ \ imported by: oops-8.config \ \ imported by: oops/oops-7.config \ \ imported by: oops-6.config \ @@ -219,7 +222,7 @@ main = cabalTest . withRepo "repo" . recordMode RecordMarked $ do \ imported by: oops/oops-3.config \ \ imported by: oops-2.config \ \ imported by: oops/oops-1.config \ - \ imported by: oops-0.project" + \ imported by: oops-0.project") oopsing log "checking bad conditional" @@ -229,12 +232,12 @@ main = cabalTest . withRepo "repo" . recordMode RecordMarked $ do log "checking that missing package message lists configuration provenance" missing <- fails $ cabal' "v2-build" [ "--project-file=cabal-missing-package.project" ] assertOutputContains - "When using configuration from: \ + (normalizeWindowsOutput "When using configuration from: \ \ - cabal-missing-package.project \ \ - missing/pkgs.config \ \ - missing/pkgs/default.config \ \The following errors occurred: \ - \ - The package location 'pkg-doesnt-exist' does not exist." + \ - The package location 'pkg-doesnt-exist' does not exist.") missing return () diff --git a/cabal-testsuite/PackageTests/Configure/cabal.test.hs b/cabal-testsuite/PackageTests/Configure/cabal.test.hs index afcc00cbf7a..cd419e8cee2 100644 --- a/cabal-testsuite/PackageTests/Configure/cabal.test.hs +++ b/cabal-testsuite/PackageTests/Configure/cabal.test.hs @@ -2,9 +2,26 @@ import Test.Cabal.Prelude import Control.Monad.IO.Class import Data.Maybe import System.Directory +import System.Environment +import Data.List (isSuffixOf) + -- Test for 'build-type: Configure' example from the setup manual. main = cabalTest $ do - hasAutoreconf <- liftIO $ fmap isJust $ findExecutable "autoreconf" - skipUnless "no autoreconf" hasAutoreconf - _ <- shell "autoreconf" ["-i"] - cabal "v2-build" [] + if isWindows + then do + (mCI, mSh) <- liftIO $ (,) <$> lookupEnv "CI" <*> lookupEnv "SHELL" + case (mCI, mSh) of + (Nothing, Nothing) -> skip "Missing $SHELL" + (Nothing, Just sh) -> do + env <- getTestEnv + void $ shell sh [ "-l", "-c", "cd $(cygpath -m '" <> testTmpDir env <> "') && autoreconf -i"] + cabal "v2-build" [] + (Just{}, _) -> do + env <- getTestEnv + void $ shell "C:\\msys64\\usr\\bin\\bash.exe" [ "-l", "-c", "cd $(cygpath -m '" <> testTmpDir env <> "') && autoreconf -i"] + cabal "v2-build" [] + else do + hasAutoreconf <- liftIO $ fmap isJust $ findExecutable "autoreconf" + skipUnless "no autoreconf" hasAutoreconf + _ <- shell "autoreconf" ["-i"] + cabal "v2-build" [] diff --git a/cabal-testsuite/PackageTests/Configure/setup.test.hs b/cabal-testsuite/PackageTests/Configure/setup.test.hs index 559b88c6ff2..5eaea387fe6 100644 --- a/cabal-testsuite/PackageTests/Configure/setup.test.hs +++ b/cabal-testsuite/PackageTests/Configure/setup.test.hs @@ -2,9 +2,25 @@ import Test.Cabal.Prelude import Control.Monad.IO.Class import Data.Maybe import System.Directory +import System.Environment + -- Test for 'build-type: Configure' example from the setup manual. -main = setupTest $ do - hasAutoreconf <- liftIO $ fmap isJust $ findExecutable "autoreconf" - skipUnless "no autoreconf" hasAutoreconf - _ <- shell "autoreconf" ["-i"] - setup_build [] +main = setupTest $ + if isWindows + then do + (mCI, mSh) <- liftIO $ (,) <$> lookupEnv "CI" <*> lookupEnv "SHELL" + case (mCI, mSh) of + (Nothing, Nothing) -> skip "Missing $SHELL" + (Nothing, Just sh) -> do + env <- getTestEnv + void $ shell sh [ "-l", "-c", "cd $(cygpath -m '" <> testTmpDir env <> "') && autoreconf -i"] + setup_build [] + (Just{}, _) -> do + env <- getTestEnv + void $ shell "C:\\msys64\\usr\\bin\\bash.exe" [ "-l", "-c", "cd $(cygpath -m '" <> testTmpDir env <> "') && autoreconf -i"] + setup_build [] + else do + hasAutoreconf <- liftIO $ fmap isJust $ findExecutable "autoreconf" + skipUnless "no autoreconf" hasAutoreconf + _ <- shell "autoreconf" ["-i"] + setup_build [] diff --git a/cabal-testsuite/PackageTests/ConfigureComponent/MissingOrPrivate/Lib.cabal b/cabal-testsuite/PackageTests/ConfigureComponent/MissingOrPrivate/Lib.cabal new file mode 100644 index 00000000000..284513bd8b1 --- /dev/null +++ b/cabal-testsuite/PackageTests/ConfigureComponent/MissingOrPrivate/Lib.cabal @@ -0,0 +1,20 @@ +cabal-version: 3.0 +name: Lib +version: 0.1.0.0 +license: BSD-3-Clause +author: Edward Z. Yang +maintainer: ezyang@cs.stanford.edu +build-type: Simple + +library foo-internal + build-depends: base + exposed-modules: Lib + default-language: Haskell2010 + +executable exe + main-is: Exe.hs + build-depends: base <=1.0, + package-that-does-not-exist, + Lib:{foo-internal, bar-internal}, + hs-source-dirs: exe + default-language: Haskell2010 diff --git a/cabal-testsuite/PackageTests/ConfigureComponent/MissingOrPrivate/Lib.hs b/cabal-testsuite/PackageTests/ConfigureComponent/MissingOrPrivate/Lib.hs new file mode 100644 index 00000000000..1d7d07d5cba --- /dev/null +++ b/cabal-testsuite/PackageTests/ConfigureComponent/MissingOrPrivate/Lib.hs @@ -0,0 +1,2 @@ +module Lib where +lib = "OK" diff --git a/cabal-testsuite/PackageTests/ConfigureComponent/MissingOrPrivate/exe/Exe.hs b/cabal-testsuite/PackageTests/ConfigureComponent/MissingOrPrivate/exe/Exe.hs new file mode 100644 index 00000000000..6ee3fb933aa --- /dev/null +++ b/cabal-testsuite/PackageTests/ConfigureComponent/MissingOrPrivate/exe/Exe.hs @@ -0,0 +1,2 @@ +import Lib +main = putStrLn lib diff --git a/cabal-testsuite/PackageTests/ConfigureComponent/MissingOrPrivate/setup-fail.out b/cabal-testsuite/PackageTests/ConfigureComponent/MissingOrPrivate/setup-fail.out new file mode 100644 index 00000000000..2ea38e253cd --- /dev/null +++ b/cabal-testsuite/PackageTests/ConfigureComponent/MissingOrPrivate/setup-fail.out @@ -0,0 +1,16 @@ +# Setup configure +Configuring library 'foo-internal' for Lib-0.1.0.0... +# Setup build +Preprocessing library 'foo-internal' for Lib-0.1.0.0... +Building library 'foo-internal' for Lib-0.1.0.0... +# Setup copy +Installing internal library foo-internal in +# Setup register +Registering library 'foo-internal' for Lib-0.1.0.0... +# Setup configure +Configuring executable 'exe' for Lib-0.1.0.0... +Error: [Cabal-8010] +Encountered missing or private dependencies: + Lib:{bar-internal,foo-internal} (missing :bar-internal), + base <=1.0 (installed: ), + package-that-does-not-exist (missing) diff --git a/cabal-testsuite/PackageTests/ConfigureComponent/MissingOrPrivate/setup-fail.test.hs b/cabal-testsuite/PackageTests/ConfigureComponent/MissingOrPrivate/setup-fail.test.hs new file mode 100644 index 00000000000..5d8123ee88c --- /dev/null +++ b/cabal-testsuite/PackageTests/ConfigureComponent/MissingOrPrivate/setup-fail.test.hs @@ -0,0 +1,8 @@ + +import Test.Cabal.Prelude +main = setupTest $ do + withPackageDb $ do + base_id <- getIPID "base" + setup_install ["foo-internal", "--cid", "foo-internal-0.1-abc"] + r <- fails $ setup' "configure" [ "exe" ] + assertOutputContains "Lib" r diff --git a/cabal-testsuite/PackageTests/ConfigureComponent/SubLib/setup-explicit-fail.out b/cabal-testsuite/PackageTests/ConfigureComponent/SubLib/setup-explicit-fail.out index fec347864e5..ee7258799b1 100644 --- a/cabal-testsuite/PackageTests/ConfigureComponent/SubLib/setup-explicit-fail.out +++ b/cabal-testsuite/PackageTests/ConfigureComponent/SubLib/setup-explicit-fail.out @@ -11,4 +11,4 @@ Registering library 'sublib' for Lib-0.1.0.0... Configuring executable 'exe' for Lib-0.1.0.0... Error: [Cabal-8010] Encountered missing or private dependencies: - Lib:sublib + Lib:sublib (missing :sublib) diff --git a/cabal-testsuite/PackageTests/CustomDep/cabal.project b/cabal-testsuite/PackageTests/CustomDep/cabal.project deleted file mode 100644 index d4198c181d9..00000000000 --- a/cabal-testsuite/PackageTests/CustomDep/cabal.project +++ /dev/null @@ -1 +0,0 @@ -packages: client custom diff --git a/cabal-testsuite/PackageTests/CustomDep/cabal.test.hs b/cabal-testsuite/PackageTests/CustomDep/cabal.test.hs deleted file mode 100644 index 9058afe19c0..00000000000 --- a/cabal-testsuite/PackageTests/CustomDep/cabal.test.hs +++ /dev/null @@ -1,10 +0,0 @@ -import Test.Cabal.Prelude -main = cabalTest $ do - -- implicit setup-depends conflict with GHC >= 8.2; c.f. #415 - skipUnlessGhcVersion "< 8.2" - -- This test depends heavily on what packages are in the global - -- database, don't record the output - recordMode DoNotRecord $ do - -- TODO: Hack, delete me - withEnvFilter (`notElem` ["HOME", "CABAL_DIR"]) $ do - cabal "v2-build" ["all"] diff --git a/cabal-testsuite/PackageTests/CustomDep/client/B.hs b/cabal-testsuite/PackageTests/CustomDep/client/B.hs deleted file mode 100644 index af119169669..00000000000 --- a/cabal-testsuite/PackageTests/CustomDep/client/B.hs +++ /dev/null @@ -1,2 +0,0 @@ -module B where -import A diff --git a/cabal-testsuite/PackageTests/CustomDep/client/client.cabal b/cabal-testsuite/PackageTests/CustomDep/client/client.cabal deleted file mode 100644 index 2bb74b34594..00000000000 --- a/cabal-testsuite/PackageTests/CustomDep/client/client.cabal +++ /dev/null @@ -1,12 +0,0 @@ -name: client -version: 0.1.0.0 -license: BSD3 -author: Edward Z. Yang -maintainer: ezyang@cs.stanford.edu -build-type: Simple -cabal-version: >=1.10 - -library - exposed-modules: B - build-depends: base, custom - default-language: Haskell2010 diff --git a/cabal-testsuite/PackageTests/CustomDep/custom/A.hs b/cabal-testsuite/PackageTests/CustomDep/custom/A.hs deleted file mode 100644 index d843c00b782..00000000000 --- a/cabal-testsuite/PackageTests/CustomDep/custom/A.hs +++ /dev/null @@ -1 +0,0 @@ -module A where diff --git a/cabal-testsuite/PackageTests/CustomDep/custom/custom.cabal b/cabal-testsuite/PackageTests/CustomDep/custom/custom.cabal deleted file mode 100644 index 4f327080098..00000000000 --- a/cabal-testsuite/PackageTests/CustomDep/custom/custom.cabal +++ /dev/null @@ -1,15 +0,0 @@ -name: custom -version: 0.1.0.0 -license: BSD3 -author: Edward Z. Yang -maintainer: ezyang@cs.stanford.edu -build-type: Custom -cabal-version: >=1.10 - -library - exposed-modules: A - build-depends: base - default-language: Haskell2010 - -custom-setup - setup-depends: base, Cabal diff --git a/cabal-testsuite/PackageTests/CustomPlain/A.hs b/cabal-testsuite/PackageTests/CustomPlain/A.hs deleted file mode 100644 index d843c00b782..00000000000 --- a/cabal-testsuite/PackageTests/CustomPlain/A.hs +++ /dev/null @@ -1 +0,0 @@ -module A where diff --git a/cabal-testsuite/PackageTests/CustomPlain/Setup.hs b/cabal-testsuite/PackageTests/CustomPlain/Setup.hs deleted file mode 100644 index 20b960ede90..00000000000 --- a/cabal-testsuite/PackageTests/CustomPlain/Setup.hs +++ /dev/null @@ -1,3 +0,0 @@ -import Distribution.Simple -import System.IO -main = hPutStrLn stderr "ThisIsCustomYeah" >> defaultMain diff --git a/cabal-testsuite/PackageTests/CustomPlain/cabal.test.hs b/cabal-testsuite/PackageTests/CustomPlain/cabal.test.hs deleted file mode 100644 index 42c64595594..00000000000 --- a/cabal-testsuite/PackageTests/CustomPlain/cabal.test.hs +++ /dev/null @@ -1,11 +0,0 @@ -import Test.Cabal.Prelude -main = cabalTest $ do - -- implicit setup-depends conflict with GHC >= 8.2; c.f. #415 - skipUnlessGhcVersion "< 8.2" - -- Regression test for #4393 - recordMode DoNotRecord $ do - -- TODO: Hack; see also CustomDep/cabal.test.hs - withEnvFilter (`notElem` ["HOME", "CABAL_DIR"]) $ do - -- On -v2, we don't have vQuiet set, which suppressed - -- the error - cabal "v2-build" ["-v1"] diff --git a/cabal-testsuite/PackageTests/CustomPlain/plain.cabal b/cabal-testsuite/PackageTests/CustomPlain/plain.cabal deleted file mode 100644 index d0666a10fd8..00000000000 --- a/cabal-testsuite/PackageTests/CustomPlain/plain.cabal +++ /dev/null @@ -1,11 +0,0 @@ -name: plain -version: 0.1.0.0 -license: BSD3 -author: Edward Z. Yang -maintainer: ezyang@cs.stanford.edu -cabal-version: >=1.10 - -library - exposed-modules: A - build-depends: base - default-language: Haskell2010 diff --git a/cabal-testsuite/PackageTests/CustomPlain/setup.cabal.out b/cabal-testsuite/PackageTests/CustomPlain/setup.cabal.out deleted file mode 100644 index 2d3ff0f9451..00000000000 --- a/cabal-testsuite/PackageTests/CustomPlain/setup.cabal.out +++ /dev/null @@ -1,7 +0,0 @@ -# Setup configure -Resolving dependencies... -Configuring plain-0.1.0.0... -Warning: No 'build-type' specified. If you do not need a custom Setup.hs or ./configure script then use 'build-type: Simple'. -# Setup build -Preprocessing library for plain-0.1.0.0... -Building library for plain-0.1.0.0... diff --git a/cabal-testsuite/PackageTests/CustomPlain/setup.out b/cabal-testsuite/PackageTests/CustomPlain/setup.out deleted file mode 100644 index 3fdfe2b7f77..00000000000 --- a/cabal-testsuite/PackageTests/CustomPlain/setup.out +++ /dev/null @@ -1,6 +0,0 @@ -# Setup configure -Configuring plain-0.1.0.0... -Warning: [no-build-type] No 'build-type' specified. If you do not need a custom Setup.hs or ./configure script then use 'build-type: Simple'. -# Setup build -Preprocessing library for plain-0.1.0.0... -Building library for plain-0.1.0.0... diff --git a/cabal-testsuite/PackageTests/CustomPlain/setup.test.hs b/cabal-testsuite/PackageTests/CustomPlain/setup.test.hs deleted file mode 100644 index abf668397b8..00000000000 --- a/cabal-testsuite/PackageTests/CustomPlain/setup.test.hs +++ /dev/null @@ -1,4 +0,0 @@ -import Test.Cabal.Prelude -main = setupTest $ do - setup' "configure" [] >>= assertOutputContains "ThisIsCustomYeah" - setup' "build" [] >>= assertOutputContains "ThisIsCustomYeah" diff --git a/cabal-testsuite/PackageTests/CustomPreProcess/Setup.hs b/cabal-testsuite/PackageTests/CustomPreProcess/Setup.hs index b315119728b..769f1309339 100644 --- a/cabal-testsuite/PackageTests/CustomPreProcess/Setup.hs +++ b/cabal-testsuite/PackageTests/CustomPreProcess/Setup.hs @@ -15,7 +15,7 @@ import Distribution.Simple import Distribution.Simple.LocalBuildInfo import Distribution.Simple.PreProcess import Distribution.Simple.Utils -#if MIN_VERSION_Cabal(3,11,0) +#if MIN_VERSION_Cabal(3,13,0) import Distribution.Utils.Path (getSymbolicPath) #endif @@ -47,7 +47,7 @@ main = defaultMainWithHooks } where builddir = -#if MIN_VERSION_Cabal(3,11,0) +#if MIN_VERSION_Cabal(3,13,0) getSymbolicPath $ #endif buildDir lbi diff --git a/cabal-testsuite/PackageTests/CustomSegfault/cabal.test.hs b/cabal-testsuite/PackageTests/CustomSegfault/cabal.test.hs index a6c74dab745..b543cc5de45 100644 --- a/cabal-testsuite/PackageTests/CustomSegfault/cabal.test.hs +++ b/cabal-testsuite/PackageTests/CustomSegfault/cabal.test.hs @@ -1,6 +1,5 @@ import Test.Cabal.Prelude main = cabalTest $ do - -- TODO: this test ought to work on Windows too - skipUnless "not Linux" =<< isLinux + skipUnless "depends on `unix` and needs Linux" isLinux skipUnlessGhcVersion ">= 7.8" fails $ cabal' "v2-build" [] >>= assertOutputContains "SIGSEGV" diff --git a/cabal-testsuite/PackageTests/ExternalCommandExitCode/cabal.out b/cabal-testsuite/PackageTests/ExternalCommandExitCode/cabal.out new file mode 100644 index 00000000000..1c4c24db55c --- /dev/null +++ b/cabal-testsuite/PackageTests/ExternalCommandExitCode/cabal.out @@ -0,0 +1,8 @@ +# cabal v2-build +Resolving dependencies... +Build profile: -w ghc- -O1 +In order, the following will be built: + - setup-test-0.1.0.0 (exe:cabal-aaaa) (first run) +Configuring executable 'cabal-aaaa' for setup-test-0.1.0.0... +Preprocessing executable 'cabal-aaaa' for setup-test-0.1.0.0... +Building executable 'cabal-aaaa' for setup-test-0.1.0.0... diff --git a/cabal-testsuite/PackageTests/ExternalCommandExitCode/cabal.project b/cabal-testsuite/PackageTests/ExternalCommandExitCode/cabal.project new file mode 100644 index 00000000000..1a33bb5a25e --- /dev/null +++ b/cabal-testsuite/PackageTests/ExternalCommandExitCode/cabal.project @@ -0,0 +1 @@ +packages: setup-test/ diff --git a/cabal-testsuite/PackageTests/ExternalCommandExitCode/cabal.test.hs b/cabal-testsuite/PackageTests/ExternalCommandExitCode/cabal.test.hs new file mode 100644 index 00000000000..7fc79d75815 --- /dev/null +++ b/cabal-testsuite/PackageTests/ExternalCommandExitCode/cabal.test.hs @@ -0,0 +1,38 @@ +import Test.Cabal.Prelude +import qualified System.Process as Process +import Control.Concurrent (threadDelay) +import System.Directory (removeFile) +import Control.Exception (catch, throwIO) +import System.IO.Error (isDoesNotExistError) +import qualified Data.Time.Clock as Time +import qualified Data.Time.Format as Time +import Data.Maybe +import System.Environment +import System.FilePath +import System.Exit + +main = do + cabalTest $ do + res <- cabalWithStdin "v2-build" ["all"] "" + exe_path <- withPlan $ planExePath "setup-test" "cabal-aaaa" + addToPath (takeDirectory exe_path) $ do + -- Test that the thing works at all + res <- fails $ cabal_raw_action ["aaaa"] (\h -> () <$ Process.waitForProcess h) + assertOutputContains "aaaa" res + -- Check the exit code is the one returned by subcommand + unless (resultExitCode res == ExitFailure 99) (assertFailure $ "Incorrect exit code: " ++ show (resultExitCode res)) + + +cabal_raw_action :: [String] -> (Process.ProcessHandle -> IO ()) -> TestM Result +cabal_raw_action args action = do + configured_prog <- requireProgramM cabalProgram + env <- getTestEnv + r <- liftIO $ runAction (testVerbosity env) + (Just $ testCurrentDir env) + (testEnvironment env) + (programPath configured_prog) + args + Nothing + action + recordLog r + requireSuccess r diff --git a/cabal-testsuite/PackageTests/ExternalCommandExitCode/setup-test/AAAA.hs b/cabal-testsuite/PackageTests/ExternalCommandExitCode/setup-test/AAAA.hs new file mode 100644 index 00000000000..b9d4e99c553 --- /dev/null +++ b/cabal-testsuite/PackageTests/ExternalCommandExitCode/setup-test/AAAA.hs @@ -0,0 +1,8 @@ +module Main where + +import System.Environment +import System.Exit + +main = do + getArgs >>= print + exitWith (ExitFailure 99) diff --git a/cabal-testsuite/PackageTests/ExternalCommandExitCode/setup-test/CHANGELOG.md b/cabal-testsuite/PackageTests/ExternalCommandExitCode/setup-test/CHANGELOG.md new file mode 100644 index 00000000000..7ae8ff6113d --- /dev/null +++ b/cabal-testsuite/PackageTests/ExternalCommandExitCode/setup-test/CHANGELOG.md @@ -0,0 +1,5 @@ +# Revision history for setup-test + +## 0.1.0.0 -- YYYY-mm-dd + +* First version. Released on an unsuspecting world. diff --git a/cabal-testsuite/PackageTests/ExternalCommandExitCode/setup-test/LICENSE b/cabal-testsuite/PackageTests/ExternalCommandExitCode/setup-test/LICENSE new file mode 100644 index 00000000000..cd8ad2ac8ae --- /dev/null +++ b/cabal-testsuite/PackageTests/ExternalCommandExitCode/setup-test/LICENSE @@ -0,0 +1,30 @@ +Copyright (c) 2023, Matthew Pickering + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + * Neither the name of Matthew Pickering nor the names of other + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/cabal-testsuite/PackageTests/ExternalCommandExitCode/setup-test/setup-test.cabal b/cabal-testsuite/PackageTests/ExternalCommandExitCode/setup-test/setup-test.cabal new file mode 100644 index 00000000000..8deb0577a16 --- /dev/null +++ b/cabal-testsuite/PackageTests/ExternalCommandExitCode/setup-test/setup-test.cabal @@ -0,0 +1,25 @@ +cabal-version: 3.0 +name: setup-test +version: 0.1.0.0 +-- synopsis: +-- description: +license: BSD-3-Clause +license-file: LICENSE +author: Matthew Pickering +maintainer: matthewtpickering@gmail.com +-- copyright: +build-type: Simple +extra-doc-files: CHANGELOG.md +-- extra-source-files: + +common warnings + ghc-options: -Wall + +executable cabal-aaaa + import: warnings + main-is: AAAA.hs + -- other-modules: + -- other-extensions: + build-depends: base + hs-source-dirs: . + default-language: Haskell2010 diff --git a/cabal-testsuite/PackageTests/ExtraProgPath/setup.out b/cabal-testsuite/PackageTests/ExtraProgPath/setup.out index 1011c8899ed..01fc2e5cfc0 100644 --- a/cabal-testsuite/PackageTests/ExtraProgPath/setup.out +++ b/cabal-testsuite/PackageTests/ExtraProgPath/setup.out @@ -1,12 +1,10 @@ # cabal v2-build Warning: cannot determine version of /pkg-config : "" -Warning: cannot determine version of /pkg-config : -"" Resolving dependencies... Error: [Cabal-7107] Could not resolve dependencies: [__0] next goal: CheckExtraProgPath (user goal) -[__0] rejecting: CheckExtraProgPath-0.1 (conflict: pkg-config package zlib-any, not found in the pkg-config database) +[__0] rejecting: CheckExtraProgPath-0.1 (pkg-config package zlib-any is needed but no pkg-config executable was found or querying it failed) [__0] fail (backjumping, conflict set: CheckExtraProgPath) After searching the rest of the dependency tree exhaustively, these were the goals I've had most trouble fulfilling: CheckExtraProgPath (2) diff --git a/cabal-testsuite/PackageTests/ExtraProgPath/setup.test.hs b/cabal-testsuite/PackageTests/ExtraProgPath/setup.test.hs index 80ee56f6287..ecc6696c1f2 100644 --- a/cabal-testsuite/PackageTests/ExtraProgPath/setup.test.hs +++ b/cabal-testsuite/PackageTests/ExtraProgPath/setup.test.hs @@ -1,8 +1,8 @@ import Test.Cabal.Prelude -- Test that extra-prog-path overrides the path for pkg-config -main = cabalTest $ do - -- skipped on windows because using a script to dummy up an executable doesn't work the same. - skipIfWindows - cdir <- testCurrentDir `fmap` getTestEnv - fails $ cabal "v2-build" ["--extra-prog-path="++cdir] +main = do + skipIfWindows "useless test (CI has no pkg-config already)" + cabalTest $ do + cdir <- testCurrentDir `fmap` getTestEnv + fails $ cabal "v2-build" ["--extra-prog-path="++cdir] diff --git a/cabal-testsuite/PackageTests/ForeignLibs/MyForeignLib.def b/cabal-testsuite/PackageTests/ForeignLibs/MyForeignLib.def new file mode 100644 index 00000000000..b9438c8d6a0 --- /dev/null +++ b/cabal-testsuite/PackageTests/ForeignLibs/MyForeignLib.def @@ -0,0 +1,4 @@ +EXPORTS + sayHi + myForeignLibExit + myForeignLibInit diff --git a/cabal-testsuite/PackageTests/ForeignLibs/my-foreign-lib.cabal b/cabal-testsuite/PackageTests/ForeignLibs/my-foreign-lib.cabal index 8b63dc24e9e..43a5a655567 100644 --- a/cabal-testsuite/PackageTests/ForeignLibs/my-foreign-lib.cabal +++ b/cabal-testsuite/PackageTests/ForeignLibs/my-foreign-lib.cabal @@ -16,7 +16,8 @@ foreign-library myforeignlib type: native-shared if os(windows) - options: standalone + options: standalone + mod-def-file: MyForeignLib.def other-modules: MyForeignLib.Hello MyForeignLib.SomeBindings diff --git a/cabal-testsuite/PackageTests/ForeignLibs/setup.test.hs b/cabal-testsuite/PackageTests/ForeignLibs/setup.test.hs index 1dcf918eaed..07a01cd0323 100644 --- a/cabal-testsuite/PackageTests/ForeignLibs/setup.test.hs +++ b/cabal-testsuite/PackageTests/ForeignLibs/setup.test.hs @@ -27,10 +27,8 @@ import Test.Cabal.Prelude main = setupAndCabalTest . recordMode DoNotRecord $ do -- Foreign libraries don't work with GHC 7.6 and earlier skipUnlessGhcVersion ">= 7.8" - win <- isWindows ghc94 <- isGhcVersion ">= 9.4.1" - expectBrokenIf (win && ghc94) 8451 $ - withPackageDb $ do + withPackageDb $ do setup_install [] setup "copy" [] -- regression test #4156 dist_dir <- fmap testDistDir getTestEnv diff --git a/cabal-testsuite/PackageTests/GHCJS/BuildRunner/cabal.test.hs b/cabal-testsuite/PackageTests/GHCJS/BuildRunner/cabal.test.hs index fd7328da0c2..da8afae103e 100644 --- a/cabal-testsuite/PackageTests/GHCJS/BuildRunner/cabal.test.hs +++ b/cabal-testsuite/PackageTests/GHCJS/BuildRunner/cabal.test.hs @@ -1,7 +1,7 @@ import Test.Cabal.Prelude -main = cabalTest . recordMode DoNotRecord $ do - skipIfWindows -- disabled because (I presume) Windows doesn't have BASH +main = do + cabalTest . recordMode DoNotRecord $ do cwd <- fmap testCurrentDir getTestEnv testInvokedWithBuildRunner cwd "test" [] testInvokedWithBuildRunner cwd "run" ["ghcjs-exe"] @@ -14,6 +14,8 @@ testInvokedWithBuildRunner cwd cabalCmd extraArgs = do [ "--ghcjs" , "--with-compiler", cwd fakeGhcjsPath ] + -- On windows point cabal to the right cc + ++ if isWindows then ["--with-gcc", "scripts/cc.bat"] else [] assertOutputContains magicString output where - fakeGhcjsPath = "scripts/fake-ghcjs.sh" + fakeGhcjsPath = if isWindows then "scripts/fake-ghcjs.exe" else "scripts/fake-ghcjs.sh" diff --git a/cabal-testsuite/PackageTests/GHCJS/BuildRunner/scripts/cc.bat b/cabal-testsuite/PackageTests/GHCJS/BuildRunner/scripts/cc.bat new file mode 100644 index 00000000000..b2300d2fd6b --- /dev/null +++ b/cabal-testsuite/PackageTests/GHCJS/BuildRunner/scripts/cc.bat @@ -0,0 +1,45 @@ +@ECHO off + +FOR /f "delims=" %%A in ('call ghc.exe --print-libdir') do set "libdir=%%A" +FOR /f "delims=" %%A in ('call ghc.exe --numeric-version') do set "numVersion=%%A" +setlocal EnableDelayedExpansion + +call :compareVersions 9.4.1 %numVersion% +if %errorlevel% == 1 (set "cc=gcc.exe") else (set "cc=clang.exe") +CALL !libdir:lib=mingw\bin\!%cc% %* +EXIT /B %ERRORLEVEL% + +REM taken from https://stackoverflow.com/questions/15807762/compare-version-numbers-in-batch-file + +:compareVersions version1 version2 +:: +:: Compares two version numbers and returns the result in the ERRORLEVEL +:: +:: Returns 1 if version1 > version2 +:: 0 if version1 = version2 +:: -1 if version1 < version2 +:: +:: The nodes must be delimited by . or , or - +:: +:: Nodes are normally strictly numeric, without a 0 prefix. A letter suffix +:: is treated as a separate node +:: +setlocal enableDelayedExpansion +set "v1=%~1" +set "v2=%~2" +:loop +call :parseNode "%v1%" n1 v1 +call :parseNode "%v2%" n2 v2 +if %n1% gtr %n2% exit /b 1 +if %n1% lss %n2% exit /b -1 +if not defined v1 if not defined v2 exit /b 0 +if not defined v1 exit /b -1 +if not defined v2 exit /b 1 +goto :loop + + +:parseNode version nodeVar remainderVar +for /f "tokens=1* delims=." %%A in ("%~1") do ( + set "%~2=%%A" + set "%~3=%%B" +) diff --git a/cabal-testsuite/PackageTests/GHCJS/BuildRunner/scripts/fake-ghcjs.exe b/cabal-testsuite/PackageTests/GHCJS/BuildRunner/scripts/fake-ghcjs.exe new file mode 100644 index 00000000000..537023174dc Binary files /dev/null and b/cabal-testsuite/PackageTests/GHCJS/BuildRunner/scripts/fake-ghcjs.exe differ diff --git a/cabal-testsuite/PackageTests/GHCJS/BuildRunner/scripts/fake-ghcjs.shim b/cabal-testsuite/PackageTests/GHCJS/BuildRunner/scripts/fake-ghcjs.shim new file mode 100644 index 00000000000..725429e82d7 --- /dev/null +++ b/cabal-testsuite/PackageTests/GHCJS/BuildRunner/scripts/fake-ghcjs.shim @@ -0,0 +1,2 @@ +path = "sh.exe" +args = "scripts/fake-ghcjs.sh" diff --git a/cabal-testsuite/PackageTests/GHCJS/BuildRunner/scripts/ghcjs-pkg.exe b/cabal-testsuite/PackageTests/GHCJS/BuildRunner/scripts/ghcjs-pkg.exe new file mode 100644 index 00000000000..537023174dc Binary files /dev/null and b/cabal-testsuite/PackageTests/GHCJS/BuildRunner/scripts/ghcjs-pkg.exe differ diff --git a/cabal-testsuite/PackageTests/GHCJS/BuildRunner/scripts/ghcjs-pkg.shim b/cabal-testsuite/PackageTests/GHCJS/BuildRunner/scripts/ghcjs-pkg.shim new file mode 100644 index 00000000000..d330fc23e3e --- /dev/null +++ b/cabal-testsuite/PackageTests/GHCJS/BuildRunner/scripts/ghcjs-pkg.shim @@ -0,0 +1,2 @@ +path = "sh.exe" +args = "scripts/ghcjs-pkg" diff --git a/cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectory/ghc-pkg.exe b/cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectory/ghc-pkg.exe new file mode 100644 index 00000000000..537023174dc Binary files /dev/null and b/cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectory/ghc-pkg.exe differ diff --git a/cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectory/ghc-pkg.shim b/cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectory/ghc-pkg.shim new file mode 100644 index 00000000000..0ec39dd3f09 --- /dev/null +++ b/cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectory/ghc-pkg.shim @@ -0,0 +1,2 @@ +path = "FINDSH\sh.exe" +args = "ghc-pkg" diff --git a/cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectory/ghc.exe b/cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectory/ghc.exe new file mode 100644 index 00000000000..537023174dc Binary files /dev/null and b/cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectory/ghc.exe differ diff --git a/cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectory/ghc.shim b/cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectory/ghc.shim new file mode 100644 index 00000000000..97596f1c171 --- /dev/null +++ b/cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectory/ghc.shim @@ -0,0 +1,2 @@ +path = "FINDSH\sh.exe" +args = "ghc" diff --git a/cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectory/setup.test.hs b/cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectory/setup.test.hs index 85b30b87523..805f56abc9c 100644 --- a/cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectory/setup.test.hs +++ b/cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectory/setup.test.hs @@ -1,10 +1,19 @@ import Test.Cabal.Prelude --- TODO: Enable this test on Windows +import System.Directory + main = setupAndCabalTest $ do - skipIfWindows - env <- getTestEnv - let cwd = testCurrentDir env - ghc_path <- programPathM ghcProgram - r <- withEnv [("WITH_GHC", Just ghc_path)] - . fails $ setup' "configure" ["-w", cwd "ghc"] - assertOutputContains "is version 9999999" r + when isWindows $ do + sh <- fmap takeDirectory <$> liftIO (findExecutable "sh") + case sh of + Nothing -> skip "no sh" + Just sh' -> do + let sh'' = concatMap (\c -> case c of + '\\' -> "\\\\\\\\" + x -> [x]) sh' + void $ shell "sed" [ "-i", "-e", "s/FINDSH/" <> sh'' <> "/g", "ghc.shim", "ghc-pkg.shim"] + env <- getTestEnv + let cwd = testCurrentDir env + ghc_path <- programPathM ghcProgram + r <- withEnv [("WITH_GHC", Just ghc_path)] + . fails $ setup' "configure" ["-w", cwd if isWindows then "ghc.exe" else "ghc" ] + assertOutputContains "is version 9999999" r diff --git a/cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectoryGhcVersion/ghc-7.10.exe b/cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectoryGhcVersion/ghc-7.10.exe new file mode 100644 index 00000000000..537023174dc Binary files /dev/null and b/cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectoryGhcVersion/ghc-7.10.exe differ diff --git a/cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectoryGhcVersion/ghc-7.10.shim b/cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectoryGhcVersion/ghc-7.10.shim new file mode 100644 index 00000000000..16ae1ddead3 --- /dev/null +++ b/cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectoryGhcVersion/ghc-7.10.shim @@ -0,0 +1,2 @@ +path = "FINDSH\sh.exe" +args = "ghc-7.10" diff --git a/cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectoryGhcVersion/ghc-pkg-ghc-7.10.exe b/cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectoryGhcVersion/ghc-pkg-ghc-7.10.exe new file mode 100644 index 00000000000..537023174dc Binary files /dev/null and b/cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectoryGhcVersion/ghc-pkg-ghc-7.10.exe differ diff --git a/cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectoryGhcVersion/ghc-pkg-ghc-7.10.shim b/cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectoryGhcVersion/ghc-pkg-ghc-7.10.shim new file mode 100644 index 00000000000..9e85ac7f0fb --- /dev/null +++ b/cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectoryGhcVersion/ghc-pkg-ghc-7.10.shim @@ -0,0 +1,2 @@ +path = "FINDSH\sh.exe" +args = "ghc-pkg-ghc-7.10" diff --git a/cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectoryGhcVersion/setup.test.hs b/cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectoryGhcVersion/setup.test.hs index 746c8015fca..e60d3685863 100644 --- a/cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectoryGhcVersion/setup.test.hs +++ b/cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectoryGhcVersion/setup.test.hs @@ -1,10 +1,19 @@ import Test.Cabal.Prelude --- TODO: Enable this test on Windows +import System.Directory + main = setupAndCabalTest $ do - skipIfWindows - env <- getTestEnv - let cwd = testCurrentDir env - ghc_path <- programPathM ghcProgram - r <- withEnv [("WITH_GHC", Just ghc_path)] - . fails $ setup' "configure" ["-w", cwd "ghc-7.10"] - assertOutputContains "is version 9999999" r + when isWindows $ do + sh <- fmap takeDirectory <$> liftIO (findExecutable "sh") + case sh of + Nothing -> skip "no sh" + Just sh' -> do + let sh'' = concatMap (\c -> case c of + '\\' -> "\\\\\\\\" + x -> [x]) sh' + void $ shell "sed" [ "-i", "-e", "s/FINDSH/" <> sh'' <> "/g", "ghc-7.10.shim", "ghc-pkg-ghc-7.10.shim"] + env <- getTestEnv + let cwd = testCurrentDir env + ghc_path <- programPathM ghcProgram + r <- withEnv [("WITH_GHC", Just ghc_path)] + . fails $ setup' "configure" ["-w", cwd if isWindows then "ghc-7.10.exe" else "ghc-7.10"] + assertOutputContains "is version 9999999" r diff --git a/cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectoryVersion/ghc-7.10.exe b/cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectoryVersion/ghc-7.10.exe new file mode 100644 index 00000000000..537023174dc Binary files /dev/null and b/cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectoryVersion/ghc-7.10.exe differ diff --git a/cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectoryVersion/ghc-7.10.shim b/cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectoryVersion/ghc-7.10.shim new file mode 100644 index 00000000000..16ae1ddead3 --- /dev/null +++ b/cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectoryVersion/ghc-7.10.shim @@ -0,0 +1,2 @@ +path = "FINDSH\sh.exe" +args = "ghc-7.10" diff --git a/cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectoryVersion/ghc-pkg-7.10.exe b/cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectoryVersion/ghc-pkg-7.10.exe new file mode 100644 index 00000000000..537023174dc Binary files /dev/null and b/cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectoryVersion/ghc-pkg-7.10.exe differ diff --git a/cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectoryVersion/ghc-pkg-7.10.shim b/cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectoryVersion/ghc-pkg-7.10.shim new file mode 100644 index 00000000000..8558f8a0513 --- /dev/null +++ b/cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectoryVersion/ghc-pkg-7.10.shim @@ -0,0 +1,2 @@ +path = "FINDSH\sh.exe" +args = "ghc-pkg-7.10" diff --git a/cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectoryVersion/setup.test.hs b/cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectoryVersion/setup.test.hs index 746c8015fca..b5f6b4c88d6 100644 --- a/cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectoryVersion/setup.test.hs +++ b/cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectoryVersion/setup.test.hs @@ -1,10 +1,19 @@ import Test.Cabal.Prelude --- TODO: Enable this test on Windows +import System.Directory + main = setupAndCabalTest $ do - skipIfWindows - env <- getTestEnv - let cwd = testCurrentDir env - ghc_path <- programPathM ghcProgram - r <- withEnv [("WITH_GHC", Just ghc_path)] - . fails $ setup' "configure" ["-w", cwd "ghc-7.10"] - assertOutputContains "is version 9999999" r + when isWindows $ do + sh <- fmap takeDirectory <$> liftIO (findExecutable "sh") + case sh of + Nothing -> skip "no sh" + Just sh' -> do + let sh'' = concatMap (\c -> case c of + '\\' -> "\\\\\\\\" + x -> [x]) sh' + void $ shell "sed" [ "-i", "-e", "s/FINDSH/" <> sh'' <> "/g", "ghc-7.10.shim", "ghc-pkg-7.10.shim"] + env <- getTestEnv + let cwd = testCurrentDir env + ghc_path <- programPathM ghcProgram + r <- withEnv [("WITH_GHC", Just ghc_path)] + . fails $ setup' "configure" ["-w", cwd if isWindows then "ghc-7.10.exe" else "ghc-7.10"] + assertOutputContains "is version 9999999" r diff --git a/cabal-testsuite/PackageTests/GhcPkgGuess/Symlink/bin/ghc-pkg.exe b/cabal-testsuite/PackageTests/GhcPkgGuess/Symlink/bin/ghc-pkg.exe new file mode 100644 index 00000000000..537023174dc Binary files /dev/null and b/cabal-testsuite/PackageTests/GhcPkgGuess/Symlink/bin/ghc-pkg.exe differ diff --git a/cabal-testsuite/PackageTests/GhcPkgGuess/Symlink/bin/ghc-pkg.shim b/cabal-testsuite/PackageTests/GhcPkgGuess/Symlink/bin/ghc-pkg.shim new file mode 100644 index 00000000000..1c68332a0a6 --- /dev/null +++ b/cabal-testsuite/PackageTests/GhcPkgGuess/Symlink/bin/ghc-pkg.shim @@ -0,0 +1,2 @@ +path = "FINDSH\sh.exe" +args = "bin\ghc-pkg" diff --git a/cabal-testsuite/PackageTests/GhcPkgGuess/Symlink/bin/ghc.exe b/cabal-testsuite/PackageTests/GhcPkgGuess/Symlink/bin/ghc.exe new file mode 100644 index 00000000000..537023174dc Binary files /dev/null and b/cabal-testsuite/PackageTests/GhcPkgGuess/Symlink/bin/ghc.exe differ diff --git a/cabal-testsuite/PackageTests/GhcPkgGuess/Symlink/bin/ghc.shim b/cabal-testsuite/PackageTests/GhcPkgGuess/Symlink/bin/ghc.shim new file mode 100644 index 00000000000..97596f1c171 --- /dev/null +++ b/cabal-testsuite/PackageTests/GhcPkgGuess/Symlink/bin/ghc.shim @@ -0,0 +1,2 @@ +path = "FINDSH\sh.exe" +args = "ghc" diff --git a/cabal-testsuite/PackageTests/GhcPkgGuess/Symlink/setup.test.hs b/cabal-testsuite/PackageTests/GhcPkgGuess/Symlink/setup.test.hs index eab35100802..b188acc36d6 100644 --- a/cabal-testsuite/PackageTests/GhcPkgGuess/Symlink/setup.test.hs +++ b/cabal-testsuite/PackageTests/GhcPkgGuess/Symlink/setup.test.hs @@ -1,11 +1,22 @@ import Test.Cabal.Prelude --- TODO: Enable this test on Windows +import System.Directory + main = setupAndCabalTest $ do - skipIfWindows - withSymlink "bin/ghc" "ghc" $ do + when isWindows $ do + sh <- fmap takeDirectory <$> liftIO (findExecutable "sh") + case sh of + Nothing -> skip "no sh" + Just sh' -> do + let sh'' = concatMap (\c -> case c of + '\\' -> "\\\\\\\\" + x -> [x]) sh' + void $ shell "sed" [ "-i", "-e", "s/FINDSH/" <> sh'' <> "/g", "bin/ghc.shim", "bin/ghc-pkg.shim"] + (if isWindows + then withSymlink "bin/ghc.exe" "ghc.exe" . withSymlink "bin/ghc.shim" "ghc.shim" . withSymlink "bin/ghc" "ghc" + else withSymlink "bin/ghc" "ghc") $ do env <- getTestEnv let cwd = testCurrentDir env ghc_path <- programPathM ghcProgram r <- withEnv [("WITH_GHC", Just ghc_path)] - . fails $ setup' "configure" ["-w", cwd "ghc"] + . fails $ setup' "configure" ["-w", cwd if isWindows then "ghc.exe" else "ghc"] assertOutputContains "is version 9999999" r diff --git a/cabal-testsuite/PackageTests/GhcPkgGuess/SymlinkGhcVersion/bin/ghc-7.10.exe b/cabal-testsuite/PackageTests/GhcPkgGuess/SymlinkGhcVersion/bin/ghc-7.10.exe new file mode 100644 index 00000000000..537023174dc Binary files /dev/null and b/cabal-testsuite/PackageTests/GhcPkgGuess/SymlinkGhcVersion/bin/ghc-7.10.exe differ diff --git a/cabal-testsuite/PackageTests/GhcPkgGuess/SymlinkGhcVersion/bin/ghc-7.10.shim b/cabal-testsuite/PackageTests/GhcPkgGuess/SymlinkGhcVersion/bin/ghc-7.10.shim new file mode 100644 index 00000000000..97596f1c171 --- /dev/null +++ b/cabal-testsuite/PackageTests/GhcPkgGuess/SymlinkGhcVersion/bin/ghc-7.10.shim @@ -0,0 +1,2 @@ +path = "FINDSH\sh.exe" +args = "ghc" diff --git a/cabal-testsuite/PackageTests/GhcPkgGuess/SymlinkGhcVersion/bin/ghc-pkg-7.10.exe b/cabal-testsuite/PackageTests/GhcPkgGuess/SymlinkGhcVersion/bin/ghc-pkg-7.10.exe new file mode 100644 index 00000000000..537023174dc Binary files /dev/null and b/cabal-testsuite/PackageTests/GhcPkgGuess/SymlinkGhcVersion/bin/ghc-pkg-7.10.exe differ diff --git a/cabal-testsuite/PackageTests/GhcPkgGuess/SymlinkGhcVersion/bin/ghc-pkg-7.10.shim b/cabal-testsuite/PackageTests/GhcPkgGuess/SymlinkGhcVersion/bin/ghc-pkg-7.10.shim new file mode 100644 index 00000000000..5c1d58caf88 --- /dev/null +++ b/cabal-testsuite/PackageTests/GhcPkgGuess/SymlinkGhcVersion/bin/ghc-pkg-7.10.shim @@ -0,0 +1,2 @@ +path = "FINDSH\sh.exe" +args = "bin\ghc-pkg-7.10" diff --git a/cabal-testsuite/PackageTests/GhcPkgGuess/SymlinkGhcVersion/setup.test.hs b/cabal-testsuite/PackageTests/GhcPkgGuess/SymlinkGhcVersion/setup.test.hs index eb95044b941..bf9b16fa195 100644 --- a/cabal-testsuite/PackageTests/GhcPkgGuess/SymlinkGhcVersion/setup.test.hs +++ b/cabal-testsuite/PackageTests/GhcPkgGuess/SymlinkGhcVersion/setup.test.hs @@ -1,11 +1,22 @@ import Test.Cabal.Prelude --- TODO: Enable this test on Windows +import System.Directory + main = setupAndCabalTest $ do - skipIfWindows - withSymlink "bin/ghc-7.10" "ghc" $ do + when isWindows $ do + sh <- fmap takeDirectory <$> liftIO (findExecutable "sh") + case sh of + Nothing -> skip "no sh" + Just sh' -> do + let sh'' = concatMap (\c -> case c of + '\\' -> "\\\\\\\\" + x -> [x]) sh' + void $ shell "sed" [ "-i", "-e", "s/FINDSH/" <> sh'' <> "/g", "bin/ghc-7.10.shim", "bin/ghc-pkg-7.10.shim"] + (if isWindows + then withSymlink "bin/ghc-7.10.exe" "ghc.exe" . withSymlink "bin/ghc-7.10.shim" "ghc.shim" . withSymlink "bin/ghc-7.10" "ghc" + else withSymlink "bin/ghc-7.10" "ghc") $ do env <- getTestEnv let cwd = testCurrentDir env ghc_path <- programPathM ghcProgram r <- withEnv [("WITH_GHC", Just ghc_path)] - . fails $ setup' "configure" ["-w", cwd "ghc"] + . fails $ setup' "configure" ["-w", cwd if isWindows then "ghc.exe" else "ghc"] assertOutputContains "is version 9999999" r diff --git a/cabal-testsuite/PackageTests/GhcPkgGuess/SymlinkVersion/bin/ghc-7.10.exe b/cabal-testsuite/PackageTests/GhcPkgGuess/SymlinkVersion/bin/ghc-7.10.exe new file mode 100644 index 00000000000..537023174dc Binary files /dev/null and b/cabal-testsuite/PackageTests/GhcPkgGuess/SymlinkVersion/bin/ghc-7.10.exe differ diff --git a/cabal-testsuite/PackageTests/GhcPkgGuess/SymlinkVersion/bin/ghc-7.10.shim b/cabal-testsuite/PackageTests/GhcPkgGuess/SymlinkVersion/bin/ghc-7.10.shim new file mode 100644 index 00000000000..97596f1c171 --- /dev/null +++ b/cabal-testsuite/PackageTests/GhcPkgGuess/SymlinkVersion/bin/ghc-7.10.shim @@ -0,0 +1,2 @@ +path = "FINDSH\sh.exe" +args = "ghc" diff --git a/cabal-testsuite/PackageTests/GhcPkgGuess/SymlinkVersion/bin/ghc-pkg-ghc-7.10.exe b/cabal-testsuite/PackageTests/GhcPkgGuess/SymlinkVersion/bin/ghc-pkg-ghc-7.10.exe new file mode 100644 index 00000000000..537023174dc Binary files /dev/null and b/cabal-testsuite/PackageTests/GhcPkgGuess/SymlinkVersion/bin/ghc-pkg-ghc-7.10.exe differ diff --git a/cabal-testsuite/PackageTests/GhcPkgGuess/SymlinkVersion/bin/ghc-pkg-ghc-7.10.shim b/cabal-testsuite/PackageTests/GhcPkgGuess/SymlinkVersion/bin/ghc-pkg-ghc-7.10.shim new file mode 100644 index 00000000000..7e9ba24d98b --- /dev/null +++ b/cabal-testsuite/PackageTests/GhcPkgGuess/SymlinkVersion/bin/ghc-pkg-ghc-7.10.shim @@ -0,0 +1,2 @@ +path = "FINDSH\sh.exe" +args = "bin\ghc-pkg-ghc-7.10" diff --git a/cabal-testsuite/PackageTests/GhcPkgGuess/SymlinkVersion/setup.test.hs b/cabal-testsuite/PackageTests/GhcPkgGuess/SymlinkVersion/setup.test.hs index eb95044b941..2f406ce6226 100644 --- a/cabal-testsuite/PackageTests/GhcPkgGuess/SymlinkVersion/setup.test.hs +++ b/cabal-testsuite/PackageTests/GhcPkgGuess/SymlinkVersion/setup.test.hs @@ -1,11 +1,22 @@ import Test.Cabal.Prelude --- TODO: Enable this test on Windows +import System.Directory + main = setupAndCabalTest $ do - skipIfWindows - withSymlink "bin/ghc-7.10" "ghc" $ do + when isWindows $ do + sh <- fmap takeDirectory <$> liftIO (findExecutable "sh") + case sh of + Nothing -> skip "no sh" + Just sh' -> do + let sh'' = concatMap (\c -> case c of + '\\' -> "\\\\\\\\" + x -> [x]) sh' + void $ shell "sed" [ "-i", "-e", "s/FINDSH/" <> sh'' <> "/g", "bin/ghc-7.10.shim", "bin/ghc-pkg-ghc-7.10.shim"] + (if isWindows + then withSymlink "bin/ghc-7.10.exe" "ghc.exe" . withSymlink "bin/ghc-7.10.shim" "ghc.shim" . withSymlink "bin/ghc-7.10" "ghc" + else withSymlink "bin/ghc-7.10" "ghc") $ do env <- getTestEnv let cwd = testCurrentDir env ghc_path <- programPathM ghcProgram r <- withEnv [("WITH_GHC", Just ghc_path)] - . fails $ setup' "configure" ["-w", cwd "ghc"] + . fails $ setup' "configure" ["-w", cwd if isWindows then "ghc.exe" else "ghc"] assertOutputContains "is version 9999999" r diff --git a/cabal-testsuite/PackageTests/Haddock/setup.cabal.out b/cabal-testsuite/PackageTests/Haddock/setup.cabal.out index a13ae638ac4..a55ef1a732a 100644 --- a/cabal-testsuite/PackageTests/Haddock/setup.cabal.out +++ b/cabal-testsuite/PackageTests/Haddock/setup.cabal.out @@ -3,4 +3,4 @@ Configuring Haddock-0.1... # Setup haddock Preprocessing library for Haddock-0.1... Running Haddock on library for Haddock-0.1... -Documentation created: setup.cabal.dist/work/dist/doc/html/Haddock/ +Documentation created: setup.cabal.dist/work/dist/doc/html/Haddock diff --git a/cabal-testsuite/PackageTests/Haddock/setup.out b/cabal-testsuite/PackageTests/Haddock/setup.out index a16722bc65c..550d84c45ae 100644 --- a/cabal-testsuite/PackageTests/Haddock/setup.out +++ b/cabal-testsuite/PackageTests/Haddock/setup.out @@ -3,4 +3,4 @@ Configuring Haddock-0.1... # Setup haddock Preprocessing library for Haddock-0.1... Running Haddock on library for Haddock-0.1... -Documentation created: setup.dist/work/dist/doc/html/Haddock/ +Documentation created: setup.dist/work/dist/doc/html/Haddock diff --git a/cabal-testsuite/PackageTests/HaddockArgs/quickjump.out b/cabal-testsuite/PackageTests/HaddockArgs/quickjump.out index f81b0b94852..c892ec8e80a 100644 --- a/cabal-testsuite/PackageTests/HaddockArgs/quickjump.out +++ b/cabal-testsuite/PackageTests/HaddockArgs/quickjump.out @@ -14,7 +14,7 @@ for sigs-0.1.0.0... Preprocessing library for sigs-0.1.0.0... Running Haddock on library instantiated with Data.Map = for sigs-0.1.0.0... -Documentation created: /quickjump.dist/work/./dist//sigs-0.1.0.0/dist/doc/html/sigs/ +Documentation created: /quickjump.dist/work/./dist//sigs-0.1.0.0/dist/doc/html/sigs Installing library in Configuring library for indef-0.1.0.0... Preprocessing library for indef-0.1.0.0... @@ -23,7 +23,7 @@ for indef-0.1.0.0... Preprocessing library for indef-0.1.0.0... Running Haddock on library instantiated with Data.Map = for indef-0.1.0.0... -Documentation created: /quickjump.dist/work/./dist//indef-0.1.0.0/dist/doc/html/indef/ +Documentation created: /quickjump.dist/work/./dist//indef-0.1.0.0/dist/doc/html/indef Installing library in Configuring library for example-1.0... Preprocessing library for example-1.0... @@ -32,4 +32,4 @@ for example-1.0... Preprocessing library for example-1.0... Running Haddock on library instantiated with Data.Map = for example-1.0... -Documentation created: /quickjump.dist/work/dist/build//ghc-/example-1.0/doc/html/example/ +Documentation created: /quickjump.dist/work/dist/build//ghc-/example-1.0/doc/html/example diff --git a/cabal-testsuite/PackageTests/HaddockBuildDepends/cabal.out b/cabal-testsuite/PackageTests/HaddockBuildDepends/cabal.out index 64f999e4368..8eff18e3d6c 100644 --- a/cabal-testsuite/PackageTests/HaddockBuildDepends/cabal.out +++ b/cabal-testsuite/PackageTests/HaddockBuildDepends/cabal.out @@ -17,11 +17,11 @@ Preprocessing library for lib-1... Building library for lib-1... Preprocessing library for lib-1... Running Haddock on library for lib-1... -Documentation created: /cabal.dist/work/./dist//lib-1/dist/doc/html/lib/ +Documentation created: /cabal.dist/work/./dist//lib-1/dist/doc/html/lib Installing library in Configuring library for a-0.1.0.0... Preprocessing library for a-0.1.0.0... Building library for a-0.1.0.0... Preprocessing library for a-0.1.0.0... Running Haddock on library for a-0.1.0.0... -Documentation created: /cabal.dist/work/dist/build//ghc-/a-0.1.0.0/doc/html/a/ +Documentation created: /cabal.dist/work/dist/build//ghc-/a-0.1.0.0/doc/html/a diff --git a/cabal-testsuite/PackageTests/NewBuild/T4375/Setup.hs b/cabal-testsuite/PackageTests/HaddockKeepTmpsCustom/Setup.hs similarity index 97% rename from cabal-testsuite/PackageTests/NewBuild/T4375/Setup.hs rename to cabal-testsuite/PackageTests/HaddockKeepTmpsCustom/Setup.hs index 9a994af677b..e8ef27dbba9 100644 --- a/cabal-testsuite/PackageTests/NewBuild/T4375/Setup.hs +++ b/cabal-testsuite/PackageTests/HaddockKeepTmpsCustom/Setup.hs @@ -1,2 +1,3 @@ import Distribution.Simple + main = defaultMain diff --git a/cabal-testsuite/PackageTests/HaddockKeepTmpsCustom/Simple.hs b/cabal-testsuite/PackageTests/HaddockKeepTmpsCustom/Simple.hs new file mode 100644 index 00000000000..df38c448c5e --- /dev/null +++ b/cabal-testsuite/PackageTests/HaddockKeepTmpsCustom/Simple.hs @@ -0,0 +1,4 @@ +module Simple where + +-- | For hiding needles. +data Haystack = Haystack diff --git a/cabal-testsuite/PackageTests/HaddockKeepTmpsCustom/cabal.project b/cabal-testsuite/PackageTests/HaddockKeepTmpsCustom/cabal.project new file mode 100644 index 00000000000..f45d5a19d3c --- /dev/null +++ b/cabal-testsuite/PackageTests/HaddockKeepTmpsCustom/cabal.project @@ -0,0 +1,3 @@ +packages: . + +haddock-keep-temp-files: true diff --git a/cabal-testsuite/PackageTests/HaddockKeepTmpsCustom/cabal.test.hs b/cabal-testsuite/PackageTests/HaddockKeepTmpsCustom/cabal.test.hs new file mode 100644 index 00000000000..e2d819e44d6 --- /dev/null +++ b/cabal-testsuite/PackageTests/HaddockKeepTmpsCustom/cabal.test.hs @@ -0,0 +1,22 @@ +import Test.Cabal.Prelude + +-- Test that "cabal haddock" preserves temporary files +-- We use haddock-keep-temp-file: True in the cabal.project. +main = cabalTest $ recordMode DoNotRecord $ withProjectFile "cabal.project" $ do + cabal "haddock" [] + + -- From the docs for `System.IO.openTempFile`: + -- + -- On Windows, the template prefix may be truncated to 3 chars, e.g. + -- "foobar.ext" will be "fooXXX.ext". + let glob = + if isWindows + then "had*.txt" + else "haddock-response*.txt" + + -- Check that there is a response file. + responseFiles <- assertGlobMatchesTestDir testTmpDir glob + + -- Check that the matched response file is not empty, and is indeed a Haddock + -- response file. + assertAnyFileContains responseFiles "--package-name" diff --git a/cabal-testsuite/PackageTests/HaddockKeepTmpsCustom/my.cabal b/cabal-testsuite/PackageTests/HaddockKeepTmpsCustom/my.cabal new file mode 100644 index 00000000000..a4a24980c12 --- /dev/null +++ b/cabal-testsuite/PackageTests/HaddockKeepTmpsCustom/my.cabal @@ -0,0 +1,16 @@ +cabal-version: 3.0 +name: HaddockKeepsTmpsCustom +version: 0.1 +license: BSD-3-Clause +author: Rodrigo Mesquita +stability: stable +category: PackageTests +build-type: Custom + +custom-setup + setup-depends: Cabal, base + +library + default-language: Haskell2010 + exposed-modules: Simple + build-depends: base diff --git a/cabal-testsuite/PackageTests/HaddockKeepsTmps/cabal.test.hs b/cabal-testsuite/PackageTests/HaddockKeepsTmps/cabal.test.hs index 9a3dfe1777b..3a76caadf6c 100644 --- a/cabal-testsuite/PackageTests/HaddockKeepsTmps/cabal.test.hs +++ b/cabal-testsuite/PackageTests/HaddockKeepsTmps/cabal.test.hs @@ -1,20 +1,29 @@ -{-# LANGUAGE LambdaCase #-} -import Test.Cabal.Prelude -import Distribution.Verbosity +import Data.List (isPrefixOf, sort) import Distribution.Simple.Glob import Distribution.Simple.Glob.Internal +import Distribution.Simple.Utils +import Distribution.Verbosity +import System.Directory +import Test.Cabal.Prelude -- Test that "cabal haddock" preserves temporary files -- We use haddock-keep-temp-file: True in the cabal.project. -main = cabalTest $ recordMode DoNotRecord $ do - skipIfWindows +main = + cabalTest $ recordMode DoNotRecord $ withProjectFile "cabal.project" $ do + cabal "haddock" [] - cabal "haddock" [] + -- From the docs for `System.IO.openTempFile`: + -- + -- On Windows, the template prefix may be truncated to 3 chars, e.g. + -- "foobar.ext" will be "fooXXX.ext". + let glob = + if isWindows + then "had*.txt" + else "haddock-response*.txt" - cwd <- fmap testCurrentDir getTestEnv + -- Check that there is a response file. + responseFiles <- assertGlobMatchesTestDir testTmpDir glob - (globMatches <$> liftIO (runDirFileGlob silent Nothing cwd (GlobDirRecursive [WildCard, Literal "response", WildCard, Literal "txt"]))) >>= \case - [] -> error "Expecting a response file to exist" - (m:_) -> - -- Assert the matched response file is not empty. - assertFileDoesContain (cwd m) "Simple.hs" + -- Check that the matched response file is not empty, and is indeed a Haddock + -- response file. + assertAnyFileContains responseFiles "--package-name" diff --git a/cabal-testsuite/PackageTests/HaddockNewline/setup.cabal.out b/cabal-testsuite/PackageTests/HaddockNewline/setup.cabal.out index 7db9a69eefe..57539271f24 100644 --- a/cabal-testsuite/PackageTests/HaddockNewline/setup.cabal.out +++ b/cabal-testsuite/PackageTests/HaddockNewline/setup.cabal.out @@ -3,4 +3,4 @@ Configuring HaddockNewline-0.1.0.0... # Setup haddock Preprocessing library for HaddockNewline-0.1.0.0... Running Haddock on library for HaddockNewline-0.1.0.0... -Documentation created: setup.cabal.dist/work/dist/doc/html/HaddockNewline/ +Documentation created: setup.cabal.dist/work/dist/doc/html/HaddockNewline diff --git a/cabal-testsuite/PackageTests/HaddockNewline/setup.out b/cabal-testsuite/PackageTests/HaddockNewline/setup.out index 57908512556..f18bb263e04 100644 --- a/cabal-testsuite/PackageTests/HaddockNewline/setup.out +++ b/cabal-testsuite/PackageTests/HaddockNewline/setup.out @@ -3,4 +3,4 @@ Configuring HaddockNewline-0.1.0.0... # Setup haddock Preprocessing library for HaddockNewline-0.1.0.0... Running Haddock on library for HaddockNewline-0.1.0.0... -Documentation created: setup.dist/work/dist/doc/html/HaddockNewline/ +Documentation created: setup.dist/work/dist/doc/html/HaddockNewline diff --git a/cabal-testsuite/PackageTests/HaddockProject/haddock-project.out b/cabal-testsuite/PackageTests/HaddockProject/haddock-project.out index 50ede874c75..bfa16bf91c5 100644 --- a/cabal-testsuite/PackageTests/HaddockProject/haddock-project.out +++ b/cabal-testsuite/PackageTests/HaddockProject/haddock-project.out @@ -4,10 +4,6 @@ Downloading the latest package list from test-local-repo Warning: haddock-project command is experimental, it might break in the future Resolving dependencies... Build profile: -w ghc- -O1 -In order, the following will be built: - - async-2.2.4 (lib) (requires build) - - a-0.1.0.0 (lib) (first run) -Build profile: -w ghc- -O1 In order, the following will be built: - async-2.2.4 (lib) (requires build) - a-0.1.0.0 (lib) (configuration changed) @@ -16,10 +12,10 @@ Preprocessing library for async-2.2.4... Building library for async-2.2.4... Preprocessing library for async-2.2.4... Running Haddock on library for async-2.2.4... -Documentation created: /dist-newstyle//async-2.2.4/dist/doc/html/async/ +Documentation created: /dist-newstyle//async-2.2.4/dist/doc/html/async Installing library in Configuring library for a-0.1.0.0... Preprocessing library for a-0.1.0.0... Running Haddock on library for a-0.1.0.0... -Documentation created: /dist-newstyle/build//ghc-/a-0.1.0.0/doc/html/a/ +Documentation created: /dist-newstyle/build//ghc-/a-0.1.0.0/doc/html/a Documentation created: haddocks/index.html diff --git a/cabal-testsuite/PackageTests/IgnoreBuildTools/Hello.hs b/cabal-testsuite/PackageTests/IgnoreBuildTools/Hello.hs new file mode 100644 index 00000000000..4c2772407db --- /dev/null +++ b/cabal-testsuite/PackageTests/IgnoreBuildTools/Hello.hs @@ -0,0 +1,7 @@ +module Main where + +a :: String +a = "0000" + +main :: IO () +main = putStrLn a diff --git a/cabal-testsuite/PackageTests/IgnoreBuildTools/client.cabal b/cabal-testsuite/PackageTests/IgnoreBuildTools/client.cabal new file mode 100644 index 00000000000..fc69b378236 --- /dev/null +++ b/cabal-testsuite/PackageTests/IgnoreBuildTools/client.cabal @@ -0,0 +1,13 @@ +cabal-version: 3.0 +name: client +version: 0.1.0.0 +license: MIT +category: Testing +build-type: Simple + +executable hello-world + main-is: Hello.hs + build-depends: base + build-tool-depends: pre-proc:zero-to-one, another:non-existent + -- build-tools: somethingnonexists + default-language: Haskell2010 diff --git a/cabal-testsuite/PackageTests/IgnoreBuildTools/setup.out b/cabal-testsuite/PackageTests/IgnoreBuildTools/setup.out new file mode 100644 index 00000000000..de3c1b9d6bc --- /dev/null +++ b/cabal-testsuite/PackageTests/IgnoreBuildTools/setup.out @@ -0,0 +1,5 @@ +# Setup configure +Configuring client-0.1.0.0... +# Setup build +Preprocessing executable 'hello-world' for client-0.1.0.0... +Building executable 'hello-world' for client-0.1.0.0... diff --git a/cabal-testsuite/PackageTests/IgnoreBuildTools/setup.test.hs b/cabal-testsuite/PackageTests/IgnoreBuildTools/setup.test.hs new file mode 100644 index 00000000000..0a0297ad454 --- /dev/null +++ b/cabal-testsuite/PackageTests/IgnoreBuildTools/setup.test.hs @@ -0,0 +1,5 @@ +import Test.Cabal.Prelude +-- Test --ignore-build-tools ignores build-tools and build-tool-depends +main = setupTest $ do + setup "configure" ["--ignore-build-tools"] + setup "build" [] diff --git a/cabal-testsuite/PackageTests/Install/DistPrefInstall/CHANGELOG.md b/cabal-testsuite/PackageTests/Install/DistPrefInstall/CHANGELOG.md new file mode 100644 index 00000000000..3d5552b0ba5 --- /dev/null +++ b/cabal-testsuite/PackageTests/Install/DistPrefInstall/CHANGELOG.md @@ -0,0 +1,5 @@ +# Revision history for DistPrefInstall + +## 0.1.0.0 -- YYYY-mm-dd + +* First version. Released on an unsuspecting world. diff --git a/cabal-testsuite/PackageTests/Install/DistPrefInstall/DistPrefInstall.cabal b/cabal-testsuite/PackageTests/Install/DistPrefInstall/DistPrefInstall.cabal new file mode 100644 index 00000000000..536d26b3648 --- /dev/null +++ b/cabal-testsuite/PackageTests/Install/DistPrefInstall/DistPrefInstall.cabal @@ -0,0 +1,18 @@ +cabal-version: 3.12 +name: DistPrefInstall +version: 0.1.0.0 +license: NONE +author: Matthew Pickering +maintainer: matthewtpickering@gmail.com +build-type: Simple +extra-doc-files: CHANGELOG.md + +common warnings + ghc-options: -Wall + +library + import: warnings + exposed-modules: MyLib + build-depends: base + hs-source-dirs: src + default-language: Haskell2010 diff --git a/cabal-testsuite/PackageTests/CustomDep/custom/Setup.hs b/cabal-testsuite/PackageTests/Install/DistPrefInstall/Setup.hs similarity index 100% rename from cabal-testsuite/PackageTests/CustomDep/custom/Setup.hs rename to cabal-testsuite/PackageTests/Install/DistPrefInstall/Setup.hs diff --git a/cabal-testsuite/PackageTests/Install/DistPrefInstall/setup.test.hs b/cabal-testsuite/PackageTests/Install/DistPrefInstall/setup.test.hs new file mode 100644 index 00000000000..27b709e7070 --- /dev/null +++ b/cabal-testsuite/PackageTests/Install/DistPrefInstall/setup.test.hs @@ -0,0 +1,8 @@ +import Test.Cabal.Prelude + +main = setupTest $ recordMode DoNotRecord $ withPackageDb $ do + setup "configure" [] + setup "build" [] + setup "copy" [] + setup "install" [] + setup "sdist" [] diff --git a/cabal-testsuite/PackageTests/Install/DistPrefInstall/src/MyLib.hs b/cabal-testsuite/PackageTests/Install/DistPrefInstall/src/MyLib.hs new file mode 100644 index 00000000000..e657c4403f6 --- /dev/null +++ b/cabal-testsuite/PackageTests/Install/DistPrefInstall/src/MyLib.hs @@ -0,0 +1,4 @@ +module MyLib (someFunc) where + +someFunc :: IO () +someFunc = putStrLn "someFunc" diff --git a/cabal-testsuite/PackageTests/InternalLibraries/Executable/setup-static.test.hs b/cabal-testsuite/PackageTests/InternalLibraries/Executable/setup-static.test.hs index e84be709823..1c12fd03a7a 100644 --- a/cabal-testsuite/PackageTests/InternalLibraries/Executable/setup-static.test.hs +++ b/cabal-testsuite/PackageTests/InternalLibraries/Executable/setup-static.test.hs @@ -24,7 +24,7 @@ import System.Directory -- this does build shared libraries just to make sure they -- don't get installed, so this test doesn't work on Windows.) main = setupAndCabalTest $ do - skipUnless "no shared libs" =<< hasSharedLibraries + skipIfNoSharedLibraries withPackageDb $ do -- MULTI forM_ [False, True] $ \is_dynamic -> do diff --git a/cabal-testsuite/PackageTests/InternalLibraries/Haddock/haddock.cabal.out b/cabal-testsuite/PackageTests/InternalLibraries/Haddock/haddock.cabal.out index bdc57a81bfd..dbd8c26e948 100644 --- a/cabal-testsuite/PackageTests/InternalLibraries/Haddock/haddock.cabal.out +++ b/cabal-testsuite/PackageTests/InternalLibraries/Haddock/haddock.cabal.out @@ -18,10 +18,10 @@ Registering library 'foo-internal-after' for foo-0.1.0.0... # Setup haddock Preprocessing library 'foo-internal-before' for foo-0.1.0.0... Running Haddock on library 'foo-internal-before' for foo-0.1.0.0... -Documentation created: haddock.cabal.dist/work/dist/doc/html/foo/ +Documentation created: haddock.cabal.dist/work/dist/doc/html/foo/foo-internal-before Preprocessing library for foo-0.1.0.0... Running Haddock on library for foo-0.1.0.0... -Documentation created: haddock.cabal.dist/work/dist/doc/html/foo/ +Documentation created: haddock.cabal.dist/work/dist/doc/html/foo Preprocessing library 'foo-internal-after' for foo-0.1.0.0... Running Haddock on library 'foo-internal-after' for foo-0.1.0.0... -Documentation created: haddock.cabal.dist/work/dist/doc/html/foo/ +Documentation created: haddock.cabal.dist/work/dist/doc/html/foo/foo-internal-after diff --git a/cabal-testsuite/PackageTests/InternalLibraries/Haddock/haddock.out b/cabal-testsuite/PackageTests/InternalLibraries/Haddock/haddock.out index 44ee7824244..6259fcfeb0c 100644 --- a/cabal-testsuite/PackageTests/InternalLibraries/Haddock/haddock.out +++ b/cabal-testsuite/PackageTests/InternalLibraries/Haddock/haddock.out @@ -18,10 +18,10 @@ Registering library 'foo-internal-after' for foo-0.1.0.0... # Setup haddock Preprocessing library 'foo-internal-before' for foo-0.1.0.0... Running Haddock on library 'foo-internal-before' for foo-0.1.0.0... -Documentation created: haddock.dist/work/dist/doc/html/foo/ +Documentation created: haddock.dist/work/dist/doc/html/foo/foo-internal-before Preprocessing library for foo-0.1.0.0... Running Haddock on library for foo-0.1.0.0... -Documentation created: haddock.dist/work/dist/doc/html/foo/ +Documentation created: haddock.dist/work/dist/doc/html/foo Preprocessing library 'foo-internal-after' for foo-0.1.0.0... Running Haddock on library 'foo-internal-after' for foo-0.1.0.0... -Documentation created: haddock.dist/work/dist/doc/html/foo/ +Documentation created: haddock.dist/work/dist/doc/html/foo/foo-internal-after diff --git a/cabal-testsuite/PackageTests/InternalLibraries/setup-gen-script.test.hs b/cabal-testsuite/PackageTests/InternalLibraries/setup-gen-script.test.hs index 644d437b8ab..ada96fc159a 100644 --- a/cabal-testsuite/PackageTests/InternalLibraries/setup-gen-script.test.hs +++ b/cabal-testsuite/PackageTests/InternalLibraries/setup-gen-script.test.hs @@ -1,13 +1,12 @@ import Test.Cabal.Prelude -- Test to see if --gen-script main = setupAndCabalTest $ do - is_windows <- isWindows withPackageDb $ do withDirectory "p" $ do setup_build [] setup "copy" [] setup "register" ["--gen-script"] - _ <- if is_windows + _ <- if isWindows then shell "cmd" ["/C", "register.bat"] else shell "sh" ["register.sh"] return () diff --git a/cabal-testsuite/PackageTests/InternalVersions/BuildDependsExtra/Foo.hs b/cabal-testsuite/PackageTests/InternalVersions/BuildDependsExtra/Foo.hs deleted file mode 100644 index efbf93bbde8..00000000000 --- a/cabal-testsuite/PackageTests/InternalVersions/BuildDependsExtra/Foo.hs +++ /dev/null @@ -1 +0,0 @@ -module Foo where diff --git a/cabal-testsuite/PackageTests/InternalVersions/BuildDependsExtra/build-depends-extra-version.cabal b/cabal-testsuite/PackageTests/InternalVersions/BuildDependsExtra/build-depends-extra-version.cabal deleted file mode 100644 index 01c7b3b5972..00000000000 --- a/cabal-testsuite/PackageTests/InternalVersions/BuildDependsExtra/build-depends-extra-version.cabal +++ /dev/null @@ -1,17 +0,0 @@ -name: build-depends-extra-version -version: 0.1.0.0 -synopsis: Checks build-depends warns for extraneous version -license: BSD3 -category: Testing -build-type: Simple -cabal-version: >=1.10 - -library - exposed-modules: Foo - default-language: Haskell2010 - -executable bar - main-is: Main.hs - build-depends: build-depends-extra-version >=0.0.0.1 - -- ^ internal dependency, extraneous version - default-language: Haskell2010 diff --git a/cabal-testsuite/PackageTests/InternalVersions/BuildDependsExtra/setup.cabal.out b/cabal-testsuite/PackageTests/InternalVersions/BuildDependsExtra/setup.cabal.out deleted file mode 100644 index 61f9d97a4ba..00000000000 --- a/cabal-testsuite/PackageTests/InternalVersions/BuildDependsExtra/setup.cabal.out +++ /dev/null @@ -1,13 +0,0 @@ -# Setup configure -Configuring build-depends-extra-version-0.1.0.0... -Warning: The package has an extraneous version range for a dependency on an internal library: build-depends-extra-version >=0.0.0.1. This version range includes the current package but isn't needed as the current package's library will always be used. -# Setup sdist -Distribution quality errors: -The package has an extraneous version range for a dependency on an internal library: build-depends-extra-version >=0.0.0.1. This version range includes the current package but isn't needed as the current package's library will always be used. -Distribution quality warnings: -No 'maintainer' field. -No 'description' field. -A 'license-file' is not specified. -Note: the public hackage server would reject this package. -Building source dist for build-depends-extra-version-0.1.0.0... -Source tarball created: setup.cabal.dist/work/dist/build-depends-extra-version-0.1.0.0.tar.gz diff --git a/cabal-testsuite/PackageTests/InternalVersions/BuildDependsExtra/setup.out b/cabal-testsuite/PackageTests/InternalVersions/BuildDependsExtra/setup.out deleted file mode 100644 index 2b9987c8544..00000000000 --- a/cabal-testsuite/PackageTests/InternalVersions/BuildDependsExtra/setup.out +++ /dev/null @@ -1,13 +0,0 @@ -# Setup configure -Configuring build-depends-extra-version-0.1.0.0... -Warning: The package has an extraneous version range for a dependency on an internal library: build-depends-extra-version >=0.0.0.1. This version range includes the current package but isn't needed as the current package's library will always be used. -# Setup sdist -Distribution quality errors: -The package has an extraneous version range for a dependency on an internal library: build-depends-extra-version >=0.0.0.1. This version range includes the current package but isn't needed as the current package's library will always be used. -Distribution quality warnings: -No 'maintainer' field. -No 'description' field. -A 'license-file' is not specified. -Note: the public hackage server would reject this package. -Building source dist for build-depends-extra-version-0.1.0.0... -Source tarball created: setup.dist/work/dist/build-depends-extra-version-0.1.0.0.tar.gz diff --git a/cabal-testsuite/PackageTests/InternalVersions/BuildDependsExtra/setup.test.hs b/cabal-testsuite/PackageTests/InternalVersions/BuildDependsExtra/setup.test.hs deleted file mode 100644 index c006efe6f72..00000000000 --- a/cabal-testsuite/PackageTests/InternalVersions/BuildDependsExtra/setup.test.hs +++ /dev/null @@ -1,6 +0,0 @@ -import Test.Cabal.Prelude --- Test unneed version bound on internal build-tools deps -main = setupAndCabalTest . expectBroken 7470 $ do - setup' "configure" [] - assertOutputContains "extraneous version range" - =<< setup' "sdist" [] diff --git a/cabal-testsuite/PackageTests/InternalVersions/BuildToolDependsExtra/Foo.hs b/cabal-testsuite/PackageTests/InternalVersions/BuildToolDependsExtra/Foo.hs deleted file mode 100644 index efbf93bbde8..00000000000 --- a/cabal-testsuite/PackageTests/InternalVersions/BuildToolDependsExtra/Foo.hs +++ /dev/null @@ -1 +0,0 @@ -module Foo where diff --git a/cabal-testsuite/PackageTests/InternalVersions/BuildToolDependsExtra/build-tool-depends-extra-version.cabal b/cabal-testsuite/PackageTests/InternalVersions/BuildToolDependsExtra/build-tool-depends-extra-version.cabal deleted file mode 100644 index af43e0cdd02..00000000000 --- a/cabal-testsuite/PackageTests/InternalVersions/BuildToolDependsExtra/build-tool-depends-extra-version.cabal +++ /dev/null @@ -1,18 +0,0 @@ -name: build-tool-depends-extra-version -version: 0.1.0.0 -synopsis: Checks build-tool-depends warns for extraneous version -license: BSD3 -category: Testing -build-type: Simple -cabal-version: >=1.10 - -library - exposed-modules: Foo - build-tool-depends: build-tool-depends-extra-version:hello-world >=0.0.0.1 - -- ^ internal dependency, extraneous version - default-language: Haskell2010 - -executable hello-world - main-is: Main.hs - build-depends: base - default-language: Haskell2010 diff --git a/cabal-testsuite/PackageTests/InternalVersions/BuildToolDependsExtra/setup.cabal.out b/cabal-testsuite/PackageTests/InternalVersions/BuildToolDependsExtra/setup.cabal.out deleted file mode 100644 index c247d90f995..00000000000 --- a/cabal-testsuite/PackageTests/InternalVersions/BuildToolDependsExtra/setup.cabal.out +++ /dev/null @@ -1,13 +0,0 @@ -# Setup configure -Configuring build-tool-depends-extra-version-0.1.0.0... -Warning: The package has an extraneous version range for a dependency on an internal executable: build-tool-depends-extra-version:hello-world >=0.0.0.1. This version range includes the current package but isn't needed as the current package's executable will always be used. -# Setup sdist -Distribution quality errors: -The package has an extraneous version range for a dependency on an internal executable: build-tool-depends-extra-version:hello-world >=0.0.0.1. This version range includes the current package but isn't needed as the current package's executable will always be used. -Distribution quality warnings: -No 'maintainer' field. -No 'description' field. -A 'license-file' is not specified. -Note: the public hackage server would reject this package. -Building source dist for build-tool-depends-extra-version-0.1.0.0... -Source tarball created: setup.cabal.dist/work/dist/build-tool-depends-extra-version-0.1.0.0.tar.gz diff --git a/cabal-testsuite/PackageTests/InternalVersions/BuildToolDependsExtra/setup.out b/cabal-testsuite/PackageTests/InternalVersions/BuildToolDependsExtra/setup.out deleted file mode 100644 index cd0ba1f5e0a..00000000000 --- a/cabal-testsuite/PackageTests/InternalVersions/BuildToolDependsExtra/setup.out +++ /dev/null @@ -1,13 +0,0 @@ -# Setup configure -Configuring build-tool-depends-extra-version-0.1.0.0... -Warning: The package has an extraneous version range for a dependency on an internal executable: build-tool-depends-extra-version:hello-world >=0.0.0.1. This version range includes the current package but isn't needed as the current package's executable will always be used. -# Setup sdist -Distribution quality errors: -The package has an extraneous version range for a dependency on an internal executable: build-tool-depends-extra-version:hello-world >=0.0.0.1. This version range includes the current package but isn't needed as the current package's executable will always be used. -Distribution quality warnings: -No 'maintainer' field. -No 'description' field. -A 'license-file' is not specified. -Note: the public hackage server would reject this package. -Building source dist for build-tool-depends-extra-version-0.1.0.0... -Source tarball created: setup.dist/work/dist/build-tool-depends-extra-version-0.1.0.0.tar.gz diff --git a/cabal-testsuite/PackageTests/InternalVersions/BuildToolDependsExtra/setup.test.hs b/cabal-testsuite/PackageTests/InternalVersions/BuildToolDependsExtra/setup.test.hs deleted file mode 100644 index c006efe6f72..00000000000 --- a/cabal-testsuite/PackageTests/InternalVersions/BuildToolDependsExtra/setup.test.hs +++ /dev/null @@ -1,6 +0,0 @@ -import Test.Cabal.Prelude --- Test unneed version bound on internal build-tools deps -main = setupAndCabalTest . expectBroken 7470 $ do - setup' "configure" [] - assertOutputContains "extraneous version range" - =<< setup' "sdist" [] diff --git a/cabal-testsuite/PackageTests/InternalVersions/BuildToolsExtra/Foo.hs b/cabal-testsuite/PackageTests/InternalVersions/BuildToolsExtra/Foo.hs deleted file mode 100644 index efbf93bbde8..00000000000 --- a/cabal-testsuite/PackageTests/InternalVersions/BuildToolsExtra/Foo.hs +++ /dev/null @@ -1 +0,0 @@ -module Foo where diff --git a/cabal-testsuite/PackageTests/InternalVersions/BuildToolsExtra/Main.hs b/cabal-testsuite/PackageTests/InternalVersions/BuildToolsExtra/Main.hs deleted file mode 100644 index d82a4bd93b7..00000000000 --- a/cabal-testsuite/PackageTests/InternalVersions/BuildToolsExtra/Main.hs +++ /dev/null @@ -1,4 +0,0 @@ -module Main where - -main :: IO () -main = return () diff --git a/cabal-testsuite/PackageTests/InternalVersions/BuildToolsExtra/build-tools-extra-version.cabal b/cabal-testsuite/PackageTests/InternalVersions/BuildToolsExtra/build-tools-extra-version.cabal deleted file mode 100644 index c5371bf45ee..00000000000 --- a/cabal-testsuite/PackageTests/InternalVersions/BuildToolsExtra/build-tools-extra-version.cabal +++ /dev/null @@ -1,18 +0,0 @@ -name: build-tools-extra-version -version: 0.1.0.0 -synopsis: Checks build-tools warns for extraneous version -license: BSD3 -category: Testing -build-type: Simple -cabal-version: >=1.10 - -library - exposed-modules: Foo - build-tools: hello-world >=0.0.0.1 - -- ^ internal dependency, extraneous version - default-language: Haskell2010 - -executable hello-world - main-is: Main.hs - build-depends: base - default-language: Haskell2010 diff --git a/cabal-testsuite/PackageTests/InternalVersions/BuildToolsExtra/setup.cabal.out b/cabal-testsuite/PackageTests/InternalVersions/BuildToolsExtra/setup.cabal.out deleted file mode 100644 index 58d3172cb43..00000000000 --- a/cabal-testsuite/PackageTests/InternalVersions/BuildToolsExtra/setup.cabal.out +++ /dev/null @@ -1,13 +0,0 @@ -# Setup configure -Configuring build-tools-extra-version-0.1.0.0... -Warning: The package has an extraneous version range for a dependency on an internal executable: build-tools-extra-version:hello-world >=0.0.0.1. This version range includes the current package but isn't needed as the current package's executable will always be used. -# Setup sdist -Distribution quality errors: -The package has an extraneous version range for a dependency on an internal executable: build-tools-extra-version:hello-world >=0.0.0.1. This version range includes the current package but isn't needed as the current package's executable will always be used. -Distribution quality warnings: -No 'maintainer' field. -No 'description' field. -A 'license-file' is not specified. -Note: the public hackage server would reject this package. -Building source dist for build-tools-extra-version-0.1.0.0... -Source tarball created: setup.cabal.dist/work/dist/build-tools-extra-version-0.1.0.0.tar.gz diff --git a/cabal-testsuite/PackageTests/InternalVersions/BuildToolsExtra/setup.out b/cabal-testsuite/PackageTests/InternalVersions/BuildToolsExtra/setup.out deleted file mode 100644 index 28059d26ccd..00000000000 --- a/cabal-testsuite/PackageTests/InternalVersions/BuildToolsExtra/setup.out +++ /dev/null @@ -1,13 +0,0 @@ -# Setup configure -Configuring build-tools-extra-version-0.1.0.0... -Warning: The package has an extraneous version range for a dependency on an internal executable: build-tools-extra-version:hello-world >=0.0.0.1. This version range includes the current package but isn't needed as the current package's executable will always be used. -# Setup sdist -Distribution quality errors: -The package has an extraneous version range for a dependency on an internal executable: build-tools-extra-version:hello-world >=0.0.0.1. This version range includes the current package but isn't needed as the current package's executable will always be used. -Distribution quality warnings: -No 'maintainer' field. -No 'description' field. -A 'license-file' is not specified. -Note: the public hackage server would reject this package. -Building source dist for build-tools-extra-version-0.1.0.0... -Source tarball created: setup.dist/work/dist/build-tools-extra-version-0.1.0.0.tar.gz diff --git a/cabal-testsuite/PackageTests/InternalVersions/BuildToolsExtra/setup.test.hs b/cabal-testsuite/PackageTests/InternalVersions/BuildToolsExtra/setup.test.hs deleted file mode 100644 index c006efe6f72..00000000000 --- a/cabal-testsuite/PackageTests/InternalVersions/BuildToolsExtra/setup.test.hs +++ /dev/null @@ -1,6 +0,0 @@ -import Test.Cabal.Prelude --- Test unneed version bound on internal build-tools deps -main = setupAndCabalTest . expectBroken 7470 $ do - setup' "configure" [] - assertOutputContains "extraneous version range" - =<< setup' "sdist" [] diff --git a/cabal-testsuite/PackageTests/JS/JsSources/js-arch.test.hs b/cabal-testsuite/PackageTests/JS/JsSources/js-arch.test.hs index 1fed749bdb8..2b318af6670 100644 --- a/cabal-testsuite/PackageTests/JS/JsSources/js-arch.test.hs +++ b/cabal-testsuite/PackageTests/JS/JsSources/js-arch.test.hs @@ -1,9 +1,9 @@ import Test.Cabal.Prelude -main = setupAndCabalTest $ do - skipUnlessGhcVersion ">= 9.6" +main = do skipUnlessJavaScript - skipIfWindows - - res <- cabal' "v2-run" ["demo"] - assertOutputContains "Hello JS!" res + skipIfWindows "" + setupAndCabalTest $ do + skipUnlessGhcVersion ">= 9.6" + res <- cabal' "v2-run" ["demo"] + assertOutputContains "Hello JS!" res diff --git a/cabal-testsuite/PackageTests/JS/JsSources/other-arch.test.hs b/cabal-testsuite/PackageTests/JS/JsSources/other-arch.test.hs index 187a9cf73bd..2e92eb1fcc5 100644 --- a/cabal-testsuite/PackageTests/JS/JsSources/other-arch.test.hs +++ b/cabal-testsuite/PackageTests/JS/JsSources/other-arch.test.hs @@ -1,7 +1,8 @@ import Test.Cabal.Prelude -main = cabalTest $ do +main = do skipIfJavaScript - -- Ensure the field `js-sources` does not raise issues - res <- cabal' "v2-run" ["demo"] - assertOutputContains "Hello Not JS!" res + cabalTest $ do + -- Ensure the field `js-sources` does not raise issues + res <- cabal' "v2-run" ["demo"] + assertOutputContains "Hello Not JS!" res diff --git a/cabal-testsuite/PackageTests/JS/JsSourcesExe/js-arch.test.hs b/cabal-testsuite/PackageTests/JS/JsSourcesExe/js-arch.test.hs index 1fed749bdb8..2b318af6670 100644 --- a/cabal-testsuite/PackageTests/JS/JsSourcesExe/js-arch.test.hs +++ b/cabal-testsuite/PackageTests/JS/JsSourcesExe/js-arch.test.hs @@ -1,9 +1,9 @@ import Test.Cabal.Prelude -main = setupAndCabalTest $ do - skipUnlessGhcVersion ">= 9.6" +main = do skipUnlessJavaScript - skipIfWindows - - res <- cabal' "v2-run" ["demo"] - assertOutputContains "Hello JS!" res + skipIfWindows "" + setupAndCabalTest $ do + skipUnlessGhcVersion ">= 9.6" + res <- cabal' "v2-run" ["demo"] + assertOutputContains "Hello JS!" res diff --git a/cabal-testsuite/PackageTests/JS/JsSourcesExe/other-arch.test.hs b/cabal-testsuite/PackageTests/JS/JsSourcesExe/other-arch.test.hs index 187a9cf73bd..2e92eb1fcc5 100644 --- a/cabal-testsuite/PackageTests/JS/JsSourcesExe/other-arch.test.hs +++ b/cabal-testsuite/PackageTests/JS/JsSourcesExe/other-arch.test.hs @@ -1,7 +1,8 @@ import Test.Cabal.Prelude -main = cabalTest $ do +main = do skipIfJavaScript - -- Ensure the field `js-sources` does not raise issues - res <- cabal' "v2-run" ["demo"] - assertOutputContains "Hello Not JS!" res + cabalTest $ do + -- Ensure the field `js-sources` does not raise issues + res <- cabal' "v2-run" ["demo"] + assertOutputContains "Hello Not JS!" res diff --git a/cabal-testsuite/PackageTests/LinkerOptions/NonignoredConfigs/cabal.test.hs b/cabal-testsuite/PackageTests/LinkerOptions/NonignoredConfigs/cabal.test.hs index 8e7c8a6391d..55ec5ee6144 100644 --- a/cabal-testsuite/PackageTests/LinkerOptions/NonignoredConfigs/cabal.test.hs +++ b/cabal-testsuite/PackageTests/LinkerOptions/NonignoredConfigs/cabal.test.hs @@ -52,14 +52,7 @@ lrun :: [Linking] lrun = [Static, Dynamic, Static, Dynamic] main = cabalTest $ do - -- Skip if on Windows, since my default Chocolatey Windows setup (and the CI - -- server setup at the time, presumably) lacks support for dynamic builds - -- since the base package appears to be static only, lacking e.g. ‘.dyn_o’ - -- files. Normal Windows installations would need support for dynamic - -- builds, or else this test would fail when it tries to build with the - -- dynamic flags. - skipIfWindows - + skipIfNoSharedLibraries env <- getTestEnv withPackageDb $ do -- Phase 1: get 4 hashes according to config flags. diff --git a/cabal-testsuite/PackageTests/LinkerOptions/T7339/setup.test.hs b/cabal-testsuite/PackageTests/LinkerOptions/T7339/setup.test.hs index a46921de895..233d3b20736 100644 --- a/cabal-testsuite/PackageTests/LinkerOptions/T7339/setup.test.hs +++ b/cabal-testsuite/PackageTests/LinkerOptions/T7339/setup.test.hs @@ -18,8 +18,7 @@ import Test.Cabal.Prelude main = setupTest $ do - - skipIfWindows + skipIfNoSharedLibraries skipUnlessGhcVersion ">= 8.4" withPackageDb $ do @@ -59,9 +58,9 @@ main = setupTest $ do pkgDb <- testPackageDbDir <$> getTestEnv ghciScript <- liftIO $ readFile (cwd "T19350.script") _ <- runProgramM ghcProgram - [ "--interactive" - , "-package", "T7339" - , "-package-db", pkgDb - ] (Just ghciScript) + [ "--interactive" + , "-package", "T7339" + , "-package-db", pkgDb + ] (Just ghciScript) return () diff --git a/cabal-testsuite/PackageTests/MultiRepl/CabalMacros/cabal.out b/cabal-testsuite/PackageTests/MultiRepl/CabalMacros/cabal.out new file mode 100644 index 00000000000..9c141d7ac42 --- /dev/null +++ b/cabal-testsuite/PackageTests/MultiRepl/CabalMacros/cabal.out @@ -0,0 +1,10 @@ +# cabal v2-repl +Resolving dependencies... +Build profile: -w ghc- -O1 +In order, the following will be built: + - pkg-a-1 (interactive) (lib) (first run) + - pkg-b-0 (interactive) (lib) (first run) +Configuring library for pkg-a-1... +Preprocessing library for pkg-a-1... +Configuring library for pkg-b-0... +Preprocessing library for pkg-b-0... diff --git a/cabal-testsuite/PackageTests/MultiRepl/CabalMacros/cabal.project b/cabal-testsuite/PackageTests/MultiRepl/CabalMacros/cabal.project new file mode 100644 index 00000000000..bf8292adeb5 --- /dev/null +++ b/cabal-testsuite/PackageTests/MultiRepl/CabalMacros/cabal.project @@ -0,0 +1,2 @@ +packages: pkg-a/*.cabal +packages: pkg-b/*.cabal diff --git a/cabal-testsuite/PackageTests/MultiRepl/CabalMacros/cabal.test.hs b/cabal-testsuite/PackageTests/MultiRepl/CabalMacros/cabal.test.hs new file mode 100644 index 00000000000..5a8434c5467 --- /dev/null +++ b/cabal-testsuite/PackageTests/MultiRepl/CabalMacros/cabal.test.hs @@ -0,0 +1,7 @@ +import Test.Cabal.Prelude + +main = do + cabalTest $ do + skipUnlessGhcVersion ">= 9.4" + res <- cabalWithStdin "v2-repl" ["--enable-multi-repl","pkg-b", "pkg-a"] "Bar.bar" + assertOutputContains "3735929054" res diff --git a/cabal-testsuite/PackageTests/MultiRepl/CabalMacros/pkg-a/Foo.hs b/cabal-testsuite/PackageTests/MultiRepl/CabalMacros/pkg-a/Foo.hs new file mode 100644 index 00000000000..997ca89eecd --- /dev/null +++ b/cabal-testsuite/PackageTests/MultiRepl/CabalMacros/pkg-a/Foo.hs @@ -0,0 +1,5 @@ +module Foo where + +foo :: Int +foo = 42 + diff --git a/cabal-testsuite/PackageTests/MultiRepl/CabalMacros/pkg-a/pkg-a.cabal b/cabal-testsuite/PackageTests/MultiRepl/CabalMacros/pkg-a/pkg-a.cabal new file mode 100644 index 00000000000..7e4a3e9ef70 --- /dev/null +++ b/cabal-testsuite/PackageTests/MultiRepl/CabalMacros/pkg-a/pkg-a.cabal @@ -0,0 +1,8 @@ +cabal-version: 2.2 +name: pkg-a +version: 1 + +library + default-language: Haskell2010 + build-depends: base + exposed-modules: Foo diff --git a/cabal-testsuite/PackageTests/MultiRepl/CabalMacros/pkg-b/Bar.hs b/cabal-testsuite/PackageTests/MultiRepl/CabalMacros/pkg-b/Bar.hs new file mode 100644 index 00000000000..c3179aa8db6 --- /dev/null +++ b/cabal-testsuite/PackageTests/MultiRepl/CabalMacros/pkg-b/Bar.hs @@ -0,0 +1,12 @@ +{-# LANGUAGE CPP #-} +module Bar (foo, bar) where + +import Foo (foo) + +#if MIN_VERSION_pkg_a(0,1,0) +bar :: Int +bar = 0xdeadc0de +#else +bar :: Int +bar = 0xdeadc0d1 +#endif diff --git a/cabal-testsuite/PackageTests/MultiRepl/CabalMacros/pkg-b/pkg-b.cabal b/cabal-testsuite/PackageTests/MultiRepl/CabalMacros/pkg-b/pkg-b.cabal new file mode 100644 index 00000000000..8e1a273f0c4 --- /dev/null +++ b/cabal-testsuite/PackageTests/MultiRepl/CabalMacros/pkg-b/pkg-b.cabal @@ -0,0 +1,8 @@ +cabal-version: 2.2 +name: pkg-b +version: 0 + +library + default-language: Haskell2010 + build-depends: base, pkg-a + exposed-modules: Bar diff --git a/cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/cabal.no.out b/cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/cabal.no.out new file mode 100644 index 00000000000..073e87feea2 --- /dev/null +++ b/cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/cabal.no.out @@ -0,0 +1,11 @@ +# cabal clean +# cabal v2-repl +Resolving dependencies... +Build profile: -w ghc- -O1 +In order, the following will be built: + - pkg-a-1 (interactive) (first run) + - pkg-b-0 (interactive) (first run) +Configuring pkg-a-1... +Preprocessing library for pkg-a-1... +Configuring pkg-b-0... +Preprocessing library for pkg-b-0... diff --git a/cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/cabal.out b/cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/cabal.out new file mode 100644 index 00000000000..9c141d7ac42 --- /dev/null +++ b/cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/cabal.out @@ -0,0 +1,10 @@ +# cabal v2-repl +Resolving dependencies... +Build profile: -w ghc- -O1 +In order, the following will be built: + - pkg-a-1 (interactive) (lib) (first run) + - pkg-b-0 (interactive) (lib) (first run) +Configuring library for pkg-a-1... +Preprocessing library for pkg-a-1... +Configuring library for pkg-b-0... +Preprocessing library for pkg-b-0... diff --git a/cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/cabal.project b/cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/cabal.project new file mode 100644 index 00000000000..bf8292adeb5 --- /dev/null +++ b/cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/cabal.project @@ -0,0 +1,2 @@ +packages: pkg-a/*.cabal +packages: pkg-b/*.cabal diff --git a/cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/cabal.test.hs b/cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/cabal.test.hs new file mode 100644 index 00000000000..ea0851f1f2c --- /dev/null +++ b/cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/cabal.test.hs @@ -0,0 +1,33 @@ +import Test.Cabal.Prelude + +main = do + cabalTest' "yes" $ do + skipUnlessAnyCabalVersion ">= 3.11" + skipUnlessGhcVersion ">= 9.4" + cabal' "clean" [] + res <- + cabalWithStdin + "v2-repl" + [ "--keep-temp-files" + , "--enable-multi-repl" + , "pkg-b" + , "pkg-a" + ] + "Bar.bar" + assertOutputContains "foo is 42" res + void $ assertGlobMatchesTestDir testDistDir "multi-out*/" + + cabalTest' "no" $ do + skipUnlessAnyCabalVersion ">= 3.11" + skipUnlessGhcVersion ">= 9.4" + cabal' "clean" [] + res <- + cabalWithStdin + "v2-repl" + [ "--enable-multi-repl" + , "pkg-b" + , "pkg-a" + ] + "Bar.bar" + assertOutputContains "foo is 42" res + void $ assertGlobDoesNotMatchTestDir testDistDir "multi-out*/" diff --git a/cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/cabal.yes.out b/cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/cabal.yes.out new file mode 100644 index 00000000000..073e87feea2 --- /dev/null +++ b/cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/cabal.yes.out @@ -0,0 +1,11 @@ +# cabal clean +# cabal v2-repl +Resolving dependencies... +Build profile: -w ghc- -O1 +In order, the following will be built: + - pkg-a-1 (interactive) (first run) + - pkg-b-0 (interactive) (first run) +Configuring pkg-a-1... +Preprocessing library for pkg-a-1... +Configuring pkg-b-0... +Preprocessing library for pkg-b-0... diff --git a/cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/pkg-a/Foo.hs b/cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/pkg-a/Foo.hs new file mode 100644 index 00000000000..208f04764de --- /dev/null +++ b/cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/pkg-a/Foo.hs @@ -0,0 +1,4 @@ +module Foo where + +foo :: Int +foo = 42 diff --git a/cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/pkg-a/Setup.hs b/cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/pkg-a/Setup.hs new file mode 100644 index 00000000000..00bfe1fe441 --- /dev/null +++ b/cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/pkg-a/Setup.hs @@ -0,0 +1,4 @@ +import Distribution.Simple + +main :: IO () +main = defaultMain diff --git a/cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/pkg-a/pkg-a.cabal b/cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/pkg-a/pkg-a.cabal new file mode 100644 index 00000000000..3c3bbde21a2 --- /dev/null +++ b/cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/pkg-a/pkg-a.cabal @@ -0,0 +1,12 @@ +cabal-version: 2.2 +name: pkg-a +version: 1 +build-type: Custom + +custom-setup + setup-depends: Cabal, base + +library + default-language: Haskell2010 + build-depends: base + exposed-modules: Foo diff --git a/cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/pkg-b/Bar.hs b/cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/pkg-b/Bar.hs new file mode 100644 index 00000000000..114eedd9306 --- /dev/null +++ b/cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/pkg-b/Bar.hs @@ -0,0 +1,6 @@ +module Bar (foo, bar) where + +import Foo (foo) + +bar :: String +bar = "foo is " <> show foo diff --git a/cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/pkg-b/Setup.hs b/cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/pkg-b/Setup.hs new file mode 100644 index 00000000000..00bfe1fe441 --- /dev/null +++ b/cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/pkg-b/Setup.hs @@ -0,0 +1,4 @@ +import Distribution.Simple + +main :: IO () +main = defaultMain diff --git a/cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/pkg-b/pkg-b.cabal b/cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/pkg-b/pkg-b.cabal new file mode 100644 index 00000000000..a354090771d --- /dev/null +++ b/cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/pkg-b/pkg-b.cabal @@ -0,0 +1,12 @@ +cabal-version: 2.2 +name: pkg-b +version: 0 +build-type: Custom + +custom-setup + setup-depends: Cabal, base + +library + default-language: Haskell2010 + build-depends: base, pkg-a + exposed-modules: Bar diff --git a/cabal-testsuite/PackageTests/MultiRepl/EnabledSucc/cabal.test.hs b/cabal-testsuite/PackageTests/MultiRepl/EnabledSucc/cabal.test.hs index 7ea2f71ea49..5a8434c5467 100644 --- a/cabal-testsuite/PackageTests/MultiRepl/EnabledSucc/cabal.test.hs +++ b/cabal-testsuite/PackageTests/MultiRepl/EnabledSucc/cabal.test.hs @@ -3,6 +3,5 @@ import Test.Cabal.Prelude main = do cabalTest $ do skipUnlessGhcVersion ">= 9.4" - skipIfWindows -- heisenbug, see #9103 res <- cabalWithStdin "v2-repl" ["--enable-multi-repl","pkg-b", "pkg-a"] "Bar.bar" assertOutputContains "3735929054" res diff --git a/cabal-testsuite/PackageTests/MultiRepl/KeepTempFiles/cabal.no.out b/cabal-testsuite/PackageTests/MultiRepl/KeepTempFiles/cabal.no.out new file mode 100644 index 00000000000..348fea760af --- /dev/null +++ b/cabal-testsuite/PackageTests/MultiRepl/KeepTempFiles/cabal.no.out @@ -0,0 +1,11 @@ +# cabal clean +# cabal v2-repl +Resolving dependencies... +Build profile: -w ghc- -O1 +In order, the following will be built: + - pkg-a-1 (interactive) (lib) (first run) + - pkg-b-0 (interactive) (lib) (first run) +Configuring library for pkg-a-1... +Preprocessing library for pkg-a-1... +Configuring library for pkg-b-0... +Preprocessing library for pkg-b-0... diff --git a/cabal-testsuite/PackageTests/MultiRepl/KeepTempFiles/cabal.project b/cabal-testsuite/PackageTests/MultiRepl/KeepTempFiles/cabal.project new file mode 100644 index 00000000000..bf8292adeb5 --- /dev/null +++ b/cabal-testsuite/PackageTests/MultiRepl/KeepTempFiles/cabal.project @@ -0,0 +1,2 @@ +packages: pkg-a/*.cabal +packages: pkg-b/*.cabal diff --git a/cabal-testsuite/PackageTests/MultiRepl/KeepTempFiles/cabal.test.hs b/cabal-testsuite/PackageTests/MultiRepl/KeepTempFiles/cabal.test.hs new file mode 100644 index 00000000000..26c90db7ab1 --- /dev/null +++ b/cabal-testsuite/PackageTests/MultiRepl/KeepTempFiles/cabal.test.hs @@ -0,0 +1,31 @@ +import Test.Cabal.Prelude + +main = do + cabalTest' "yes" $ do + skipUnlessGhcVersion ">= 9.4" + cabal' "clean" [] + res <- + cabalWithStdin + "v2-repl" + [ "--keep-temp-files" + , "--enable-multi-repl" + , "pkg-b" + , "pkg-a" + ] + "Bar.bar" + assertOutputContains "foo is 42" res + void $ assertGlobMatchesTestDir testDistDir "multi-out*/" + + cabalTest' "no" $ do + skipUnlessGhcVersion ">= 9.4" + cabal' "clean" [] + res <- + cabalWithStdin + "v2-repl" + [ "--enable-multi-repl" + , "pkg-b" + , "pkg-a" + ] + "Bar.bar" + assertOutputContains "foo is 42" res + void $ assertGlobDoesNotMatchTestDir testDistDir "multi-out*/" diff --git a/cabal-testsuite/PackageTests/MultiRepl/KeepTempFiles/cabal.yes.out b/cabal-testsuite/PackageTests/MultiRepl/KeepTempFiles/cabal.yes.out new file mode 100644 index 00000000000..348fea760af --- /dev/null +++ b/cabal-testsuite/PackageTests/MultiRepl/KeepTempFiles/cabal.yes.out @@ -0,0 +1,11 @@ +# cabal clean +# cabal v2-repl +Resolving dependencies... +Build profile: -w ghc- -O1 +In order, the following will be built: + - pkg-a-1 (interactive) (lib) (first run) + - pkg-b-0 (interactive) (lib) (first run) +Configuring library for pkg-a-1... +Preprocessing library for pkg-a-1... +Configuring library for pkg-b-0... +Preprocessing library for pkg-b-0... diff --git a/cabal-testsuite/PackageTests/MultiRepl/KeepTempFiles/pkg-a/Foo.hs b/cabal-testsuite/PackageTests/MultiRepl/KeepTempFiles/pkg-a/Foo.hs new file mode 100644 index 00000000000..208f04764de --- /dev/null +++ b/cabal-testsuite/PackageTests/MultiRepl/KeepTempFiles/pkg-a/Foo.hs @@ -0,0 +1,4 @@ +module Foo where + +foo :: Int +foo = 42 diff --git a/cabal-testsuite/PackageTests/MultiRepl/KeepTempFiles/pkg-a/pkg-a.cabal b/cabal-testsuite/PackageTests/MultiRepl/KeepTempFiles/pkg-a/pkg-a.cabal new file mode 100644 index 00000000000..7e4a3e9ef70 --- /dev/null +++ b/cabal-testsuite/PackageTests/MultiRepl/KeepTempFiles/pkg-a/pkg-a.cabal @@ -0,0 +1,8 @@ +cabal-version: 2.2 +name: pkg-a +version: 1 + +library + default-language: Haskell2010 + build-depends: base + exposed-modules: Foo diff --git a/cabal-testsuite/PackageTests/MultiRepl/KeepTempFiles/pkg-b/Bar.hs b/cabal-testsuite/PackageTests/MultiRepl/KeepTempFiles/pkg-b/Bar.hs new file mode 100644 index 00000000000..114eedd9306 --- /dev/null +++ b/cabal-testsuite/PackageTests/MultiRepl/KeepTempFiles/pkg-b/Bar.hs @@ -0,0 +1,6 @@ +module Bar (foo, bar) where + +import Foo (foo) + +bar :: String +bar = "foo is " <> show foo diff --git a/cabal-testsuite/PackageTests/MultiRepl/KeepTempFiles/pkg-b/pkg-b.cabal b/cabal-testsuite/PackageTests/MultiRepl/KeepTempFiles/pkg-b/pkg-b.cabal new file mode 100644 index 00000000000..8e1a273f0c4 --- /dev/null +++ b/cabal-testsuite/PackageTests/MultiRepl/KeepTempFiles/pkg-b/pkg-b.cabal @@ -0,0 +1,8 @@ +cabal-version: 2.2 +name: pkg-b +version: 0 + +library + default-language: Haskell2010 + build-depends: base, pkg-a + exposed-modules: Bar diff --git a/cabal-testsuite/PackageTests/NewBuild/CmdClean/CleanSourceRepositoryPackage/a.cabal b/cabal-testsuite/PackageTests/NewBuild/CmdClean/CleanSourceRepositoryPackage/a.cabal new file mode 100644 index 00000000000..77f47fbbcf5 --- /dev/null +++ b/cabal-testsuite/PackageTests/NewBuild/CmdClean/CleanSourceRepositoryPackage/a.cabal @@ -0,0 +1,6 @@ +cabal-version: 3.0 +name: aa +version: 0.1.0.0 +build-type: Simple + +library diff --git a/cabal-testsuite/PackageTests/NewBuild/CmdClean/CleanSourceRepositoryPackage/cabal.out b/cabal-testsuite/PackageTests/NewBuild/CmdClean/CleanSourceRepositoryPackage/cabal.out new file mode 100644 index 00000000000..e4f538647f6 --- /dev/null +++ b/cabal-testsuite/PackageTests/NewBuild/CmdClean/CleanSourceRepositoryPackage/cabal.out @@ -0,0 +1,6 @@ +# cabal build +Resolving dependencies... +Build profile: -w ghc- -O1 +In order, the following would be built: + - aa-0.1.0.0 (lib) (first run) +# cabal clean diff --git a/cabal-testsuite/PackageTests/NewBuild/CmdClean/CleanSourceRepositoryPackage/cabal.project b/cabal-testsuite/PackageTests/NewBuild/CmdClean/CleanSourceRepositoryPackage/cabal.project new file mode 100644 index 00000000000..60739ea84dd --- /dev/null +++ b/cabal-testsuite/PackageTests/NewBuild/CmdClean/CleanSourceRepositoryPackage/cabal.project @@ -0,0 +1,5 @@ +packages: . + +source-repository-package + type: git + location: https://github.com/haskell-hvr/Only diff --git a/cabal-testsuite/PackageTests/NewBuild/CmdClean/CleanSourceRepositoryPackage/cabal.test.hs b/cabal-testsuite/PackageTests/NewBuild/CmdClean/CleanSourceRepositoryPackage/cabal.test.hs new file mode 100644 index 00000000000..9e93c607ce4 --- /dev/null +++ b/cabal-testsuite/PackageTests/NewBuild/CmdClean/CleanSourceRepositoryPackage/cabal.test.hs @@ -0,0 +1,5 @@ +import Test.Cabal.Prelude + +main = cabalTest $ withProjectFile "cabal.project" $ do + void $ cabal' "build" ["--dry-run"] + void $ cabal' "clean" [] diff --git a/cabal-testsuite/PackageTests/NewBuild/CmdRun/Terminate/cabal.test.hs b/cabal-testsuite/PackageTests/NewBuild/CmdRun/Terminate/cabal.test.hs index 44f88c26656..8c3277174b8 100644 --- a/cabal-testsuite/PackageTests/NewBuild/CmdRun/Terminate/cabal.test.hs +++ b/cabal-testsuite/PackageTests/NewBuild/CmdRun/Terminate/cabal.test.hs @@ -17,36 +17,36 @@ without forking in the future.) -} main :: IO () -main = cabalTest $ do - skipIfWindows -- test project relies on Posix +main = do + skipIfWindows "depends on `unix`" + cabalTest $ do + -- timestamped logging to aid with #8416 + let logIO msg = do + ts <- Time.getCurrentTime + let tsfmt = Time.formatTime Time.defaultTimeLocale "%H:%M:%S.%q" ts + putStrLn $ tsfmt <> " [cabal.test] " <> msg + log = liftIO . logIO - -- timestamped logging to aid with #8416 - let logIO msg = do - ts <- Time.getCurrentTime - let tsfmt = Time.formatTime Time.defaultTimeLocale "%H:%M:%S.%q" ts - putStrLn $ tsfmt <> " [cabal.test] " <> msg - log = liftIO . logIO + dir <- fmap testCurrentDir getTestEnv + let runFile = dir "exe.run" + liftIO $ removeFile runFile `catchNoExist` return () - dir <- fmap testCurrentDir getTestEnv - let runFile = dir "exe.run" - liftIO $ removeFile runFile `catchNoExist` return () + log "about to v2-build" + cabal_raw_action ["v2-build", "exe"] (\_ -> return ()) + log "about to v2-run" + r <- fails $ cabal_raw_action ["v2-run", "exe"] $ \cabalHandle -> do + -- wait for "cabal run" to have started "exe" + logIO "about to wait for file" + waitFile total runFile + -- then kill "cabal run" + logIO "about to terminate cabal" + Process.terminateProcess cabalHandle + log "v2-run done" - log "about to v2-build" - cabal_raw_action ["v2-build", "exe"] (\_ -> return ()) - log "about to v2-run" - r <- fails $ cabal_raw_action ["v2-run", "exe"] $ \cabalHandle -> do - -- wait for "cabal run" to have started "exe" - logIO "about to wait for file" - waitFile total runFile - -- then kill "cabal run" - logIO "about to terminate cabal" - Process.terminateProcess cabalHandle - log "v2-run done" - - -- "exe" should exit, and should have been interrupted before - -- finishing its sleep - assertOutputContains "exiting" r - assertOutputDoesNotContain "done sleeping" r + -- "exe" should exit, and should have been interrupted before + -- finishing its sleep + assertOutputContains "exiting" r + assertOutputDoesNotContain "done sleeping" r where catchNoExist action handle = diff --git a/cabal-testsuite/PackageTests/NewBuild/CustomSetup/RemotePackageWithCustomSetup/build-package-from-repo-with-custom-setup.test.hs b/cabal-testsuite/PackageTests/NewBuild/CustomSetup/RemotePackageWithCustomSetup/build-package-from-repo-with-custom-setup.test.hs index f3774f78cd7..114d3487e8e 100644 --- a/cabal-testsuite/PackageTests/NewBuild/CustomSetup/RemotePackageWithCustomSetup/build-package-from-repo-with-custom-setup.test.hs +++ b/cabal-testsuite/PackageTests/NewBuild/CustomSetup/RemotePackageWithCustomSetup/build-package-from-repo-with-custom-setup.test.hs @@ -2,11 +2,7 @@ import Test.Cabal.Prelude -- The one local package, pkg, has a dependency on remote-pkg-2.0, which has a -- setup dependency on remote-setup-dep-3.0. -main = - cabalTest $ withShorterPathForNewBuildStore $ do - - -- TODO: Debug this failure on Windows. - skipIfWindows +main = cabalTest $ withShorterPathForNewBuildStore $ do skipUnless "no v2-build compatible boot-Cabal" =<< hasNewBuildCompatBootCabal withRepo "repo" $ do diff --git a/cabal-testsuite/PackageTests/NewBuild/T3827/cabal.test.hs b/cabal-testsuite/PackageTests/NewBuild/T3827/cabal.test.hs index f418538b074..93d28460c83 100644 --- a/cabal-testsuite/PackageTests/NewBuild/T3827/cabal.test.hs +++ b/cabal-testsuite/PackageTests/NewBuild/T3827/cabal.test.hs @@ -1,6 +1,4 @@ import Test.Cabal.Prelude main = cabalTest $ do - linux <- isLinux - osx <- isOSX - skipIf "8032 heisenbug profiling" (linux || osx) + skipIf "8032 heisenbug profiling" (isLinux || isOSX) cabal "v2-build" ["exe:q"] diff --git a/cabal-testsuite/PackageTests/NewBuild/T4375/A.hs b/cabal-testsuite/PackageTests/NewBuild/T4375/A.hs deleted file mode 100644 index d843c00b782..00000000000 --- a/cabal-testsuite/PackageTests/NewBuild/T4375/A.hs +++ /dev/null @@ -1 +0,0 @@ -module A where diff --git a/cabal-testsuite/PackageTests/NewBuild/T4375/a.cabal b/cabal-testsuite/PackageTests/NewBuild/T4375/a.cabal deleted file mode 100644 index e3c9ed6bca1..00000000000 --- a/cabal-testsuite/PackageTests/NewBuild/T4375/a.cabal +++ /dev/null @@ -1,11 +0,0 @@ -name: a -version: 0.1 -build-type: Custom -cabal-version: >= 1.10 - --- no explicit setup deps - -library - exposed-modules: A - build-depends: base - default-language: Haskell2010 diff --git a/cabal-testsuite/PackageTests/NewBuild/T4375/cabal.out b/cabal-testsuite/PackageTests/NewBuild/T4375/cabal.out deleted file mode 100644 index ebbf63746ef..00000000000 --- a/cabal-testsuite/PackageTests/NewBuild/T4375/cabal.out +++ /dev/null @@ -1,7 +0,0 @@ -# cabal v2-update -Downloading the latest package list from test-local-repo -# cabal v2-build -Resolving dependencies... -Build profile: -w ghc- -O1 -In order, the following will be built: - - a-0.1 (lib:a) (first run) diff --git a/cabal-testsuite/PackageTests/NewBuild/T4375/cabal.test.hs b/cabal-testsuite/PackageTests/NewBuild/T4375/cabal.test.hs deleted file mode 100644 index b42f3f28c7a..00000000000 --- a/cabal-testsuite/PackageTests/NewBuild/T4375/cabal.test.hs +++ /dev/null @@ -1,13 +0,0 @@ -import Test.Cabal.Prelude -main = - -- TODO: is this test ever run? - cabalTest $ withShorterPathForNewBuildStore $ do - -- Don't run this test unless the GHC is sufficiently recent - -- to not ship boot old-time/old-locale - skipUnlessGhcVersion ">= 7.11" - -- Don't run this test on GHC 8.2, which ships with Cabal 2.0, - -- which is not eligible for old-style Custom setup (if - -- we had the full Hackage index, we'd try it.) - skipUnlessGhcVersion "< 8.1" - withRepo "repo" $ do - cabal "v2-build" ["a"] diff --git a/cabal-testsuite/PackageTests/NewBuild/T4375/repo/old-locale-1.0.0.7/System/Locale.hs b/cabal-testsuite/PackageTests/NewBuild/T4375/repo/old-locale-1.0.0.7/System/Locale.hs deleted file mode 100644 index 83af47b0ef4..00000000000 --- a/cabal-testsuite/PackageTests/NewBuild/T4375/repo/old-locale-1.0.0.7/System/Locale.hs +++ /dev/null @@ -1 +0,0 @@ -module System.Locale where diff --git a/cabal-testsuite/PackageTests/NewBuild/T4375/repo/old-locale-1.0.0.7/old-locale.cabal b/cabal-testsuite/PackageTests/NewBuild/T4375/repo/old-locale-1.0.0.7/old-locale.cabal deleted file mode 100644 index f6e3dadf6d5..00000000000 --- a/cabal-testsuite/PackageTests/NewBuild/T4375/repo/old-locale-1.0.0.7/old-locale.cabal +++ /dev/null @@ -1,9 +0,0 @@ -name: old-locale -version: 1.0.0.7 -build-type: Simple -cabal-version: >= 1.10 - -library - exposed-modules: System.Locale - build-depends: base - default-language: Haskell2010 diff --git a/cabal-testsuite/PackageTests/NewBuild/T4375/repo/old-time-1.1.0.3/System/Time.hs b/cabal-testsuite/PackageTests/NewBuild/T4375/repo/old-time-1.1.0.3/System/Time.hs deleted file mode 100644 index f4185b6527a..00000000000 --- a/cabal-testsuite/PackageTests/NewBuild/T4375/repo/old-time-1.1.0.3/System/Time.hs +++ /dev/null @@ -1,2 +0,0 @@ -module System.Time where -import System.Locale diff --git a/cabal-testsuite/PackageTests/NewBuild/T4375/repo/old-time-1.1.0.3/old-time.cabal b/cabal-testsuite/PackageTests/NewBuild/T4375/repo/old-time-1.1.0.3/old-time.cabal deleted file mode 100644 index 11ac6cccc91..00000000000 --- a/cabal-testsuite/PackageTests/NewBuild/T4375/repo/old-time-1.1.0.3/old-time.cabal +++ /dev/null @@ -1,9 +0,0 @@ -name: old-time -version: 1.1.0.3 -build-type: Simple -cabal-version: >= 1.10 - -library - exposed-modules: System.Time - build-depends: base, old-locale == 1.0.* - default-language: Haskell2010 diff --git a/cabal-testsuite/PackageTests/NewFreeze/T9799b/src/None.hs b/cabal-testsuite/PackageTests/NewFreeze/T9799b/src/None.hs index f4c629a9329..e4aa4f2393a 100644 --- a/cabal-testsuite/PackageTests/NewFreeze/T9799b/src/None.hs +++ b/cabal-testsuite/PackageTests/NewFreeze/T9799b/src/None.hs @@ -3,8 +3,11 @@ module None where import MyLib import Language.Haskell.TH +import System.IO $(do - runIO $ putStrLn $ "Building: " ++ renamedVers + runIO $ do + putStrLn $ "Building: " ++ renamedVers + hFlush stdout [d| x = () |] ) diff --git a/cabal-testsuite/PackageTests/NewHaddock/DisableDoc/cabal.out b/cabal-testsuite/PackageTests/NewHaddock/DisableDoc/cabal.out index ac34ca8e161..0683a3921ce 100644 --- a/cabal-testsuite/PackageTests/NewHaddock/DisableDoc/cabal.out +++ b/cabal-testsuite/PackageTests/NewHaddock/DisableDoc/cabal.out @@ -13,4 +13,4 @@ Installing library in Configuring library for B-0.1.0.0... Preprocessing library for B-0.1.0.0... Running Haddock on library for B-0.1.0.0... -Documentation created: /cabal.dist/work/dist/build//ghc-/B-0.1.0.0/doc/html/B/ +Documentation created: /cabal.dist/work/dist/build//ghc-/B-0.1.0.0/doc/html/B diff --git a/cabal-testsuite/PackageTests/NewHaddock/HaddockOutput/HaddockForHackageCmdOutput/cabal.out b/cabal-testsuite/PackageTests/NewHaddock/HaddockOutput/HaddockForHackageCmdOutput/cabal.out index e17593a966c..5a0ba914174 100644 --- a/cabal-testsuite/PackageTests/NewHaddock/HaddockOutput/HaddockForHackageCmdOutput/cabal.out +++ b/cabal-testsuite/PackageTests/NewHaddock/HaddockOutput/HaddockForHackageCmdOutput/cabal.out @@ -6,5 +6,5 @@ In order, the following will be built: Configuring library for A-0.0.0... Preprocessing library for A-0.0.0... Running Haddock on library for A-0.0.0... -Documentation created: /cabal.dist/work/dist/build//ghc-/A-0.0.0/doc/html/A-0.0.0-docs/, /cabal.dist/work/dist/build//ghc-/A-0.0.0/doc/html/A-0.0.0-docs/A.txt +Documentation created: /cabal.dist/work/dist/build//ghc-/A-0.0.0/doc/html/A-0.0.0-docs, /cabal.dist/work/dist/build//ghc-/A-0.0.0/doc/html/A-0.0.0-docs/A.txt Documentation tarball created: /cabal.dist/work/./dist/A-0.0.0-docs.tar.gz diff --git a/cabal-testsuite/PackageTests/NewHaddock/HaddockOutput/HaddockOutputCmd/cabal.out b/cabal-testsuite/PackageTests/NewHaddock/HaddockOutput/HaddockOutputCmd/cabal.out index 38e56384678..38614b49b84 100644 --- a/cabal-testsuite/PackageTests/NewHaddock/HaddockOutput/HaddockOutputCmd/cabal.out +++ b/cabal-testsuite/PackageTests/NewHaddock/HaddockOutput/HaddockOutputCmd/cabal.out @@ -8,4 +8,4 @@ In order, the following will be built: Configuring library for A-0.0.0... Preprocessing library for A-0.0.0... Running Haddock on library for A-0.0.0... -Documentation created: /docs/ +Documentation created: /docs/A diff --git a/cabal-testsuite/PackageTests/NewHaddock/HaddockOutput/HaddockOutputCmd/cabal.test.hs b/cabal-testsuite/PackageTests/NewHaddock/HaddockOutput/HaddockOutputCmd/cabal.test.hs index 1bfe939dab9..de59c2f90ee 100644 --- a/cabal-testsuite/PackageTests/NewHaddock/HaddockOutput/HaddockOutputCmd/cabal.test.hs +++ b/cabal-testsuite/PackageTests/NewHaddock/HaddockOutput/HaddockOutputCmd/cabal.test.hs @@ -8,4 +8,4 @@ main = cabalTest . withRepo "repo" $ do let docsDir = testDir "docs" liftIO (removePathForcibly docsDir) r <- cabal' "haddock" ["--haddock-output-dir=docs", "A"] - assertFindInFile "A minimal test package for testing haddock." (docsDir "index.html") + assertFindInFile "A minimal test package for testing haddock." (docsDir "A" "index.html") diff --git a/cabal-testsuite/PackageTests/NewHaddock/HaddockOutput/HaddockOutputConfig/cabal.out b/cabal-testsuite/PackageTests/NewHaddock/HaddockOutput/HaddockOutputConfig/cabal.out index 38e56384678..38614b49b84 100644 --- a/cabal-testsuite/PackageTests/NewHaddock/HaddockOutput/HaddockOutputConfig/cabal.out +++ b/cabal-testsuite/PackageTests/NewHaddock/HaddockOutput/HaddockOutputConfig/cabal.out @@ -8,4 +8,4 @@ In order, the following will be built: Configuring library for A-0.0.0... Preprocessing library for A-0.0.0... Running Haddock on library for A-0.0.0... -Documentation created: /docs/ +Documentation created: /docs/A diff --git a/cabal-testsuite/PackageTests/NewHaddock/HaddockOutput/HaddockOutputConfig/cabal.test.hs b/cabal-testsuite/PackageTests/NewHaddock/HaddockOutput/HaddockOutputConfig/cabal.test.hs index ba3a957ef60..db5b6d493a2 100644 --- a/cabal-testsuite/PackageTests/NewHaddock/HaddockOutput/HaddockOutputConfig/cabal.test.hs +++ b/cabal-testsuite/PackageTests/NewHaddock/HaddockOutput/HaddockOutputConfig/cabal.test.hs @@ -8,4 +8,4 @@ main = cabalTest . withRepo "repo" $ do let docsDir = testDir "docs" liftIO (removePathForcibly docsDir) r <- cabal' "haddock" ["A"] - assertFindInFile "A minimal test package for testing haddock." (docsDir "index.html") + assertFindInFile "A minimal test package for testing haddock." (docsDir "A" "index.html") diff --git a/cabal-testsuite/PackageTests/NewHaddock/ImplyDependencies/cabal.out b/cabal-testsuite/PackageTests/NewHaddock/ImplyDependencies/cabal.out index 07fc04a1119..32f39065358 100644 --- a/cabal-testsuite/PackageTests/NewHaddock/ImplyDependencies/cabal.out +++ b/cabal-testsuite/PackageTests/NewHaddock/ImplyDependencies/cabal.out @@ -11,9 +11,9 @@ Preprocessing library for A-0.1.0.0... Building library for A-0.1.0.0... Preprocessing library for A-0.1.0.0... Running Haddock on library for A-0.1.0.0... -Documentation created: /cabal.dist/work/./dist//A-0.1.0.0/dist/doc/html/A/ +Documentation created: /cabal.dist/work/./dist//A-0.1.0.0/dist/doc/html/A Installing library in Configuring library for B-0.1.0.0... Preprocessing library for B-0.1.0.0... Running Haddock on library for B-0.1.0.0... -Documentation created: /cabal.dist/work/dist/build//ghc-/B-0.1.0.0/doc/html/B/ +Documentation created: /cabal.dist/work/dist/build//ghc-/B-0.1.0.0/doc/html/B diff --git a/cabal-testsuite/PackageTests/NewSdist/DeterministicTrivial/deterministic.test.hs b/cabal-testsuite/PackageTests/NewSdist/DeterministicTrivial/deterministic.test.hs index 67c2944b39c..8b260c9e1ba 100644 --- a/cabal-testsuite/PackageTests/NewSdist/DeterministicTrivial/deterministic.test.hs +++ b/cabal-testsuite/PackageTests/NewSdist/DeterministicTrivial/deterministic.test.hs @@ -24,6 +24,5 @@ main = cabalTest $ do known <- liftIO (BS.readFile knownSdist) unknown <- liftIO (BS.readFile mySdist) - skipIf "#8356" True -- bogus, just to indicate that the test is skipped assertEqual "hashes didn't match for sdist" True True -- assertEqual "hashes didn't match for sdist" (BS16.encode $ SHA256.hash known) (BS16.encode $ SHA256.hash unknown) diff --git a/cabal-testsuite/PackageTests/NewUpdate/RejectFutureIndexStates/cabal.test.hs b/cabal-testsuite/PackageTests/NewUpdate/RejectFutureIndexStates/cabal.test.hs index 475a093360d..442d3508849 100644 --- a/cabal-testsuite/PackageTests/NewUpdate/RejectFutureIndexStates/cabal.test.hs +++ b/cabal-testsuite/PackageTests/NewUpdate/RejectFutureIndexStates/cabal.test.hs @@ -1,13 +1,7 @@ import Test.Cabal.Prelude import Data.List (isPrefixOf) -main = cabalTest $ do - - skip "Flaky test failing in `curl`, see #9530" - - testBody - -testBody = withProjectFile "cabal.project" $ withRemoteRepo "repo" $ do +main = skipIfCIAndWindows 10230 >> cabalTest (flakyIfCI 9530 $ withProjectFile "cabal.project" $ withRemoteRepo "repo" $ do output <- last . words @@ -18,9 +12,9 @@ testBody = withProjectFile "cabal.project" $ withRemoteRepo "repo" $ do <$> recordMode DoNotRecord (cabal' "update" []) -- update golden output with actual timestamp shell "cp" ["cabal.out.in", "cabal.out"] - shell "sed" ["-i''", "-e", "s/REPLACEME/" <> output <> "/g", "cabal.out"] + shell "sed" [ "-i" ++ if not isWindows then "''" else "", "-e", "s/REPLACEME/" <> output <> "/g", "cabal.out"] -- This shall fail with an error message as specified in `cabal.out` fails $ cabal "build" ["--index-state=4000-01-01T00:00:00Z", "fake-pkg"] -- This shall fail by not finding the package, what indicates that it -- accepted an older index-state. - fails $ cabal "build" ["--index-state=2023-01-01T00:00:00Z", "fake-pkg"] + fails $ cabal "build" ["--index-state=2023-01-01T00:00:00Z", "fake-pkg"]) diff --git a/cabal-testsuite/PackageTests/NewUpdate/UpdateIndexState/update-index-state.test.hs b/cabal-testsuite/PackageTests/NewUpdate/UpdateIndexState/update-index-state.test.hs index e6485d51f71..eb3bc8daff7 100644 --- a/cabal-testsuite/PackageTests/NewUpdate/UpdateIndexState/update-index-state.test.hs +++ b/cabal-testsuite/PackageTests/NewUpdate/UpdateIndexState/update-index-state.test.hs @@ -1,19 +1,13 @@ import Test.Cabal.Prelude -main = cabalTest $ do - - skip "Flaky test failing in `curl`, see #9530" - - testBody - -testBody = withRemoteRepo "repo" $ do +main = skipIfCIAndWindows 10230 >> cabalTest (flakyIfCI 9530 $ withRemoteRepo "repo" $ do -- The _first_ update call causes a warning about missing mirrors, the warning -- is platform-dependent and it's not part of the test expectations, so we -- check the output manually. res <- recordMode DoNotRecord $ - cabal' "update" ["repository.localhost,2022-01-28T02:36:41Z"] + cabal' "update" ["repository.localhost,2022-01-28T02:36:41Z"] assertOutputContains "The index-state is set to 2022-01-28T02:36:41Z" res assertOutputDoesNotContain "revert" res cabal "update" ["repository.localhost,2016-09-24T17:47:48Z"] - cabal "update" ["repository.localhost,2022-01-28T02:36:41Z"] + cabal "update" ["repository.localhost,2022-01-28T02:36:41Z"]) diff --git a/cabal-testsuite/PackageTests/InternalVersions/BuildDependsExtra/Main.hs b/cabal-testsuite/PackageTests/NoOSSupport/DynExe/Main.hs similarity index 63% rename from cabal-testsuite/PackageTests/InternalVersions/BuildDependsExtra/Main.hs rename to cabal-testsuite/PackageTests/NoOSSupport/DynExe/Main.hs index d82a4bd93b7..6f2b80aa9ed 100644 --- a/cabal-testsuite/PackageTests/InternalVersions/BuildDependsExtra/Main.hs +++ b/cabal-testsuite/PackageTests/NoOSSupport/DynExe/Main.hs @@ -1,4 +1,4 @@ -module Main where - -main :: IO () -main = return () +module Main where + +main :: IO () +main = pure () diff --git a/cabal-testsuite/PackageTests/NoOSSupport/DynExe/a.cabal b/cabal-testsuite/PackageTests/NoOSSupport/DynExe/a.cabal new file mode 100644 index 00000000000..58868453b6b --- /dev/null +++ b/cabal-testsuite/PackageTests/NoOSSupport/DynExe/a.cabal @@ -0,0 +1,8 @@ +cabal-version: 3.0 +name: aa +version: 0.1.0.0 +build-type: Simple + +executable a + default-language: Haskell2010 + main-is: Main.hs diff --git a/cabal-testsuite/PackageTests/NoOSSupport/DynExe/cabal.out b/cabal-testsuite/PackageTests/NoOSSupport/DynExe/cabal.out new file mode 100644 index 00000000000..53ccefe2347 --- /dev/null +++ b/cabal-testsuite/PackageTests/NoOSSupport/DynExe/cabal.out @@ -0,0 +1,12 @@ +# cabal build +Resolving dependencies... +Build profile: -w ghc- -O1 +In order, the following will be built: + - aa-0.1.0.0 (exe:a) (first run) +Configuring executable 'a' for aa-0.1.0.0... +Warning: Executables will use dynamic linking, but a shared library is not +being built. Linking will fail if any executables depend on the library. +Error: [Cabal-3339] +Operating system: windows, does not support shared executables +Error: [Cabal-7125] +Failed to build aa-0.1.0.0-inplace-a. The failure occurred during the configure step. diff --git a/cabal-testsuite/PackageTests/NoOSSupport/DynExe/cabal.test.hs b/cabal-testsuite/PackageTests/NoOSSupport/DynExe/cabal.test.hs new file mode 100644 index 00000000000..aa0c8e83b7b --- /dev/null +++ b/cabal-testsuite/PackageTests/NoOSSupport/DynExe/cabal.test.hs @@ -0,0 +1,5 @@ +import Test.Cabal.Prelude + +main = do + skipUnlessWindows + cabalTest $ fails $ cabal "build" ["--enable-executable-dynamic", "--disable-shared"] diff --git a/cabal-testsuite/PackageTests/InternalVersions/BuildToolDependsExtra/Main.hs b/cabal-testsuite/PackageTests/NoOSSupport/RelocatableExe/Main.hs similarity index 63% rename from cabal-testsuite/PackageTests/InternalVersions/BuildToolDependsExtra/Main.hs rename to cabal-testsuite/PackageTests/NoOSSupport/RelocatableExe/Main.hs index d82a4bd93b7..6f2b80aa9ed 100644 --- a/cabal-testsuite/PackageTests/InternalVersions/BuildToolDependsExtra/Main.hs +++ b/cabal-testsuite/PackageTests/NoOSSupport/RelocatableExe/Main.hs @@ -1,4 +1,4 @@ -module Main where - -main :: IO () -main = return () +module Main where + +main :: IO () +main = pure () diff --git a/cabal-testsuite/PackageTests/NoOSSupport/RelocatableExe/a.cabal b/cabal-testsuite/PackageTests/NoOSSupport/RelocatableExe/a.cabal new file mode 100644 index 00000000000..58868453b6b --- /dev/null +++ b/cabal-testsuite/PackageTests/NoOSSupport/RelocatableExe/a.cabal @@ -0,0 +1,8 @@ +cabal-version: 3.0 +name: aa +version: 0.1.0.0 +build-type: Simple + +executable a + default-language: Haskell2010 + main-is: Main.hs diff --git a/cabal-testsuite/PackageTests/NoOSSupport/RelocatableExe/cabal.out b/cabal-testsuite/PackageTests/NoOSSupport/RelocatableExe/cabal.out new file mode 100644 index 00000000000..f59d29e6b17 --- /dev/null +++ b/cabal-testsuite/PackageTests/NoOSSupport/RelocatableExe/cabal.out @@ -0,0 +1,10 @@ +# cabal build +Resolving dependencies... +Build profile: -w ghc- -O1 +In order, the following will be built: + - aa-0.1.0.0 (exe:a) (first run) +Configuring executable 'a' for aa-0.1.0.0... +Error: [Cabal-3339] +Operating system: windows, does not support relocatable builds +Error: [Cabal-7125] +Failed to build aa-0.1.0.0-inplace-a. The failure occurred during the configure step. diff --git a/cabal-testsuite/PackageTests/NoOSSupport/RelocatableExe/cabal.test.hs b/cabal-testsuite/PackageTests/NoOSSupport/RelocatableExe/cabal.test.hs new file mode 100644 index 00000000000..448fc6fc22a --- /dev/null +++ b/cabal-testsuite/PackageTests/NoOSSupport/RelocatableExe/cabal.test.hs @@ -0,0 +1,5 @@ +import Test.Cabal.Prelude + +main = do + skipUnlessWindows + cabalTest $ fails $ cabal "build" ["--enable-relocatable"] diff --git a/cabal-testsuite/PackageTests/OfflineFlag/offlineFlag.test.hs b/cabal-testsuite/PackageTests/OfflineFlag/offlineFlag.test.hs index 7c9617a623c..00dc5c17ba6 100644 --- a/cabal-testsuite/PackageTests/OfflineFlag/offlineFlag.test.hs +++ b/cabal-testsuite/PackageTests/OfflineFlag/offlineFlag.test.hs @@ -3,7 +3,6 @@ import Test.Cabal.Prelude main = cabalTest $ withShorterPathForNewBuildStore $ do skipUnlessGhcVersion ">= 8.1" - skipIfWindows withProjectFile "cabal.repo.project" $ do withRepo "repo" $ do fails $ cabal "v2-build" ["current", "--offline"] diff --git a/cabal-testsuite/PackageTests/PathsModule/Executable-Relocatable/setup.test.hs b/cabal-testsuite/PackageTests/PathsModule/Executable-Relocatable/setup.test.hs index ea88c7f9e41..fab6c7c0a06 100644 --- a/cabal-testsuite/PackageTests/PathsModule/Executable-Relocatable/setup.test.hs +++ b/cabal-testsuite/PackageTests/PathsModule/Executable-Relocatable/setup.test.hs @@ -1,7 +1,8 @@ import Test.Cabal.Prelude -- Test that Paths module is generated and usable when relocatable is turned on. -main = setupAndCabalTest $ do - skipIfWindows - skipUnlessGhcVersion ">= 8.0" - withPackageDb $ setup_build ["--enable-relocatable"] +main = do + skipIfWindows "no relocatable builds" + setupAndCabalTest $ do + skipUnlessGhcVersion ">= 8.0" + withPackageDb $ setup_build ["--enable-relocatable"] diff --git a/cabal-testsuite/PackageTests/PkgConfigParse/pkg-config.exe b/cabal-testsuite/PackageTests/PkgConfigParse/pkg-config.exe new file mode 100644 index 00000000000..537023174dc Binary files /dev/null and b/cabal-testsuite/PackageTests/PkgConfigParse/pkg-config.exe differ diff --git a/cabal-testsuite/PackageTests/PkgConfigParse/pkg-config.shim b/cabal-testsuite/PackageTests/PkgConfigParse/pkg-config.shim new file mode 100644 index 00000000000..2c187de462e --- /dev/null +++ b/cabal-testsuite/PackageTests/PkgConfigParse/pkg-config.shim @@ -0,0 +1,2 @@ +path = "FINDSH\sh.exe" +args = "pkg-config" \ No newline at end of file diff --git a/cabal-testsuite/PackageTests/PkgConfigParse/setup.test.hs b/cabal-testsuite/PackageTests/PkgConfigParse/setup.test.hs index 0f860ab637a..edebd2d131c 100644 --- a/cabal-testsuite/PackageTests/PkgConfigParse/setup.test.hs +++ b/cabal-testsuite/PackageTests/PkgConfigParse/setup.test.hs @@ -1,9 +1,17 @@ +import System.Directory import Test.Cabal.Prelude -- Test that invalid unicode in pkg-config output doesn't trip up cabal very much main = cabalTest $ do - -- skipped on windows because using a script to dummy up an executable doesn't work the same. - skipIfWindows + when isWindows $ do + sh <- fmap takeDirectory <$> liftIO (findExecutable "sh") + case sh of + Nothing -> skip "no sh" + Just sh' -> do + let sh'' = concatMap (\c -> case c of + '\\' -> "\\\\\\\\" + x -> [x]) sh' + void $ shell "sed" [ "-i", "-e", "s/FINDSH/" <> sh'' <> "/g", "pkg-config.shim"] cdir <- testCurrentDir `fmap` getTestEnv res <- cabal' "v2-build" ["--extra-prog-path="++cdir, "-v2"] assertOutputContains "Some pkg-config packages have names containing invalid unicode: or" res diff --git a/cabal-testsuite/PackageTests/PreProcess/Hsc2HsOptionsCC/my.cabal b/cabal-testsuite/PackageTests/PreProcess/Hsc2HsOptionsCC/my.cabal index 6d195b52b44..a1f30e58d6c 100644 --- a/cabal-testsuite/PackageTests/PreProcess/Hsc2HsOptionsCC/my.cabal +++ b/cabal-testsuite/PackageTests/PreProcess/Hsc2HsOptionsCC/my.cabal @@ -11,4 +11,3 @@ executable my-executable main-is: Main.hs build-depends: base other-modules: Foo - hsc2hs-options: "--cc=g++" diff --git a/cabal-testsuite/PackageTests/PreProcess/Hsc2HsOptionsCC/setup.test.hs b/cabal-testsuite/PackageTests/PreProcess/Hsc2HsOptionsCC/setup.test.hs index 8dfca6d7d52..eb3a5eb255e 100644 --- a/cabal-testsuite/PackageTests/PreProcess/Hsc2HsOptionsCC/setup.test.hs +++ b/cabal-testsuite/PackageTests/PreProcess/Hsc2HsOptionsCC/setup.test.hs @@ -5,24 +5,34 @@ import System.Directory (findExecutable) -- Check that preprocessors (hsc2hs) are run main = setupAndCabalTest $ do - -- we need "g++" - hasGxx <- liftIO $ fmap isJust $ findExecutable "g++" - skipUnless "g++" hasGxx - - -- Figure out how recent GHC we need - -- https://github.com/msys2/MINGW-packages/issues/3531 - skipIfWindows + -- we need "g++" (or "clang++" in newer Windows) + ghcVer <- isGhcVersion ">= 9.4" + cc <- if isWindows + then + -- The mingw tools distributed with GHC are not usually on the + -- path so we specify the path to cc directly. + joinPath + . (++ ["mingw", "bin", if ghcVer then "clang++.exe" else "g++.exe"]) + . init + . splitPath + . resultOutput + <$> runProgramM ghcProgram ["--print-libdir"] Nothing + else do + hasGxx <- liftIO $ fmap isJust $ findExecutable "g++" + skipUnless "g++" hasGxx + pure "g++" -- we need recent enough hsc2hs -- hsc2hs commit 9671202c11f7fe98e5b96d379532b6f691dc46dd -- Fix when using g++ as C compiler. Patch from elaforge. Fixes ghc #7232 + -- We also require 0.68.8 so that last --cc is the one that applies. p <- requireProgramM hsc2hsProgram case programVersion p of - Nothing -> skip "Unknown hsc2hs version" - Just v | v < mkVersion [0,68] -> skip $ "hsc2hs version: " ++ prettyShow v ++ " < 0.68" - _ -> return () + Nothing -> skip "Unknown hsc2hs version" + Just v | v < mkVersion [0,68,8] -> skip $ "hsc2hs version: " ++ prettyShow v ++ " < 0.68.8" + _ -> return () -- Actual test - setup_build [] + setup_build ["--hsc2hs-options=\"--cc=" <> cc <> "\""] r <- runExe' "my-executable" [] assertOutputContains "Is not C, is C++" r diff --git a/cabal-testsuite/PackageTests/ProfShared/Lib.hs b/cabal-testsuite/PackageTests/ProfShared/Lib.hs new file mode 100644 index 00000000000..516d174a825 --- /dev/null +++ b/cabal-testsuite/PackageTests/ProfShared/Lib.hs @@ -0,0 +1,3 @@ +module Lib where + +lib = 10 diff --git a/cabal-testsuite/PackageTests/ProfShared/exe/Prof.hs b/cabal-testsuite/PackageTests/ProfShared/exe/Prof.hs new file mode 100644 index 00000000000..200915ffefa --- /dev/null +++ b/cabal-testsuite/PackageTests/ProfShared/exe/Prof.hs @@ -0,0 +1,5 @@ +module Main where + +import Lib + +main = print lib diff --git a/cabal-testsuite/PackageTests/ProfShared/profShared.cabal b/cabal-testsuite/PackageTests/ProfShared/profShared.cabal new file mode 100644 index 00000000000..ef348cfecc6 --- /dev/null +++ b/cabal-testsuite/PackageTests/ProfShared/profShared.cabal @@ -0,0 +1,13 @@ +Cabal-Version: 3.8 +Name: prof-shared +Version: 0.1 +Build-Type: Simple + +library + exposed-modules: Lib + Build-Depends: base + +executable Prof + main-is: Prof.hs + hs-source-dirs: exe + build-depends: base, prof-shared diff --git a/cabal-testsuite/PackageTests/ProfShared/setup.test.hs b/cabal-testsuite/PackageTests/ProfShared/setup.test.hs new file mode 100644 index 00000000000..54147e34575 --- /dev/null +++ b/cabal-testsuite/PackageTests/ProfShared/setup.test.hs @@ -0,0 +1,142 @@ +import Test.Cabal.Prelude +import Data.List +import Data.Bifunctor + +data BuildWay = StaticWay | DynWay | ProfWay | ProfDynWay + deriving (Eq, Ord, Show, Read, Enum) + +-- Test building with profiling shared support +main = do + setupTest $ recordMode DoNotRecord $ do + -- Tests are not robust against missing dynamic libraries yet. Would + -- be better to fix this. + skipIfNoSharedLibraries + + let analyse_result expected r = do + + let ls = lines (resultOutput r) + + library_prefix = "Wanted module build ways(library): " + executable_prefix = "Wanted module build ways(executable 'Prof'): " + + get_ways prefix = map (drop (length prefix)) (filter (prefix `isPrefixOf`) ls) + library_ways = read_ways (get_ways library_prefix) + executable_ways = read_ways (get_ways executable_prefix) + + read_ways raw_ways = + case raw_ways of + -- There should only be one + [x] -> (read :: String -> [BuildWay]) x + -- Unless there are none, when we don't built the executable for example + [] -> [] + xs -> error "Unexpected number of log lines" + + way = (library_ways, executable_ways) + + unless (bimap (nub . sort) (nub . sort) expected == bimap (nub . sort) (nub . sort) way) $ + assertFailure $ "Expected:" ++ show expected ++ "\n" ++ "Got:" ++ show way + + requireSuccess r + setupTest $ recordMode DoNotRecord $ do + + has_prof_shared <- hasProfiledSharedLibraries + has_shared <- hasSharedLibraries + + let v = [ StaticWay ] + dyn = [ DynWay | has_shared ] + p_dyn = if has_prof_shared then [ProfDynWay] else p + p = [ ProfWay ] + none = [] + + let run_test args expected = do + setup "configure" args + res <- setup' "build" [] + analyse_result expected res + setup "clean" [] + + + run_test [] + (v <> dyn, v) + + + run_test ["--disable-library-vanilla", "--enable-executable-dynamic"] + (dyn, dyn) + + run_test ["--enable-profiling-shared"] + (v <> dyn <> p_dyn, v) + + run_test ["--enable-profiling-shared", "--enable-executable-dynamic"] + (v <> dyn <> p_dyn, dyn) + + run_test ["--enable-executable-dynamic", "--disable-library-vanilla"] + (dyn, dyn) + + run_test ["--enable-profiling"] + (v <> dyn <> p, p) + + run_test ["--enable-executable-profiling"] + (v <> dyn <> p, p) + + run_test ["--enable-executable-profiling", "--enable-executable-dynamic"] + (v <> dyn <> p_dyn, p_dyn) + + run_test ["--enable-profiling", "--enable-executable-dynamic"] + (v <> dyn <> p_dyn, p_dyn) + + --v dyn p (p exe) + run_test ["--enable-library-profiling", "--enable-executable-profiling"] + (v <> dyn <> p, p) + + run_test ["prof-shared", "--enable-profiling-shared", "--disable-library-vanilla", "--disable-shared"] + (p_dyn, none) + + -- p p_dyn + run_test ["prof-shared", "--enable-profiling-shared", "--enable-library-profiling", "--disable-library-vanilla", "--disable-shared"] + (p <> p_dyn, []) + + -- v p p_dyn + run_test ["prof-shared","--enable-profiling-shared", "--enable-library-profiling", "--enable-library-vanilla", "--disable-shared"] + (v <> p <> p_dyn, none) + + -- v dyn p p_dyn + run_test ["prof-shared", "--enable-profiling-shared", "--enable-library-profiling", "--enable-library-vanilla", "--enable-shared"] + (v <> dyn <> p <> p_dyn, none) + + let run_cabal_test args expected = cabalTest $ recordMode DoNotRecord $ do + has_prof_shared <- hasProfiledSharedLibraries + has_shared <- hasSharedLibraries + -- See GHC commit e400b9babdcf11669f963aeec20078fe7ccfca0d + -- Only installing profiled library is broken on very old ghc-pkg versions + broken_ghc_pkg <- isGhcVersion "<= 8.6.5" + + let cvt_l StaticWay = [ StaticWay ] + cvt_l DynWay = [ DynWay | has_shared ] + cvt_l ProfDynWay = [ProfDynWay | has_prof_shared ] + cvt_l ProfWay = [ ProfWay ] + + let cvt_e StaticWay = StaticWay + cvt_e DynWay = if has_shared then DynWay else error "DynWay" + cvt_e ProfDynWay = if has_prof_shared then ProfDynWay else ProfWay + cvt_e ProfWay = ProfWay + + unless (broken_ghc_pkg && (fst expected == [ProfWay])) $ do + res <- cabal' "v2-build" args + void $ analyse_result (bimap (concatMap cvt_l) (map cvt_e) expected) res + + run_cabal_test ["--disable-shared"] ([StaticWay], [StaticWay]) + run_cabal_test ["--disable-shared", "--disable-executable-dynamic"] ([StaticWay], [StaticWay]) + run_cabal_test ["--enable-shared"] ([DynWay, StaticWay], [StaticWay]) + run_cabal_test ["--enable-executable-dynamic"] ([DynWay, StaticWay], [DynWay]) + run_cabal_test ["--enable-shared", "--disable-library-vanilla", "--enable-executable-dynamic"] ([DynWay], [DynWay]) + + run_cabal_test ["--disable-shared", "--disable-library-vanilla", "--enable-profiling"] ([ProfWay], [ProfWay]) + + run_cabal_test ["--disable-shared", "--enable-profiling"] ([ProfWay, StaticWay], [ProfWay]) + + run_cabal_test ["--disable-shared", "--enable-profiling-shared", "--enable-profiling"] ([ProfDynWay, ProfWay, StaticWay], [ProfWay]) + + run_cabal_test ["--disable-shared", "--enable-profiling", "--enable-profiling-shared", "--enable-executable-dynamic"] ([ProfWay, ProfDynWay, StaticWay], [ProfDynWay]) + + run_cabal_test ["--enable-profiling", "--enable-executable-dynamic"] ([ProfDynWay, ProfWay, DynWay, StaticWay], [ProfDynWay]) + + run_cabal_test ["prof-shared", "--disable-library-profiling", "--enable-profiling", "--enable-executable-dynamic"] ([ProfDynWay, DynWay, StaticWay], []) diff --git a/cabal-testsuite/PackageTests/ProfSharedWarning/Lib.hs b/cabal-testsuite/PackageTests/ProfSharedWarning/Lib.hs new file mode 100644 index 00000000000..516d174a825 --- /dev/null +++ b/cabal-testsuite/PackageTests/ProfSharedWarning/Lib.hs @@ -0,0 +1,3 @@ +module Lib where + +lib = 10 diff --git a/cabal-testsuite/PackageTests/CustomPlain/cabal.project b/cabal-testsuite/PackageTests/ProfSharedWarning/cabal.project similarity index 100% rename from cabal-testsuite/PackageTests/CustomPlain/cabal.project rename to cabal-testsuite/PackageTests/ProfSharedWarning/cabal.project diff --git a/cabal-testsuite/PackageTests/ProfSharedWarning/exe/Prof.hs b/cabal-testsuite/PackageTests/ProfSharedWarning/exe/Prof.hs new file mode 100644 index 00000000000..200915ffefa --- /dev/null +++ b/cabal-testsuite/PackageTests/ProfSharedWarning/exe/Prof.hs @@ -0,0 +1,5 @@ +module Main where + +import Lib + +main = print lib diff --git a/cabal-testsuite/PackageTests/ProfSharedWarning/profShared.cabal b/cabal-testsuite/PackageTests/ProfSharedWarning/profShared.cabal new file mode 100644 index 00000000000..ef348cfecc6 --- /dev/null +++ b/cabal-testsuite/PackageTests/ProfSharedWarning/profShared.cabal @@ -0,0 +1,13 @@ +Cabal-Version: 3.8 +Name: prof-shared +Version: 0.1 +Build-Type: Simple + +library + exposed-modules: Lib + Build-Depends: base + +executable Prof + main-is: Prof.hs + hs-source-dirs: exe + build-depends: base, prof-shared diff --git a/cabal-testsuite/PackageTests/ProfSharedWarning/setup.out b/cabal-testsuite/PackageTests/ProfSharedWarning/setup.out new file mode 100644 index 00000000000..66512712837 --- /dev/null +++ b/cabal-testsuite/PackageTests/ProfSharedWarning/setup.out @@ -0,0 +1,3 @@ +# Setup configure +Configuring prof-shared-0.1... +Warning: Executables will use dynamic linking, but a shared library is not being built. Linking will fail if any executables depend on the library. diff --git a/cabal-testsuite/PackageTests/ProfSharedWarning/setup_prof.out b/cabal-testsuite/PackageTests/ProfSharedWarning/setup_prof.out new file mode 100644 index 00000000000..ad201b3b391 --- /dev/null +++ b/cabal-testsuite/PackageTests/ProfSharedWarning/setup_prof.out @@ -0,0 +1,4 @@ +# Setup configure +Configuring prof-shared-0.1... +Warning: The flag --enable-executable-profiling is deprecated. Please use --enable-profiling instead. +Warning: Executables will use profiled dynamic linking, but a profiled shared library is not being built. Linking will fail if any executables depend on the library. diff --git a/cabal-testsuite/PackageTests/QuasiQuotes/dynamic/setup.test.hs b/cabal-testsuite/PackageTests/QuasiQuotes/dynamic/setup.test.hs index 31309a46f0c..bbc850992fa 100644 --- a/cabal-testsuite/PackageTests/QuasiQuotes/dynamic/setup.test.hs +++ b/cabal-testsuite/PackageTests/QuasiQuotes/dynamic/setup.test.hs @@ -1,5 +1,5 @@ import Test.Cabal.Prelude -- Test building a dynamic library/executable which uses QuasiQuotes main = setupAndCabalTest $ do - skipUnless "no shared libs" =<< hasSharedLibraries + skipIfNoSharedLibraries setup_build ["--enable-shared", "--enable-executable-dynamic"] diff --git a/cabal-testsuite/PackageTests/Recompilation/GHC24926/Repro.hs b/cabal-testsuite/PackageTests/Recompilation/GHC24926/Repro.hs new file mode 100644 index 00000000000..204872538ea --- /dev/null +++ b/cabal-testsuite/PackageTests/Recompilation/GHC24926/Repro.hs @@ -0,0 +1,6 @@ +import Process (a) +import Internal (Unused) + +main :: IO () +main = a + diff --git a/cabal-testsuite/PackageTests/Recompilation/GHC24926/cabal.test.hs b/cabal-testsuite/PackageTests/Recompilation/GHC24926/cabal.test.hs new file mode 100644 index 00000000000..607426f381c --- /dev/null +++ b/cabal-testsuite/PackageTests/Recompilation/GHC24926/cabal.test.hs @@ -0,0 +1,36 @@ +import Test.Cabal.Prelude + +-- See ghc#24926 +main = cabalTest $ do + recordMode DoNotRecord $ do + + root <- testTmpDir <$> getTestEnv + + writeInternalOrig root + cabal "test" [] + + liftIO $ writeFile (root ++ "/src/Internal.hs") + " module Internal where;\ + + \ data Unused = Unused;" + fails $ cabal "test" [] -- broken module on purpose + + writeInternalOrig root + out <- cabal' "test" [] -- shouldn't fail! + + assertOutputDoesNotContain + ": error:" out + assertOutputDoesNotContain + "Cannot continue after interface file error" out + + where + + writeInternalOrig r = liftIO $ do + writeFile (r ++ "/src/Internal.hs") + " module Internal where;\ + + \ data Unused = Unused;\ + + \ b :: IO (); \ + \ b = pure ();" + diff --git a/cabal-testsuite/PackageTests/Recompilation/GHC24926/repro.cabal b/cabal-testsuite/PackageTests/Recompilation/GHC24926/repro.cabal new file mode 100644 index 00000000000..30ad3d92d13 --- /dev/null +++ b/cabal-testsuite/PackageTests/Recompilation/GHC24926/repro.cabal @@ -0,0 +1,19 @@ +cabal-version: 3.0 +name: repro +version: 0.1.0.0 +build-type: Simple + +library + default-language: Haskell2010 + exposed-modules: + Internal + Process + build-depends: base + hs-source-dirs: src + +test-suite repro + default-language: Haskell2010 + type: exitcode-stdio-1.0 + main-is: Repro.hs + build-depends: base, repro + diff --git a/cabal-testsuite/PackageTests/Recompilation/GHC24926/src/Process.hs b/cabal-testsuite/PackageTests/Recompilation/GHC24926/src/Process.hs new file mode 100644 index 00000000000..919c5d46df5 --- /dev/null +++ b/cabal-testsuite/PackageTests/Recompilation/GHC24926/src/Process.hs @@ -0,0 +1,7 @@ +module Process where + +import Internal + +a :: IO () +a = b + diff --git a/cabal-testsuite/PackageTests/Regression/T10046/aa.cabal b/cabal-testsuite/PackageTests/Regression/T10046/aa.cabal new file mode 100644 index 00000000000..4acc7154baa --- /dev/null +++ b/cabal-testsuite/PackageTests/Regression/T10046/aa.cabal @@ -0,0 +1,28 @@ +cabal-version: 3.0 +name: aa +version: 0.1.0.0 +license: NONE +build-type: Simple +extra-doc-files: CHANGELOG.md + +library + exposed-modules: MyLib + build-depends: base, template-haskell + hs-source-dirs: src + default-language: Haskell2010 + +test-suite bb-test + default-language: Haskell2010 + type: exitcode-stdio-1.0 + hs-source-dirs: testbb + main-is: Main.hs + build-depends: + base, aa + +test-suite aa-test + default-language: Haskell2010 + type: exitcode-stdio-1.0 + hs-source-dirs: test + main-is: Main.hs + build-depends: + base diff --git a/cabal-testsuite/PackageTests/Regression/T10046/app/Main.hs b/cabal-testsuite/PackageTests/Regression/T10046/app/Main.hs new file mode 100644 index 00000000000..76a9bdb5d48 --- /dev/null +++ b/cabal-testsuite/PackageTests/Regression/T10046/app/Main.hs @@ -0,0 +1 @@ +main = pure () diff --git a/cabal-testsuite/PackageTests/NewBuild/T4375/cabal.project b/cabal-testsuite/PackageTests/Regression/T10046/cabal.project similarity index 100% rename from cabal-testsuite/PackageTests/NewBuild/T4375/cabal.project rename to cabal-testsuite/PackageTests/Regression/T10046/cabal.project diff --git a/cabal-testsuite/PackageTests/Regression/T10046/cabal.test.hs b/cabal-testsuite/PackageTests/Regression/T10046/cabal.test.hs new file mode 100644 index 00000000000..9b857e2f09a --- /dev/null +++ b/cabal-testsuite/PackageTests/Regression/T10046/cabal.test.hs @@ -0,0 +1,6 @@ +import Test.Cabal.Prelude + +-- T10046 +main = cabalTest $ recordMode DoNotRecord $ do + out <- cabal' "test" ["all"] + assertOutputDoesNotContain "Failed to find the installed unit 'aa-0.1.0.0-inplace'" out diff --git a/cabal-testsuite/PackageTests/Regression/T10046/src/MyLib.hs b/cabal-testsuite/PackageTests/Regression/T10046/src/MyLib.hs new file mode 100644 index 00000000000..ca3816aaab9 --- /dev/null +++ b/cabal-testsuite/PackageTests/Regression/T10046/src/MyLib.hs @@ -0,0 +1,11 @@ +{-# LANGUAGE TemplateHaskell #-} +module MyLib where + +import Control.Concurrent +import Language.Haskell.TH + +-- Must take longer to compile than the testsuite +$(do runIO $ + threadDelay (5*1000*1000) -- 5s + [d| data X |] + ) diff --git a/cabal-testsuite/PackageTests/Regression/T10046/test/Main.hs b/cabal-testsuite/PackageTests/Regression/T10046/test/Main.hs new file mode 100644 index 00000000000..76a9bdb5d48 --- /dev/null +++ b/cabal-testsuite/PackageTests/Regression/T10046/test/Main.hs @@ -0,0 +1 @@ +main = pure () diff --git a/cabal-testsuite/PackageTests/Regression/T10046/testbb/Main.hs b/cabal-testsuite/PackageTests/Regression/T10046/testbb/Main.hs new file mode 100644 index 00000000000..76a9bdb5d48 --- /dev/null +++ b/cabal-testsuite/PackageTests/Regression/T10046/testbb/Main.hs @@ -0,0 +1 @@ +main = pure () diff --git a/cabal-testsuite/PackageTests/Regression/T4025/setup.test.hs b/cabal-testsuite/PackageTests/Regression/T4025/setup.test.hs index 0ec5d068147..b26afa66701 100644 --- a/cabal-testsuite/PackageTests/Regression/T4025/setup.test.hs +++ b/cabal-testsuite/PackageTests/Regression/T4025/setup.test.hs @@ -1,16 +1,13 @@ import Test.Cabal.Prelude -- Test that we don't accidentally add the inplace directory to --- an executable RPATH. Don't test on Windows, which doesn't --- support RPATH. +-- an executable RPATH. main = setupAndCabalTest $ do - skipIfWindows - osx <- isOSX - ghc <- isGhcVersion ">= 8.10.7" - expectBrokenIf (osx && ghc) 7610 $ do -- see also issue #7988 - setup "configure" ["--enable-executable-dynamic"] - setup "build" [] - -- This should fail as it we should NOT be able to find the - -- dynamic library for the internal library (since we didn't - -- install it). If we incorrectly encoded our local dist - -- dir in the RPATH, this will succeed. - recordMode DoNotRecord . fails $ runExe "exe" [] + skipIfNoSharedLibraries + expectBrokenIfOSXAndGhc ">= 8.10.7" 7610 $ do -- see also issue #7988 + setup "configure" ["--enable-executable-dynamic"] + setup "build" [] + -- This should fail as it we should NOT be able to find the + -- dynamic library for the internal library (since we didn't + -- install it). If we incorrectly encoded our local dist + -- dir in the RPATH, this will succeed. + recordMode DoNotRecord . fails $ runExe "exe" [] diff --git a/cabal-testsuite/PackageTests/Regression/T4270/setup.test.hs b/cabal-testsuite/PackageTests/Regression/T4270/setup.test.hs index 258dcc21e16..6dbe57b8ede 100644 --- a/cabal-testsuite/PackageTests/Regression/T4270/setup.test.hs +++ b/cabal-testsuite/PackageTests/Regression/T4270/setup.test.hs @@ -4,10 +4,8 @@ import Test.Cabal.Prelude -- See https://github.com/haskell/cabal/issues/4270 main = setupAndCabalTest $ do skipIfAllCabalVersion "< 2.2" - skipUnless "no shared libs" =<< hasSharedLibraries + skipIfNoSharedLibraries skipUnless "no shared Cabal" =<< hasCabalShared - ghc <- isGhcVersion "== 8.0.2" - osx <- isOSX - expectBrokenIf (osx && ghc) 8028 $ do + expectBrokenIfOSXAndGhc "== 8.0.2" 8028 $ do setup_build ["--enable-tests", "--enable-executable-dynamic"] setup "test" [] diff --git a/cabal-testsuite/PackageTests/Regression/T4291/setup.test.hs b/cabal-testsuite/PackageTests/Regression/T4291/setup.test.hs index a6eb9844785..f5152c93ccb 100644 --- a/cabal-testsuite/PackageTests/Regression/T4291/setup.test.hs +++ b/cabal-testsuite/PackageTests/Regression/T4291/setup.test.hs @@ -3,15 +3,16 @@ import Test.Cabal.Prelude -- Test that checkRelocate doesn't fail when library directory of dependee -- contains '..' -main = setupAndCabalTest $ withPackageDb $ do - skipIfWindows - skipUnlessGhcVersion ">= 7.6" - env <- getTestEnv - let pkgroot = takeDirectory $ testPackageDbDir env - prefix = testTmpDir env "prefix" - assertBool "we need a prefix that is not under pkgroot for this test" $ - not $ pkgroot `isPrefixOf` prefix - withDirectory "dependee" $ - setup_install ["--enable-relocatable", "--prefix", prefix] - withDirectory "depender" $ - setup_install ["--enable-relocatable", "--prefix", prefix] +main = do + skipIfWindows "no relocatable builds" + setupAndCabalTest $ withPackageDb $ do + skipUnlessGhcVersion ">= 7.6" + env <- getTestEnv + let pkgroot = takeDirectory $ testPackageDbDir env + prefix = testTmpDir env "prefix" + assertBool "we need a prefix that is not under pkgroot for this test" $ + not $ pkgroot `isPrefixOf` prefix + withDirectory "dependee" $ + setup_install ["--enable-relocatable", "--prefix", prefix] + withDirectory "depender" $ + setup_install ["--enable-relocatable", "--prefix", prefix] diff --git a/cabal-testsuite/PackageTests/Regression/T5309/cabal.test.hs b/cabal-testsuite/PackageTests/Regression/T5309/cabal.test.hs index a81a75197f3..4700f191578 100644 --- a/cabal-testsuite/PackageTests/Regression/T5309/cabal.test.hs +++ b/cabal-testsuite/PackageTests/Regression/T5309/cabal.test.hs @@ -1,6 +1,6 @@ import Test.Cabal.Prelude main = cabalTest $ do - skipIfWindows -- TODO: https://github.com/haskell/cabal/issues/6271 - cabal "v2-build" ["all"] - cabal "v2-test" ["all"] - cabal "v2-bench" ["all"] + expectBrokenIfWindowsCIAndGhc ">= 9.4" 10189 $ do + cabal "v2-build" ["all"] + cabal "v2-test" ["all"] + cabal "v2-bench" ["all"] diff --git a/cabal-testsuite/PackageTests/Regression/T5677/cabal.test.hs b/cabal-testsuite/PackageTests/Regression/T5677/cabal.test.hs index 27edba49486..a8ea261289a 100644 --- a/cabal-testsuite/PackageTests/Regression/T5677/cabal.test.hs +++ b/cabal-testsuite/PackageTests/Regression/T5677/cabal.test.hs @@ -2,5 +2,4 @@ import Test.Cabal.Prelude main = cabalTest $ do -- -Wmissing-export-lists is new in 8.4. skipUnlessGhcVersion ">= 8.3" - skipIfWindows -- TODO: https://github.com/haskell/cabal/issues/6271 cabal "v2-build" ["all"] diff --git a/cabal-testsuite/PackageTests/Regression/T6906/cabal.test.hs b/cabal-testsuite/PackageTests/Regression/T6906/cabal.test.hs index 233f4a2a3d1..9f71b845736 100644 --- a/cabal-testsuite/PackageTests/Regression/T6906/cabal.test.hs +++ b/cabal-testsuite/PackageTests/Regression/T6906/cabal.test.hs @@ -1,9 +1,7 @@ import Test.Cabal.Prelude main = cabalTest $ do - win <- isWindows - ghcsWithMaxPathIssue <- isGhcVersion "< 8.6.5" - expectBrokenIf (win && ghcsWithMaxPathIssue) 6271 $ do + expectBrokenIfWindowsAndGhc "< 8.6.5" 6271 $ do res <- recordMode DoNotRecord $ cabalG' ["--config=cabal.config"] "v2-install" ["-v3"] assertOutputContains "creating file with the inputs used to compute the package hash:" res assertOutputContains "extra-lib-dirs: bar" res diff --git a/cabal-testsuite/PackageTests/SDist/T8817/cabal.out b/cabal-testsuite/PackageTests/SDist/T8817/cabal.out new file mode 100644 index 00000000000..c99d15276fe --- /dev/null +++ b/cabal-testsuite/PackageTests/SDist/T8817/cabal.out @@ -0,0 +1,2 @@ +# cabal v2-sdist +Wrote tarball sdist to /t8817-0.tar.gz diff --git a/cabal-testsuite/PackageTests/SDist/T8817/cabal.project b/cabal-testsuite/PackageTests/SDist/T8817/cabal.project new file mode 100644 index 00000000000..f69442ca765 --- /dev/null +++ b/cabal-testsuite/PackageTests/SDist/T8817/cabal.project @@ -0,0 +1 @@ +packages: pkg/*.cabal diff --git a/cabal-testsuite/PackageTests/SDist/T8817/cabal.test.hs b/cabal-testsuite/PackageTests/SDist/T8817/cabal.test.hs new file mode 100644 index 00000000000..1fca4955b48 --- /dev/null +++ b/cabal-testsuite/PackageTests/SDist/T8817/cabal.test.hs @@ -0,0 +1,17 @@ +import Test.Cabal.Prelude + +main = cabalTest $ do + tmpdir <- fmap testTmpDir getTestEnv + + cabal "v2-sdist" ["--output-directory", tmpdir, "all"] + + let distTarPath = tmpdir "t8817-0.tar.gz" + distExtractedPath = tmpdir "t8817-0" + + shouldExist distTarPath + + tar ["-xzf", distTarPath] + + shouldExist (distExtractedPath "f1") + shouldExist (distExtractedPath "d1" "f2.txt") + shouldExist (distExtractedPath "d1" "f3.txt") diff --git a/cabal-testsuite/PackageTests/SDist/T8817/pkg/Main.hs b/cabal-testsuite/PackageTests/SDist/T8817/pkg/Main.hs new file mode 100644 index 00000000000..4233a67ecdd --- /dev/null +++ b/cabal-testsuite/PackageTests/SDist/T8817/pkg/Main.hs @@ -0,0 +1 @@ +main = putStrLn "hi" diff --git a/cabal-testsuite/PackageTests/SDist/T8817/pkg/d1/f2.txt b/cabal-testsuite/PackageTests/SDist/T8817/pkg/d1/f2.txt new file mode 100644 index 00000000000..9de77c18733 --- /dev/null +++ b/cabal-testsuite/PackageTests/SDist/T8817/pkg/d1/f2.txt @@ -0,0 +1 @@ +f2 diff --git a/cabal-testsuite/PackageTests/SDist/T8817/pkg/d1/f3.txt b/cabal-testsuite/PackageTests/SDist/T8817/pkg/d1/f3.txt new file mode 100644 index 00000000000..45d9e0e9fc8 --- /dev/null +++ b/cabal-testsuite/PackageTests/SDist/T8817/pkg/d1/f3.txt @@ -0,0 +1 @@ +f3 diff --git a/cabal-testsuite/PackageTests/SDist/T8817/pkg/f1 b/cabal-testsuite/PackageTests/SDist/T8817/pkg/f1 new file mode 100644 index 00000000000..8e1e71d5ce3 --- /dev/null +++ b/cabal-testsuite/PackageTests/SDist/T8817/pkg/f1 @@ -0,0 +1 @@ +f1 diff --git a/cabal-testsuite/PackageTests/SDist/T8817/pkg/t8817.cabal b/cabal-testsuite/PackageTests/SDist/T8817/pkg/t8817.cabal new file mode 100644 index 00000000000..899eb191b84 --- /dev/null +++ b/cabal-testsuite/PackageTests/SDist/T8817/pkg/t8817.cabal @@ -0,0 +1,11 @@ +cabal-version: 3.14 +name: t8817 +version: 0 + +extra-files: + d1/*.txt + f1 + +executable foo + default-language: Haskell2010 + main-is: Main.hs diff --git a/cabal-testsuite/PackageTests/ShowBuildInfo/Complex/single.out b/cabal-testsuite/PackageTests/ShowBuildInfo/Complex/single.out index 98ffd99b300..3825d1f6cf8 100644 --- a/cabal-testsuite/PackageTests/ShowBuildInfo/Complex/single.out +++ b/cabal-testsuite/PackageTests/ShowBuildInfo/Complex/single.out @@ -15,11 +15,11 @@ Warning: [unknown-directory] 'hs-source-dirs: doesnt-exist' specifies a director Preprocessing executable 'Complex' for Complex-0.1.0.0... Building executable 'Complex' for Complex-0.1.0.0... # show-build-info Complex exe:Complex -{"cabal-lib-version":"","compiler":{"flavour":"ghc","compiler-id":"ghc-","path":""},"components":[{"type":"exe","name":"exe:Complex","unit-id":"Complex-0.1.0.0-inplace-Complex","compiler-args":["-fbuilding-cabal-package","-O","-outputdir","single.dist/work/./dist/build//ghc-/Complex-0.1.0.0/x/Complex/build","-odir","single.dist/work/./dist/build//ghc-/Complex-0.1.0.0/x/Complex/build","-hidir","single.dist/work/./dist/build//ghc-/Complex-0.1.0.0/x/Complex/build","-hiedir","single.dist/work/./dist/build//ghc-/Complex-0.1.0.0/x/Complex/build/extra-compilation-artifacts/hie","-stubdir","single.dist/work/./dist/build//ghc-/Complex-0.1.0.0/x/Complex/build","-i","-iapp","-isingle.dist/work/./dist/build//ghc-/Complex-0.1.0.0/x/Complex/build","-isingle.dist/work/./dist/build//ghc-/Complex-0.1.0.0/x/Complex/build/Complex/autogen","-isingle.dist/work/./dist/build//ghc-/Complex-0.1.0.0/x/Complex/build/global-autogen","-Isingle.dist/work/./dist/build//ghc-/Complex-0.1.0.0/x/Complex/build/Complex/autogen","-Isingle.dist/work/./dist/build//ghc-/Complex-0.1.0.0/x/Complex/build/global-autogen","-Isingle.dist/work/./dist/build//ghc-/Complex-0.1.0.0/x/Complex/build","-optP-include","-optPsingle.dist/work/./dist/build//ghc-/Complex-0.1.0.0/x/Complex/build/Complex/autogen/cabal_macros.h","-this-unit-id","Complex-0.1.0.0-inplace-Complex","-hide-all-packages","-Wmissing-home-modules","-no-user-package-db","-package-db","/single.dist/home/.cabal/store/ghc-/package.db","-package-db","/single.dist/work/./dist/packagedb/ghc-","-package-id","","-package-id","","-XHaskell2010","-threaded","-rtsopts","-with-rtsopts=-N -T","-Wredundant-constraints"],"modules":["Other","Paths_Complex"],"src-files":["Main.lhs"],"hs-src-dirs":["app"],"src-dir":"/","cabal-file":"Complex.cabal"}]} +{"cabal-lib-version":"","compiler":{"flavour":"ghc","compiler-id":"ghc-","path":""},"components":[{"type":"exe","name":"exe:Complex","unit-id":"Complex-0.1.0.0-inplace-Complex","compiler-args":["-fbuilding-cabal-package","-O","-outputdir","single.dist/work/./dist/build//ghc-/Complex-0.1.0.0/x/Complex/build","-odir","single.dist/work/./dist/build//ghc-/Complex-0.1.0.0/x/Complex/build","-hidir","single.dist/work/./dist/build//ghc-/Complex-0.1.0.0/x/Complex/build","-hiedir","single.dist/work/./dist/build//ghc-/Complex-0.1.0.0/x/Complex/build/extra-compilation-artifacts/hie","-stubdir","single.dist/work/./dist/build//ghc-/Complex-0.1.0.0/x/Complex/build","-i","-iapp","-isingle.dist/work/./dist/build//ghc-/Complex-0.1.0.0/x/Complex/build","-isingle.dist/work/./dist/build//ghc-/Complex-0.1.0.0/x/Complex/build/Complex/autogen","-isingle.dist/work/./dist/build//ghc-/Complex-0.1.0.0/x/Complex/build/global-autogen","-Isingle.dist/work/./dist/build//ghc-/Complex-0.1.0.0/x/Complex/build/Complex/autogen","-Isingle.dist/work/./dist/build//ghc-/Complex-0.1.0.0/x/Complex/build/global-autogen","-Isingle.dist/work/./dist/build//ghc-/Complex-0.1.0.0/x/Complex/build","-optP-include","-optPsingle.dist/work/./dist/build//ghc-/Complex-0.1.0.0/x/Complex/build/Complex/autogen/cabal_macros.h","-this-unit-id","Complex-0.1.0.0-inplace-Complex","-hide-all-packages","-Wmissing-home-modules","-no-user-package-db","-package-db","/single.dist/home/.cabal/store/ghc-/package.db","-package-db","/single.dist/work/dist/packagedb/ghc-","-package-id","","-package-id","","-XHaskell2010","-threaded","-rtsopts","-with-rtsopts=-N -T","-Wredundant-constraints"],"modules":["Other","Paths_Complex"],"src-files":["Main.lhs"],"hs-src-dirs":["app"],"src-dir":"/","cabal-file":"Complex.cabal"}]} # cabal build Up to date # show-build-info Complex lib -{"cabal-lib-version":"","compiler":{"flavour":"ghc","compiler-id":"ghc-","path":""},"components":[{"type":"lib","name":"lib","unit-id":"Complex-0.1.0.0-inplace","compiler-args":["-fbuilding-cabal-package","-O","-outputdir","single.dist/work/./dist/build//ghc-/Complex-0.1.0.0/build","-odir","single.dist/work/./dist/build//ghc-/Complex-0.1.0.0/build","-hidir","single.dist/work/./dist/build//ghc-/Complex-0.1.0.0/build","-hiedir","single.dist/work/./dist/build//ghc-/Complex-0.1.0.0/build/extra-compilation-artifacts/hie","-stubdir","single.dist/work/./dist/build//ghc-/Complex-0.1.0.0/build","-i","-isrc","-idoesnt-exist","-isingle.dist/work/./dist/build//ghc-/Complex-0.1.0.0/build","-isingle.dist/work/./dist/build//ghc-/Complex-0.1.0.0/build/autogen","-isingle.dist/work/./dist/build//ghc-/Complex-0.1.0.0/build/global-autogen","-Isingle.dist/work/./dist/build//ghc-/Complex-0.1.0.0/build/autogen","-Isingle.dist/work/./dist/build//ghc-/Complex-0.1.0.0/build/global-autogen","-Isingle.dist/work/./dist/build//ghc-/Complex-0.1.0.0/build","-optP-include","-optPsingle.dist/work/./dist/build//ghc-/Complex-0.1.0.0/build/autogen/cabal_macros.h","-this-unit-id","Complex-0.1.0.0-inplace","-hide-all-packages","-Wmissing-home-modules","-no-user-package-db","-package-db","/single.dist/home/.cabal/store/ghc-/package.db","-package-db","/single.dist/work/./dist/packagedb/ghc-","-package-id","","-XHaskell2010","-Wall"],"modules":["A","B","C","D","Paths_Complex"],"src-files":[],"hs-src-dirs":["src","doesnt-exist"],"src-dir":"/","cabal-file":"Complex.cabal"}]} +{"cabal-lib-version":"","compiler":{"flavour":"ghc","compiler-id":"ghc-","path":""},"components":[{"type":"lib","name":"lib","unit-id":"Complex-0.1.0.0-inplace","compiler-args":["-fbuilding-cabal-package","-O","-outputdir","single.dist/work/./dist/build//ghc-/Complex-0.1.0.0/build","-odir","single.dist/work/./dist/build//ghc-/Complex-0.1.0.0/build","-hidir","single.dist/work/./dist/build//ghc-/Complex-0.1.0.0/build","-hiedir","single.dist/work/./dist/build//ghc-/Complex-0.1.0.0/build/extra-compilation-artifacts/hie","-stubdir","single.dist/work/./dist/build//ghc-/Complex-0.1.0.0/build","-i","-isrc","-idoesnt-exist","-isingle.dist/work/./dist/build//ghc-/Complex-0.1.0.0/build","-isingle.dist/work/./dist/build//ghc-/Complex-0.1.0.0/build/autogen","-isingle.dist/work/./dist/build//ghc-/Complex-0.1.0.0/build/global-autogen","-Isingle.dist/work/./dist/build//ghc-/Complex-0.1.0.0/build/autogen","-Isingle.dist/work/./dist/build//ghc-/Complex-0.1.0.0/build/global-autogen","-Isingle.dist/work/./dist/build//ghc-/Complex-0.1.0.0/build","-optP-include","-optPsingle.dist/work/./dist/build//ghc-/Complex-0.1.0.0/build/autogen/cabal_macros.h","-this-unit-id","Complex-0.1.0.0-inplace","-hide-all-packages","-Wmissing-home-modules","-no-user-package-db","-package-db","/single.dist/home/.cabal/store/ghc-/package.db","-package-db","/single.dist/work/dist/packagedb/ghc-","-package-id","","-XHaskell2010","-Wall"],"modules":["A","B","C","D","Paths_Complex"],"src-files":[],"hs-src-dirs":["src","doesnt-exist"],"src-dir":"/","cabal-file":"Complex.cabal"}]} # cabal build Build profile: -w ghc- -O1 In order, the following will be built: @@ -34,7 +34,7 @@ Warning: [unknown-directory] 'hs-source-dirs: doesnt-exist' specifies a director Preprocessing benchmark 'complex-benchmarks' for Complex-0.1.0.0... Building benchmark 'complex-benchmarks' for Complex-0.1.0.0... # show-build-info Complex bench:complex-benchmarks -{"cabal-lib-version":"","compiler":{"flavour":"ghc","compiler-id":"ghc-","path":""},"components":[{"type":"bench","name":"bench:complex-benchmarks","unit-id":"Complex-0.1.0.0-inplace-complex-benchmarks","compiler-args":["-fbuilding-cabal-package","-O","-outputdir","single.dist/work/./dist/build//ghc-/Complex-0.1.0.0/b/complex-benchmarks/build","-odir","single.dist/work/./dist/build//ghc-/Complex-0.1.0.0/b/complex-benchmarks/build","-hidir","single.dist/work/./dist/build//ghc-/Complex-0.1.0.0/b/complex-benchmarks/build","-hiedir","single.dist/work/./dist/build//ghc-/Complex-0.1.0.0/b/complex-benchmarks/build/extra-compilation-artifacts/hie","-stubdir","single.dist/work/./dist/build//ghc-/Complex-0.1.0.0/b/complex-benchmarks/build","-i","-ibenchmark","-isingle.dist/work/./dist/build//ghc-/Complex-0.1.0.0/b/complex-benchmarks/build","-isingle.dist/work/./dist/build//ghc-/Complex-0.1.0.0/b/complex-benchmarks/build/complex-benchmarks/autogen","-isingle.dist/work/./dist/build//ghc-/Complex-0.1.0.0/b/complex-benchmarks/build/global-autogen","-Isingle.dist/work/./dist/build//ghc-/Complex-0.1.0.0/b/complex-benchmarks/build/complex-benchmarks/autogen","-Isingle.dist/work/./dist/build//ghc-/Complex-0.1.0.0/b/complex-benchmarks/build/global-autogen","-Isingle.dist/work/./dist/build//ghc-/Complex-0.1.0.0/b/complex-benchmarks/build","-optP-include","-optPsingle.dist/work/./dist/build//ghc-/Complex-0.1.0.0/b/complex-benchmarks/build/complex-benchmarks/autogen/cabal_macros.h","-this-unit-id","Complex-0.1.0.0-inplace-complex-benchmarks","-hide-all-packages","-Wmissing-home-modules","-no-user-package-db","-package-db","/single.dist/home/.cabal/store/ghc-/package.db","-package-db","/single.dist/work/./dist/packagedb/ghc-","-package-id","","-package-id","","-package-id","","-XHaskell2010","-Wall","-rtsopts","-threaded","-with-rtsopts=-N"],"modules":["Paths_Complex"],"src-files":["Main.hs"],"hs-src-dirs":["benchmark"],"src-dir":"/","cabal-file":"Complex.cabal"}]} +{"cabal-lib-version":"","compiler":{"flavour":"ghc","compiler-id":"ghc-","path":""},"components":[{"type":"bench","name":"bench:complex-benchmarks","unit-id":"Complex-0.1.0.0-inplace-complex-benchmarks","compiler-args":["-fbuilding-cabal-package","-O","-outputdir","single.dist/work/./dist/build//ghc-/Complex-0.1.0.0/b/complex-benchmarks/build","-odir","single.dist/work/./dist/build//ghc-/Complex-0.1.0.0/b/complex-benchmarks/build","-hidir","single.dist/work/./dist/build//ghc-/Complex-0.1.0.0/b/complex-benchmarks/build","-hiedir","single.dist/work/./dist/build//ghc-/Complex-0.1.0.0/b/complex-benchmarks/build/extra-compilation-artifacts/hie","-stubdir","single.dist/work/./dist/build//ghc-/Complex-0.1.0.0/b/complex-benchmarks/build","-i","-ibenchmark","-isingle.dist/work/./dist/build//ghc-/Complex-0.1.0.0/b/complex-benchmarks/build","-isingle.dist/work/./dist/build//ghc-/Complex-0.1.0.0/b/complex-benchmarks/build/complex-benchmarks/autogen","-isingle.dist/work/./dist/build//ghc-/Complex-0.1.0.0/b/complex-benchmarks/build/global-autogen","-Isingle.dist/work/./dist/build//ghc-/Complex-0.1.0.0/b/complex-benchmarks/build/complex-benchmarks/autogen","-Isingle.dist/work/./dist/build//ghc-/Complex-0.1.0.0/b/complex-benchmarks/build/global-autogen","-Isingle.dist/work/./dist/build//ghc-/Complex-0.1.0.0/b/complex-benchmarks/build","-optP-include","-optPsingle.dist/work/./dist/build//ghc-/Complex-0.1.0.0/b/complex-benchmarks/build/complex-benchmarks/autogen/cabal_macros.h","-this-unit-id","Complex-0.1.0.0-inplace-complex-benchmarks","-hide-all-packages","-Wmissing-home-modules","-no-user-package-db","-package-db","/single.dist/home/.cabal/store/ghc-/package.db","-package-db","/single.dist/work/dist/packagedb/ghc-","-package-id","","-package-id","","-package-id","","-XHaskell2010","-Wall","-rtsopts","-threaded","-with-rtsopts=-N"],"modules":["Paths_Complex"],"src-files":["Main.hs"],"hs-src-dirs":["benchmark"],"src-dir":"/","cabal-file":"Complex.cabal"}]} # cabal build Build profile: -w ghc- -O1 In order, the following will be built: @@ -49,7 +49,7 @@ Warning: [unknown-directory] 'hs-source-dirs: doesnt-exist' specifies a director Preprocessing test suite 'func-test' for Complex-0.1.0.0... Building test suite 'func-test' for Complex-0.1.0.0... # show-build-info Complex test:func-test -{"cabal-lib-version":"","compiler":{"flavour":"ghc","compiler-id":"ghc-","path":""},"components":[{"type":"test","name":"test:func-test","unit-id":"Complex-0.1.0.0-inplace-func-test","compiler-args":["-fbuilding-cabal-package","-O","-outputdir","single.dist/work/./dist/build//ghc-/Complex-0.1.0.0/t/func-test/build","-odir","single.dist/work/./dist/build//ghc-/Complex-0.1.0.0/t/func-test/build","-hidir","single.dist/work/./dist/build//ghc-/Complex-0.1.0.0/t/func-test/build","-hiedir","single.dist/work/./dist/build//ghc-/Complex-0.1.0.0/t/func-test/build/extra-compilation-artifacts/hie","-stubdir","single.dist/work/./dist/build//ghc-/Complex-0.1.0.0/t/func-test/build","-i","-itest","-isingle.dist/work/./dist/build//ghc-/Complex-0.1.0.0/t/func-test/build","-isingle.dist/work/./dist/build//ghc-/Complex-0.1.0.0/t/func-test/build/func-test/autogen","-isingle.dist/work/./dist/build//ghc-/Complex-0.1.0.0/t/func-test/build/global-autogen","-Isingle.dist/work/./dist/build//ghc-/Complex-0.1.0.0/t/func-test/build/func-test/autogen","-Isingle.dist/work/./dist/build//ghc-/Complex-0.1.0.0/t/func-test/build/global-autogen","-Isingle.dist/work/./dist/build//ghc-/Complex-0.1.0.0/t/func-test/build","-optP-include","-optPsingle.dist/work/./dist/build//ghc-/Complex-0.1.0.0/t/func-test/build/func-test/autogen/cabal_macros.h","-this-unit-id","Complex-0.1.0.0-inplace-func-test","-hide-all-packages","-Wmissing-home-modules","-no-user-package-db","-package-db","/single.dist/home/.cabal/store/ghc-/package.db","-package-db","/single.dist/work/./dist/packagedb/ghc-","-package-id","","-package-id","","-package-id","","-XHaskell2010"],"modules":[],"src-files":["FuncMain.hs"],"hs-src-dirs":["test"],"src-dir":"/","cabal-file":"Complex.cabal"}]} +{"cabal-lib-version":"","compiler":{"flavour":"ghc","compiler-id":"ghc-","path":""},"components":[{"type":"test","name":"test:func-test","unit-id":"Complex-0.1.0.0-inplace-func-test","compiler-args":["-fbuilding-cabal-package","-O","-outputdir","single.dist/work/./dist/build//ghc-/Complex-0.1.0.0/t/func-test/build","-odir","single.dist/work/./dist/build//ghc-/Complex-0.1.0.0/t/func-test/build","-hidir","single.dist/work/./dist/build//ghc-/Complex-0.1.0.0/t/func-test/build","-hiedir","single.dist/work/./dist/build//ghc-/Complex-0.1.0.0/t/func-test/build/extra-compilation-artifacts/hie","-stubdir","single.dist/work/./dist/build//ghc-/Complex-0.1.0.0/t/func-test/build","-i","-itest","-isingle.dist/work/./dist/build//ghc-/Complex-0.1.0.0/t/func-test/build","-isingle.dist/work/./dist/build//ghc-/Complex-0.1.0.0/t/func-test/build/func-test/autogen","-isingle.dist/work/./dist/build//ghc-/Complex-0.1.0.0/t/func-test/build/global-autogen","-Isingle.dist/work/./dist/build//ghc-/Complex-0.1.0.0/t/func-test/build/func-test/autogen","-Isingle.dist/work/./dist/build//ghc-/Complex-0.1.0.0/t/func-test/build/global-autogen","-Isingle.dist/work/./dist/build//ghc-/Complex-0.1.0.0/t/func-test/build","-optP-include","-optPsingle.dist/work/./dist/build//ghc-/Complex-0.1.0.0/t/func-test/build/func-test/autogen/cabal_macros.h","-this-unit-id","Complex-0.1.0.0-inplace-func-test","-hide-all-packages","-Wmissing-home-modules","-no-user-package-db","-package-db","/single.dist/home/.cabal/store/ghc-/package.db","-package-db","/single.dist/work/dist/packagedb/ghc-","-package-id","","-package-id","","-package-id","","-XHaskell2010"],"modules":[],"src-files":["FuncMain.hs"],"hs-src-dirs":["test"],"src-dir":"/","cabal-file":"Complex.cabal"}]} # cabal build Build profile: -w ghc- -O1 In order, the following will be built: @@ -64,4 +64,4 @@ Warning: [unknown-directory] 'hs-source-dirs: doesnt-exist' specifies a director Preprocessing test suite 'unit-test' for Complex-0.1.0.0... Building test suite 'unit-test' for Complex-0.1.0.0... # show-build-info Complex test:unit-test -{"cabal-lib-version":"","compiler":{"flavour":"ghc","compiler-id":"ghc-","path":""},"components":[{"type":"test","name":"test:unit-test","unit-id":"Complex-0.1.0.0-inplace-unit-test","compiler-args":["-fbuilding-cabal-package","-O","-outputdir","single.dist/work/./dist/build//ghc-/Complex-0.1.0.0/t/unit-test/build","-odir","single.dist/work/./dist/build//ghc-/Complex-0.1.0.0/t/unit-test/build","-hidir","single.dist/work/./dist/build//ghc-/Complex-0.1.0.0/t/unit-test/build","-hiedir","single.dist/work/./dist/build//ghc-/Complex-0.1.0.0/t/unit-test/build/extra-compilation-artifacts/hie","-stubdir","single.dist/work/./dist/build//ghc-/Complex-0.1.0.0/t/unit-test/build","-i","-itest","-isingle.dist/work/./dist/build//ghc-/Complex-0.1.0.0/t/unit-test/build","-isingle.dist/work/./dist/build//ghc-/Complex-0.1.0.0/t/unit-test/build/unit-test/autogen","-isingle.dist/work/./dist/build//ghc-/Complex-0.1.0.0/t/unit-test/build/global-autogen","-Isingle.dist/work/./dist/build//ghc-/Complex-0.1.0.0/t/unit-test/build/unit-test/autogen","-Isingle.dist/work/./dist/build//ghc-/Complex-0.1.0.0/t/unit-test/build/global-autogen","-Isingle.dist/work/./dist/build//ghc-/Complex-0.1.0.0/t/unit-test/build","-optP-include","-optPsingle.dist/work/./dist/build//ghc-/Complex-0.1.0.0/t/unit-test/build/unit-test/autogen/cabal_macros.h","-this-unit-id","Complex-0.1.0.0-inplace-unit-test","-hide-all-packages","-Wmissing-home-modules","-no-user-package-db","-package-db","/single.dist/home/.cabal/store/ghc-/package.db","-package-db","/single.dist/work/./dist/packagedb/ghc-","-package-id","","-package-id","","-XHaskell2010"],"modules":[],"src-files":["UnitMain.hs"],"hs-src-dirs":["test"],"src-dir":"/","cabal-file":"Complex.cabal"}]} +{"cabal-lib-version":"","compiler":{"flavour":"ghc","compiler-id":"ghc-","path":""},"components":[{"type":"test","name":"test:unit-test","unit-id":"Complex-0.1.0.0-inplace-unit-test","compiler-args":["-fbuilding-cabal-package","-O","-outputdir","single.dist/work/./dist/build//ghc-/Complex-0.1.0.0/t/unit-test/build","-odir","single.dist/work/./dist/build//ghc-/Complex-0.1.0.0/t/unit-test/build","-hidir","single.dist/work/./dist/build//ghc-/Complex-0.1.0.0/t/unit-test/build","-hiedir","single.dist/work/./dist/build//ghc-/Complex-0.1.0.0/t/unit-test/build/extra-compilation-artifacts/hie","-stubdir","single.dist/work/./dist/build//ghc-/Complex-0.1.0.0/t/unit-test/build","-i","-itest","-isingle.dist/work/./dist/build//ghc-/Complex-0.1.0.0/t/unit-test/build","-isingle.dist/work/./dist/build//ghc-/Complex-0.1.0.0/t/unit-test/build/unit-test/autogen","-isingle.dist/work/./dist/build//ghc-/Complex-0.1.0.0/t/unit-test/build/global-autogen","-Isingle.dist/work/./dist/build//ghc-/Complex-0.1.0.0/t/unit-test/build/unit-test/autogen","-Isingle.dist/work/./dist/build//ghc-/Complex-0.1.0.0/t/unit-test/build/global-autogen","-Isingle.dist/work/./dist/build//ghc-/Complex-0.1.0.0/t/unit-test/build","-optP-include","-optPsingle.dist/work/./dist/build//ghc-/Complex-0.1.0.0/t/unit-test/build/unit-test/autogen/cabal_macros.h","-this-unit-id","Complex-0.1.0.0-inplace-unit-test","-hide-all-packages","-Wmissing-home-modules","-no-user-package-db","-package-db","/single.dist/home/.cabal/store/ghc-/package.db","-package-db","/single.dist/work/dist/packagedb/ghc-","-package-id","","-package-id","","-XHaskell2010"],"modules":[],"src-files":["UnitMain.hs"],"hs-src-dirs":["test"],"src-dir":"/","cabal-file":"Complex.cabal"}]} diff --git a/cabal-testsuite/PackageTests/TestNameCollision/setup.cabal.out b/cabal-testsuite/PackageTests/TestNameCollision/setup.cabal.out index a86a3788e72..9e42bccb4fb 100644 --- a/cabal-testsuite/PackageTests/TestNameCollision/setup.cabal.out +++ b/cabal-testsuite/PackageTests/TestNameCollision/setup.cabal.out @@ -18,5 +18,5 @@ Building test suite 'parent' for child-0.1... Running 1 test suites... Test suite parent: RUNNING... Test suite parent: PASS -Test suite logged to: ../setup.cabal.dist/work/child/dist/test/child-0.1-parent.log +Test suite logged to: ./child/../setup.cabal.dist/work/child/dist/test/child-0.1-parent.log 1 of 1 test suites (1 of 1 test cases) passed. diff --git a/cabal-testsuite/PackageTests/TestNameCollision/setup.out b/cabal-testsuite/PackageTests/TestNameCollision/setup.out index c76a83141c1..70dfb63e581 100644 --- a/cabal-testsuite/PackageTests/TestNameCollision/setup.out +++ b/cabal-testsuite/PackageTests/TestNameCollision/setup.out @@ -18,5 +18,5 @@ Building test suite 'parent' for child-0.1... Running 1 test suites... Test suite parent: RUNNING... Test suite parent: PASS -Test suite logged to: ../setup.dist/work/child/dist/test/child-0.1-parent.log +Test suite logged to: ./child/../setup.dist/work/child/dist/test/child-0.1-parent.log 1 of 1 test suites (1 of 1 test cases) passed. diff --git a/cabal-testsuite/PackageTests/TestSuiteTests/ExeV10/cabal-with-hpc.multitest.hs b/cabal-testsuite/PackageTests/TestSuiteTests/ExeV10/cabal-with-hpc.multitest.hs index 14f12247548..172b48d8c80 100644 --- a/cabal-testsuite/PackageTests/TestSuiteTests/ExeV10/cabal-with-hpc.multitest.hs +++ b/cabal-testsuite/PackageTests/TestSuiteTests/ExeV10/cabal-with-hpc.multitest.hs @@ -8,10 +8,9 @@ import qualified Distribution.Verbosity as Verbosity import Test.Cabal.Prelude -main = cabalTest $ do - skipIf "osx" =<< isOSX -- TODO: re-enable this once the macOS CI - -- issues are resolved, see discussion in #4902. - +main = do + skipIfCIAndOSX 4902 + cabalTest $ do hasShared <- hasSharedLibraries hasProfiled <- hasProfiledLibraries hpcOk <- correctHpcVersion diff --git a/cabal-testsuite/PackageTests/WarnEarlyOverwrite/clean-install-by-copy.test.hs b/cabal-testsuite/PackageTests/WarnEarlyOverwrite/clean-install-by-copy.test.hs index 710878ce1f0..353caa5b5c8 100644 --- a/cabal-testsuite/PackageTests/WarnEarlyOverwrite/clean-install-by-copy.test.hs +++ b/cabal-testsuite/PackageTests/WarnEarlyOverwrite/clean-install-by-copy.test.hs @@ -1,14 +1,6 @@ import Test.Cabal.Prelude -main = cabalTest $ withShorterPathForNewBuildStore $ do +main = cabalTest $ expectBrokenIfWindows 10180 $ withShorterPathForNewBuildStore $ do storeDir <- testStoreDir <$> getTestEnv let options = ["--installdir=" ++ storeDir] - -- Use install method copy that should surely work on Windows too but our - -- path normalization for testing is not good enough yet as can be seen in - -- this CI failure snippet diff: - -- -Warning: The directory /ghc-/incoming/new-/ghc-/-/bin is not in the system search path. - -- -Copying 'warn-early-overwrite' to '/warn-early-overwrite' - -- +Warning: The directory /incoming/new-2448/Users/RUNNER~1/AppData/Local/Temp/cabal-test-store-28260/ghc-/WarnEarlyOver_-0.1.0.0-4c19059e06a32b93b2812983631117e77a2d3833/bin is not in the system search path. - -- +Copying 'warn-early-overwrite' to '' - skipIfWindows cabalG options "v2-install" ["--install-method=copy"] diff --git a/cabal-testsuite/PackageTests/WarnEarlyOverwrite/clean-install-by-symlink.test.hs b/cabal-testsuite/PackageTests/WarnEarlyOverwrite/clean-install-by-symlink.test.hs index f4e6556b167..62f9305d4ee 100644 --- a/cabal-testsuite/PackageTests/WarnEarlyOverwrite/clean-install-by-symlink.test.hs +++ b/cabal-testsuite/PackageTests/WarnEarlyOverwrite/clean-install-by-symlink.test.hs @@ -1,8 +1,6 @@ import Test.Cabal.Prelude -main = cabalTest $ withShorterPathForNewBuildStore $ do +main = cabalTest $ expectBrokenIfWindows 10180 $ withShorterPathForNewBuildStore $ do storeDir <- testStoreDir <$> getTestEnv - -- The default install method is symlink that may not work on Windows. - skipIfWindows let options = ["--installdir=" ++ storeDir] cabalG options "v2-install" [] diff --git a/cabal-testsuite/PackageTests/WarnEarlyOverwrite/dirty-install.test.hs b/cabal-testsuite/PackageTests/WarnEarlyOverwrite/dirty-install.test.hs index 8d2ae8e6cc5..17008de3f7c 100644 --- a/cabal-testsuite/PackageTests/WarnEarlyOverwrite/dirty-install.test.hs +++ b/cabal-testsuite/PackageTests/WarnEarlyOverwrite/dirty-install.test.hs @@ -2,14 +2,11 @@ import Test.Cabal.Prelude import System.FilePath -main = cabalTest $ withShorterPathForNewBuildStore $ do - +main = cabalTest $ expectBrokenIfWindows 10180 $ withShorterPathForNewBuildStore $ do storeDir <- testStoreDir <$> getTestEnv - -- Windows does not natively include a touch command. - -- SEE: https://stackoverflow.com/questions/30011267/create-an-empty-file-on-the-commandline-in-windows-like-the-linux-touch-command - skipIfWindows let options = ["--installdir=" ++ storeDir] -- Touch the target to see if the warning is made early before the build. - _ <- runM "touch" [storeDir "warn-early-overwrite"] Nothing + _ <- runM "touch" [ (if isWindows then (<.> "exe") else id) + $ storeDir "warn-early-overwrite" ] Nothing fails $ cabalG options "v2-install" [] cabalG options "v2-install" ["--overwrite-policy=always"] diff --git a/cabal-testsuite/PackageTests/WorkingDirRel/WD_NO_MENTION/CHANGELOG.md b/cabal-testsuite/PackageTests/WorkingDirRel/WD_NO_MENTION/CHANGELOG.md new file mode 100644 index 00000000000..2959e9a055b --- /dev/null +++ b/cabal-testsuite/PackageTests/WorkingDirRel/WD_NO_MENTION/CHANGELOG.md @@ -0,0 +1,5 @@ +# Revision history for n + +## 0.1.0.0 -- YYYY-mm-dd + +* First version. Released on an unsuspecting world. diff --git a/cabal-testsuite/PackageTests/WorkingDirRel/WD_NO_MENTION/app/Main.hsc b/cabal-testsuite/PackageTests/WorkingDirRel/WD_NO_MENTION/app/Main.hsc new file mode 100644 index 00000000000..918e213f57b --- /dev/null +++ b/cabal-testsuite/PackageTests/WorkingDirRel/WD_NO_MENTION/app/Main.hsc @@ -0,0 +1,3 @@ +module Main where + +main = print () diff --git a/cabal-testsuite/PackageTests/WorkingDirRel/WD_NO_MENTION/n.cabal b/cabal-testsuite/PackageTests/WorkingDirRel/WD_NO_MENTION/n.cabal new file mode 100644 index 00000000000..83acab380b3 --- /dev/null +++ b/cabal-testsuite/PackageTests/WorkingDirRel/WD_NO_MENTION/n.cabal @@ -0,0 +1,19 @@ +cabal-version: 3.0 +name: n +version: 0.1.0.0 +license: NONE +author: Matthew Pickering +maintainer: matthewtpickering@gmail.com +build-type: Simple +extra-doc-files: CHANGELOG.md + +common warnings + ghc-options: -Wall + +executable n + import: warnings + main-is: Main.hs + build-depends: base + hs-source-dirs: app + build-tool-depends: hsc2hs:hsc2hs + default-language: Haskell2010 diff --git a/cabal-testsuite/PackageTests/WorkingDirRel/setup.test.hs b/cabal-testsuite/PackageTests/WorkingDirRel/setup.test.hs new file mode 100644 index 00000000000..01fbfb9795c --- /dev/null +++ b/cabal-testsuite/PackageTests/WorkingDirRel/setup.test.hs @@ -0,0 +1,4 @@ +import Test.Cabal.Prelude + +main = setupTest $ recordMode DoNotRecord $ do + withDirectory "WD_NO_MENTION" $ setup_build [] diff --git a/cabal-testsuite/PackageTests/postCheckoutCommand/cabal.test.hs b/cabal-testsuite/PackageTests/postCheckoutCommand/cabal.test.hs index d4747aceb92..50e45454ff3 100644 --- a/cabal-testsuite/PackageTests/postCheckoutCommand/cabal.test.hs +++ b/cabal-testsuite/PackageTests/postCheckoutCommand/cabal.test.hs @@ -1,7 +1,6 @@ import Test.Cabal.Prelude main = cabalTest $ do - skipIfWindows withProjectFile "cabal.positive.project" $ do cabal "v2-build" ["-v0"] withProjectFile "cabal.negative.project" $ do diff --git a/cabal-testsuite/README.md b/cabal-testsuite/README.md index 79b9185fecb..73b39d56801 100644 --- a/cabal-testsuite/README.md +++ b/cabal-testsuite/README.md @@ -200,17 +200,29 @@ and stderr. these with include `hasSharedLibraries`, `hasProfiledLibraries`, `hasCabalShared`, `isGhcVersion`, `isWindows`, `isLinux`, `isOSX`. +There are some pre-defined versions of those combinators like `skipIfWindows` +or `skipIfCI`. If possible try to use those as the error message will be uniform +with other tests, allowing for `grep`ing the output more easily. + +Make sure that you only skip tests which cannot be run by fundamental reasons, +like the OS or the capabilities of the GHC version. If a test is failing do not +skip it, mark it as broken instead (see next question). + +**How do I mark a test as broken?** Use `expectBroken`, which takes +the ticket number as its first argument. + +**How do I mark a flaky test?** If a test passes only sometimes for unknown +reasons, it is better to mark it as flaky with the `flaky` and `flakyIf` +combinators. They both take a ticket number so the flaky tests has to be tracked +in an issue. Flaky tests are executed, and the outcome is reported by the +test-suite but even if they fail they won't make the test-suite fail. + **I programmatically modified a file in my test suite, but Cabal/GHC doesn't seem to be picking it up.** You need to sleep sufficiently long before editing a file, in order for file system timestamp resolution to pick it up. Use `withDelay` and `delay` prior to making a modification. -**How do I mark a test as broken?** Use `expectBroken`, which takes -the ticket number as its first argument. Note that this does NOT -handle accept-test brokenness, so you will have to add a manual -string output test, if that is how your test is "failing." - Hermetic tests -------------- diff --git a/cabal-testsuite/Setup.hs b/cabal-testsuite/Setup.hs index ca4ab043b04..3a4a335b86e 100644 --- a/cabal-testsuite/Setup.hs +++ b/cabal-testsuite/Setup.hs @@ -30,7 +30,10 @@ generateScriptEnvModule lbi verbosity = do createDirectoryIfMissing True moduledir rewriteFileEx verbosity (moduledir "ScriptEnv0.hs") $ unlines - [ "module Test.Cabal.ScriptEnv0 where" + [ "{-# LANGUAGE OverloadedStrings #-}" + , "{-# LANGUAGE FlexibleInstances #-}" + , "{-# OPTIONS_GHC -Wno-orphans #-}" + , "module Test.Cabal.ScriptEnv0 where" , "" , "import Distribution.Simple" , "import Distribution.System (Platform(..), Arch(..), OS(..))" @@ -38,8 +41,10 @@ generateScriptEnvModule lbi verbosity = do , "import Distribution.Simple.Program.Db" , "import Distribution.Backpack (OpenUnitId)" , "import Data.Map (fromList)" + , "import Data.String (IsString(..))" + , "import Distribution.Utils.Path" , "" - , "lbiPackageDbStack :: PackageDBStack" + , "lbiPackageDbStack :: PackageDBStackCWD" , "lbiPackageDbStack = " ++ show lbiPackageDbStack , "" , "lbiPlatform :: Platform" @@ -56,6 +61,9 @@ generateScriptEnvModule lbi verbosity = do , "" , "lbiWithSharedLib :: Bool" , "lbiWithSharedLib = " ++ show (withSharedLib lbi) + , "" + , "instance IsString (SymbolicPath from to) where" + , " fromString = makeSymbolicPath" ] where moduledir = libAutogenDir "Test" "Cabal" diff --git a/cabal-testsuite/cabal-testsuite.cabal b/cabal-testsuite/cabal-testsuite.cabal index 1a6ed19967c..7de6a531115 100644 --- a/cabal-testsuite/cabal-testsuite.cabal +++ b/cabal-testsuite/cabal-testsuite.cabal @@ -26,9 +26,9 @@ common shared default-language: Haskell2010 build-depends: - , base >= 4.11 && < 4.20 + , base >= 4.11 && < 4.22 -- this needs to match the in-tree lib:Cabal version - , Cabal ^>= 3.13.0.0 + , Cabal ^>= 3.15.0.0 ghc-options: -Wall @@ -70,6 +70,7 @@ library , directory ^>= 1.2.0.1 || ^>= 1.3.0.0 , exceptions ^>= 0.10.0 , filepath ^>= 1.3.0.1 || ^>= 1.4.0.0 || ^>= 1.5.0.0 + , Glob ^>= 0.10.2 , network-wait ^>= 0.1.2.0 || ^>= 0.2.0.0 , optparse-applicative ^>= 0.14.3.0 || ^>=0.15.1.0 || ^>=0.16.0.0 || ^>= 0.17.0.0 || ^>= 0.18.1.0 , process ^>= 1.2.1.0 || ^>= 1.4.2.0 || ^>= 1.6.1.0 @@ -91,7 +92,7 @@ executable cabal-tests import: shared main-is: cabal-tests.hs hs-source-dirs: main - ghc-options: -threaded + ghc-options: -threaded -rtsopts -- Make sure these are built before the executable is run build-tool-depends: cabal-testsuite:test-runtime-deps build-depends: @@ -145,9 +146,8 @@ executable test-runtime-deps custom-setup -- we only depend on even stable releases of lib:Cabal - -- and due to Custom complexity and ConstraintSetupCabalMaxVersion - -- it has to be the latest release version plus - -- you have to use the latest cabal-install release - setup-depends: Cabal == 3.10.*, - Cabal-syntax == 3.10.*, + -- and must match the release used in validate.yml (see + -- https://github.com/haskell/cabal/pull/10251) + setup-depends: Cabal ^>= 3.12.1, + Cabal-syntax ^>= 3.12.1, base, filepath, directory diff --git a/cabal-testsuite/main/cabal-tests.hs b/cabal-testsuite/main/cabal-tests.hs index c3d167e3b8c..4ffdadd4352 100644 --- a/cabal-testsuite/main/cabal-tests.hs +++ b/cabal-testsuite/main/cabal-tests.hs @@ -28,17 +28,11 @@ import qualified System.Clock as Clock import System.IO import System.FilePath import System.Exit -import System.Process (callProcess, showCommandForUser) +import System.Process (readProcessWithExitCode, showCommandForUser) import System.Directory import Distribution.Pretty import Data.Maybe -#if !MIN_VERSION_base(4,12,0) -import Data.Monoid ((<>)) -#endif -#if !MIN_VERSION_base(4,8,0) -import Data.Monoid (mempty) -#endif {- Note [Testsuite package environments] @@ -125,12 +119,13 @@ mainArgParser = MainArgs <*> commonArgParser -- Unpack and build a specific released version of Cabal and Cabal-syntax libraries -buildCabalLibsProject :: String -> Verbosity -> Maybe FilePath -> FilePath -> IO FilePath +buildCabalLibsProject :: String -> Verbosity -> Maybe FilePath -> FilePath -> IO [FilePath] buildCabalLibsProject projString verb mbGhc dir = do let prog_db = userSpecifyPaths [("ghc", path) | Just path <- [mbGhc] ] defaultProgramDb (cabal, _) <- requireProgram verb (simpleProgram "cabal") prog_db (ghc, _) <- requireProgram verb ghcProgram prog_db + let storeRoot = dir "store" let pv = fromMaybe (error "no ghc version") (programVersion ghc) let final_package_db = dir "dist-newstyle" "packagedb" "ghc-" ++ prettyShow pv createDirectoryIfMissing True dir @@ -138,16 +133,24 @@ buildCabalLibsProject projString verb mbGhc dir = do runProgramInvocation verb ((programInvocation cabal - ["--store-dir", dir "store" + ["--store-dir", storeRoot , "--project-file=" ++ dir "cabal.project-test" , "build" , "-w", programPath ghc , "Cabal", "Cabal-syntax", "Cabal-hooks" ] ) { progInvokeCwd = Just dir }) - return final_package_db + -- Determine the path to the packagedb in the store for this ghc version + storesByGhc <- getDirectoryContents storeRoot + case filter (prettyShow pv `isInfixOf`) storesByGhc of + [] -> return [final_package_db] + storeForGhc:_ -> do + let storePackageDB = (storeRoot storeForGhc "package.db") + return [storePackageDB, final_package_db] -buildCabalLibsSpecific :: String -> Verbosity -> Maybe FilePath -> FilePath -> IO FilePath + + +buildCabalLibsSpecific :: String -> Verbosity -> Maybe FilePath -> FilePath -> IO [FilePath] buildCabalLibsSpecific ver verb mbGhc builddir_rel = do let prog_db = userSpecifyPaths [("ghc", path) | Just path <- [mbGhc] ] defaultProgramDb (cabal, _) <- requireProgram verb (simpleProgram "cabal") prog_db @@ -166,7 +169,7 @@ buildCabalLibsSpecific ver verb mbGhc builddir_rel = do buildCabalLibsProject ("packages: Cabal-" ++ ver ++ " Cabal-syntax-" ++ ver ++ " Cabal-hooks-" ++ hooksVer) verb mbGhc dir -buildCabalLibsIntree :: String -> Verbosity -> Maybe FilePath -> FilePath -> IO FilePath +buildCabalLibsIntree :: String -> Verbosity -> Maybe FilePath -> FilePath -> IO [FilePath] buildCabalLibsIntree root verb mbGhc builddir_rel = do dir <- canonicalizePath (builddir_rel "intree") buildCabalLibsProject ("packages: " ++ root "Cabal" ++ " " ++ root "Cabal-syntax" ++ " " ++ root "Cabal-hooks") verb mbGhc dir @@ -182,26 +185,26 @@ main = do args <- execParser $ info (mainArgParser <**> helper) mempty let verbosity = if mainArgVerbose args then verbose else normal - mpkg_db <- + pkg_dbs <- -- Not path to cabal-install so we're not going to run cabal-install tests so we -- can skip setting up a Cabal library to use with cabal-install. case argCabalInstallPath (mainCommonArgs args) of Nothing -> do when (isJust $ mainArgCabalSpec args) (putStrLn "Ignoring Cabal library specification as cabal-install tests are not running") - return Nothing + return [] -- Path to cabal-install is passed, so need to install the requested relevant version of Cabal -- library. Just {} -> case mainArgCabalSpec args of Nothing -> do putStrLn "No Cabal library specified, using boot Cabal library with cabal-install tests" - return Nothing - Just BootCabalLib -> return Nothing + return [] + Just BootCabalLib -> return [] Just (InTreeCabalLib root build_dir) -> - Just <$> buildCabalLibsIntree root verbosity (argGhcPath (mainCommonArgs args)) build_dir + buildCabalLibsIntree root verbosity (argGhcPath (mainCommonArgs args)) build_dir Just (SpecificCabalLib ver build_dir) -> - Just <$> buildCabalLibsSpecific ver verbosity (argGhcPath (mainCommonArgs args)) build_dir + buildCabalLibsSpecific ver verbosity (argGhcPath (mainCommonArgs args)) build_dir -- To run our test scripts, we need to be able to run Haskell code -- linked against the Cabal library under test. The most efficient @@ -228,14 +231,28 @@ main = do -> IO result runTest runner path = runner Nothing [] path $ - ["--builddir", dist_dir, path] ++ ["--extra-package-db=" ++ pkg_db | Just pkg_db <- [mpkg_db]] ++ renderCommonArgs (mainCommonArgs args) + ["--builddir", dist_dir, path] ++ ["--extra-package-db=" ++ pkg_db | pkg_db <- pkg_dbs] ++ renderCommonArgs (mainCommonArgs args) case mainArgTestPaths args of [path] -> do -- Simple runner (real_path, real_args) <- runTest (runnerCommand senv) path hPutStrLn stderr $ showCommandForUser real_path real_args - callProcess real_path real_args + -- If the test was reported flaky, the `runghc` call will exit + -- with exit code 1, and report `TestCodeFlaky` on the stderr output + -- + -- This seems to be the only way to catch this case. + -- + -- Sadly it means that stdout and stderr are not interleaved + -- directly anymore. + (e, out, err) <- readProcessWithExitCode real_path real_args "" + putStrLn "# STDOUT:" + putStrLn out + putStrLn "# STDERR:" + putStrLn err + if "TestCodeFlaky" `isInfixOf` err + then pure () + else throwIO e hPutStrLn stderr "OK" user_paths -> do -- Read out tests from filesystem @@ -260,6 +277,8 @@ main = do unexpected_fails_var <- newMVar [] unexpected_passes_var <- newMVar [] skipped_var <- newMVar [] + flaky_pass_var <- newMVar [] + flaky_fail_var <- newMVar [] chan <- newChan let logAll msg = writeChan chan (ServerLogMsg AllServers msg) @@ -312,7 +331,7 @@ main = do modifyMVar_ unexpected_fails_var $ \paths -> return (path:paths) - when (code == TestCodeUnexpectedOk) $ + when (isJust $ isTestCodeUnexpectedSuccess code) $ modifyMVar_ unexpected_passes_var $ \paths -> return (path:paths) @@ -320,6 +339,12 @@ main = do modifyMVar_ skipped_var $ \paths -> return (path:paths) + case isTestCodeFlaky code of + NotFlaky -> pure () + Flaky b _ -> + modifyMVar_ (if b then flaky_pass_var else flaky_fail_var) $ \paths -> + return (path:paths) + go server -- Start as many threads as requested by -j to spawn @@ -330,13 +355,17 @@ main = do unexpected_fails <- takeMVar unexpected_fails_var unexpected_passes <- takeMVar unexpected_passes_var skipped <- takeMVar skipped_var + flaky_passes <- takeMVar flaky_pass_var + flaky_fails <- takeMVar flaky_fail_var -- print summary let sl = show . length testSummary = sl all_tests ++ " tests, " ++ sl skipped ++ " skipped, " ++ sl unexpected_passes ++ " unexpected passes, " - ++ sl unexpected_fails ++ " unexpected fails." + ++ sl unexpected_fails ++ " unexpected fails, " + ++ sl flaky_passes ++ " flaky passes, " + ++ sl flaky_fails ++ " flaky fails." logAll testSummary -- print failed or unexpected ok diff --git a/cabal-testsuite/src/Test/Cabal/Monad.hs b/cabal-testsuite/src/Test/Cabal/Monad.hs index e817a89c282..31e1e07bf52 100644 --- a/cabal-testsuite/src/Test/Cabal/Monad.hs +++ b/cabal-testsuite/src/Test/Cabal/Monad.hs @@ -45,18 +45,25 @@ module Test.Cabal.Monad ( testActualFile, -- * Skipping tests skip, + skipIO, skipIf, + skipIfIO, skipUnless, + skipUnlessIO, -- * Known broken tests - expectedBroken, - unexpectedSuccess, - -- whenHasSharedLibraries, + expectBroken, + expectBrokenIf, + expectBrokenUnless, + -- * Flaky tests + flaky, + flakyIf, -- * Arguments (TODO: move me) CommonArgs(..), renderCommonArgs, commonArgParser, -- * Version Constants cabalVersionLibrary, + ) where import Test.Cabal.Script @@ -66,7 +73,7 @@ import Test.Cabal.TestCode import Distribution.Pretty (prettyShow) import Distribution.Simple.Compiler - ( PackageDBStack, PackageDB(..), compilerFlavor + ( PackageDBStackCWD, PackageDBX(..), compilerFlavor , Compiler, compilerVersion, showCompilerIdWithAbi ) import Distribution.System import Distribution.Simple.Program.Db @@ -76,10 +83,11 @@ import Distribution.Simple.Configure import qualified Distribution.Simple.Utils as U (cabalVersion) import Distribution.Text -import Test.Utils.TempTestDir (removeDirectoryRecursiveHack) +import Test.Utils.TempTestDir (removeDirectoryRecursiveHack, withTestDir') import Distribution.Verbosity import Distribution.Version +import Control.Concurrent.Async #if !MIN_VERSION_base(4,11,0) import Data.Monoid ((<>)) #endif @@ -158,7 +166,7 @@ renderCommonArgs args = data TestArgs = TestArgs { testArgDistDir :: FilePath, - testArgPackageDb :: Maybe FilePath, + testArgPackageDb :: [FilePath], testArgScriptPath :: FilePath, testCommonArgs :: CommonArgs } @@ -169,34 +177,96 @@ testArgParser = TestArgs ( help "Build directory of cabal-testsuite" <> long "builddir" <> metavar "DIR") - <*> optional (option str + <*> many (option str ( help "Package DB which contains Cabal and Cabal-syntax" <> long "extra-package-db" <> metavar "DIR")) <*> argument str ( metavar "FILE") <*> commonArgParser -skip :: String -> TestM () -skip reason = liftIO $ do - putStrLn ("SKIP " ++ reason) +-- * skip tests + +skipIO :: String -> IO () +skipIO reason = do + putStrLn $ "SKIP (" <> reason <> ")" E.throwIO (TestCodeSkip reason) +skip :: String -> TestM () +skip = liftIO . skipIO + +skipIfIO :: String -> Bool -> IO () +skipIfIO reason b = when b (skipIO reason) + skipIf :: String -> Bool -> TestM () skipIf reason b = when b (skip reason) +skipUnlessIO :: String -> Bool -> IO () +skipUnlessIO reason b = unless b (skipIO reason) + skipUnless :: String -> Bool -> TestM () skipUnless reason b = unless b (skip reason) -expectedBroken :: TestM () -expectedBroken = liftIO $ do - putStrLn "EXPECTED FAIL" - E.throwIO TestCodeKnownFail - -unexpectedSuccess :: TestM () -unexpectedSuccess = liftIO $ do - putStrLn "UNEXPECTED OK" - E.throwIO TestCodeUnexpectedOk +-- * Broken tests +expectBroken :: IssueID -> TestM a -> TestM a +expectBroken ticket m = do + env <- getTestEnv + liftIO . withAsync (runReaderT m env) $ \a -> do + r <- waitCatch a + case r of + Left e -> do + putStrLn $ "This test is known broken, see #" ++ show ticket ++ ":" + print e + throwExpectedBroken ticket + Right _ -> do + throwUnexpectedSuccess ticket + +expectBrokenIf :: Bool -> IssueID -> TestM a -> TestM a +expectBrokenIf True ticket m = expectBroken ticket m +expectBrokenIf False _ m = m + +expectBrokenUnless :: Bool -> IssueID -> TestM a -> TestM a +expectBrokenUnless b = expectBrokenIf (not b) + +throwExpectedBroken :: IssueID -> IO a +throwExpectedBroken ticket = do + putStrLn $ "EXPECTED FAIL (#" <> show ticket <> ")" + E.throwIO (TestCodeKnownFail ticket) + +throwUnexpectedSuccess :: IssueID -> IO a +throwUnexpectedSuccess ticket = do + putStrLn $ "UNEXPECTED OK (#" <> show ticket <> ")" + E.throwIO (TestCodeUnexpectedOk ticket) + +-- * Flaky tests + +flaky :: IssueID -> TestM a -> TestM a +flaky ticket m = do + env <- getTestEnv + liftIO . withAsync (runReaderT m env) $ \a -> do + r <- waitCatch a + case r of + Left e -> do + putStrLn $ "This test is known flaky, and it failed, see #" ++ show ticket ++ ":" + print e + throwFlakyFail ticket + Right _ -> do + putStrLn $ "This test is known flaky, but it passed, see #" ++ show ticket ++ ":" + throwFlakyPass ticket + +flakyIf :: Bool -> IssueID -> TestM a -> TestM a +flakyIf True ticket m = flaky ticket m +flakyIf False _ m = m + +throwFlakyFail :: IssueID -> IO a +throwFlakyFail ticket = do + putStrLn $ "FLAKY FAIL (#" <> show ticket <> ")" + E.throwIO (TestCodeFlakyFailed ticket) + +throwFlakyPass :: IssueID -> IO a +throwFlakyPass ticket = do + putStrLn $ "FLAKY OK (#" <> show ticket <> ")" + E.throwIO (TestCodeFlakyPassed ticket) trySkip :: IO a -> IO (Either String a) trySkip m = fmap Right m `E.catch` \e -> case e of @@ -247,15 +317,10 @@ python3Program :: Program python3Program = simpleProgram "python3" -- | Run a test in the test monad according to program's arguments. -runTestM :: String -> TestM a -> IO a +runTestM :: String -> TestM () -> IO () runTestM mode m = - liftIO $ (canonicalizePath =<< getTemporaryDirectory) >>= \systemTmpDir -> - -- canonicalizePath: cabal-install is inconsistent w.r.t. looking through - -- symlinks. We canonicalize here to avoid such issues when the temporary - -- directory contains symlinks. See #9763. execParser (info testArgParser Data.Monoid.mempty) >>= \args -> - withTempDirectoryEx verbosity (defaultTempFileOptions { optKeepTempFiles = argKeepTmpFiles (testCommonArgs args) }) - systemTmpDir + withTestDir' verbosity (defaultTempFileOptions { optKeepTempFiles = argKeepTmpFiles (testCommonArgs args) }) "cabal-testsuite" $ \tmp_dir -> do let dist_dir = testArgDistDir args (script_dir0, script_filename) = splitFileName (testArgScriptPath args) @@ -333,18 +398,22 @@ runTestM mode m = testMtimeChangeDelay = Nothing, testScriptEnv = senv, testSetupPath = dist_dir "build" "setup" "setup", - testPackageDbPath = testArgPackageDb args, + testPackageDbPath = case testArgPackageDb args of [] -> Nothing; xs -> Just xs, testSkipSetupTests = argSkipSetupTests (testCommonArgs args), testHaveCabalShared = runnerWithSharedLib senv, testEnvironment = - -- Try to avoid Unicode output - [ ("LC_ALL", Just "C") + -- Use UTF-8 output on all platforms. + [ ("LC_ALL", Just "en_US.UTF-8") -- Hermetic builds (knot-tied) , ("HOME", Just (testHomeDir env)) -- Set CABAL_DIR in addition to HOME, since HOME has no -- effect on Windows. , ("CABAL_DIR", Just (testCabalDir env)) , ("CABAL_CONFIG", Just (testUserCabalConfigFile env)) + -- Set `TMPDIR` so that temporary files aren't created in the global `TMPDIR`. + , ("TMPDIR", Just tmp_dir) + -- Windows uses `TMP` for the `TMPDIR`. + , ("TMP", Just tmp_dir) ], testShouldFail = False, testRelativeCurrentDir = ".", @@ -357,11 +426,26 @@ runTestM mode m = testRecordUserMode = Nothing, testMaybeStoreDir = Nothing } - let go = do cleanup - r <- withSourceCopy m - check_expect (argAccept (testCommonArgs args)) - return r - runReaderT go env + runReaderT cleanup env + join $ E.catch (runReaderT + (do + withSourceCopy m + check_expect (argAccept (testCommonArgs args)) Nothing + ) + env + ) + (\(e :: TestCode) -> do + -- A test that resulted in unexpected success should check its output + -- because maybe it is the output the one that makes it fail! + case isTestCodeUnexpectedSuccess e of + Just t -> runReaderT (check_expect (argAccept (testCommonArgs args)) (Just (t, False))) env + Nothing -> + -- A test that is reported flaky but passed might fail because of the output + case isTestCodeFlaky e of + Flaky True t -> runReaderT (check_expect (argAccept (testCommonArgs args)) (Just (t, True))) env + _ -> E.throwIO e + ) + where verbosity = normal -- TODO: configurable @@ -377,13 +461,15 @@ runTestM mode m = liftIO $ writeFile (testUserCabalConfigFile env) $ unlines [ "with-compiler: " ++ ghc_path ] - check_expect accept = do + check_expect accept was_expected_to_fail = do env <- getTestEnv actual_raw <- liftIO $ readFileOrEmpty (testActualFile env) expect <- liftIO $ readFileOrEmpty (testExpectFile env) norm_env <- mkNormalizerEnv let actual = normalizeOutput norm_env actual_raw - when (words actual /= words expect) $ do + case (was_expected_to_fail, words actual /= words expect) of + -- normal test, output doesn't match + (Nothing, True) -> do -- First try whitespace insensitive diff let actual_fp = testNormalizedActualFile env expect_fp = testNormalizedExpectFile env @@ -393,9 +479,25 @@ runTestM mode m = b <- diff ["-uw"] expect_fp actual_fp unless b . void $ diff ["-u"] expect_fp actual_fp if accept - then do liftIO $ putStrLn "Accepting new output." - liftIO $ writeFileNoCR (testExpectFile env) actual - else liftIO $ exitWith (ExitFailure 1) + then do liftIO $ putStrLn $ "Writing actual test output to " <> testExpectAcceptFile env + liftIO $ writeFileNoCR (testExpectAcceptFile env) actual + pure (pure ()) + else pure (E.throwIO TestCodeFail) + -- normal test, output matches + (Nothing, False) -> pure (pure ()) + -- expected fail, output matches + (Just (t, was_flaky), False) -> pure (E.throwIO $ if was_flaky then TestCodeFlakyPassed t else TestCodeUnexpectedOk t) + -- expected fail, output doesn't match + (Just (t, was_flaky), True) -> do + -- First try whitespace insensitive diff + let actual_fp = testNormalizedActualFile env + expect_fp = testNormalizedExpectFile env + liftIO $ writeFile actual_fp actual + liftIO $ writeFile expect_fp expect + liftIO $ putStrLn "Actual output differs from expected:" + b <- diff ["-uw"] expect_fp actual_fp + unless b . void $ diff ["-u"] expect_fp actual_fp + pure (E.throwIO $ if was_flaky then TestCodeFlakyFailed t else TestCodeKnownFail t) readFileOrEmpty :: FilePath -> IO String readFileOrEmpty f = readFile f `E.catch` \e -> @@ -532,6 +634,7 @@ mkNormalizerEnv = do tmpDir <- liftIO $ getTemporaryDirectory canonicalizedTestTmpDir <- liftIO $ canonicalizePath (testTmpDir env) + canonicalizedGblDir <- liftIO $ canonicalizePath tmpDir -- 'cabal' is configured in the package-db, but doesn't specify how to find the program version -- Thus we find the program location, if it exists, and query for the program version for @@ -544,14 +647,26 @@ mkNormalizerEnv = do liftIO (findProgramVersion "--numeric-version" id (testVerbosity env) (programPath cabalProg)) return NormalizerEnv { - normalizerRoot - = addTrailingPathSeparator (testSourceDir env), normalizerTmpDir - = addTrailingPathSeparator (testTmpDir env), + = (if buildOS == Windows + then joinDrive "\\" . dropDrive + else id) + $ addTrailingPathSeparator (testTmpDir env), normalizerCanonicalTmpDir - = addTrailingPathSeparator canonicalizedTestTmpDir, + = (if buildOS == Windows + then joinDrive "\\" . dropDrive + else id) + $ addTrailingPathSeparator canonicalizedTestTmpDir, normalizerGblTmpDir - = addTrailingPathSeparator tmpDir, + = (if buildOS == Windows + then joinDrive "\\" . dropDrive + else id) + $ addTrailingPathSeparator tmpDir, + normalizerCanonicalGblTmpDir + = (if buildOS == Windows + then joinDrive "\\" . dropDrive + else id) + $ addTrailingPathSeparator canonicalizedGblDir, normalizerGhcVersion = compilerVersion (testCompiler env), normalizerGhcPath @@ -637,7 +752,7 @@ data TestEnv = TestEnv -- | Platform we are running tests on , testPlatform :: Platform -- | Package database stack (actually this changes lol) - , testPackageDBStack :: PackageDBStack + , testPackageDBStack :: PackageDBStackCWD -- | How verbose to be , testVerbosity :: Verbosity -- | How long we should 'threadDelay' to make sure the file timestamp is @@ -649,8 +764,8 @@ data TestEnv = TestEnv -- | Setup script path , testSetupPath :: FilePath -- | Setup package-db path which contains Cabal and Cabal-syntax for cabal-install to - -- use when compiling custom setups. - , testPackageDbPath :: Maybe FilePath + -- use when compiling custom setups, plus the store with possible dependencies of those setup packages. + , testPackageDbPath :: Maybe [FilePath] -- | Skip Setup tests? , testSkipSetupTests :: Bool -- | Do we have shared libraries for the Cabal-under-tests? @@ -768,8 +883,18 @@ testUserCabalConfigFile :: TestEnv -> FilePath testUserCabalConfigFile env = testCabalDir env "config" -- | The file where the expected output of the test lives +-- +-- Pointing to the @testTmpDir@ allows us to modify the expected output if +-- needed, to adapt it to outcomes of previous steps in the test. testExpectFile :: TestEnv -> FilePath -testExpectFile env = testSourceDir env testName env <.> "out" +testExpectFile env = testTmpDir env testName env <.> "out" + +-- | The file where the expected output of the test is written in @--accept@ mode +-- +-- Note: This needs to point to `testSourceDir` so the output is visible in the +-- user's repository. +testExpectAcceptFile :: TestEnv -> FilePath +testExpectAcceptFile env = testSourceDir env testName env <.> "out" -- | Where we store the actual output testActualFile :: TestEnv -> FilePath diff --git a/cabal-testsuite/src/Test/Cabal/OutputNormalizer.hs b/cabal-testsuite/src/Test/Cabal/OutputNormalizer.hs index 42daa708885..fb2840be9e6 100644 --- a/cabal-testsuite/src/Test/Cabal/OutputNormalizer.hs +++ b/cabal-testsuite/src/Test/Cabal/OutputNormalizer.hs @@ -19,26 +19,35 @@ import qualified Data.Foldable as F normalizeOutput :: NormalizerEnv -> String -> String normalizeOutput nenv = - -- Munge away .exe suffix on filenames (Windows) - resub "([A-Za-z0-9.-]+)\\.exe" "\\1" -- Normalize backslashes to forward slashes to normalize -- file paths - . map (\c -> if c == '\\' then '/' else c) + map (\c -> if c == '\\' then '/' else c) -- Install path frequently has architecture specific elements, so -- nub it out . resub "Installing (.+) in .+" "Installing \\1 in " -- Things that look like libraries . resub "libHS[A-Za-z0-9.-]+\\.(so|dll|a|dynlib)" "" -- look for PackageHash directories + . (if buildOS == Windows + then resub "\\\\(([A-Za-z0-9_]+)(-[A-Za-z0-9\\._]+)*)-[0-9a-f]{4,64}\\\\" + "\\\\-\\\\" + else id) . resub "/(([A-Za-z0-9_]+)(-[A-Za-z0-9\\._]+)*)-[0-9a-f]{4,64}/" "/-/" -- This is dumb but I don't feel like pulling in another dep for -- string search-replace. Make sure we do this before backslash -- normalization! . resub (posixRegexEscape (normalizerGblTmpDir nenv) ++ "[a-z0-9\\.-]+") "" + . resub (posixRegexEscape (normalizerCanonicalGblTmpDir nenv) ++ "[a-z0-9\\.-]+") "" + -- Munge away .exe suffix on filenames (Windows) + . (if buildOS == Windows then resub "([A-Za-z0-9.-]+)\\.exe" "\\1" else id) + -- tmp/src-[0-9]+ is tmp\src-[0-9]+ in Windows + . (if buildOS == Windows then resub (posixRegexEscape "tmp\\src-" ++ "[0-9]+") "" else id) . resub (posixRegexEscape "tmp/src-" ++ "[0-9]+") "" . resub (posixRegexEscape (normalizerTmpDir nenv) ++ sameDir) "/" . resub (posixRegexEscape (normalizerCanonicalTmpDir nenv) ++ sameDir) "/" + -- Munge away C: prefix on filenames (Windows). We convert C:\\ to \\. + . (if buildOS == Windows then resub "([A-Z]):\\\\" "\\\\" else id) . appEndo (F.fold (map (Endo . packageIdRegex) (normalizerKnownPackages nenv))) -- Look for 0.1/installed-0d6uzW7Ubh1Fb4TB5oeQ3G -- These installed packages will vary depending on GHC version @@ -46,6 +55,10 @@ normalizeOutput nenv = . resub "[0-9]+(\\.[0-9]+)*/installed-[A-Za-z0-9.+]+" "/installed-" -- incoming directories in the store + . (if buildOS == Windows then resub "\\\\incoming\\\\new-[0-9]+" + "\\\\incoming\\\\new-" + else id) + -- incoming directories in the store . resub "/incoming/new-[0-9]+" "/incoming/new-" -- Normalize architecture @@ -67,6 +80,7 @@ normalizeOutput nenv = . maybe id normalizePathCmdOutput (normalizerCabalInstallVersion nenv) -- hackage-security locks occur non-deterministically . resub "(Released|Acquired|Waiting) .*hackage-security-lock\n" "" + . resub "installed: [0-9]+(\\.[0-9]+)*" "installed: " where sameDir = "(\\.((\\\\)+|\\/))*" packageIdRegex pid = @@ -111,12 +125,21 @@ normalizeOutput nenv = "\"-package-id\",\"\"" data NormalizerEnv = NormalizerEnv - { normalizerRoot :: FilePath - , normalizerTmpDir :: FilePath + { normalizerTmpDir :: FilePath , normalizerCanonicalTmpDir :: FilePath -- ^ May differ from 'normalizerTmpDir', especially e.g. on macos, where -- `/var` is a symlink for `/private/var`. , normalizerGblTmpDir :: FilePath + -- ^ The global temp directory: @/tmp@ on Linux, @/var/folders/...@ on macos + -- and @\\msys64\\tmp@ on Windows. + -- + -- Note that on windows the actual path would be @C:\\msys64\\tmp@ but we + -- drop the @C:@ prefix because this path appears sometimes + -- twice in the same path in some tests, and the second time it doesn't have a @C:@, so + -- the logic fails to catch it. + , normalizerCanonicalGblTmpDir :: FilePath + -- ^ The canonical version of 'normalizerGblTmpDir', might differ in the same + -- way as above on macos , normalizerGhcVersion :: Version , normalizerGhcPath :: FilePath , normalizerKnownPackages :: [PackageId] diff --git a/cabal-testsuite/src/Test/Cabal/Prelude.hs b/cabal-testsuite/src/Test/Cabal/Prelude.hs index 8a0aaff928b..d8cee954d83 100644 --- a/cabal-testsuite/src/Test/Cabal/Prelude.hs +++ b/cabal-testsuite/src/Test/Cabal/Prelude.hs @@ -22,9 +22,10 @@ import Test.Cabal.Script import Test.Cabal.Run import Test.Cabal.Monad import Test.Cabal.Plan +import Test.Cabal.TestCode import Distribution.Compat.Time (calibrateMtimeChangeDelay) -import Distribution.Simple.Compiler (PackageDBStack, PackageDB(..)) +import Distribution.Simple.Compiler (PackageDBStackCWD, PackageDBCWD, PackageDBX(..)) import Distribution.Simple.PackageDescription (readGenericPackageDescription) import Distribution.Simple.Program.Types import Distribution.Simple.Program.Db @@ -43,25 +44,24 @@ import Distribution.PackageDescription import Test.Utils.TempTestDir (withTestDir) import Distribution.Verbosity (normal) import Distribution.Utils.Path - ( makeSymbolicPath, relativeSymbolicPath ) + ( makeSymbolicPath, relativeSymbolicPath, interpretSymbolicPathCWD ) import Distribution.Compat.Stack import Text.Regex.TDFA ((=~)) -import Control.Concurrent.Async (waitCatch, withAsync) +import Control.Concurrent.Async (withAsync) import qualified Data.Aeson as JSON import qualified Data.ByteString.Lazy as BSL -import Control.Monad (unless, when, void, forM_, liftM2, liftM4) -import Control.Monad.Trans.Reader (withReaderT, runReaderT) +import Control.Monad (unless, when, void, forM_, foldM, liftM2, liftM4) +import Control.Monad.Catch ( bracket_ ) +import Control.Monad.Trans.Reader (asks, withReaderT, runReaderT) import Control.Monad.IO.Class (MonadIO (..)) import qualified Crypto.Hash.SHA256 as SHA256 import qualified Data.ByteString.Base16 as Base16 import qualified Data.ByteString.Char8 as C import Data.List (isInfixOf, stripPrefix, isPrefixOf, intercalate) -import Data.List.NonEmpty (NonEmpty (..)) -import qualified Data.List.NonEmpty as NE -import Data.Maybe (mapMaybe, fromMaybe) +import Data.Maybe (isJust, mapMaybe, fromMaybe) import System.Exit (ExitCode (..)) import System.FilePath import Control.Concurrent (threadDelay) @@ -70,21 +70,28 @@ import System.Directory import Control.Retry (exponentialBackoff, limitRetriesByCumulativeDelay) import Network.Wait (waitTcpVerbose) import System.Environment +import qualified System.FilePath.Glob as Glob (globDir1, compile) +import System.Process +import System.IO #ifndef mingw32_HOST_OS -import Control.Monad.Catch ( bracket_ ) -import System.Posix.Files ( createSymbolicLink ) import System.Posix.Resource #endif ------------------------------------------------------------------------ -- * Utilities + runM :: FilePath -> [String] -> Maybe String -> TestM Result runM path args input = do + env <- getTestEnv + runM' (Just $ testCurrentDir env) path args input + +runM' :: Maybe FilePath -> FilePath -> [String] -> Maybe String -> TestM Result +runM' run_dir path args input = do env <- getTestEnv r <- liftIO $ run (testVerbosity env) - (Just $ testCurrentDir env) + run_dir (testEnvironment env) path args @@ -92,12 +99,17 @@ runM path args input = do recordLog r requireSuccess r -runProgramM :: Program -> [String] -> Maybe String -> TestM Result +runProgramM :: Program -> [String] -> Maybe String -> TestM Result runProgramM prog args input = do + env <- getTestEnv + runProgramM' (Just $ testCurrentDir env) prog args input + +runProgramM' :: Maybe FilePath -> Program -> [String] -> Maybe String -> TestM Result +runProgramM' run_dir prog args input = do configured_prog <- requireProgramM prog -- TODO: Consider also using other information from -- ConfiguredProgram, e.g., env and args - runM (programPath configured_prog) args input + runM' run_dir (programPath configured_prog) args input getLocalBuildInfoM :: TestM LocalBuildInfo getLocalBuildInfoM = do @@ -156,6 +168,7 @@ setup'' -> TestM Result setup'' prefix cmd args = do env <- getTestEnv + let work_dir = if testRelativeCurrentDir env == "." then Nothing else Just (testRelativeCurrentDir env) when ((cmd == "register" || cmd == "copy") && not (testHavePackageDb env)) $ error "Cannot register/copy without using 'withPackageDb'" ghc_path <- programPathM ghcProgram @@ -184,7 +197,10 @@ setup'' prefix cmd args = do ++ args _ -> args let rel_dist_dir = definitelyMakeRelative (testCurrentDir env) (testDistDir env) - full_args = cmd :| [marked_verbose, "--distdir", rel_dist_dir] ++ args' + work_dir_arg = case work_dir of + Nothing -> [] + Just wd -> ["--working-dir", wd] + full_args = work_dir_arg ++ (cmd : [marked_verbose, "--distdir", rel_dist_dir] ++ args') defaultRecordMode RecordMarked $ do recordHeader ["Setup", cmd] @@ -192,23 +208,23 @@ setup'' prefix cmd args = do -- -- `cabal` and `Setup.hs` do have different interface. -- - let pkgDir = makeSymbolicPath $ testCurrentDir env prefix + let pkgDir = makeSymbolicPath $ testTmpDir env testRelativeCurrentDir env prefix pdfile <- liftIO $ tryFindPackageDesc (testVerbosity env) (Just pkgDir) pdesc <- liftIO $ readGenericPackageDescription (testVerbosity env) (Just pkgDir) $ relativeSymbolicPath pdfile if testCabalInstallAsSetup env then if buildType (packageDescription pdesc) == Simple - then runProgramM cabalProgram ("act-as-setup" : "--" : NE.toList full_args) Nothing + then runProgramM' (Just (testTmpDir env)) cabalProgram ("act-as-setup" : "--" : full_args) Nothing else fail "Using act-as-setup for not 'build-type: Simple' package" else do if buildType (packageDescription pdesc) == Simple - then runM (testSetupPath env) (NE.toList full_args) Nothing + then runM' (Just $ testTmpDir env) (testSetupPath env) (full_args) Nothing -- Run the Custom script! else do r <- liftIO $ runghc (testScriptEnv env) - (Just $ testCurrentDir env) + (Just $ testTmpDir env) (testEnvironment env) - (testCurrentDir env prefix "Setup.hs") - (NE.toList full_args) + (testRelativeCurrentDir env prefix "Setup.hs") + (full_args) recordLog r requireSuccess r @@ -264,11 +280,11 @@ setup_install_with_docs args = do setup "register" [] return () -packageDBParams :: PackageDBStack -> [String] +packageDBParams :: PackageDBStackCWD -> [String] packageDBParams dbs = "--package-db=clear" : map (("--package-db=" ++) . convert) dbs where - convert :: PackageDB -> String + convert :: PackageDBCWD -> String convert GlobalPackageDB = "global" convert UserPackageDB = "user" convert (SpecificPackageDB path) = path @@ -324,14 +340,13 @@ cabalGArgs global_args cmd args input = do = [ "--builddir", testDistDir env , "-j1" ] ++ [ "--project-file=" ++ fp | Just fp <- [testCabalProjectFile env] ] - ++ ["--package-db=" ++ db | Just db <- [testPackageDbPath env]] + ++ ["--package-db=" ++ db | Just dbs <- [testPackageDbPath env], db <- dbs] | "v1-" `isPrefixOf` cmd = [ "--builddir", testDistDir env ] ++ install_args - | otherwise = [ "--builddir", testDistDir env ] - ++ ["--package-db=" ++ db | Just db <- [testPackageDbPath env]] + ++ ["--package-db=" ++ db | Just dbs <- [testPackageDbPath env], db <- dbs] ++ install_args install_args @@ -439,9 +454,9 @@ ghcPkg' cmd args = do recordHeader ["ghc-pkg", cmd] runProgramM ghcPkgProgram (cmd : extraArgs ++ args) Nothing -ghcPkgPackageDBParams :: Version -> PackageDBStack -> [String] +ghcPkgPackageDBParams :: Version -> PackageDBStackCWD -> [String] ghcPkgPackageDBParams version dbs = concatMap convert dbs where - convert :: PackageDB -> [String] + convert :: PackageDBCWD -> [String] -- Ignoring global/user is dodgy but there's no way good -- way to give ghc-pkg the correct flags in this case. convert GlobalPackageDB = [] @@ -545,7 +560,6 @@ src `archiveTo` dst = do -- TODO: --format ustar, like createArchive? -- --force-local is necessary for handling colons in Windows paths. tar $ ["-czf", dst] - ++ ["--force-local" | buildOS == Windows] ++ ["-C", src_parent, src_dir] infixr 4 `archiveTo` @@ -555,10 +569,6 @@ infixr 4 `archiveTo` -- external repository corresponding to all of these packages withRepo :: FilePath -> TestM a -> TestM a withRepo repo_dir m = do - -- https://github.com/haskell/cabal/issues/7065 - -- you don't simply put a windows path into URL... - skipIfWindows - env <- getTestEnv -- 1. Initialize repo directory @@ -604,16 +614,17 @@ withRepo repo_dir m = do withReaderT (\env' -> env' { testHaveRepo = True }) m -- TODO: Arguably should undo everything when we're done... where - repoUri env ="file+noindex://" ++ testRepoDir env + repoUri env ="file+noindex://" ++ (if isWindows + then map (\x -> case x of + '\\' -> '/' + _ -> x) + else id) (testRepoDir env) -- | Given a directory (relative to the 'testCurrentDir') containing -- a series of directories representing packages, generate an -- remote repository corresponding to all of these packages withRemoteRepo :: FilePath -> TestM a -> TestM a withRemoteRepo repoDir m = do - -- https://github.com/haskell/cabal/issues/7065 - -- you don't simply put a windows path into URL... - skipIfWindows -- we rely on the presence of python3 for a simple http server skipUnless "no python3" =<< isAvailableProgram python3Program @@ -682,7 +693,12 @@ withRemoteRepo repoDir m = do -- wait for the python webserver to come up with a exponential -- backoff starting from 50ms, up to a maximum wait of 60s _ <- waitTcpVerbose putStrLn (limitRetriesByCumulativeDelay 60000000 $ exponentialBackoff 50000) "localhost" "8000" - runReaderT m (env { testHaveRepo = True })) + r <- runReaderT m (env { testHaveRepo = True }) + -- Windows fails to kill the python server when the function above + -- is complete, so we kill it directly via CMD. + when (buildOS == Windows) $ void $ createProcess_ "kill python" $ System.Process.shell "taskkill /F /IM python3.exe" + pure r + ) @@ -711,7 +727,7 @@ recordHeader args = do ------------------------------------------------------------------------ -- * Subprocess run results -assertFailure :: WithCallStack (String -> m ()) +assertFailure :: WithCallStack (String -> m a) assertFailure msg = withFrozenCallStack $ error msg assertExitCode :: MonadIO m => WithCallStack (ExitCode -> Result -> m ()) @@ -820,6 +836,31 @@ assertFileDoesNotContain path needle = (assertFailure ("expected: " ++ needle ++ "\n" ++ " in file: " ++ path))) +-- | Assert that at least one of the given paths contains the given search string. +assertAnyFileContains :: MonadIO m => WithCallStack ([FilePath] -> String -> m ()) +assertAnyFileContains paths needle = do + let findOne found path = + if found + then pure found + else withFileContents path $ \contents -> + pure $! needle `isInfixOf` contents + foundNeedle <- liftIO $ foldM findOne False paths + withFrozenCallStack $ + unless foundNeedle $ + assertFailure $ + "expected: " <> + needle <> + "\nin one of:\n" <> + unlines (map ("* " <>) paths) + +-- | Assert that none of the given paths contains the given search string. +assertNoFileContains :: MonadIO m => WithCallStack ([FilePath] -> String -> m ()) +assertNoFileContains paths needle = + liftIO $ + forM_ paths $ + \path -> + assertFileDoesNotContain path needle + -- | Replace line breaks with spaces, correctly handling "\r\n". concatOutput :: String -> String concatOutput = unwords . lines . filter ((/=) '\r') @@ -833,24 +874,82 @@ getScriptCacheDirectory script = do return $ cabalDir "script-builds" hash ------------------------------------------------------------------------ --- * Skipping tests +-- * Globs + +-- | Match a glob from a root directory and return the results. +matchGlob :: MonadIO m => FilePath -> String -> m [FilePath] +matchGlob root glob = do + liftIO $ Glob.globDir1 (Glob.compile glob) root -hasSharedLibraries :: TestM Bool -hasSharedLibraries = do - shared_libs_were_removed <- isGhcVersion ">= 7.8" - return (not (buildOS == Windows && shared_libs_were_removed)) +-- | Assert that a glob matches at least one path in the given root directory. +-- +-- The matched paths are returned for further validation. +assertGlobMatches :: MonadIO m => WithCallStack (FilePath -> String -> m [FilePath]) +assertGlobMatches root glob = do + results <- matchGlob root glob + withFrozenCallStack $ + when (null results) $ + assertFailure $ + "Expected glob " <> show glob <> " to match in " <> show root + pure results + +-- | Assert that a glob matches no paths in the given root directory. +assertGlobDoesNotMatch :: MonadIO m => WithCallStack (FilePath -> String -> m ()) +assertGlobDoesNotMatch root glob = do + results <- matchGlob root glob + withFrozenCallStack $ + unless (null results) $ + assertFailure $ + "Expected glob " + <> show glob + <> " to not match any paths in " + <> show root + <> ", but the following matches were found:" + <> unlines (map ("* " <>) results) + +-- | Assert that a glob matches a path in the given root directory. +-- +-- The root directory is determined from the `TestEnv` with a function like `testDistDir`. +-- +-- The matched paths are returned for further validation. +assertGlobMatchesTestDir :: WithCallStack ((TestEnv -> FilePath) -> String -> TestM [FilePath]) +assertGlobMatchesTestDir rootSelector glob = do + root <- asks rootSelector + assertGlobMatches root glob -hasProfiledLibraries :: TestM Bool -hasProfiledLibraries = do +-- | Assert that a glob matches a path in the given root directory. +-- +-- The root directory is determined from the `TestEnv` with a function like `testDistDir`. +assertGlobDoesNotMatchTestDir :: WithCallStack ((TestEnv -> FilePath) -> String -> TestM ()) +assertGlobDoesNotMatchTestDir rootSelector glob = do + root <- asks rootSelector + assertGlobDoesNotMatch root glob + +------------------------------------------------------------------------ +-- * Skipping tests + +testCompilerWithArgs :: [String] -> TestM Bool +testCompilerWithArgs args = do env <- getTestEnv ghc_path <- programPathM ghcProgram let prof_test_hs = testWorkDir env "Prof.hs" liftIO $ writeFile prof_test_hs "module Prof where" r <- liftIO $ run (testVerbosity env) (Just $ testCurrentDir env) - (testEnvironment env) ghc_path ["-prof", "-c", prof_test_hs] + (testEnvironment env) ghc_path (["-c", prof_test_hs] ++ args) Nothing return (resultExitCode r == ExitSuccess) +hasProfiledLibraries, hasProfiledSharedLibraries, hasSharedLibraries :: TestM Bool +hasProfiledLibraries = testCompilerWithArgs ["-prof"] +hasProfiledSharedLibraries = testCompilerWithArgs ["-prof", "-dynamic"] +hasSharedLibraries = testCompilerWithArgs ["-dynamic"] + +skipIfNoSharedLibraries :: TestM () +skipIfNoSharedLibraries = skipUnless "no shared libraries" =<< hasSharedLibraries + +skipIfNoProfiledLibraries :: TestM () +skipIfNoProfiledLibraries = skipUnless "no profiled libraries" =<< hasProfiledLibraries + -- | Check if the GHC that is used for compiling package tests has -- a shared library of the cabal library under test in its database. -- @@ -875,7 +974,7 @@ allCabalVersion = isCabalVersion all isCabalVersion :: WithCallStack (((Version -> Bool) -> [Version] -> Bool) -> String -> TestM Bool) isCabalVersion decide range = do env <- getTestEnv - cabal_pkgs <- ghcPkg_raw' $ ["--global", "list", "Cabal", "--simple"] ++ ["--package-db=" ++ db | Just db <- [testPackageDbPath env]] + cabal_pkgs <- ghcPkg_raw' $ ["--global", "list", "Cabal", "--simple"] ++ ["--package-db=" ++ db | Just dbs <- [testPackageDbPath env], db <- dbs] let pkg_versions :: [PackageIdentifier] = mapMaybe simpleParsec (words (resultOutput cabal_pkgs)) vr <- case eitherParsec range of Left err -> fail err @@ -886,7 +985,6 @@ isCabalVersion decide range = do skipUnlessAnyCabalVersion :: String -> TestM () skipUnlessAnyCabalVersion range = skipUnless ("needs any Cabal " ++ range) =<< anyCabalVersion range - -- | Skip a test if any available Cabal library version matches the predicate. skipIfAnyCabalVersion :: String -> TestM () skipIfAnyCabalVersion range = skipIf ("incompatible with Cabal " ++ range) =<< anyCabalVersion range @@ -917,28 +1015,83 @@ skipUnlessGhcVersion range = skipUnless ("needs ghc " ++ range) =<< isGhcVersion skipIfGhcVersion :: String -> TestM () skipIfGhcVersion range = skipIf ("incompatible with ghc " ++ range) =<< isGhcVersion range -skipUnlessJavaScript :: TestM () -skipUnlessJavaScript = skipUnless "needs the JavaScript backend" =<< isJavaScript +skipUnlessJavaScript :: IO () +skipUnlessJavaScript = skipUnlessIO "needs the JavaScript backend" isJavaScript -skipIfJavaScript :: TestM () -skipIfJavaScript = skipIf "incompatible with the JavaScript backend" =<< isJavaScript +skipIfJavaScript :: IO () +skipIfJavaScript = skipIfIO "incompatible with the JavaScript backend" isJavaScript -isWindows :: TestM Bool -isWindows = return (buildOS == Windows) +isWindows :: Bool +isWindows = buildOS == Windows -isOSX :: TestM Bool -isOSX = return (buildOS == OSX) +isCI :: IO Bool +isCI = isJust <$> lookupEnv "CI" -isLinux :: TestM Bool -isLinux = return (buildOS == Linux) +isOSX :: Bool +isOSX = buildOS == OSX -isJavaScript :: TestM Bool -isJavaScript = return (buildArch == JavaScript) +isLinux :: Bool +isLinux = buildOS == Linux + +isJavaScript :: Bool +isJavaScript = buildArch == JavaScript -- should probably be `hostArch` but Cabal doesn't distinguish build platform -- and host platform -skipIfWindows :: TestM () -skipIfWindows = skipIf "Windows" =<< isWindows +skipIfWindows :: String -> IO () +skipIfWindows why = skipIfIO ("Windows " <> why) isWindows + +skipUnlessWindows :: IO () +skipUnlessWindows = skipIfIO "Only interesting in Windows" (not isWindows) + +skipIfOSX :: String -> IO () +skipIfOSX why = skipIfIO ("OSX " <> why) isOSX + +skipIfCI :: IssueID -> IO () +skipIfCI ticket = skipIfIO ("CI, see #" <> show ticket) =<< isCI + +skipIfCIAndWindows :: IssueID -> IO () +skipIfCIAndWindows ticket = skipIfIO ("Windows CI, see #" <> show ticket) . (isWindows &&) =<< isCI + +skipIfCIAndOSX :: IssueID -> IO () +skipIfCIAndOSX ticket = skipIfIO ("OSX CI, see #" <> show ticket) . (isOSX &&) =<< isCI + +expectBrokenIfWindows :: IssueID -> TestM a -> TestM a +expectBrokenIfWindows ticket = expectBrokenIf isWindows ticket + +expectBrokenIfWindowsCI :: IssueID -> TestM a -> TestM a +expectBrokenIfWindowsCI ticket m = do + ci <- liftIO isCI + expectBrokenIf (isWindows && ci) ticket m + +expectBrokenIfWindowsCIAndGhc :: String -> IssueID -> TestM a -> TestM a +expectBrokenIfWindowsCIAndGhc range ticket m = do + ghcVer <- isGhcVersion range + ci <- liftIO isCI + expectBrokenIf (isWindows && ghcVer && ci) ticket m + +expectBrokenIfWindowsAndGhc :: String -> IssueID -> TestM a -> TestM a +expectBrokenIfWindowsAndGhc range ticket m = do + ghcVer <- isGhcVersion range + expectBrokenIf (isWindows && ghcVer) ticket m + +expectBrokenIfOSXAndGhc :: String -> IssueID -> TestM a -> TestM a +expectBrokenIfOSXAndGhc range ticket m = do + ghcVer <- isGhcVersion range + expectBrokenIf (isOSX && ghcVer) ticket m + +expectBrokenIfGhc :: String -> IssueID -> TestM a -> TestM a +expectBrokenIfGhc range ticket m = do + ghcVer <- isGhcVersion range + expectBrokenIf ghcVer ticket m + +flakyIfCI :: IssueID -> TestM a -> TestM a +flakyIfCI ticket m = do + ci <- liftIO isCI + flakyIf ci ticket m + +flakyIfWindows :: IssueID -> TestM a -> TestM a +flakyIfWindows ticket m = flakyIf isWindows ticket m getOpenFilesLimit :: TestM (Maybe Integer) #ifdef mingw32_HOST_OS @@ -964,29 +1117,6 @@ getOpenFilesLimit = liftIO $ do hasNewBuildCompatBootCabal :: TestM Bool hasNewBuildCompatBootCabal = isGhcVersion ">= 7.9" ------------------------------------------------------------------------- --- * Broken tests - -expectBroken :: Int -> TestM a -> TestM () -expectBroken ticket m = do - env <- getTestEnv - liftIO . withAsync (runReaderT m env) $ \a -> do - r <- waitCatch a - case r of - Left e -> do - putStrLn $ "This test is known broken, see #" ++ show ticket ++ ":" - print e - runReaderT expectedBroken env - Right _ -> do - runReaderT unexpectedSuccess env - -expectBrokenIf :: Bool -> Int -> TestM a -> TestM () -expectBrokenIf False _ m = void $ m -expectBrokenIf True ticket m = expectBroken ticket m - -expectBrokenUnless :: Bool -> Int -> TestM a -> TestM () -expectBrokenUnless b = expectBrokenIf (not b) - -- * Programs git :: String -> [String] -> TestM () @@ -1071,19 +1201,20 @@ withDelay m = do Just _ -> m -- | Create a symlink for the duration of the provided action. If the symlink --- already exists, it is deleted. Does not work on Windows. +-- already exists, it is deleted. withSymlink :: FilePath -> FilePath -> TestM a -> TestM a -#ifdef mingw32_HOST_OS +#if defined(mingw32_HOST_OS) && !MIN_VERSION_directory(1,3,1) withSymlink _oldpath _newpath _act = - error "PackageTests.PackageTester.withSymlink: does not work on Windows!" + error "Test.Cabal.Prelude.withSymlink: does not work on Windows with directory <1.3.1!" #else withSymlink oldpath newpath0 act = do + liftIO $ hPutStrLn stderr $ "Symlinking " <> oldpath <> " <== " <> newpath0 env <- getTestEnv let newpath = testCurrentDir env newpath0 symlinkExists <- liftIO $ doesFileExist newpath when symlinkExists $ liftIO $ removeFile newpath - bracket_ (liftIO $ createSymbolicLink oldpath newpath) - (liftIO $ removeFile newpath) act + bracket_ (liftIO $ createFileLink oldpath newpath) + (liftIO $ pure ()) act #endif writeSourceFile :: FilePath -> String -> TestM () diff --git a/cabal-testsuite/src/Test/Cabal/Run.hs b/cabal-testsuite/src/Test/Cabal/Run.hs index 37b27e9edf3..498c14ded23 100644 --- a/cabal-testsuite/src/Test/Cabal/Run.hs +++ b/cabal-testsuite/src/Test/Cabal/Run.hs @@ -54,6 +54,29 @@ runAction _verbosity mb_cwd env_overrides path0 args input action = do mb_env <- getEffectiveEnvironment env_overrides putStrLn $ "+ " ++ showCommandForUser path args (readh, writeh) <- createPipe + + -- `System.Process.createPipe` calls (through many intermediaries) + -- `GHC.IO.Handle.FD.fdToHandle`, whose documentation says: + -- + -- > Makes a binary Handle. This is for historical reasons; it should + -- > probably be a text Handle with the default encoding and newline + -- > translation instead. + -- + -- The documentation for `System.IO.hSetBinaryMode` says: + -- + -- > This has the same effect as calling `hSetEncoding` with `char8`, together + -- > with `hSetNewlineMode` with `noNewlineTranslation`. + -- + -- But this is a lie, and Unicode written to or read from binary handles is + -- always encoded or decoded as Latin-1, which is always the wrong choice. + -- + -- Therefore, we explicitly set the output to UTF-8 to keep it consistent + -- between platforms and correct on all modern computers. + -- + -- See: https://gitlab.haskell.org/ghc/ghc/-/issues/25307 + hSetEncoding readh utf8 + hSetEncoding writeh utf8 + hSetBuffering readh LineBuffering hSetBuffering writeh LineBuffering let drain = do diff --git a/cabal-testsuite/src/Test/Cabal/Script.hs b/cabal-testsuite/src/Test/Cabal/Script.hs index 15e17ed2b94..117fd21861c 100644 --- a/cabal-testsuite/src/Test/Cabal/Script.hs +++ b/cabal-testsuite/src/Test/Cabal/Script.hs @@ -35,7 +35,7 @@ import qualified Data.Monoid as M -- parameters for invoking GHC. Mostly subset of 'LocalBuildInfo'. data ScriptEnv = ScriptEnv { runnerProgramDb :: ProgramDb - , runnerPackageDbStack :: PackageDBStack + , runnerPackageDbStack :: PackageDBStackCWD , runnerVerbosity :: Verbosity , runnerPlatform :: Platform , runnerCompiler :: Compiler @@ -97,7 +97,7 @@ runnerGhcArgs :: ScriptEnv -> Maybe FilePath -> [String] runnerGhcArgs senv mb_cwd = renderGhcOptions (runnerCompiler senv) (runnerPlatform senv) ghc_options where - ghc_options = M.mempty { ghcOptPackageDBs = runnerPackageDbStack senv + ghc_options = M.mempty { ghcOptPackageDBs = fmap (fmap makeSymbolicPath) (runnerPackageDbStack senv) , ghcOptPackages = toNubListR (runnerPackages senv) , ghcOptHideAllPackages = Flag True -- Avoid picking stray module files that look diff --git a/cabal-testsuite/src/Test/Cabal/TestCode.hs b/cabal-testsuite/src/Test/Cabal/TestCode.hs index e29c9ea6b45..fc24b216285 100644 --- a/cabal-testsuite/src/Test/Cabal/TestCode.hs +++ b/cabal-testsuite/src/Test/Cabal/TestCode.hs @@ -1,12 +1,19 @@ -{-# LANGUAGE CPP #-} +{-# LANGUAGE CPP #-} {-# LANGUAGE DeriveDataTypeable #-} +{-# LANGUAGE DerivingStrategies #-} +{-# LANGUAGE GeneralizedNewtypeDeriving #-} + -- | Exception type like 'ExitCode' but with more information -- than just integer. module Test.Cabal.TestCode ( -- * TestCode TestCode (..), + FlakyStatus (..), + IssueID (..), displayTestCode, isTestCodeSkip, + isTestCodeFlaky, + isTestCodeUnexpectedSuccess, ) where import Control.Exception (Exception (..)) @@ -19,24 +26,44 @@ import Data.Typeable (Typeable) data TestCode = TestCodeOk | TestCodeSkip String - | TestCodeKnownFail - | TestCodeUnexpectedOk + | TestCodeKnownFail IssueID + | TestCodeUnexpectedOk IssueID | TestCodeFail + | TestCodeFlakyFailed IssueID + | TestCodeFlakyPassed IssueID deriving (Eq, Show, Read, Typeable) instance Exception TestCode -#if MIN_VERSION_base(4,8,0) where displayException = displayTestCode -#endif displayTestCode :: TestCode -> String -displayTestCode TestCodeOk = "OK" -displayTestCode (TestCodeSkip msg) = "SKIP " ++ msg -displayTestCode TestCodeKnownFail = "OK (known failure)" -displayTestCode TestCodeUnexpectedOk = "FAIL (unexpected success)" -displayTestCode TestCodeFail = "FAIL" +displayTestCode TestCodeOk = "OK" +displayTestCode (TestCodeSkip msg) = "SKIP " ++ msg +displayTestCode (TestCodeKnownFail t) = "OK (known failure, see #" <> show t <> ")" +displayTestCode (TestCodeUnexpectedOk t) = "FAIL (unexpected success, see #" <> show t <> ")" +displayTestCode TestCodeFail = "FAIL" +displayTestCode (TestCodeFlakyFailed t) = "FLAKY (FAIL, see #" <> show t <> ")" +displayTestCode (TestCodeFlakyPassed t) = "FLAKY (OK, see #" <> show t <> ")" isTestCodeSkip :: TestCode -> Bool isTestCodeSkip (TestCodeSkip _) = True isTestCodeSkip _ = False + +type TestPassed = Bool + +newtype IssueID = IssueID Int + deriving newtype (Eq, Typeable, Num, Show, Read) + +data FlakyStatus + = NotFlaky + | Flaky TestPassed IssueID + +isTestCodeFlaky :: TestCode -> FlakyStatus +isTestCodeFlaky (TestCodeFlakyPassed t) = Flaky True t +isTestCodeFlaky (TestCodeFlakyFailed t) = Flaky False t +isTestCodeFlaky _ = NotFlaky + +isTestCodeUnexpectedSuccess :: TestCode -> Maybe IssueID +isTestCodeUnexpectedSuccess (TestCodeUnexpectedOk t) = Just t +isTestCodeUnexpectedSuccess _ = Nothing diff --git a/cabal-testsuite/src/Test/Cabal/Workdir.hs b/cabal-testsuite/src/Test/Cabal/Workdir.hs index bbb545c6494..148508eb606 100644 --- a/cabal-testsuite/src/Test/Cabal/Workdir.hs +++ b/cabal-testsuite/src/Test/Cabal/Workdir.hs @@ -15,9 +15,8 @@ import Distribution.Utils.Path ) import System.Directory -import System.FilePath - import System.Environment ( getExecutablePath ) +import System.FilePath -- | Guess what the dist directory of a running executable is, -- by using the conventional layout of built executables diff --git a/cabal-validate/README.md b/cabal-validate/README.md new file mode 100644 index 00000000000..5f40e9d28f1 --- /dev/null +++ b/cabal-validate/README.md @@ -0,0 +1,23 @@ +# cabal-validate + +`cabal-validate` is a script that builds and tests `Cabal` and `cabal-install`. +`cabal-validate` can be run with `validate.sh` in the repository root; +arguments passed to `validate.sh` will be forwarded to `cabal-validate`. + +Notable arguments include: + +- `-v`/`--verbose` to display build and test output in real-time, instead of + only if commands fail. +- `-s`/`--step` to run a specific step (e.g. `-s build -s lib-tests` will only + run the `build` and `lib-tests` steps). +- `-p`/`--pattern` to filter tests by a pattern. + +## Hacking on cabal-validate + +Overview of important modules: + +- `Main.hs` encodes all the commands that are run for each step. +- `Cli.hs` parses the CLI arguments and resolves default values from the + environment, like determining which steps are run by default or the `--jobs` + argument to pass to test suites. +- `Step.hs` lists the available steps. diff --git a/cabal-validate/cabal-validate.cabal b/cabal-validate/cabal-validate.cabal new file mode 100644 index 00000000000..582cf67434a --- /dev/null +++ b/cabal-validate/cabal-validate.cabal @@ -0,0 +1,47 @@ +cabal-version: 3.0 +name: cabal-validate +version: 1.0.0 +copyright: 2024-2024, Cabal Development Team (see AUTHORS file) +license: BSD-3-Clause +author: Cabal Development Team +synopsis: An internal tool for building and testing the Cabal package manager +build-type: Simple + +common common + ghc-options: -Wall + + if impl(ghc <9.6) + -- Pattern exhaustiveness checker is not as good, misses a case. + ghc-options: -Wno-incomplete-patterns + + default-language: Haskell2010 + default-extensions: + OverloadedStrings + , TypeApplications + +executable cabal-validate + import: common + ghc-options: -O -threaded -rtsopts -with-rtsopts=-N + + main-is: Main.hs + hs-source-dirs: src + + other-modules: + , ANSI + , Cli + , ClockUtil + , OutputUtil + , ProcessUtil + , Step + + build-depends: + , base >=4 && <5 + , bytestring >=0.11 && <1 + , containers >=0.6 && <1 + , directory >=1.0 && <2 + , filepath >=1 && <2 + , optparse-applicative >=0.18 && <1 + , terminal-size >=0.3 && <1 + , text >=2 && <3 + , time >=1 && <2 + , typed-process >=0.2 && <1 diff --git a/cabal-validate/src/ANSI.hs b/cabal-validate/src/ANSI.hs new file mode 100644 index 00000000000..a0d9111d957 --- /dev/null +++ b/cabal-validate/src/ANSI.hs @@ -0,0 +1,105 @@ +-- | ANSI escape sequences. +-- +-- This is a stripped-down version of the parts of the @ansi-terminal@ package +-- we use. +-- +-- See: +module ANSI + ( SGR (..) + , setSGR + ) where + +-- | Render a single numeric SGR sequence. +rawSGR :: Int -> String +rawSGR code = "\x1b[" <> show code <> "m" + +-- | Render a series of `SGR` escape sequences. +setSGR :: [SGR] -> String +setSGR = concat . map renderSGR + +-- | All of the SGR sequences we want to use. +data SGR + = Reset + | Bold + | Dim + | Italic + | Underline + | Black + | Red + | Green + | Yellow + | Blue + | Magenta + | Cyan + | White + | Default + | OnBlack + | OnRed + | OnGreen + | OnYellow + | OnBlue + | OnMagenta + | OnCyan + | OnWhite + | OnDefault + | BrightBlack + | BrightRed + | BrightGreen + | BrightYellow + | BrightBlue + | BrightMagenta + | BrightCyan + | BrightWhite + | OnBrightBlack + | OnBrightRed + | OnBrightGreen + | OnBrightYellow + | OnBrightBlue + | OnBrightMagenta + | OnBrightCyan + | OnBrightWhite + deriving (Show) + +-- Render a single `SGR` sequence. +renderSGR :: SGR -> String +renderSGR code = + case code of + Reset -> rawSGR 0 + Bold -> rawSGR 1 + Dim -> rawSGR 2 + Italic -> rawSGR 3 + Underline -> rawSGR 4 + Black -> rawSGR 30 + Red -> rawSGR 31 + Green -> rawSGR 32 + Yellow -> rawSGR 33 + Blue -> rawSGR 34 + Magenta -> rawSGR 35 + Cyan -> rawSGR 36 + White -> rawSGR 37 + Default -> rawSGR 39 + OnBlack -> rawSGR 40 + OnRed -> rawSGR 41 + OnGreen -> rawSGR 42 + OnYellow -> rawSGR 43 + OnBlue -> rawSGR 44 + OnMagenta -> rawSGR 45 + OnCyan -> rawSGR 46 + OnWhite -> rawSGR 47 + OnDefault -> rawSGR 49 + BrightBlack -> rawSGR 90 + BrightRed -> rawSGR 91 + BrightGreen -> rawSGR 92 + BrightYellow -> rawSGR 93 + BrightBlue -> rawSGR 94 + BrightMagenta -> rawSGR 95 + BrightCyan -> rawSGR 96 + BrightWhite -> rawSGR 97 + OnBrightBlack -> rawSGR 100 + OnBrightRed -> rawSGR 101 + OnBrightGreen -> rawSGR 102 + OnBrightYellow -> rawSGR 103 + OnBrightBlue -> rawSGR 104 + OnBrightMagenta -> rawSGR 105 + OnBrightCyan -> rawSGR 106 + OnBrightWhite -> rawSGR 107 diff --git a/cabal-validate/src/Cli.hs b/cabal-validate/src/Cli.hs new file mode 100644 index 00000000000..423769cd1d9 --- /dev/null +++ b/cabal-validate/src/Cli.hs @@ -0,0 +1,446 @@ +-- | Parse CLI arguments and resolve defaults from the environment. +module Cli + ( Opts (..) + , parseOpts + , HackageTests (..) + , Compiler (..) + , VersionParseException (..) + ) +where + +import Control.Applicative (Alternative (many, (<|>)), (<**>)) +import Control.Exception (Exception (displayException), throw) +import Control.Monad (forM_, when) +import Data.Data (Typeable) +import Data.Maybe (listToMaybe) +import qualified Data.Text as T +import qualified Data.Text.Lazy as T (toStrict) +import qualified Data.Text.Lazy.Encoding as T (decodeUtf8) +import Data.Version (Version, parseVersion) +import GHC.Conc (getNumCapabilities) +import Options.Applicative + ( FlagFields + , Mod + , Parser + , ParserInfo + , auto + , execParser + , flag + , flag' + , fullDesc + , help + , helper + , hidden + , info + , long + , maybeReader + , option + , progDesc + , short + , strOption + , switch + , value + ) +import qualified Options.Applicative as Opt +import System.Directory (getCurrentDirectory) +import System.Exit (exitSuccess) +import System.Info (arch, os) +import System.Process.Typed (proc, readProcessStdout_) +import Text.ParserCombinators.ReadP (readP_to_S) + +import ClockUtil (AbsoluteTime, getAbsoluteTime) +import Step (Step (..), displayStep, parseStep) + +-- | Command-line options, resolved with context from the environment. +data Opts = Opts + { verbose :: Bool + -- ^ Whether to display build and test output. + , jobs :: Int + -- ^ How many jobs to use when running tests. + -- + -- Defaults to the number of physical cores. + , cwd :: FilePath + -- ^ Current working directory when @cabal-validate@ was started. + , startTime :: AbsoluteTime + -- ^ System time when @cabal-validate@ was started. + -- + -- Used to determine the total test duration so far. + , compiler :: Compiler + -- ^ Compiler to build Cabal with. + -- + -- Defaults to @ghc@. + , extraCompilers :: [FilePath] + -- ^ Extra compilers to run @cabal-testsuite@ with. + , cabal :: FilePath + -- ^ @cabal-install@ to build Cabal with. + -- + -- Defaults to @cabal@. + , hackageTests :: HackageTests + -- ^ Whether to run tests on Hackage data, and if so how much. + -- + -- Defaults to `NoHackageTests`. + , archPath :: FilePath + -- ^ The path for this system's architecture within the build directory. + -- + -- Like @x86_64-windows@ or @aarch64-osx@ or @arm-linux@. + , projectFile :: FilePath + -- ^ Path to the @cabal.project@ file to use for running tests. + , tastyArgs :: [String] + -- ^ Extra arguments to pass to @tasty@ test suites. + -- + -- This defaults to @--hide-successes@ (which cannot yet be changed) and + -- includes the @--pattern@ argument if one is given. + , targets :: [String] + -- ^ Targets to build. + , steps :: [Step] + -- ^ Steps to run. + } + deriving (Show) + +-- | Whether to run tests on Hackage data, and if so how much. +data HackageTests + = -- | Run tests on complete Hackage data. + CompleteHackageTests + | -- | Run tests on partial Hackage data. + PartialHackageTests + | -- | Do not run tests on Hackage data. + NoHackageTests + deriving (Show) + +-- | A compiler executable and version number. +data Compiler = Compiler + { compilerExecutable :: FilePath + -- ^ The compiler's executable. + , compilerVersion :: Version + -- ^ The compiler's version number. + } + deriving (Show) + +-- | An `Exception` thrown when parsing @--numeric-version@ output from a compiler. +data VersionParseException = VersionParseException + { versionInput :: String + -- ^ The string we attempted to parse. + , versionExecutable :: FilePath + -- ^ The compiler which produced the string. + } + deriving (Typeable, Show) + +instance Exception VersionParseException where + displayException exception = + "Failed to parse `" + <> versionExecutable exception + <> " --numeric-version` output: " + <> show (versionInput exception) + +-- | Runs @ghc --numeric-version@ for the given executable to construct a +-- `Compiler`. +makeCompiler :: FilePath -> IO Compiler +makeCompiler executable = do + stdout <- + readProcessStdout_ $ + proc executable ["--numeric-version"] + let version = T.unpack $ T.strip $ T.toStrict $ T.decodeUtf8 stdout + parsedVersions = readP_to_S parseVersion version + -- Who needs error messages? Those aren't in the API. + maybeParsedVersion = + listToMaybe + [ parsed + | (parsed, []) <- parsedVersions + ] + parsedVersion = case maybeParsedVersion of + Just parsedVersion' -> parsedVersion' + Nothing -> + throw + VersionParseException + { versionInput = version + , versionExecutable = executable + } + + pure + Compiler + { compilerExecutable = executable + , compilerVersion = parsedVersion + } + +-- | Resolve options and default values from the environment. +-- +-- This makes the `Opts` type much nicer to deal with than `RawOpts`. +resolveOpts :: RawOpts -> IO Opts +resolveOpts opts = do + let optionals :: Bool -> [a] -> [a] + optionals True items = items + optionals False _ = [] + + optional :: Bool -> a -> [a] + optional keep item = optionals keep [item] + + steps' = + if not (null (rawSteps opts)) + then rawSteps opts + else + concat + [ + [ PrintConfig + , PrintToolVersions + , Build + ] + , optional (rawDoctest opts) Doctest + , optional (rawRunLibTests opts) LibTests + , optional (rawRunLibSuite opts) LibSuite + , optional (rawRunLibSuite opts && not (null (rawExtraCompilers opts))) LibSuiteExtras + , optional (rawRunCliTests opts && not (rawLibOnly opts)) CliTests + , optional (rawRunCliSuite opts && not (rawLibOnly opts)) CliSuite + , optionals (rawSolverBenchmarks opts) [SolverBenchmarksTests, SolverBenchmarksRun] + , [TimeSummary] + ] + + targets' = + concat + [ + [ "Cabal" + , "Cabal-hooks" + , "cabal-testsuite" + , "Cabal-tests" + , "Cabal-QuickCheck" + , "Cabal-tree-diff" + , "Cabal-described" + ] + , optionals + (not (rawLibOnly opts)) + [ "cabal-install" + , "cabal-install-solver" + , "cabal-benchmarks" + ] + , optionals + (rawSolverBenchmarks opts) + [ "solver-benchmarks" + , "solver-benchmarks:tests" + ] + ] + + archPath' = + let osPath = + case os of + "darwin" -> "osx" + "linux" -> "linux" + "mingw32" -> "windows" + _ -> os -- TODO: Warning? + in arch <> "-" <> osPath + + projectFile' = + if rawLibOnly opts + then "cabal.validate-libonly.project" + else "cabal.validate.project" + + tastyArgs' = + "--hide-successes" + : maybe + [] + (\tastyPattern -> ["--pattern", tastyPattern]) + (rawTastyPattern opts) + ++ rawTastyArgs opts + + when (rawListSteps opts) $ do + -- TODO: This should probably list _all_ available steps, not just the selected ones! + putStrLn "Targets:" + forM_ targets' $ \target -> do + putStrLn $ " " <> target + putStrLn "Steps:" + forM_ steps' $ \step -> do + putStrLn $ " " <> displayStep step + exitSuccess + + startTime' <- getAbsoluteTime + jobs' <- maybe getNumCapabilities pure (rawJobs opts) + cwd' <- getCurrentDirectory + compiler' <- makeCompiler (rawCompiler opts) + + pure + Opts + { verbose = rawVerbose opts + , jobs = jobs' + , cwd = cwd' + , startTime = startTime' + , compiler = compiler' + , extraCompilers = rawExtraCompilers opts + , cabal = rawCabal opts + , archPath = archPath' + , projectFile = projectFile' + , hackageTests = rawHackageTests opts + , tastyArgs = tastyArgs' + , targets = targets' + , steps = steps' + } + +-- | Literate command-line options as supplied by the user, before resolving +-- defaults and other values from the environment. +data RawOpts = RawOpts + { rawVerbose :: Bool + , rawJobs :: Maybe Int + , rawCompiler :: FilePath + , rawCabal :: FilePath + , rawExtraCompilers :: [FilePath] + , rawTastyPattern :: Maybe String + , rawTastyArgs :: [String] + , rawDoctest :: Bool + , rawSteps :: [Step] + , rawListSteps :: Bool + , rawLibOnly :: Bool + , rawRunLibTests :: Bool + , rawRunCliTests :: Bool + , rawRunLibSuite :: Bool + , rawRunCliSuite :: Bool + , rawSolverBenchmarks :: Bool + , rawHackageTests :: HackageTests + } + deriving (Show) + +-- | `Parser` for `RawOpts`. +-- +-- See: `fullRawOptsParser` +rawOptsParser :: Parser RawOpts +rawOptsParser = + RawOpts + <$> ( flag' + True + ( short 'v' + <> long "verbose" + <> help "Always display build and test output" + ) + <|> flag + False + False + ( short 'q' + <> long "quiet" + <> help "Silence build and test output" + ) + ) + <*> option + (Just <$> auto) + ( short 'j' + <> long "jobs" + <> help "Passed to `cabal build --jobs`" + <> value Nothing + ) + <*> strOption + ( short 'w' + <> long "with-compiler" + <> help "Build Cabal with the given compiler instead of `ghc`" + <> value "ghc" + ) + <*> strOption + ( long "with-cabal" + <> help "Test the given `cabal-install` (the `cabal` on your `$PATH` is used for builds)" + <> value "cabal" + ) + <*> many + ( strOption + ( long "extra-hc" + <> help "Extra compilers to run the test suites against" + ) + ) + <*> option + (Just <$> Opt.str) + ( short 'p' + <> long "pattern" + <> help "Pattern to filter tests by" + <> value Nothing + ) + <*> many + ( strOption + ( long "tasty-arg" + <> help "Extra arguments to pass to Tasty test suites" + ) + ) + <*> boolOption + False + "doctest" + ( help "Run doctest on the `Cabal` library" + ) + <*> many + ( option + (maybeReader parseStep) + ( short 's' + <> long "step" + <> help "Run only a specific step (can be specified multiple times)" + ) + ) + <*> switch + ( long "list-steps" + <> help "List the available steps and exit" + ) + <*> ( flag' + True + ( long "lib-only" + <> help "Test only `Cabal` (the library)" + ) + <|> flag + False + False + ( long "cli" + <> help "Test `cabal-install` (the executable) in addition to `Cabal` (the library)" + ) + ) + <*> boolOption + True + "run-lib-tests" + ( help "Run tests for the `Cabal` library" + ) + <*> boolOption + True + "run-cli-tests" + ( help "Run client tests for the `cabal-install` executable" + ) + <*> boolOption + False + "run-lib-suite" + ( help "Run `cabal-testsuite` with the `Cabal` library" + ) + <*> boolOption + False + "run-cli-suite" + ( help "Run `cabal-testsuite` with the `cabal-install` executable" + ) + <*> boolOption + False + "solver-benchmarks" + ( help "Build and trial run `solver-benchmarks`" + ) + <*> ( flag' + CompleteHackageTests + ( long "complete-hackage-tests" + <> help "Run `hackage-tests` on complete Hackage data" + ) + <|> flag + NoHackageTests + PartialHackageTests + ( long "partial-hackage-tests" + <> help "Run `hackage-tests` on parts of Hackage data" + ) + ) + +-- | Parse a boolean switch with separate names for the true and false options. +boolOption' :: Bool -> String -> String -> Mod FlagFields Bool -> Parser Bool +boolOption' defaultValue trueName falseName modifiers = + flag' True (modifiers <> long trueName) + <|> flag defaultValue False (modifiers <> hidden <> long falseName) + +-- | Parse a boolean switch with a @--no-*@ flag for setting the option to false. +boolOption :: Bool -> String -> Mod FlagFields Bool -> Parser Bool +boolOption defaultValue trueName = + boolOption' defaultValue trueName ("no-" <> trueName) + +-- | Full `Parser` for `RawOpts`, which includes a @--help@ argument and +-- information about the program. +fullRawOptsParser :: ParserInfo RawOpts +fullRawOptsParser = + info + (rawOptsParser <**> helper) + ( fullDesc + <> progDesc "Test suite runner for `Cabal` and `cabal-install` developers" + ) + +-- | Parse command-line arguments and resolve defaults from the environment, +-- producing `Opts`. +parseOpts :: IO Opts +parseOpts = execParser fullRawOptsParser >>= resolveOpts diff --git a/cabal-validate/src/ClockUtil.hs b/cabal-validate/src/ClockUtil.hs new file mode 100644 index 00000000000..2df7cdd9866 --- /dev/null +++ b/cabal-validate/src/ClockUtil.hs @@ -0,0 +1,33 @@ +-- | Utilities for dealing with times and durations. +module ClockUtil + ( DiffTime + , AbsoluteTime + , diffAbsoluteTime + , getAbsoluteTime + , formatDiffTime + ) where + +import Data.Time.Clock (DiffTime, secondsToDiffTime) +import Data.Time.Clock.System (getSystemTime, systemToTAITime) +import Data.Time.Clock.TAI (AbsoluteTime, diffAbsoluteTime) +import Data.Time.Format (defaultTimeLocale, formatTime) + +-- | Get the current time as an `AbsoluteTime`. +getAbsoluteTime :: IO AbsoluteTime +getAbsoluteTime = systemToTAITime <$> getSystemTime + +-- | Format a `DiffTime` nicely. +-- +-- Short durations are formatted like @16.34s@, durations longer than a minute +-- are formatted like @22:34.68@, durations longer than an hour are formatted +-- like @1:32:04.68@. +formatDiffTime :: DiffTime -> String +formatDiffTime delta = + let minute = secondsToDiffTime 60 + hour = 60 * minute + in if delta >= hour + then formatTime defaultTimeLocale "%h:%02M:%02ES" delta + else + if delta >= minute + then formatTime defaultTimeLocale "%m:%2ES" delta + else formatTime defaultTimeLocale "%2Ess" delta diff --git a/cabal-validate/src/Main.hs b/cabal-validate/src/Main.hs new file mode 100644 index 00000000000..428a8a7358d --- /dev/null +++ b/cabal-validate/src/Main.hs @@ -0,0 +1,425 @@ +-- | Entry-point to the @cabal-validate@ script. +-- +-- This module encodes all the commands that are run for each step in +-- `runStep`. +module Main + ( main + , runStep + ) where + +import Control.Monad (forM_) +import qualified Data.Text as T +import qualified Data.Text.IO as T +import qualified Data.Text.Lazy as T (toStrict) +import qualified Data.Text.Lazy.Encoding as T (decodeUtf8) +import Data.Version (makeVersion, showVersion) +import System.FilePath (()) +import System.Process.Typed (proc, readProcessStdout_) + +import ANSI (SGR (Bold, BrightCyan, Reset), setSGR) +import Cli (Compiler (..), HackageTests (..), Opts (..), parseOpts) +import ClockUtil (diffAbsoluteTime, formatDiffTime, getAbsoluteTime) +import OutputUtil (printHeader, withTiming) +import ProcessUtil (timed, timedWithCwd) +import Step (Step (..), displayStep) + +-- | Entry-point for @cabal-validate@. +main :: IO () +main = do + opts <- parseOpts + forM_ (steps opts) $ \step -> do + runStep opts step + +-- | Run a given `Step` with the given `Opts`. +runStep :: Opts -> Step -> IO () +runStep opts step = do + let title = displayStep step + printHeader title + let action = case step of + PrintConfig -> printConfig opts + PrintToolVersions -> printToolVersions opts + Build -> build opts + Doctest -> doctest opts + LibTests -> libTests opts + LibSuite -> libSuite opts + LibSuiteExtras -> libSuiteExtras opts + CliSuite -> cliSuite opts + CliTests -> cliTests opts + SolverBenchmarksTests -> solverBenchmarksTests opts + SolverBenchmarksRun -> solverBenchmarksRun opts + TimeSummary -> timeSummary opts + withTiming (startTime opts) title action + T.putStrLn "" + +-- | Compiler with version number like @ghc-9.6.6@. +baseHc :: Opts -> FilePath +baseHc opts = "ghc-" <> showVersion (compilerVersion $ compiler opts) + +-- | Base build directory for @cabal-validate@. +baseBuildDir :: Opts -> FilePath +baseBuildDir opts = "dist-newstyle-validate-" <> baseHc opts + +-- | Absolute path to the build directory for this architecture. +-- +-- This is a path nested fairly deeply under `baseBuildDir`. +buildDir :: Opts -> FilePath +buildDir opts = + cwd opts + baseBuildDir opts + "build" + archPath opts + baseHc opts + +-- | @--num-threads@ argument for test suites. +-- +-- This isn't always used because some test suites are finicky and only accept +-- @-j@. +jobsArgs :: Opts -> [String] +jobsArgs opts = ["--num-threads", show $ jobs opts] + +-- | Default arguments for invoking @cabal@. +cabalArgs :: Opts -> [String] +cabalArgs opts = + [ "--jobs=" <> show (jobs opts) + , "--with-compiler=" <> compilerExecutable (compiler opts) + , "--builddir=" <> baseBuildDir opts + , "--project-file=" <> projectFile opts + ] + +-- | The `buildDir` for @cabal-testsuite-3@. +cabalTestsuiteBuildDir :: Opts -> FilePath +cabalTestsuiteBuildDir opts = + buildDir opts + "cabal-testsuite-3" + +-- | Arguments for @cabal build@. +cabalNewBuildArgs :: Opts -> [String] +cabalNewBuildArgs opts = "build" : cabalArgs opts + +-- | Arguments for @cabal list-bin@. +-- +-- This is used to find the binaries for various test suites. +cabalListBinArgs :: Opts -> [String] +cabalListBinArgs opts = "list-bin" : cabalArgs opts + +-- | Get the binary for a given @cabal@ target by running @cabal list-bin@. +cabalListBin :: Opts -> String -> IO FilePath +cabalListBin opts target = do + let args = cabalListBinArgs opts ++ [target] + stdout <- + readProcessStdout_ $ + proc (cabal opts) args + + pure (T.unpack $ T.strip $ T.toStrict $ T.decodeUtf8 stdout) + +-- | Get the RTS arguments for invoking test suites. +-- +-- These seem to only be used for some of the test suites, I'm not sure why. +rtsArgs :: Opts -> [String] +rtsArgs opts = + case archPath opts of + "x86_64-windows" -> + -- See: https://github.com/haskell/cabal/issues/9571 + if compilerVersion (compiler opts) > makeVersion [9, 0, 2] + then ["+RTS", "--io-manager=native", "-RTS"] + else [] + _ -> [] + +-- | Run a binary built by @cabal@ and output timing information. +-- +-- This is used to run many of the test suites. +timedCabalBin :: Opts -> String -> String -> [String] -> IO () +timedCabalBin opts package component args = do + command <- cabalListBin opts (package <> ":" <> component) + timedWithCwd + opts + package + command + args + +-- | Print the configuration for CI logs. +printConfig :: Opts -> IO () +printConfig opts = do + putStr $ + unlines + [ "compiler: " + <> compilerExecutable (compiler opts) + , "cabal-install: " + <> cabal opts + , "jobs: " + <> show (jobs opts) + , "steps: " + <> unwords (map displayStep (steps opts)) + , "Hackage tests: " + <> show (hackageTests opts) + , "verbose: " + <> show (verbose opts) + , "extra compilers: " + <> unwords (extraCompilers opts) + , "extra RTS options: " + <> unwords (rtsArgs opts) + ] + +-- | Print the versions of tools being used. +printToolVersions :: Opts -> IO () +printToolVersions opts = do + timed opts (compilerExecutable (compiler opts)) ["--version"] + timed opts (cabal opts) ["--version"] + + forM_ (extraCompilers opts) $ \compiler' -> do + timed opts compiler' ["--version"] + +-- | Run the build step. +build :: Opts -> IO () +build opts = do + printHeader "build (dry run)" + timed + opts + (cabal opts) + ( cabalNewBuildArgs opts + ++ targets opts + ++ ["--dry-run"] + ) + + printHeader "build (full build plan; cached and to-be-built dependencies)" + timed + opts + "jq" + [ "-r" + , -- TODO: Maybe use `cabal-plan`? It's a heavy dependency though... + ".\"install-plan\" | map(.\"pkg-name\" + \"-\" + .\"pkg-version\" + \" \" + .\"component-name\") | join(\"\n\")" + , baseBuildDir opts "cache" "plan.json" + ] + + printHeader "build (actual build)" + timed + opts + (cabal opts) + (cabalNewBuildArgs opts ++ targets opts) + +-- | Run doctests. +-- +-- This doesn't work on my machine, maybe @cabal.nix@ needs some love to +-- support @cabal-env@? +doctest :: Opts -> IO () +doctest opts = do + timed + opts + "cabal-env" + [ "--name" + , "doctest-cabal" + , "--transitive" + , "QuickCheck" + ] + + timed + opts + "cabal-env" + [ "--name" + , "doctest-cabal" + , "array" + , "bytestring" + , "containers" + , "deepseq" + , "directory" + , "filepath" + , "pretty" + , "process" + , "time" + , "binary" + , "unix" + , "text" + , "parsec" + , "mtl" + ] + + timed + opts + "doctest" + [ "-package-env=doctest-Cabal" + , "--fast" + , "Cabal/Distribution" + , "Cabal/Language" + ] + +-- | Run tests for the @Cabal@ library, and also `runHackageTests` if those are +-- enabled. +libTests :: Opts -> IO () +libTests opts = do + let runCabalTests' suite extraArgs = + timedCabalBin + opts + "Cabal-tests" + ("test:" <> suite) + ( tastyArgs opts + ++ jobsArgs opts + ++ extraArgs + ) + + runCabalTests suite = runCabalTests' suite [] + + runCabalTests' "unit-tests" ["--with-ghc=" <> compilerExecutable (compiler opts)] + runCabalTests "check-tests" + runCabalTests "parser-tests" + runCabalTests "rpmvercmp" + runCabalTests "no-thunks-test" + + runHackageTests opts + +-- | Run Hackage tests, if enabled. +runHackageTests :: Opts -> IO () +runHackageTests opts + | NoHackageTests <- hackageTests opts = pure () + | otherwise = do + command <- cabalListBin opts "Cabal-tests:test:hackage-tests" + + let + -- See #10284 for why this value is pinned. + hackageTestsIndexState = "--index-state=2024-08-25" + + hackageTest args = + timedWithCwd + opts + "Cabal-tests" + command + (args ++ [hackageTestsIndexState]) + + hackageTest ["read-fields"] + + case hackageTests opts of + CompleteHackageTests -> do + hackageTest ["parsec"] + hackageTest ["roundtrip"] + PartialHackageTests -> do + hackageTest ["parsec", "d"] + hackageTest ["roundtrip", "k"] + +-- | Run @cabal-testsuite@ with the @Cabal@ library with a non-default GHC. +libSuiteWith :: Opts -> FilePath -> [String] -> IO () +libSuiteWith opts ghc extraArgs = + timedCabalBin + opts + "cabal-testsuite" + "exe:cabal-tests" + ( [ "--builddir=" <> cabalTestsuiteBuildDir opts + , "--with-ghc=" <> ghc + , -- This test suite doesn't support `--jobs` _or_ `--num-threads`! + "-j" <> show (jobs opts) + ] + ++ tastyArgs opts + ++ extraArgs + ) + +-- | Run @cabal-testsuite@ with the @Cabal@ library with the default GHC. +libSuite :: Opts -> IO () +libSuite opts = libSuiteWith opts (compilerExecutable (compiler opts)) (rtsArgs opts) + +-- | Run @cabal-testsuite@ with the @Cabal@ library with all extra GHCs. +libSuiteExtras :: Opts -> IO () +libSuiteExtras opts = forM_ (extraCompilers opts) $ \compiler' -> + libSuiteWith opts compiler' [] + +-- | Test the @cabal-install@ executable. +-- +-- These tests mostly run sequentially, so they're pretty slow as a result. +cliTests :: Opts -> IO () +cliTests opts = do + -- These are sorted in asc time used, quicker tests first. + timedCabalBin + opts + "cabal-install" + "test:long-tests" + ( jobsArgs opts + ++ tastyArgs opts + ) + + -- This doesn't work in parallel either. + timedCabalBin + opts + "cabal-install" + "test:unit-tests" + ( ["--num-threads", "1"] + ++ tastyArgs opts + ) + + -- Only single job, otherwise we fail with "Heap exhausted" + timedCabalBin + opts + "cabal-install" + "test:mem-use-tests" + ( ["--num-threads", "1"] + ++ tastyArgs opts + ) + + -- This test-suite doesn't like concurrency + timedCabalBin + opts + "cabal-install" + "test:integration-tests2" + ( [ "--num-threads" + , "1" + , "--with-ghc=" <> compilerExecutable (compiler opts) + ] + ++ tastyArgs opts + ) + +-- | Run @cabal-testsuite@ with the @cabal-install@ executable. +cliSuite :: Opts -> IO () +cliSuite opts = do + cabal' <- cabalListBin opts "cabal-install:exe:cabal" + + timedCabalBin + opts + "cabal-testsuite" + "exe:cabal-tests" + ( [ "--builddir=" <> cabalTestsuiteBuildDir opts + , "--with-cabal=" <> cabal' + , "--with-ghc=" <> compilerExecutable (compiler opts) + , "--intree-cabal-lib=" <> cwd opts + , "--test-tmp=" <> cwd opts "testdb" + , -- This test suite doesn't support `--jobs` _or_ `--num-threads`! + "-j" + , show (jobs opts) + ] + ++ tastyArgs opts + ++ rtsArgs opts + ) + +-- | Run the @solver-benchmarks@ unit tests. +solverBenchmarksTests :: Opts -> IO () +solverBenchmarksTests opts = do + command <- cabalListBin opts "solver-benchmarks:test:unit-tests" + + timedWithCwd + opts + "Cabal" + command + [] + +-- | Run the @solver-benchmarks@. +solverBenchmarksRun :: Opts -> IO () +solverBenchmarksRun opts = do + command <- cabalListBin opts "solver-benchmarks:exe:hackage-benchmark" + cabal' <- cabalListBin opts "cabal-install:exe:cabal" + + timedWithCwd + opts + "Cabal" + command + [ "--cabal1=" <> cabal opts + , "--cabal2=" <> cabal' + , "--trials=5" + , "--packages=Chart-diagrams" + , "--print-trials" + ] + +-- | Print the total time taken so far. +timeSummary :: Opts -> IO () +timeSummary opts = do + endTime <- getAbsoluteTime + let totalDuration = diffAbsoluteTime endTime (startTime opts) + putStrLn $ + setSGR [Bold, BrightCyan] + <> "!!! Validation completed in " + <> formatDiffTime totalDuration + <> setSGR [Reset] diff --git a/cabal-validate/src/OutputUtil.hs b/cabal-validate/src/OutputUtil.hs new file mode 100644 index 00000000000..576c6180433 --- /dev/null +++ b/cabal-validate/src/OutputUtil.hs @@ -0,0 +1,86 @@ +-- | Utilities for printing terminal output. +module OutputUtil + ( printHeader + , withTiming + ) where + +import Control.Exception (catch) +import qualified System.Console.Terminal.Size as Terminal +import System.Process.Typed (ExitCodeException) + +import ANSI (SGR (Bold, BrightCyan, BrightGreen, BrightRed, Reset), setSGR) +import ClockUtil (AbsoluteTime, diffAbsoluteTime, formatDiffTime, getAbsoluteTime) +import System.Exit (exitFailure) + +-- | Get the width of the current terminal, or 80 if no width can be determined. +getTerminalWidth :: IO Int +getTerminalWidth = maybe 80 Terminal.width <$> Terminal.size @Int + +-- | Print a header for a given step. +-- +-- This is colorful and hard to miss in the output. +printHeader + :: String + -- ^ Title to print. + -> IO () +printHeader title = do + columns <- getTerminalWidth + let left = 3 + right = columns - length title - left - 2 + header = + setSGR [Bold, BrightCyan] + <> replicate left '═' + <> " " + <> title + <> " " + <> replicate right '═' + <> setSGR [Reset] + putStrLn header + +-- | Run an `IO` action and print duration information after it finishes. +withTiming + :: AbsoluteTime + -- ^ Start time for the whole @cabal-validate@ run. + -> String + -- ^ Name for describing the action. + -- + -- Used in a sentence like "@title@ finished after 16.34s". + -> IO a + -- ^ Action to time. + -> IO a +withTiming startTime title action = do + startTime' <- getAbsoluteTime + + result <- + (Right <$> action) + `catch` (\exception -> pure (Left (exception :: ExitCodeException))) + + endTime <- getAbsoluteTime + + let duration = diffAbsoluteTime endTime startTime' + totalDuration = diffAbsoluteTime endTime startTime + + case result of + Right inner -> do + putStrLn $ + setSGR [Bold, BrightGreen] + <> title + <> " finished after " + <> formatDiffTime duration + <> "\nTotal time so far: " + <> formatDiffTime totalDuration + <> setSGR [Reset] + + pure inner + Left _procFailed -> do + putStrLn $ + setSGR [Bold, BrightRed] + <> title + <> " failed after " + <> formatDiffTime duration + <> "\nTotal time so far: " + <> formatDiffTime totalDuration + <> setSGR [Reset] + + -- TODO: `--keep-going` mode. + exitFailure diff --git a/cabal-validate/src/ProcessUtil.hs b/cabal-validate/src/ProcessUtil.hs new file mode 100644 index 00000000000..3e27f5517a1 --- /dev/null +++ b/cabal-validate/src/ProcessUtil.hs @@ -0,0 +1,137 @@ +-- | Utilities for running processes and timing them. +module ProcessUtil + ( timed + , timedWithCwd + ) where + +import Control.Exception (throwIO) +import Control.Monad (unless) +import Data.ByteString.Lazy (ByteString) +import qualified Data.ByteString.Lazy as ByteString +import Data.Text (Text) +import qualified Data.Text as T +import qualified Data.Text.IO as T +import qualified Data.Text.Lazy as T (toStrict) +import qualified Data.Text.Lazy.Encoding as T (decodeUtf8) +import System.Directory (withCurrentDirectory) +import System.Exit (ExitCode (ExitFailure, ExitSuccess)) +import System.Process.Typed (ExitCodeException (..), proc, readProcess, runProcess) + +import ANSI (SGR (BrightBlue, BrightGreen, BrightRed, Reset), setSGR) +import Cli (Opts (..)) +import ClockUtil (diffAbsoluteTime, formatDiffTime, getAbsoluteTime) + +-- | Like `timed`, but runs the command in a given directory. +timedWithCwd + :: Opts + -- ^ @cabal-validate@ options. + -> FilePath + -- ^ Path to run the command in. + -> FilePath + -- ^ The command to run. + -> [String] + -- ^ Arguments to pass to the command. + -> IO () +timedWithCwd opts cdPath command args = + withCurrentDirectory cdPath (timed opts command args) + +-- | Run a command, displaying timing information after it finishes. +-- +-- This prints out the command to be executed before it's run, handles hiding +-- or showing output (according to the value of `verbose`), and throws an +-- `ExitCodeException` if the command fails. +timed + :: Opts + -- ^ @cabal-validate@ options. + -> FilePath + -- ^ The command to run. + -> [String] + -- ^ Arguments to pass to the command. + -> IO () +timed opts command args = do + let prettyCommand = displayCommand command args + process = proc command args + + startTime' <- getAbsoluteTime + + -- TODO: Replace `$HOME` or `opts.cwd` for brevity? + putStrLn $ + setSGR [BrightBlue] + <> "$ " + <> prettyCommand + <> setSGR [Reset] + + (exitCode, rawStdout, rawStderr) <- + if verbose opts + then do + exitCode <- runProcess process + pure (exitCode, ByteString.empty, ByteString.empty) + else readProcess process + + endTime <- getAbsoluteTime + + let duration = diffAbsoluteTime endTime startTime' + totalDuration = diffAbsoluteTime endTime (startTime opts) + + output = decodeStrip rawStdout <> "\n" <> decodeStrip rawStderr + linesLimit = 50 + outputLines = T.lines output + hiddenLines = length outputLines - linesLimit + tailLines = drop hiddenLines outputLines + + case exitCode of + ExitSuccess -> do + unless (verbose opts) $ do + if hiddenLines <= 0 + then T.putStrLn output + else + T.putStrLn $ + "(" + <> T.pack (show hiddenLines) + <> " lines hidden, use `--verbose` to show)\n" + <> "...\n" + <> T.unlines tailLines + + putStrLn $ + setSGR [BrightGreen] + <> "Finished after " + <> formatDiffTime duration + <> ": " + <> prettyCommand + <> "\nTotal time so far: " + <> formatDiffTime totalDuration + <> setSGR [Reset] + ExitFailure exitCode' -> do + unless (verbose opts) $ do + T.putStrLn output + + putStrLn $ + setSGR [BrightRed] + <> "Failed with exit code " + <> show exitCode' + <> " after " + <> formatDiffTime duration + <> ": " + <> prettyCommand + <> "\nTotal time so far: " + <> formatDiffTime totalDuration + <> setSGR [Reset] + + throwIO + ExitCodeException + { eceExitCode = exitCode + , eceProcessConfig = process + , eceStdout = rawStdout + , eceStderr = rawStderr + } + +-- | Decode `ByteString` output from a command and strip whitespace at the +-- start and end. +decodeStrip :: ByteString -> Text +decodeStrip = T.strip . T.toStrict . T.decodeUtf8 + +-- | Escape a shell command to display it to a user. +-- +-- TODO: Shell escaping +displayCommand :: String -> [String] -> String +displayCommand command args = command <> " " <> unwords args diff --git a/cabal-validate/src/Step.hs b/cabal-validate/src/Step.hs new file mode 100644 index 00000000000..2636f483a79 --- /dev/null +++ b/cabal-validate/src/Step.hs @@ -0,0 +1,62 @@ +-- | The steps that can be run by @cabal-validate@. +module Step + ( Step (..) + , displayStep + , nameToStep + , parseStep + ) where + +import Data.Map.Strict (Map) +import qualified Data.Map.Strict as Map + +-- | A step to be run by @cabal-validate@. +data Step + = PrintConfig + | PrintToolVersions + | Build + | Doctest + | LibTests + | LibSuite + | LibSuiteExtras + | CliTests + | CliSuite + | SolverBenchmarksTests + | SolverBenchmarksRun + | TimeSummary + deriving (Eq, Enum, Bounded, Show) + +-- | Get the display identifier for a given `Step`. +-- +-- This is used to parse the @--step@ command-line argument. +-- +-- Note that these names are just kebab-case variants of the `Step` constructor +-- names; they do not attempt to describe the steps. +displayStep :: Step -> String +displayStep step = + case step of + PrintConfig -> "print-config" + PrintToolVersions -> "print-tool-versions" + Build -> "build" + Doctest -> "doctest" + LibTests -> "lib-tests" + LibSuite -> "lib-suite" + LibSuiteExtras -> "lib-suite-extras" + CliTests -> "cli-tests" + CliSuite -> "cli-suite" + SolverBenchmarksTests -> "solver-benchmarks-tests" + SolverBenchmarksRun -> "solver-benchmarks-run" + TimeSummary -> "time-summary" + +-- | A map from step names to `Steps`. +-- +-- This is an inverse of `displayStep`. +nameToStep :: Map String Step +nameToStep = + Map.fromList + [ (displayStep step, step) + | step <- [minBound .. maxBound] + ] + +-- | Parse a string as a `Step`. +parseStep :: String -> Maybe Step +parseStep step = Map.lookup step nameToStep diff --git a/cabal.bootstrap.project b/cabal.bootstrap.project index 845a3fca7fd..a700ac72b7c 100644 --- a/cabal.bootstrap.project +++ b/cabal.bootstrap.project @@ -9,4 +9,9 @@ packages: tests: False benchmarks: False -index-state: hackage.haskell.org 2024-04-22T06:16:57Z +-- This project file is used to generate bootstrap plans, +-- as such we cannot enable "-march=native". +constraints: + hashable -arch-native + +index-state: hackage.haskell.org 2024-09-06T14:16:40Z diff --git a/cabal.release.project b/cabal.release.project index 3d73d2f19a1..74a2632797b 100644 --- a/cabal.release.project +++ b/cabal.release.project @@ -2,4 +2,7 @@ import: project-cabal/pkgs/cabal.config import: project-cabal/pkgs/install.config import: project-cabal/pkgs/tests.config -index-state: hackage.haskell.org 2024-04-22T06:16:57Z +constraints: + hashable -arch-native + +index-state: hackage.haskell.org 2024-09-06T14:16:40Z diff --git a/cabal.validate.project b/cabal.validate.project index 52c78411107..2e3084cccf0 100644 --- a/cabal.validate.project +++ b/cabal.validate.project @@ -7,3 +7,8 @@ tests: True write-ghc-environment-files: never program-options ghc-options: -Werror + +-- This project file is used to distribute the cabal-head binary, +-- as such we cannot enable "-march=native". +constraints: + hashable -arch-native diff --git a/changelog.d/config b/changelog.d/config index f4f1b9e5f57..58f62d6a4f3 100644 --- a/changelog.d/config +++ b/changelog.d/config @@ -1,3 +1,9 @@ organization: haskell repository: cabal required-fields: packages prs +packages: + Cabal + Cabal-hooks + Cabal-syntax + cabal-install + cabal-install-solver diff --git a/changelog.d/i10418 b/changelog.d/i10418 new file mode 100644 index 00000000000..9a96e47a1e9 --- /dev/null +++ b/changelog.d/i10418 @@ -0,0 +1,13 @@ +synopsis: Fix build ways for modules in executables +packages: Cabal +prs: #10419 +issues: #10418 +significance: significant + +description: { + +- Modules belonging to executables were being built in too many ways. For instance, if you +had configured to build profiled library files then your executable modules would also +be built profiled. Which was a regression in behaviour since `Cabal-3.12`. + +} diff --git a/changelog.d/issue-10042 b/changelog.d/issue-10042 deleted file mode 100644 index e254210c028..00000000000 --- a/changelog.d/issue-10042 +++ /dev/null @@ -1,9 +0,0 @@ -synopsis: Don't recommend deprecated/removed 'extensions:' field -packages: Cabal -prs: #10044 -issues: #10042 - -description: { - When applicable, field 'default-extensions:' is recommended (rather than - deprecated/removed 'extensions:'). -} diff --git a/changelog.d/issue-6750 b/changelog.d/issue-6750 deleted file mode 100644 index e392258267b..00000000000 --- a/changelog.d/issue-6750 +++ /dev/null @@ -1,13 +0,0 @@ -synopsis: Make Setup copy/install succeed when there's no executable or library -packages: Cabal -prs: #9926 -issues: #6750 - -description: { - Historically the Setup copy and install steps would fail if the package didn't - contain an executable or library component. In this case there's nothing to do. - - This required workarounds for downstream users of Cabal to handle this edge case. - Now that this error has been downgraded to a warning, Cabal will succeed if - there's nothing to do. -} diff --git a/changelog.d/issue-8875 b/changelog.d/issue-8875 deleted file mode 100644 index 6642609a0e6..00000000000 --- a/changelog.d/issue-8875 +++ /dev/null @@ -1,10 +0,0 @@ -synopsis: Allow whitespace in targets -packages: cabal-install -prs: #10032 -issues: #8875 - -description: { -Allow spaces in the final component of target selectors. This resolves an issue -where using absolute paths in selectors can fail if there is whitespace in the -parent directories of the project. -} diff --git a/changelog.d/issue-9641 b/changelog.d/issue-9641 deleted file mode 100644 index 34666f0ad59..00000000000 --- a/changelog.d/issue-9641 +++ /dev/null @@ -1,8 +0,0 @@ -synopsis: offline flag applied to `source-repository-package`s -packages: Cabal-install -prs: #9771 -issues: #9641 - -description: { -`--offline` flag is already used to block access to Hackage. Now with this PR, this also applies to remote dependency `source-repository-package` in `cabal.project`. -} diff --git a/changelog.d/issue-9702 b/changelog.d/issue-9702 deleted file mode 100644 index 7df998b8d8d..00000000000 --- a/changelog.d/issue-9702 +++ /dev/null @@ -1,39 +0,0 @@ -synopsis: Working directory support for Cabal -packages: Cabal-syntax Cabal cabal-install -prs: #9718 -issues: #9702 - -description: { - -The Cabal library is now able to handle a passed-in working directory, instead -of always relying on the current working directory of the parent process. - -In order to achieve this, the `SymbolicPath` abstraction was fleshed out, and -all fields of `PackageDescription` that, if relative, should be interpreted -with respect to e.g. the package root, use `SymbolicPath` instead of `FilePath`. - -This means that many library functions in `Cabal` take an extra argument of type -`Maybe (SymbolicPath CWD (Dir "Package))`, which is an optional (relative or -absolute) path to the package root (if relative, relative to the current working -directory). In addition, many functions that used to manipulate `FilePath`s now -manipulate `SymbolicPath`s, require explicit conversion using e.g. `getSymbolicPath`. - -To illustrate with file searching, the `Cabal` library defines: - -```haskell -findFileCwd - :: forall dir1 dir2 file - . Verbosity - -> Maybe (SymbolicPath CWD (Dir dir1)) - -- ^ working directory - -> [SymbolicPath dir1 (Dir dir2)] - -- ^ search directories - -> RelativePath dir2 File - -- ^ filename - -> IO (SymbolicPath dir1 File) -``` - -See Note [Symbolic paths] in `Distribution.Utils.Path` for further information -on the design of this API. -} - diff --git a/changelog.d/issue-9919 b/changelog.d/issue-9919 deleted file mode 100644 index a4fe32bbdef..00000000000 --- a/changelog.d/issue-9919 +++ /dev/null @@ -1,4 +0,0 @@ -synopsis: Fix --program-suffix resulting in invalid installation -packages: cabal-install -issues: #8823 #9919 -prs: #10056 diff --git a/changelog.d/issue-9971 b/changelog.d/issue-9971 deleted file mode 100644 index 9bfb2e4822f..00000000000 --- a/changelog.d/issue-9971 +++ /dev/null @@ -1,6 +0,0 @@ -synopsis: Renders project configuration provenance as a list of canonical paths -packages: cabal-install cabal-install-solver -prs: #9985 -issues: #9971 - -description: Removes interleaved rendering of project imports. diff --git a/changelog.d/pr-10190 b/changelog.d/pr-10190 new file mode 100644 index 00000000000..d9e4f009b94 --- /dev/null +++ b/changelog.d/pr-10190 @@ -0,0 +1,11 @@ +synopsis: Fix `cabal clean` permissions on Windows +packages: cabal-install +prs: #10190 +issues: #10182 +significance: + +description: { + +- `cabal clean` now removes the read-only mark recursively in the `dist-newstyle` folder on Windows before attempting to delete it. + +} diff --git a/changelog.d/pr-10273 b/changelog.d/pr-10273 new file mode 100644 index 00000000000..343c871377b --- /dev/null +++ b/changelog.d/pr-10273 @@ -0,0 +1,19 @@ +--- +synopsis: "Show why `cabal act-as-setup configure` failed" +packages: [Cabal] +prs: 10273 +--- + +When `cabal act-as-setup configure` fails, it prints a list of "missing or +private dependencies". + +Now, it will show you if each failing dependency is missing, private, or an +incompatible version: + +``` +Error: [Cabal-8010] +Encountered missing or private dependencies: + Lib:{bar-internal,foo-internal} (missing :bar-internal), + base <=1.0 (installed: 4.18.2.1), + package-that-does-not-exist (missing) +``` diff --git a/changelog.d/pr-10356 b/changelog.d/pr-10356 new file mode 100644 index 00000000000..dbe464ae492 --- /dev/null +++ b/changelog.d/pr-10356 @@ -0,0 +1,11 @@ +synopsis: New licence constructors for SPDX licences starting with a digit +packages: Cabal-syntax +prs: #10356 + +description: { + +- LicenseId constructor `NullBSD` is now `N_0BSD`. +- LicenseId constructor `DS389_exception` is now and `N_389_exception`. +- LicenseId constructor `X3D_Slicer_1_0` is now and `N_3D_Slicer_1_0`. + +} diff --git a/changelog.d/pr-10432 b/changelog.d/pr-10432 new file mode 100644 index 00000000000..1bb76adb0a1 --- /dev/null +++ b/changelog.d/pr-10432 @@ -0,0 +1,10 @@ +synopsis: Avoid partial `Data.List.last` in autogenerated `Paths_.hs` +packages: Cabal +prs: #10432 +significance: + +description: { + +- Autogenerated `Paths_.hs` now avoids use of the partial function `Data.List.last`. + +} diff --git a/changelog.d/pr-9177 b/changelog.d/pr-9177 deleted file mode 100644 index 6b1eb227350..00000000000 --- a/changelog.d/pr-9177 +++ /dev/null @@ -1,31 +0,0 @@ -synopsis: Enable recompilation avoidance during Haddock generation -packages: cabal-install -prs: #9177 -issues: #9175 - -description: { - -* Haddock no longer writes compilation files by default, so we do not need to - pass tmp dirs for `-hidir`, `-stubdir`, and `-odir` via `--optghc`. Indeed, we - do not *want* to do so, since it results in recompilation for every invocation - of Haddock via Cabal. We now stop this from happening for Haddock versions - 2.28 and greater, since that is when Hi Haddock was introduced. - -* We no longer define the `__HADDOCK_VERSION__` macro when invoking GHC through - Haddock, since doing so essentially guarantees recompilation during - documentation generation. We audited all uses of `__HADDOCK_VERSION__` in - hackage, ensuring there was a reasonable path forward to migrate away from - using `__HADDOCK_VERSION__` for each, while generating the same documentation - as it did before. - If you are a user of `__HADDOCK_VERSION__`, please take a look at the - discussion in https://github.com/haskell/cabal/pull/9177 and reach out to us - if your use case is not covered. - -* Rename the `--haddock-lib` flag to `--haddock-resources-dir` (and - `haddock-lib:` cabal.project field to `haddock-resources-dir:`), and add this - flag to the users guide since it was missing an entry. - -* `documentation: true` or `--enable-documentation` now implies `-haddock` for - GHC. - -} diff --git a/changelog.d/pr-9551 b/changelog.d/pr-9551 deleted file mode 100644 index 5116234a653..00000000000 --- a/changelog.d/pr-9551 +++ /dev/null @@ -1,19 +0,0 @@ -synopsis: Introduce SetupHooks -packages: Cabal -prs: #9551 -description: { - Introduction of a new build type: Hooks. - This build type, intended as replacement to the Custom build type, integrates - better with the rest of the ecosystem (`cabal-install`, Haskell Language Server). - - The motivation and full design of this new build-type are specified in the - Haskell Foundation Tech Proposal - [Replacing the Cabal Custom build-type](https://github.com/haskellfoundation/tech-proposals/pull/60). - - Package authors willing to use this feature should declare `build-type: Hooks` - in their `.cabal` file, declare a custom-setup stanza with a dependency on the - `Cabal-hooks` package, and define a module `SetupHooks` that exports a value - `setupHooks :: SetupHooks`, using the API exported by `Distribution.Simple.SetupHooks` - from the `Cabal-hooks` package. Refer to the Haddock documentation of - `Distribution.Simple.SetupHooks` for example usage. -} diff --git a/changelog.d/pr-9740 b/changelog.d/pr-9740 deleted file mode 100644 index c5a3b9a173e..00000000000 --- a/changelog.d/pr-9740 +++ /dev/null @@ -1,9 +0,0 @@ -synopsis: Add language extension NamedDefaults -packages: Cabal-syntax -prs: #9740 - -description: { - -- adds support for the `NamedDefaults` language extension (GHC proposal #409) - -} diff --git a/changelog.d/pr-9766 b/changelog.d/pr-9766 deleted file mode 100644 index 3d10abb659f..00000000000 --- a/changelog.d/pr-9766 +++ /dev/null @@ -1,11 +0,0 @@ -synopsis: Warn on missing `default-language` -packages: Cabalcabal-install -prs: #9766 -issues: #9620 - -description: { - -- To help the adoption of GHC language editions, `cabal check` will now - warn about missing `default-language`. - -} diff --git a/changelog.d/pr-9824 b/changelog.d/pr-9824 deleted file mode 100644 index 168b9c98e64..00000000000 --- a/changelog.d/pr-9824 +++ /dev/null @@ -1,10 +0,0 @@ -synopsis: Abbrevate solver rejection messages with installed versions -packages: cabal-install-solver -prs: #9824 -issues: #9823 - -description: { - -Abbreviate solver rejection messages even in the presence of installed versions. - -} diff --git a/changelog.d/pr-9950 b/changelog.d/pr-9950 deleted file mode 100644 index a961c953639..00000000000 --- a/changelog.d/pr-9950 +++ /dev/null @@ -1,21 +0,0 @@ -synopsis: Re-instate `initialBuildSteps` -packages: Cabal -issues: #9856 -prs: #9950 - -description: { - -The `initialBuildSteps` function from `Distribution.Simple.Build`, which had -been hastily removed, has been reinstated. - -It now comes with a deprecation warning: calling that function does not suffice -to prepare the sources for a package, as there are other steps that one might -also need to perform: - - - running pre-processors (such as alex/happy) - - running pre-build hooks or custom logic - (in build-type: Hooks or build-type: Custom or Configure) - -Consumers wanting to prepare the sources of a package, e.g. in order to launch a -REPL session, are advised to run `setup repl --repl-multi-file=` instead. -} diff --git a/changelog.d/t10416 b/changelog.d/t10416 new file mode 100644 index 00000000000..071b9b1ad95 --- /dev/null +++ b/changelog.d/t10416 @@ -0,0 +1,11 @@ +synopsis: Fix ./setup install command +packages: Cabal +prs: #10417 +issues: #10416 +significance: significant + +description: { + +- `./setup install` was failing with a `fromFlag NoFlag` error. It is now fixed. + +} diff --git a/doc/buildinfo-fields-reference.rst b/doc/buildinfo-fields-reference.rst index c1ccf418f81..a289292945a 100644 --- a/doc/buildinfo-fields-reference.rst +++ b/doc/buildinfo-fields-reference.rst @@ -387,6 +387,14 @@ ghc-prof-options .. math:: {\left\{ \mathop{\mathit{hs\text{-}string}}\mid{{[\mathop{\mathord{``}\mathtt{\ }\mathord{"}}]^c}}^+_{} \right\}}^\ast_{\bullet} +ghc-prof-shared-options + * Monoidal field + * Available since ``cabal-version: 3.14``. + * Documentation of :pkg-field:`library:ghc-prof-shared-options` + + .. math:: + {\left\{ \mathop{\mathit{hs\text{-}string}}\mid{{[\mathop{\mathord{``}\mathtt{\ }\mathord{"}}]^c}}^+_{} \right\}}^\ast_{\bullet} + ghc-shared-options * Monoidal field * Documentation of :pkg-field:`library:ghc-shared-options` @@ -408,6 +416,14 @@ ghcjs-prof-options .. math:: {\left\{ \mathop{\mathit{hs\text{-}string}}\mid{{[\mathop{\mathord{``}\mathtt{\ }\mathord{"}}]^c}}^+_{} \right\}}^\ast_{\bullet} +ghcjs-prof-shared-options + * Monoidal field + * Available since ``cabal-version: 3.14``. + * Documentation of :pkg-field:`library:ghcjs-prof-shared-options` + + .. math:: + {\left\{ \mathop{\mathit{hs\text{-}string}}\mid{{[\mathop{\mathord{``}\mathtt{\ }\mathord{"}}]^c}}^+_{} \right\}}^\ast_{\bullet} + ghcjs-shared-options * Monoidal field * Documentation of :pkg-field:`library:ghcjs-shared-options` @@ -579,6 +595,14 @@ extra-doc-files .. math:: \mathrm{commalist}\left\{ \mathop{\mathit{hs\text{-}string}}\mid{{[\mathop{\mathord{``}\mathtt{\ }\mathord{"}}\mathop{\mathord{``}\mathtt{\text{,}}\mathord{"}}]^c}}^+_{} \right\} +extra-files + * Monoidal field + * Available since ``cabal-version: 3.14``. + * Documentation of :pkg-field:`extra-files` + + .. math:: + \mathrm{commalist}\left\{ \mathop{\mathit{hs\text{-}string}}\mid{{[\mathop{\mathord{``}\mathtt{\ }\mathord{"}}\mathop{\mathord{``}\mathtt{\text{,}}\mathord{"}}]^c}}^+_{} \right\} + extra-source-files * Monoidal field * Documentation of :pkg-field:`extra-source-files` diff --git a/doc/cabal-commands.rst b/doc/cabal-commands.rst index 5da0ec7a939..c1987afbfd8 100644 --- a/doc/cabal-commands.rst +++ b/doc/cabal-commands.rst @@ -343,6 +343,7 @@ While this interface is intended to be used for scripting, it is an experimental Scripting example: :: + $ ls $(cabal path --installdir) ... @@ -1326,6 +1327,9 @@ A list of all warnings with their constructor: - ``unrecognised-repo-type``: unrecognised kind of source-repository. - ``repo-no-type``: missing ``type`` in ``source-repository``. - ``repo-no-location``: missing ``location`` in ``source-repository``. +- ``git-protocol``: using insecure ``git://`` protocol + (`explanation `__ + in Git Book). - ``repo-no-module``: missing ``module`` in ``source-repository``. - ``repo-no-tag``: missing ``tag`` in ``source-repository``. - ``repo-relative-dir``: ``subdir`` in ``source-repository`` must be relative. diff --git a/doc/cabal-package-description-file.rst b/doc/cabal-package-description-file.rst index 450ddc0c0d3..6ae467b4774 100644 --- a/doc/cabal-package-description-file.rst +++ b/doc/cabal-package-description-file.rst @@ -646,42 +646,24 @@ describe the package as a whole: :: - tested-with: GHC == 9.0.1, GHC == 8.10.4, GHC == 8.8.4, - GHC == 8.6.5, GHC == 8.4.4, GHC == 8.2.2, GHC == 8.0.2, - GHC == 7.10.3, GHC == 7.8.4, GHC == 7.6.3, GHC == 7.4.2 + tested-with: GHC == 9.10.1, GHC == 9.8.2, GHC == 9.6.5 The same can be spread over several lines, for instance: :: - tested-with: GHC == 9.0.1 - , GHC == 8.10.4 - , GHC == 8.8.4 - , GHC == 8.6.5 - , GHC == 8.4.4 - , GHC == 8.2.2 - , GHC == 8.0.2 - , GHC == 7.10.3 - , GHC == 7.8.4 - , GHC == 7.6.3 - , GHC == 7.4.2 + tested-with: GHC == 9.10.1 + , GHC == 9.8.2 + , GHC == 9.6.5 The separating comma can also be dropped altogether: :: tested-with: - GHC == 9.0.1 - GHC == 8.10.4 - GHC == 8.8.4 - GHC == 8.6.5 - GHC == 8.4.4 - GHC == 8.2.2 - GHC == 8.0.2 - GHC == 7.10.3 - GHC == 7.8.4 - GHC == 7.6.3 - GHC == 7.4.2 + GHC == 9.10.1 + GHC == 9.8.2 + GHC == 9.6.5 However, this alternative might `disappear `__ @@ -696,24 +678,16 @@ describe the package as a whole: :: tested-with: - , GHC == 9.0.1 - , GHC == 8.10.4 - , GHC == 8.8.4 - , GHC == 8.6.5 - , GHC == 8.4.4 - , GHC == 8.2.2 - , GHC == 8.0.2 - , GHC == 7.10.3 - , GHC == 7.8.4 - , GHC == 7.6.3 - , GHC == 7.4.2 + , GHC == 9.10.1 + , GHC == 9.8.2 + , GHC == 9.6.5 2. A concise set notation syntax is available: :: - tested-with: GHC == { 9.0.1, 8.10.4, 8.8.4, 8.6.5, 8.4.4, 8.2.2, 8.0.2, 7.10.3, 7.8.4, 7.6.3, 7.4.2 } + tested-with: GHC == { 9.10.1, 9.8.2, 9.6.5 } .. pkg-field:: data-files: filename list @@ -799,6 +773,11 @@ describe the package as a whole: additional hooks, such as the scheme described in the section on `system-dependent parameters`_. +.. pkg-field:: extra-files: filename list + + A list of additional files to be included in source distributions built with :ref:`setup-sdist`. + As with :pkg-field:`data-files` it can use a limited form of ``*`` wildcards in file names. + Library ^^^^^^^ @@ -993,10 +972,10 @@ is an example: library build-depends: - , base ^>= 4.11.1.0 - , bytestring ^>= 0.10.2.0 - , containers ^>= 0.4.2.1 || ^>= 0.5.0.0 - , transformers ^>= 0.5.0.0 + , base ^>= 4.19.0.0 + , bytestring ^>= 0.12.0.0 + , containers ^>= 0.6.8 || ^>= 0.7.0 + , transformers ^>= 0.6.1.0 hs-source-dirs: src @@ -1010,9 +989,9 @@ is an example: library attoparsec build-depends: - , base ^>= 4.11.1.0 - , bytestring ^>= 0.10.2.0 - , deepseq ^>= 1.4.0.0 + , base ^>= 4.19.0.0 + , bytestring ^>= 0.12.0.0 + , deepseq ^>= 1.5.0.0 hs-source-dirs: vendor/attoparsec-0.13.1.0 @@ -1310,146 +1289,7 @@ Example: end <- getCurrentTime putStrLn $ "fib 20 took " ++ show (diffUTCTime end start) - -Foreign libraries -^^^^^^^^^^^^^^^^^ - -Foreign libraries are system libraries intended to be linked against -programs written in C or other "foreign" languages. They -come in two primary flavours: dynamic libraries (``.so`` files on Linux, -``.dylib`` files on OSX, ``.dll`` files on Windows, etc.) are linked against -executables when the executable is run (or even lazily during -execution), while static libraries (``.a`` files on Linux/OSX, ``.lib`` -files on Windows) get linked against the executable at compile time. - -Foreign libraries only work with GHC 7.8 and later. - -A typical stanza for a foreign library looks like - -:: - - foreign-library myforeignlib - type: native-shared - lib-version-info: 6:3:2 - - if os(Windows) - options: standalone - mod-def-file: MyForeignLib.def - - other-modules: MyForeignLib.SomeModule - MyForeignLib.SomeOtherModule - build-depends: base >=4.7 && <4.9 - hs-source-dirs: src - c-sources: csrc/MyForeignLibWrapper.c - default-language: Haskell2010 - - -.. pkg-section:: foreign-library name - :since: 2.0 - :synopsis: Foreign library build information. - - Build information for `foreign libraries`_. - -.. pkg-field:: type: foreign library type - - Cabal recognizes ``native-static`` and ``native-shared`` here, although - we currently only support building `native-shared` libraries. - -.. pkg-field:: options: foreign library option list - - Options for building the foreign library, typically specific to the - specified type of foreign library. Currently we only support - ``standalone`` here. A standalone dynamic library is one that does not - have any dependencies on other (Haskell) shared libraries; without - the ``standalone`` option the generated library would have dependencies - on the Haskell runtime library (``libHSrts``), the base library - (``libHSbase``), etc. Currently, ``standalone`` *must* be used on Windows - and *must not* be used on any other platform. - -.. pkg-field:: mod-def-file: filename - - This option can only be used when creating dynamic Windows libraries - (that is, when using ``native-shared`` and the ``os`` is ``Windows``). If - used, it must be a path to a *module definition file*. The details of - module definition files are beyond the scope of this document; see the - `GHC `_ - manual for some details and some further pointers. - -.. pkg-field:: lib-version-info: current:revision:age - - This field is currently only used on Linux. - - This field specifies a Libtool-style version-info field that sets - an appropriate ABI version for the foreign library. Note that the - three numbers specified in this field do not directly specify the - actual ABI version: ``6:3:2`` results in library version ``4.2.3``. - - With this field set, the SONAME of the library is set, and symlinks - are installed. - - How you should bump this field on an ABI change depends on the - breakage you introduce: - - - Programs using the previous version may use the new version as - drop-in replacement, and programs using the new version can also - work with the previous one. In other words, no recompiling nor - relinking is needed. In this case, bump ``revision`` only, don't - touch current nor age. - - Programs using the previous version may use the new version as - drop-in replacement, but programs using the new version may use - APIs not present in the previous one. In other words, a program - linking against the new version may fail with "unresolved - symbols" if linking against the old version at runtime: set - revision to 0, bump current and age. - - Programs may need to be changed, recompiled, and relinked in - order to use the new version. Bump current, set revision and age - to 0. - - Also refer to the Libtool documentation on the version-info field. - -.. pkg-field:: lib-version-linux: version - - This field is only used on Linux. - - Specifies the library ABI version directly for foreign libraries - built on Linux: so specifying ``4.2.3`` causes a library - ``libfoo.so.4.2.3`` to be built with SONAME ``libfoo.so.4``, and - appropriate symlinks ``libfoo.so.4`` and ``libfoo.so`` to be - installed. - -Note that typically foreign libraries should export a way to initialize -and shutdown the Haskell runtime. In the example above, this is done by -the ``csrc/MyForeignLibWrapper.c`` file, which might look something like - -.. code-block:: c - - #include - #include "HsFFI.h" - - HsBool myForeignLibInit(void){ - int argc = 2; - char *argv[] = { "+RTS", "-A32m", NULL }; - char **pargv = argv; - - // Initialize Haskell runtime - hs_init(&argc, &pargv); - - // do any other initialization here and - // return false if there was a problem - return HS_BOOL_TRUE; - } - - void myForeignLibExit(void){ - hs_exit(); - } - -With modern ghc regular libraries are installed in directories that contain -package keys. This isn't usually a problem because the package gets registered -in ghc's package DB and so we can figure out what the location of the library -is. Foreign libraries however don't get registered, which means that we'd have -to have a way of finding out where a platform library got installed (other than by -searching the ``lib/`` directory). Instead, we install foreign libraries in -``~/.local/lib``. +.. _build-info: Build information ^^^^^^^^^^^^^^^^^ @@ -1892,8 +1732,11 @@ system-dependent values for these fields. .. pkg-field:: ghc-options: token list - Additional options for GHC. You can often achieve the same effect - using the :pkg-field:`default-extensions` field, which is preferred. + Additional options for GHC. + + If specifying extensions (via ``-X`` flags) one can often achieve + the same effect using the :pkg-field:`default-extensions` field, which is + preferred. Options required only by one module may be specified by placing an ``OPTIONS_GHC`` pragma in the source file affected. @@ -1930,6 +1773,18 @@ system-dependent values for these fields. ones specified via :pkg-field:`ghc-options`, and are passed to GHC during both the compile and link phases. +.. pkg-field:: ghc-prof-shared-options: token list + + Additional options for GHC when the package is built as shared profiling + library. The options specified via this field are combined with the + ones specified via :pkg-field:`ghc-options`, and are passed to GHC during + both the compile and link phases. + + Note that if any :pkg-field:`ghc-shared-options` are set, the + ``-dynamic-too` option will never be passed to GHC, leading to all modules + being compiled twice (once to generate the ``.o`` files and another to + generate the ``.dyn_o`` files). + .. pkg-field:: ghcjs-options: token list Like :pkg-field:`ghc-options` but applies to GHCJS @@ -1942,7 +1797,16 @@ system-dependent values for these fields. Like :pkg-field:`ghc-shared-options` but applies to GHCJS +.. pkg-field:: ghcjs-prof-shared-options: token list + + Like :pkg-field:`ghc-prof-shared-options` but applies to GHCJS + .. pkg-field:: includes: filename list + :since: 1.0 + :deprecated: 2.0 + + From GHC 6.10.1, :pkg-field:`includes` has no effect when compiling with + GHC. From Cabal 2.0, support for GHC versions before GHC 6.12 was removed. A list of header files to be included in any compilations via C. This field applies to both header files that are already installed @@ -1993,6 +1857,8 @@ system-dependent values for these fields. locate files listed in :pkg-field:`includes` and :pkg-field:`install-includes`. + Directories here will be passed as ``-I`` flags to GHC. + .. pkg-field:: c-sources: filename list A list of C source files to be compiled and linked with the Haskell @@ -2029,7 +1895,7 @@ system-dependent values for these fields. .. pkg-field:: extra-libraries: token list A list of extra libraries to link with (when not linking fully static - executables). + executables). Libraries will be passed as ``-optl-l`` flags to GHC. .. pkg-field:: extra-libraries-static: token list @@ -2063,7 +1929,7 @@ system-dependent values for these fields. .. pkg-field:: extra-lib-dirs: directory list A list of directories to search for libraries (when not linking fully static - executables). + executables). Directories will be passed as ``-optl-L`` flags to GHC. .. pkg-field:: extra-lib-dirs-static: directory list @@ -2080,7 +1946,8 @@ system-dependent values for these fields. .. pkg-field:: cc-options: token list - Command-line arguments to be passed to the C compiler. Since the + Command-line arguments to be passed to the Haskell compiler for the C + compiling phase (as ``-optc`` flags for GHC). Since the arguments are compiler-dependent, this field is more useful with the setup described in the section on `system-dependent parameters`_. @@ -2089,12 +1956,14 @@ system-dependent values for these fields. Command-line arguments for pre-processing Haskell code. Applies to Haskell source and other pre-processed Haskell source like .hsc .chs. Does not apply to C code, that's what cc-options is for. + Flags here will be passed as ``-optP`` flags to GHC. .. pkg-field:: cxx-options: token list :since: 2.2 - Command-line arguments to be passed to the compiler when compiling - C++ code. The C++ sources to which these command-line arguments + Command-line arguments to be passed to the Haskell compiler for the C++ + compiling phase (as ``-optcxx`` flags for GHC). + The C++ sources to which these command-line arguments should be applied can be specified with the :pkg-field:`cxx-sources` field. Command-line options for C and C++ can be passed separately to the compiler when compiling both C and C++ sources by segregating the C @@ -2106,20 +1975,22 @@ system-dependent values for these fields. .. pkg-field:: cmm-options: token list :since: 3.0 - Command-line arguments to be passed to the compiler when compiling + Command-line arguments to be passed to the Haskell compiler when compiling C-- code. See also :pkg-field:`cmm-sources`. .. pkg-field:: asm-options: token list :since: 3.0 - Command-line arguments to be passed to the assembler when compiling - assembler code. See also :pkg-field:`asm-sources`. + Command-line arguments to be passed to the Haskell compiler (as ``-opta`` + flags for GHC) when compiling assembler code. See also :pkg-field:`asm-sources`. .. pkg-field:: ld-options: token list - Command-line arguments to be passed to the linker. Since the - arguments are compiler-dependent, this field is more useful with the - setup described in the section on `system-dependent parameters`_. + Command-line arguments to be passed to the Haskell compiler (as ``-optl`` + flags for GHC) for the linking phase. Note that only executables (including + test-suites and benchmarks) are linked so this has no effect in libraries. + Since the arguments are compiler-dependent, this field is more useful with + the setup described in the section on `system-dependent parameters`_. .. pkg-field:: hsc2hs-options: token list :since: 3.6 @@ -2266,6 +2137,146 @@ system-dependent values for these fields. in a different package dependency, or at least in a separate internal library. +Foreign libraries +^^^^^^^^^^^^^^^^^ + +Foreign libraries are system libraries intended to be linked against +programs written in C or other "foreign" languages. They +come in two primary flavours: dynamic libraries (``.so`` files on Linux, +``.dylib`` files on OSX, ``.dll`` files on Windows, etc.) are linked against +executables when the executable is run (or even lazily during +execution), while static libraries (``.a`` files on Linux/OSX, ``.lib`` +files on Windows) get linked against the executable at compile time. + +Foreign libraries only work with GHC 7.8 and later. + +A typical stanza for a foreign library looks like + +:: + + foreign-library myforeignlib + type: native-shared + lib-version-info: 6:3:2 + + if os(Windows) + options: standalone + mod-def-file: MyForeignLib.def + + other-modules: MyForeignLib.SomeModule + MyForeignLib.SomeOtherModule + build-depends: base >=4.7 && <4.9 + hs-source-dirs: src + c-sources: csrc/MyForeignLibWrapper.c + default-language: Haskell2010 + + +.. pkg-section:: foreign-library name + :since: 2.0 + :synopsis: Foreign library build information. + + Build information for `foreign libraries`_. + +.. pkg-field:: type: foreign library type + + Cabal recognizes ``native-static`` and ``native-shared`` here, although + we currently only support building `native-shared` libraries. + +.. pkg-field:: options: foreign library option list + + Options for building the foreign library, typically specific to the + specified type of foreign library. Currently we only support + ``standalone`` here. A standalone dynamic library is one that does not + have any dependencies on other (Haskell) shared libraries; without + the ``standalone`` option the generated library would have dependencies + on the Haskell runtime library (``libHSrts``), the base library + (``libHSbase``), etc. Currently, ``standalone`` *must* be used on Windows + and *must not* be used on any other platform. + +.. pkg-field:: mod-def-file: filename + + This option can only be used when creating dynamic Windows libraries + (that is, when using ``native-shared`` and the ``os`` is ``Windows``). If + used, it must be a path to a *module definition file*. The details of + module definition files are beyond the scope of this document; see the + `GHC `_ + manual for some details and some further pointers. + +.. pkg-field:: lib-version-info: current:revision:age + + This field is currently only used on Linux. + + This field specifies a Libtool-style version-info field that sets + an appropriate ABI version for the foreign library. Note that the + three numbers specified in this field do not directly specify the + actual ABI version: ``6:3:2`` results in library version ``4.2.3``. + + With this field set, the SONAME of the library is set, and symlinks + are installed. + + How you should bump this field on an ABI change depends on the + breakage you introduce: + + - Programs using the previous version may use the new version as + drop-in replacement, and programs using the new version can also + work with the previous one. In other words, no recompiling nor + relinking is needed. In this case, bump ``revision`` only, don't + touch current nor age. + - Programs using the previous version may use the new version as + drop-in replacement, but programs using the new version may use + APIs not present in the previous one. In other words, a program + linking against the new version may fail with "unresolved + symbols" if linking against the old version at runtime: set + revision to 0, bump current and age. + - Programs may need to be changed, recompiled, and relinked in + order to use the new version. Bump current, set revision and age + to 0. + + Also refer to the Libtool documentation on the version-info field. + +.. pkg-field:: lib-version-linux: version + + This field is only used on Linux. + + Specifies the library ABI version directly for foreign libraries + built on Linux: so specifying ``4.2.3`` causes a library + ``libfoo.so.4.2.3`` to be built with SONAME ``libfoo.so.4``, and + appropriate symlinks ``libfoo.so.4`` and ``libfoo.so`` to be + installed. + +Note that typically foreign libraries should export a way to initialize +and shutdown the Haskell runtime. In the example above, this is done by +the ``csrc/MyForeignLibWrapper.c`` file, which might look something like + +.. code-block:: c + + #include + #include "HsFFI.h" + + HsBool myForeignLibInit(void){ + int argc = 2; + char *argv[] = { "+RTS", "-A32m", NULL }; + char **pargv = argv; + + // Initialize Haskell runtime + hs_init(&argc, &pargv); + + // do any other initialization here and + // return false if there was a problem + return HS_BOOL_TRUE; + } + + void myForeignLibExit(void){ + hs_exit(); + } + +With modern ghc regular libraries are installed in directories that contain +package keys. This isn't usually a problem because the package gets registered +in ghc's package DB and so we can figure out what the location of the library +is. Foreign libraries however don't get registered, which means that we'd have +to have a way of finding out where a platform library got installed (other than by +searching the ``lib/`` directory). Instead, we install foreign libraries in +``~/.local/lib``. + Configurations ^^^^^^^^^^^^^^ @@ -2637,11 +2648,11 @@ Starting with Cabal-2.2 it's possible to use common build info stanzas. :: common deps - build-depends: base ^>= 4.11 + build-depends: base ^>= 4.18 ghc-options: -Wall common test-deps - build-depends: tasty ^>= 0.12.0.1 + build-depends: tasty ^>= 1.4 library import: deps @@ -2852,8 +2863,8 @@ Declaring a ``custom-setup`` stanza also enables the generation of custom-setup setup-depends: - base >= 4.5 && < 4.11, - Cabal >= 1.14 && < 1.25 + base >= 4.18 && < 5, + Cabal >= 3.10 .. pkg-field:: setup-depends: package list :since: 1.24 @@ -3004,6 +3015,9 @@ Right now :pkg-field:`executable:main-is` modules are not supported on Accessing data files from package code -------------------------------------- +.. index:: Paths +.. index:: Paths_ + The placement on the target system of files listed in the :pkg-field:`data-files` field varies between systems, and in some cases one can even move packages around after installation @@ -3059,6 +3073,9 @@ the configured data directory for ``pretty-show`` is controlled with the Accessing the package version ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.. index:: PackageInfo +.. index:: PackageInfo_ + The auto generated :file:`PackageInfo_{pkgname}` module exports the constant ``version ::`` `Version `__ which is defined as the version of your package as specified in the diff --git a/doc/cabal-project-description-file.rst b/doc/cabal-project-description-file.rst index c1f29bfc052..f024e540010 100644 --- a/doc/cabal-project-description-file.rst +++ b/doc/cabal-project-description-file.rst @@ -86,19 +86,25 @@ would not be necessitated. Specifying the local packages ----------------------------- +You *must* provide a non-empty list of local packages in your project, filling +out either a ``packages`` field or an ``optional-packages`` field or both to +satisfy this requirement. + +When ``cabal.project`` doesn't exist, ``cabal-install`` fabricates an ephemeral +project for its own use with this simple content, a glob that will find any (but +expects to find one) package in the current directory: + +.. code-block:: cabal + + packages: ./*.cabal + The following top-level options specify what the local packages of a project are: .. cfg-field:: packages: package location list (space or comma separated) :synopsis: Project packages. - :default: ``./*.cabal`` - - .. warning:: - - The default value ``./*.cabal`` only takes effect if there is no explicit - ``cabal.project`` file. - If you use such explicit file you *must* fill the field. + :default: empty Specifies the list of package locations which contain the local packages to be built by this project. Package locations can take the @@ -779,20 +785,17 @@ ways a package option can be specified: apply to all packages, local ones from the project and also external dependencies. - For example, the following options specify that :cfg-field:`optimization` -should be turned off for all local packages, and that ``bytestring`` (possibly -an external dependency) should be built with ``-fno-state-hack``:: +should be turned off for all local packages, and that ``awesome-package`` (possibly +an external dependency) should have the flag ``some-flag`` disabled :: optimization: False - package bytestring - ghc-options: -fno-state-hack + package awesome-package + flags: -some-flag -``ghc-options`` is not specifically described in this documentation, but is one -of many fields for configuring programs. They take the form -``progname-options`` and ``progname-location``, and can be set for all local -packages in a ``program-options`` stanza or under a package stanza. +Note that options at the top level take precedence over those at the ``package`` +stanza for local packages. On the command line, these options are applied to all local packages. There is no per-package command line interface. @@ -802,6 +805,26 @@ means that they are NOT supported by packages which use Custom setup scripts that require a version of the Cabal library older than when the feature was added. +.. cfg-section:: package name or * + + Specify package configuration options for the specific package (be it an + external or local package) or for all packages (external and local). + + A ``package`` stanza can contain the configuration fields listed in this + section and ``-options``: + + :: + + package awesome-package + flags: -some-flag + profiling: True + cxx-options: -Wall + + Program options are not extensively described in this documentation but a + good amount of them can be found in the :ref:`build-info` section. + +.. cfg-section:: None + .. cfg-field:: flags: list of +flagname or -flagname (space separated) -f FLAGS or -fFLAGS, --flags=FLAGS --flags="+foo -bar", -ffoo, -f-bar @@ -1610,6 +1633,12 @@ running ``setup haddock``. This flag is provided as a technology preview and is subject to change in the next releases. +.. cfg-field:: haddock-use-unicode: boolean + --haddock-use-unicode + :synopsis: Pass --use-unicode option to haddock. + + Generate HTML documentation which contains unicode characters. + .. cfg-field:: haddock-resources-dir: DIR --haddock-resources-dir=DIR :synopsis: Location of Haddock's static/auxiliary files. @@ -1627,11 +1656,36 @@ running ``setup haddock``. when complete. This will use ``xdg-open`` on Linux and BSD systems, ``open`` on macOS, and ``start`` on Windows. +Program options +^^^^^^^^^^^^^^^ + +.. cfg-section:: program-options + +:ref:`Program options` can be specified once for all local packages by means of the +``program-options`` stanza. For example: + +:: + + program-options + ghc-options: -Werror + +indicates that all **local packages** will provide ``-Werror`` to GHC when being +built. On the other hand, the following snippet: + +:: + + package * + ghc-options: -Werror + +will apply ``-Werror`` to all packages, local and remote. + Advanced global configuration options ------------------------------------- +.. cfg-section:: None + .. cfg-field:: write-ghc-environment-files: always, never, or ghc8.4.4+ - --write-ghc-environment-files=always\|never\|ghc8.4.4+ + --write-ghc-environment-files=always|never|ghc8.4.4+ :synopsis: Whether a ``.ghc.environment`` should be created after a successful build. :default: ``never`` @@ -1640,7 +1694,7 @@ Advanced global configuration options should be created after a successful build. Since Cabal 3.0, defaults to ``never``. Before that, defaulted to - creating them only when compiling with GHC 8.4.4 and older (GHC + creating them only when compiling with GHC 8.4.4 and later (GHC 8.4.4 `is the first version `_ that supports the ``-package-env -`` option that allows ignoring the package diff --git a/doc/cabaldomain.py b/doc/cabaldomain.py index 2d318f8508f..9e16aefa6d6 100644 --- a/doc/cabaldomain.py +++ b/doc/cabaldomain.py @@ -548,7 +548,7 @@ class CabalPackageFieldXRef(CabalFieldXRef): ''' section_key = 'cabal:pkg-section' -class CabalConfigSection(CabalSection): +class CabalConfigSection(CabalObject): """ Marks section in package.cabal file """ @@ -556,6 +556,39 @@ class CabalConfigSection(CabalSection): section_key = 'cabal:cfg-section' target_prefix = 'cfg-section-' + def handle_signature(self, sig, signode): + ''' + As in sphinx.directives.ObjectDescription + + By default make an object description from name and adding + either deprecated or since as annotation. + ''' + env = self.state.document.settings.env + + sig = sig.strip() + parts = sig.split(' ',1) + name = parts[0] + signode += addnodes.desc_name(name, name) + signode += addnodes.desc_addname(' ', ' ') + if len(parts) > 1: + rest = parts[1].strip() + signode += addnodes.desc_annotation(rest, rest) + + return name + + def get_env_key(self, env, name): + store = CabalDomain.types[self.objtype] + return name, store + + def run(self): + env = self.state.document.settings.env + section = self.arguments[0].strip().split(' ',1)[0] + if section == 'None': + env.ref_context.pop('cabal:cfg-section', None) + return [] + env.ref_context['cabal:cfg-section'] = section + return super(CabalConfigSection, self).run() + class ConfigField(CabalField): section_key = 'cabal:cfg-section' indextemplate = '%s ; cabal project option' @@ -791,6 +824,9 @@ def make_full_name(typ, key, meta): if typ == 'pkg-section': return 'pkg-section-' + key + elif typ == 'cfg-section': + return 'cfg-section-' + key + elif typ == 'pkg-field': section, name = key if section is not None: @@ -914,4 +950,3 @@ class CabalLexer(lexer.RegexLexer): def setup(app): app.add_domain(CabalDomain) app.add_lexer('cabal', CabalLexer) - diff --git a/doc/config.rst b/doc/config.rst index 5c85498b181..36a53f958b0 100644 --- a/doc/config.rst +++ b/doc/config.rst @@ -297,3 +297,102 @@ recommended instead to use a *secure* local repository: The layout of these secure local repos matches the layout of remote repositories exactly; the :hackage-pkg:`hackage-repo-tool` can be used to create and manage such repositories. + +.. _program_options: + +Program options +--------------- + +Programs that ``cabal`` knows about can be provided with options that will be +passed in whenever the program is invoked by ``cabal``. The configuration file +can contain a stanza of ``program-default-options`` with ``-options`` +fields to specify these. + +:: + + program-default-options + ghc-options: ... + happy-options: ... + +The list of known programs is: + ++-----------------------+------------------------------------------------------------------------------------------------------------------------------------+ +| Program | Notes | ++=======================+====================================================================================================================================+ +| ``alex`` | ``_ | ++-----------------------+------------------------------------------------------------------------------------------------------------------------------------+ +| ``ar`` | Usually provided by GHC's ``"ar command"`` entry in ``ghc --info``. Note this might refer to ``llvm-ar`` instead of GNU's ``ar``. | ++-----------------------+------------------------------------------------------------------------------------------------------------------------------------+ +| ``c2hs`` | ``_ | ++-----------------------+------------------------------------------------------------------------------------------------------------------------------------+ +| ``doctest`` | ``_ | ++-----------------------+------------------------------------------------------------------------------------------------------------------------------------+ +| ``gcc`` | Usually provided by GHC's ``"C compiler command"`` entry in ``ghc --info``. Note this might refer to ``clang`` instead of ``gcc``. | ++-----------------------+------------------------------------------------------------------------------------------------------------------------------------+ +| ``ghc`` | | ++-----------------------+------------------------------------------------------------------------------------------------------------------------------------+ +| ``ghc-pkg`` | | ++-----------------------+------------------------------------------------------------------------------------------------------------------------------------+ +| ``ghcjs`` | | ++-----------------------+------------------------------------------------------------------------------------------------------------------------------------+ +| ``ghcjs-pkg`` | | ++-----------------------+------------------------------------------------------------------------------------------------------------------------------------+ +| ``greencard`` | Greencard hasn't been updated since 2014, it doesn't build with newer GHCs ``_ | ++-----------------------+------------------------------------------------------------------------------------------------------------------------------------+ +| ``haddock`` | ``_ | ++-----------------------+------------------------------------------------------------------------------------------------------------------------------------+ +| ``happy`` | ``_ | ++-----------------------+------------------------------------------------------------------------------------------------------------------------------------+ +| ``haskell-suite`` | Haskell suite was abandoned a long time ago. | ++-----------------------+------------------------------------------------------------------------------------------------------------------------------------+ +| ``haskell-suite-pkg`` | Haskell suite was abandoned a long time ago. | ++-----------------------+------------------------------------------------------------------------------------------------------------------------------------+ +| ``hmake`` | Seems like hmake disappeared a long time ago ``_ | ++-----------------------+------------------------------------------------------------------------------------------------------------------------------------+ +| ``hpc`` | ``_ | ++-----------------------+------------------------------------------------------------------------------------------------------------------------------------+ +| ``hsc2hs`` | ``_ | ++-----------------------+------------------------------------------------------------------------------------------------------------------------------------+ +| ``hscolour`` | ``_ | ++-----------------------+------------------------------------------------------------------------------------------------------------------------------------+ +| ``jhc`` | ``_ | ++-----------------------+------------------------------------------------------------------------------------------------------------------------------------+ +| ``ld`` | Usually provided by GHC's ``"ld command"`` entry in ``ghc --info``. | ++-----------------------+------------------------------------------------------------------------------------------------------------------------------------+ +| ``pkg-config`` | | ++-----------------------+------------------------------------------------------------------------------------------------------------------------------------+ +| ``runghc`` | | ++-----------------------+------------------------------------------------------------------------------------------------------------------------------------+ +| ``strip`` | | ++-----------------------+------------------------------------------------------------------------------------------------------------------------------------+ +| ``tar`` | | ++-----------------------+------------------------------------------------------------------------------------------------------------------------------------+ +| ``uhc`` | ``_ | ++-----------------------+------------------------------------------------------------------------------------------------------------------------------------+ + +.. warning:: + + It is important to not confuse these options with the ones listed in the + :ref:`build info` section. The ``*-options`` fields mentioned are in + fact syntactic sugar for specific ``ghc-options`` that will be passed only on + certain phases. + +.. warning:: + + These options will be used when ``cabal`` invokes the tool as part of the build process or as part of a + :pkg-field:`build-tool-depends` declaration, not whenever the tool is invoked by + third parties. + + In particular this means that for example ``gcc-options`` will be used when ``cabal`` + invokes ``gcc``, which is **not** when C sources are compiled by GHC (even though GHC + might invoke ``gcc`` internally). In order to provide options through GHC for those programs, one has to check the + GHC User guide's `Section `_. + In short, those options have to be given as ``-opt`` flags to GHC. + +.. note:: + + The only case that violates the rule specified in this last warning above is + ``ld-options``, which get passed as ``-optl`` options when GHC is invoked for + linking, as with the :pkg-field:`ld-options` field in package descriptions. + Notably, although ``gcc-options`` could be passed as :pkg-field:`cc-options` + in the appropriate phases, they are actually **not** passed. diff --git a/doc/external-commands.rst b/doc/external-commands.rst index e72495aa160..eca76483cc1 100644 --- a/doc/external-commands.rst +++ b/doc/external-commands.rst @@ -4,7 +4,8 @@ External Commands ``cabal-install`` provides a system for external commands, akin to the ones used by tools like ``git`` or ``cargo``. If you execute ``cabal ``, ``cabal-install`` will search the path for an executable named ``cabal-`` and execute it. The name of the command is passed as the first argument and -the remaining arguments are passed afterwards. An error will be thrown in case the custom command is not found. +the remaining arguments are passed afterwards. An error will be thrown in case the custom command is not found. The exit code of cabal when calling an external command is the same as the exit code +of the command. The ``$CABAL`` environment variable is set to the path of the ``cabal-install`` executable which invoked the subcommand. diff --git a/doc/file-format-changelog.rst b/doc/file-format-changelog.rst index 854f949b301..174cb3c3189 100644 --- a/doc/file-format-changelog.rst +++ b/doc/file-format-changelog.rst @@ -19,6 +19,15 @@ relative to the respective preceding *published* version. versions of the ``Cabal`` library denote unreleased development branches which have no stability guarantee. +``cabal-version: 3.14`` +----------------------- + +* Added field ``extra-files`` for specifying extra files to be included in + ``sdist`` without adding any other semantics (cf. ``extra-source-files`` + is tracked by ``cabal build``). +* License fields use identifiers from SPDX License List version + ``3.25 2024-08-19``. + ``cabal-version: 3.12`` ----------------------- diff --git a/doc/getting-started.rst b/doc/getting-started.rst index 056c4a85ebd..f75e0488132 100644 --- a/doc/getting-started.rst +++ b/doc/getting-started.rst @@ -58,6 +58,18 @@ The ``myapp.cabal`` file is a package description file, commonly referred to as hs-source-dirs: app default-language: Haskell2010 +.. warning:: + + The version bounds on base, a boot library distributed with GHC + [#boot-packages]_, are tied to the GHC version visible when ``cabal init`` + is run. If run with a later version of GHC you might see a difference in the + version bounds. + + .. code-block:: diff + + - build-depends: base ^>=4.19.0.0 + + build-depends: base ^>=4.20.0.0 + It contains metadata (package name and version, author name, license, etc.) and sections to define package components. Components can be used to split large codebases into smaller, more managable building blocks. @@ -189,7 +201,7 @@ the following file named ``myscript``: #!/usr/bin/env cabal {- cabal: build-depends: - base ^>=4.19.0.0, + base, haskell-say ^>=1.0.0.0 -} @@ -198,9 +210,24 @@ the following file named ``myscript``: main :: IO () main = haskellSay "Hello, Haskell!" +.. note:: + + Widening or dropping version bound constraints on *packages included with + the compiler* [#boot-packages]_, like ``base``, may allow single-file + scripts to run with a wider range of compiler versions. + + .. code-block:: diff + + build-depends: + - base ^>=4.19.0.0, + + base, + The necessary sections of a ``.cabal`` file are placed directly into the script as a comment. +The necessary sections of a package description that would otherwise be in a +``.cabal`` file are placed directly into the script as a comment. + Use the familiar ``cabal run`` command to execute this script: .. code-block:: console @@ -222,6 +249,12 @@ can be run directly after setting the execute permission (+x): See more in the documentation for :ref:`cabal run`. +.. warning:: + + Single-file scripts cannot also be part of a package, as an executable or + listed as a module. Trying to run a module that is included in a package + will error with `Cabal-7070`_. + What Next? ---------- @@ -229,3 +262,11 @@ 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 `__ or read more about packages and Cabal on the :doc:`What Cabal does ` page. + +.. _Cabal-7070: https://errors.haskell.org/messages/Cabal-7070/ + +.. [#boot-packages] Packages included with the compiler are also called boot + packages. Each GHC compiler version has accompanying `release notes`_ that + list these included packages. + +.. _release notes: https://downloads.haskell.org/ghc/latest/docs/users_guide/release-notes.html diff --git a/doc/how-to-run-in-windows.rst b/doc/how-to-run-in-windows.rst index 5c06f62bbb3..53aeb33b849 100644 --- a/doc/how-to-run-in-windows.rst +++ b/doc/how-to-run-in-windows.rst @@ -8,7 +8,7 @@ more explanations. For a TL;DR, jump to the :ref:`Complete configuration`. Install the Haskell environment ------------------------------- -Haskell development on Windows makes use of the `MSYS2 `_ +Haskell development on Windows makes use of the `MSYS2 `_ tools. The recommended way of setting up a Haskell environment in Windows is by using @@ -19,11 +19,43 @@ system in your computer unless told not to do so: refer to `its documentation .. NOTE:: Stack is another tool you can use to set up a Haskell environment on Windows. Stack - can be installed on its own or via GHCup. See - `Stack's webpage `_ and/or + can be installed on its own or via GHCup. See + `Stack's webpage `_ and/or `GHCup's section on Stack integration `_, in particular the `Windows related subsection `_. +MSYS2 environments and packages +------------------------------- + +A particular environment has to be chosen when using MSYS2. By default GHCup will +use ``MINGW64``. You can learn more about the different environments in the `MSYS2 +documentation `_. + +GHCs before 9.4.1 are shipped with a minimal set of packages based on the +``MINGW64`` environment, and GHC 9.4.1 and newer are shipped with a minimal set +of packages based on the ``CLANG64`` environment. It is in general advisable to +work inside the same environment as your GHC uses, but (with some exceptions) +it shouldn't matter whether environments are mixed. Stay warned that it can +sometimes lead to undecipherable errors. + +We will refer to the chosen environment as ```` through this +documentation. + +Third-party libraries and tools can be installed using the ``pacman`` package +manager on the MSYS2 installation +(`see `_). If MSYS2 was +installed via GHCup, check GHCup's documentation on how to call ``pacman``. Note +that installing a package ``mingw-w64--x86_64-`` will install +it in the ``\`` tree of directories, and might not be +visible if working on a different environment than ````. In +general, it is advisable to install only packages for the environment that was +chosen above. + +Apart from these environments, there is the ``msys`` environment which is based +on Cygwin. Some tools only exist for this environment. Tools from this environment +are callable when working in any other environment. It is in general not possible +to link to libraries installed in the ``msys`` environment. + Ensure that Cabal can call the tools it needs --------------------------------------------- @@ -39,11 +71,10 @@ Windows. The directories where those are located need to be made visible in the extra-prog-path: \\bin \usr\bin -Where ```` points to the location of your MSYS2 installation. Refer to -GHCup's documentation on the default location of this directory. -```` has to be one of the environments of MSYS2, which for GHCup is -``mingw64``. You can learn more about the different environments in the `MSYS2 -documentation `_. +Where ```` points to the location of your MSYS2 installation. If MSYS2 +was installed via GHCup, refer to GHCup's documentation on the default location +of this directory. If MSYS2 was installed system-wide this is usually +``C:\msys64``. .. note:: @@ -53,8 +84,7 @@ documentation `_. Ensure that Cabal can use system libraries ------------------------------------------ -Third-party libraries can be installed using the ``pacman`` package manager on -the MSYS2 installation. When installing a third party package its libraries and +When installing a third party package its libraries and header files will (usually) be placed in ``\\{lib,include}`` respectively. These directories need to be specified in the ``extra-lib-dirs`` and ``extra-include-dirs`` @@ -74,11 +104,18 @@ include these options: .. warning:: - Packages in the ``msys/`` repo are not native Windows libraries and will - probably not work when one tries to link to them. Install the packages for - your selected environment, which for GHCup is ``mingw64/``. Refer to `MSYS2's - package management documentation - `_ for more information. + GHCs older than 9.4.1 will crash if a recent + ``mingw-w64--x86_64-crt-git`` is installed for whichever ```` and + these directories are set globally . + + Effectively this means that if you have installed ``mingw-w64--x86_64-crt-git`` + (which you probably have if you are using ``clang`` in the ``CLANG64`` + environment or ``gcc`` in the ``UCRT64`` or ``MINGW64`` environments outside of + Haskell, as this package is part of the ``mingw-w64--x86_64-toolchain`` + meta-packages) and are using a GHC older than 9.4.1, you cannot simply depend on system + libraries by adding these paths to the global config, and instead you will + have to go through some other method to depend on those libraries like + :pkg-field:`pkgconfig-depends`. Ensure that Cabal can call Haskell tools ---------------------------------------- diff --git a/doc/requirements.in b/doc/requirements.in index 1c3ee5b9fd9..f0514fb5581 100644 --- a/doc/requirements.in +++ b/doc/requirements.in @@ -12,3 +12,5 @@ urllib3 >= 2.0.7 jinja2 >= 3.1.4 # CVE-2024-3651 idna >= 3.7 +# CVE-2024-35195 +requests >= 2.32.0 diff --git a/doc/setup-commands.rst b/doc/setup-commands.rst index 20bdafabfae..4babff6f40c 100644 --- a/doc/setup-commands.rst +++ b/doc/setup-commands.rst @@ -795,10 +795,21 @@ Miscellaneous options Build shared library. This implies a separate compiler run to generate position independent code as required on most platforms. + ``--enable-shared`` is enabled automatically if GHC is dynamically linked or + you request to build dynamic executables. + .. option:: --disable-shared (default) Do not build shared library. +.. option:: --enable-profiling-shared + + Build a profiling shared library. + +.. option:: --disable-profiling-shared + + (default) Do not built a profiling shared library. + .. option:: --enable-static Build a static library. This passes ``-staticlib`` to GHC (available @@ -1374,7 +1385,8 @@ The files placed in this distribution are the package description file, the setup script, the sources of the modules named in the package description file, and files named in the ``license-file``, ``main-is``, ``c-sources``, ``asm-sources``, ``cmm-sources``, ``js-sources``, -``data-files``, ``extra-source-files`` and ``extra-doc-files`` fields. +``data-files``, ``extra-source-files``, ``extra-doc-files``, and +``extra-files`` fields. This command takes the following option: diff --git a/doc/version-control-fields.rst b/doc/version-control-fields.rst index 71dd59c4953..739905d4b8a 100644 --- a/doc/version-control-fields.rst +++ b/doc/version-control-fields.rst @@ -64,7 +64,7 @@ The location of the repository, usually a URL but the exact form of this field depends on the repository type. For example: - for Darcs: ``http://code.haskell.org/foo/`` -- for Git: ``git://github.com/foo/bar.git`` +- for Git: ``https://github.com/foo/bar.git`` - for CVS: ``anoncvs@cvs.foo.org:/cvs`` VCS branch diff --git a/editors/vim/syntax/cabal.vim b/editors/vim/syntax/cabal.vim index 119a5ccb767..2e578307a7e 100644 --- a/editors/vim/syntax/cabal.vim +++ b/editors/vim/syntax/cabal.vim @@ -80,6 +80,7 @@ syn keyword cabalFieldName contained \ extra-bundled-libraries \ extra-doc-files \ extra-dynamic-library-flavours + \ extra-files \ extra-framework-dirs \ extra-ghci-libraries \ extra-lib-dirs @@ -218,6 +219,7 @@ syn keyword cabalExtension contained \ MonoLocalBinds \ MonoPatBinds \ MonomorphismRestriction + \ MultilineStrings \ MultiParamTypeClasses \ MultiWayIf \ NPlusKPatterns @@ -230,6 +232,7 @@ syn keyword cabalExtension contained \ NullaryTypeClasses \ NumDecimals \ NumericUnderscores + \ OrPatterns \ OverlappingInstances \ OverloadedLabels \ OverloadedLists @@ -360,6 +363,7 @@ syn keyword cabalExtension contained \ NoMonoLocalBinds \ NoMonoPatBinds \ NoMonomorphismRestriction + \ NoMultilineStrings \ NoMultiParamTypeClasses \ NoMultiWayIf \ NoNPlusKPatterns @@ -377,6 +381,7 @@ syn keyword cabalExtension contained \ NoOverloadedLists \ NoOverloadedRecordDot \ NoOverloadedStrings + \ NoOrPatterns \ NoPackageImports \ NoParallelArrays \ NoParallelListComp diff --git a/license-list-data/exceptions-3.25.json b/license-list-data/exceptions-3.25.json new file mode 100644 index 00000000000..9d20ee4866a --- /dev/null +++ b/license-list-data/exceptions-3.25.json @@ -0,0 +1,836 @@ +{ + "licenseListVersion": "3.25.0", + "exceptions": [ + { + "reference": "./389-exception.json", + "isDeprecatedLicenseId": false, + "detailsUrl": "./389-exception.html", + "referenceNumber": 53, + "name": "389 Directory Server Exception", + "licenseExceptionId": "389-exception", + "seeAlso": [ + "http://directory.fedoraproject.org/wiki/GPL_Exception_License_Text", + "https://web.archive.org/web/20080828121337/http://directory.fedoraproject.org/wiki/GPL_Exception_License_Text" + ] + }, + { + "reference": "./Asterisk-exception.json", + "isDeprecatedLicenseId": false, + "detailsUrl": "./Asterisk-exception.html", + "referenceNumber": 60, + "name": "Asterisk exception", + "licenseExceptionId": "Asterisk-exception", + "seeAlso": [ + "https://github.com/asterisk/libpri/blob/7f91151e6bd10957c746c031c1f4a030e8146e9a/pri.c#L22", + "https://github.com/asterisk/libss7/blob/03e81bcd0d28ff25d4c77c78351ddadc82ff5c3f/ss7.c#L24" + ] + }, + { + "reference": "./Asterisk-linking-protocols-exception.json", + "isDeprecatedLicenseId": false, + "detailsUrl": "./Asterisk-linking-protocols-exception.html", + "referenceNumber": 24, + "name": "Asterisk linking protocols exception", + "licenseExceptionId": "Asterisk-linking-protocols-exception", + "seeAlso": [ + "https://github.com/asterisk/asterisk/blob/115d7c01e32ccf4566a99e9d74e2b88830985a0b/LICENSE#L27" + ] + }, + { + "reference": "./Autoconf-exception-2.0.json", + "isDeprecatedLicenseId": false, + "detailsUrl": "./Autoconf-exception-2.0.html", + "referenceNumber": 72, + "name": "Autoconf exception 2.0", + "licenseExceptionId": "Autoconf-exception-2.0", + "seeAlso": [ + "http://ac-archive.sourceforge.net/doc/copyright.html", + "http://ftp.gnu.org/gnu/autoconf/autoconf-2.59.tar.gz" + ] + }, + { + "reference": "./Autoconf-exception-3.0.json", + "isDeprecatedLicenseId": false, + "detailsUrl": "./Autoconf-exception-3.0.html", + "referenceNumber": 17, + "name": "Autoconf exception 3.0", + "licenseExceptionId": "Autoconf-exception-3.0", + "seeAlso": [ + "http://www.gnu.org/licenses/autoconf-exception-3.0.html" + ] + }, + { + "reference": "./Autoconf-exception-generic.json", + "isDeprecatedLicenseId": false, + "detailsUrl": "./Autoconf-exception-generic.html", + "referenceNumber": 48, + "name": "Autoconf generic exception", + "licenseExceptionId": "Autoconf-exception-generic", + "seeAlso": [ + "https://launchpad.net/ubuntu/precise/+source/xmltooling/+copyright", + "https://tracker.debian.org/media/packages/s/sipwitch/copyright-1.9.15-3", + "https://opensource.apple.com/source/launchd/launchd-258.1/launchd/compile.auto.html", + "https://git.savannah.gnu.org/gitweb/?p\u003dgnulib.git;a\u003dblob;f\u003dgnulib-tool;h\u003d029a8cf377ad8d8f2d9e54061bf2f20496ad2eef;hb\u003d73c74ba0197e6566da6882c87b1adee63e24d75c#l407" + ] + }, + { + "reference": "./Autoconf-exception-generic-3.0.json", + "isDeprecatedLicenseId": false, + "detailsUrl": "./Autoconf-exception-generic-3.0.html", + "referenceNumber": 64, + "name": "Autoconf generic exception for GPL-3.0", + "licenseExceptionId": "Autoconf-exception-generic-3.0", + "seeAlso": [ + "https://src.fedoraproject.org/rpms/redhat-rpm-config/blob/rawhide/f/config.guess" + ] + }, + { + "reference": "./Autoconf-exception-macro.json", + "isDeprecatedLicenseId": false, + "detailsUrl": "./Autoconf-exception-macro.html", + "referenceNumber": 51, + "name": "Autoconf macro exception", + "licenseExceptionId": "Autoconf-exception-macro", + "seeAlso": [ + "https://github.com/freedesktop/xorg-macros/blob/39f07f7db58ebbf3dcb64a2bf9098ed5cf3d1223/xorg-macros.m4.in", + "https://www.gnu.org/software/autoconf-archive/ax_pthread.html", + "https://launchpad.net/ubuntu/precise/+source/xmltooling/+copyright" + ] + }, + { + "reference": "./Bison-exception-1.24.json", + "isDeprecatedLicenseId": false, + "detailsUrl": "./Bison-exception-1.24.html", + "referenceNumber": 59, + "name": "Bison exception 1.24", + "licenseExceptionId": "Bison-exception-1.24", + "seeAlso": [ + "https://github.com/arineng/rwhoisd/blob/master/rwhoisd/mkdb/y.tab.c#L180" + ] + }, + { + "reference": "./Bison-exception-2.2.json", + "isDeprecatedLicenseId": false, + "detailsUrl": "./Bison-exception-2.2.html", + "referenceNumber": 21, + "name": "Bison exception 2.2", + "licenseExceptionId": "Bison-exception-2.2", + "seeAlso": [ + "http://git.savannah.gnu.org/cgit/bison.git/tree/data/yacc.c?id\u003d193d7c7054ba7197b0789e14965b739162319b5e#n141" + ] + }, + { + "reference": "./Bootloader-exception.json", + "isDeprecatedLicenseId": false, + "detailsUrl": "./Bootloader-exception.html", + "referenceNumber": 40, + "name": "Bootloader Distribution Exception", + "licenseExceptionId": "Bootloader-exception", + "seeAlso": [ + "https://github.com/pyinstaller/pyinstaller/blob/develop/COPYING.txt" + ] + }, + { + "reference": "./Classpath-exception-2.0.json", + "isDeprecatedLicenseId": false, + "detailsUrl": "./Classpath-exception-2.0.html", + "referenceNumber": 34, + "name": "Classpath exception 2.0", + "licenseExceptionId": "Classpath-exception-2.0", + "seeAlso": [ + "http://www.gnu.org/software/classpath/license.html", + "https://fedoraproject.org/wiki/Licensing/GPL_Classpath_Exception" + ] + }, + { + "reference": "./CLISP-exception-2.0.json", + "isDeprecatedLicenseId": false, + "detailsUrl": "./CLISP-exception-2.0.html", + "referenceNumber": 71, + "name": "CLISP exception 2.0", + "licenseExceptionId": "CLISP-exception-2.0", + "seeAlso": [ + "http://sourceforge.net/p/clisp/clisp/ci/default/tree/COPYRIGHT" + ] + }, + { + "reference": "./cryptsetup-OpenSSL-exception.json", + "isDeprecatedLicenseId": false, + "detailsUrl": "./cryptsetup-OpenSSL-exception.html", + "referenceNumber": 5, + "name": "cryptsetup OpenSSL exception", + "licenseExceptionId": "cryptsetup-OpenSSL-exception", + "seeAlso": [ + "https://gitlab.com/cryptsetup/cryptsetup/-/blob/main/COPYING", + "https://gitlab.nic.cz/datovka/datovka/-/blob/develop/COPYING", + "https://github.com/nbs-system/naxsi/blob/951123ad456bdf5ac94e8d8819342fe3d49bc002/naxsi_src/naxsi_raw.c", + "http://web.mit.edu/jgross/arch/amd64_deb60/bin/mosh", + "https://sourceforge.net/p/linux-ima/ima-evm-utils/ci/master/tree/src/evmctl.c#l30" + ] + }, + { + "reference": "./DigiRule-FOSS-exception.json", + "isDeprecatedLicenseId": false, + "detailsUrl": "./DigiRule-FOSS-exception.html", + "referenceNumber": 66, + "name": "DigiRule FOSS License Exception", + "licenseExceptionId": "DigiRule-FOSS-exception", + "seeAlso": [ + "http://www.digirulesolutions.com/drupal/foss" + ] + }, + { + "reference": "./eCos-exception-2.0.json", + "isDeprecatedLicenseId": false, + "detailsUrl": "./eCos-exception-2.0.html", + "referenceNumber": 35, + "name": "eCos exception 2.0", + "licenseExceptionId": "eCos-exception-2.0", + "seeAlso": [ + "http://ecos.sourceware.org/license-overview.html" + ] + }, + { + "reference": "./erlang-otp-linking-exception.json", + "isDeprecatedLicenseId": false, + "detailsUrl": "./erlang-otp-linking-exception.html", + "referenceNumber": 46, + "name": "Erlang/OTP Linking Exception", + "licenseExceptionId": "erlang-otp-linking-exception", + "seeAlso": [ + "https://www.gnu.org/licenses/gpl-faq.en.html#GPLIncompatibleLibs", + "https://erlang.org/pipermail/erlang-questions/2012-May/066355.html", + "https://gitea.osmocom.org/erlang/osmo_ss7/src/commit/2286c1b8738d715950026650bf53f19a69d6ed0e/src/ss7_links.erl#L20" + ] + }, + { + "reference": "./Fawkes-Runtime-exception.json", + "isDeprecatedLicenseId": false, + "detailsUrl": "./Fawkes-Runtime-exception.html", + "referenceNumber": 23, + "name": "Fawkes Runtime Exception", + "licenseExceptionId": "Fawkes-Runtime-exception", + "seeAlso": [ + "http://www.fawkesrobotics.org/about/license/" + ] + }, + { + "reference": "./FLTK-exception.json", + "isDeprecatedLicenseId": false, + "detailsUrl": "./FLTK-exception.html", + "referenceNumber": 9, + "name": "FLTK exception", + "licenseExceptionId": "FLTK-exception", + "seeAlso": [ + "http://www.fltk.org/COPYING.php" + ] + }, + { + "reference": "./fmt-exception.json", + "isDeprecatedLicenseId": false, + "detailsUrl": "./fmt-exception.html", + "referenceNumber": 69, + "name": "fmt exception", + "licenseExceptionId": "fmt-exception", + "seeAlso": [ + "https://github.com/fmtlib/fmt/blob/master/LICENSE", + "https://github.com/fmtlib/fmt/blob/2eb363297b24cd71a68ccfb20ff755430f17e60f/LICENSE#L22C1-L27C62" + ] + }, + { + "reference": "./Font-exception-2.0.json", + "isDeprecatedLicenseId": false, + "detailsUrl": "./Font-exception-2.0.html", + "referenceNumber": 19, + "name": "Font exception 2.0", + "licenseExceptionId": "Font-exception-2.0", + "seeAlso": [ + "http://www.gnu.org/licenses/gpl-faq.html#FontException" + ] + }, + { + "reference": "./freertos-exception-2.0.json", + "isDeprecatedLicenseId": false, + "detailsUrl": "./freertos-exception-2.0.html", + "referenceNumber": 54, + "name": "FreeRTOS Exception 2.0", + "licenseExceptionId": "freertos-exception-2.0", + "seeAlso": [ + "https://web.archive.org/web/20060809182744/http://www.freertos.org/a00114.html" + ] + }, + { + "reference": "./GCC-exception-2.0.json", + "isDeprecatedLicenseId": false, + "detailsUrl": "./GCC-exception-2.0.html", + "referenceNumber": 14, + "name": "GCC Runtime Library exception 2.0", + "licenseExceptionId": "GCC-exception-2.0", + "seeAlso": [ + "https://gcc.gnu.org/git/?p\u003dgcc.git;a\u003dblob;f\u003dgcc/libgcc1.c;h\u003d762f5143fc6eed57b6797c82710f3538aa52b40b;hb\u003dcb143a3ce4fb417c68f5fa2691a1b1b1053dfba9#l10", + "https://sourceware.org/git/?p\u003dglibc.git;a\u003dblob;f\u003dcsu/abi-note.c;h\u003dc2ec208e94fbe91f63d3c375bd254b884695d190;hb\u003dHEAD" + ] + }, + { + "reference": "./GCC-exception-2.0-note.json", + "isDeprecatedLicenseId": false, + "detailsUrl": "./GCC-exception-2.0-note.html", + "referenceNumber": 55, + "name": "GCC Runtime Library exception 2.0 - note variant", + "licenseExceptionId": "GCC-exception-2.0-note", + "seeAlso": [ + "https://sourceware.org/git/?p\u003dglibc.git;a\u003dblob;f\u003dsysdeps/x86_64/start.S" + ] + }, + { + "reference": "./GCC-exception-3.1.json", + "isDeprecatedLicenseId": false, + "detailsUrl": "./GCC-exception-3.1.html", + "referenceNumber": 6, + "name": "GCC Runtime Library exception 3.1", + "licenseExceptionId": "GCC-exception-3.1", + "seeAlso": [ + "http://www.gnu.org/licenses/gcc-exception-3.1.html" + ] + }, + { + "reference": "./Gmsh-exception.json", + "isDeprecatedLicenseId": false, + "detailsUrl": "./Gmsh-exception.html", + "referenceNumber": 58, + "name": "Gmsh exception\u003e", + "licenseExceptionId": "Gmsh-exception", + "seeAlso": [ + "https://gitlab.onelab.info/gmsh/gmsh/-/raw/master/LICENSE.txt" + ] + }, + { + "reference": "./GNAT-exception.json", + "isDeprecatedLicenseId": false, + "detailsUrl": "./GNAT-exception.html", + "referenceNumber": 26, + "name": "GNAT exception", + "licenseExceptionId": "GNAT-exception", + "seeAlso": [ + "https://github.com/AdaCore/florist/blob/master/libsrc/posix-configurable_file_limits.adb" + ] + }, + { + "reference": "./GNOME-examples-exception.json", + "isDeprecatedLicenseId": false, + "detailsUrl": "./GNOME-examples-exception.html", + "referenceNumber": 12, + "name": "GNOME examples exception", + "licenseExceptionId": "GNOME-examples-exception", + "seeAlso": [ + "https://gitlab.gnome.org/Archive/gnome-devel-docs/-/blob/master/platform-demos/C/legal.xml?ref_type\u003dheads", + "http://meldmerge.org/help/" + ] + }, + { + "reference": "./GNU-compiler-exception.json", + "isDeprecatedLicenseId": false, + "detailsUrl": "./GNU-compiler-exception.html", + "referenceNumber": 18, + "name": "GNU Compiler Exception", + "licenseExceptionId": "GNU-compiler-exception", + "seeAlso": [ + "https://sourceware.org/git?p\u003dbinutils-gdb.git;a\u003dblob;f\u003dlibiberty/unlink-if-ordinary.c;h\u003de49f2f2f67bfdb10d6b2bd579b0e01cad0fd708e;hb\u003dHEAD#l19" + ] + }, + { + "reference": "./gnu-javamail-exception.json", + "isDeprecatedLicenseId": false, + "detailsUrl": "./gnu-javamail-exception.html", + "referenceNumber": 43, + "name": "GNU JavaMail exception", + "licenseExceptionId": "gnu-javamail-exception", + "seeAlso": [ + "http://www.gnu.org/software/classpathx/javamail/javamail.html" + ] + }, + { + "reference": "./GPL-3.0-interface-exception.json", + "isDeprecatedLicenseId": false, + "detailsUrl": "./GPL-3.0-interface-exception.html", + "referenceNumber": 28, + "name": "GPL-3.0 Interface Exception", + "licenseExceptionId": "GPL-3.0-interface-exception", + "seeAlso": [ + "https://www.gnu.org/licenses/gpl-faq.en.html#LinkingOverControlledInterface" + ] + }, + { + "reference": "./GPL-3.0-linking-exception.json", + "isDeprecatedLicenseId": false, + "detailsUrl": "./GPL-3.0-linking-exception.html", + "referenceNumber": 45, + "name": "GPL-3.0 Linking Exception", + "licenseExceptionId": "GPL-3.0-linking-exception", + "seeAlso": [ + "https://www.gnu.org/licenses/gpl-faq.en.html#GPLIncompatibleLibs" + ] + }, + { + "reference": "./GPL-3.0-linking-source-exception.json", + "isDeprecatedLicenseId": false, + "detailsUrl": "./GPL-3.0-linking-source-exception.html", + "referenceNumber": 39, + "name": "GPL-3.0 Linking Exception (with Corresponding Source)", + "licenseExceptionId": "GPL-3.0-linking-source-exception", + "seeAlso": [ + "https://www.gnu.org/licenses/gpl-faq.en.html#GPLIncompatibleLibs", + "https://github.com/mirror/wget/blob/master/src/http.c#L20" + ] + }, + { + "reference": "./GPL-CC-1.0.json", + "isDeprecatedLicenseId": false, + "detailsUrl": "./GPL-CC-1.0.html", + "referenceNumber": 27, + "name": "GPL Cooperation Commitment 1.0", + "licenseExceptionId": "GPL-CC-1.0", + "seeAlso": [ + "https://github.com/gplcc/gplcc/blob/master/Project/COMMITMENT", + "https://gplcc.github.io/gplcc/Project/README-PROJECT.html" + ] + }, + { + "reference": "./GStreamer-exception-2005.json", + "isDeprecatedLicenseId": false, + "detailsUrl": "./GStreamer-exception-2005.html", + "referenceNumber": 63, + "name": "GStreamer Exception (2005)", + "licenseExceptionId": "GStreamer-exception-2005", + "seeAlso": [ + "https://gstreamer.freedesktop.org/documentation/frequently-asked-questions/licensing.html?gi-language\u003dc#licensing-of-applications-using-gstreamer" + ] + }, + { + "reference": "./GStreamer-exception-2008.json", + "isDeprecatedLicenseId": false, + "detailsUrl": "./GStreamer-exception-2008.html", + "referenceNumber": 30, + "name": "GStreamer Exception (2008)", + "licenseExceptionId": "GStreamer-exception-2008", + "seeAlso": [ + "https://gstreamer.freedesktop.org/documentation/frequently-asked-questions/licensing.html?gi-language\u003dc#licensing-of-applications-using-gstreamer" + ] + }, + { + "reference": "./i2p-gpl-java-exception.json", + "isDeprecatedLicenseId": false, + "detailsUrl": "./i2p-gpl-java-exception.html", + "referenceNumber": 36, + "name": "i2p GPL+Java Exception", + "licenseExceptionId": "i2p-gpl-java-exception", + "seeAlso": [ + "http://geti2p.net/en/get-involved/develop/licenses#java_exception" + ] + }, + { + "reference": "./KiCad-libraries-exception.json", + "isDeprecatedLicenseId": false, + "detailsUrl": "./KiCad-libraries-exception.html", + "referenceNumber": 10, + "name": "KiCad Libraries Exception", + "licenseExceptionId": "KiCad-libraries-exception", + "seeAlso": [ + "https://www.kicad.org/libraries/license/" + ] + }, + { + "reference": "./LGPL-3.0-linking-exception.json", + "isDeprecatedLicenseId": false, + "detailsUrl": "./LGPL-3.0-linking-exception.html", + "referenceNumber": 31, + "name": "LGPL-3.0 Linking Exception", + "licenseExceptionId": "LGPL-3.0-linking-exception", + "seeAlso": [ + "https://raw.githubusercontent.com/go-xmlpath/xmlpath/v2/LICENSE", + "https://github.com/goamz/goamz/blob/master/LICENSE", + "https://github.com/juju/errors/blob/master/LICENSE" + ] + }, + { + "reference": "./libpri-OpenH323-exception.json", + "isDeprecatedLicenseId": false, + "detailsUrl": "./libpri-OpenH323-exception.html", + "referenceNumber": 15, + "name": "libpri OpenH323 exception", + "licenseExceptionId": "libpri-OpenH323-exception", + "seeAlso": [ + "https://github.com/asterisk/libpri/blob/1.6.0/README#L19-L22" + ] + }, + { + "reference": "./Libtool-exception.json", + "isDeprecatedLicenseId": false, + "detailsUrl": "./Libtool-exception.html", + "referenceNumber": 20, + "name": "Libtool Exception", + "licenseExceptionId": "Libtool-exception", + "seeAlso": [ + "http://git.savannah.gnu.org/cgit/libtool.git/tree/m4/libtool.m4", + "https://git.savannah.gnu.org/cgit/libtool.git/tree/libltdl/lt__alloc.c#n15" + ] + }, + { + "reference": "./Linux-syscall-note.json", + "isDeprecatedLicenseId": false, + "detailsUrl": "./Linux-syscall-note.html", + "referenceNumber": 52, + "name": "Linux Syscall Note", + "licenseExceptionId": "Linux-syscall-note", + "seeAlso": [ + "https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/COPYING" + ] + }, + { + "reference": "./LLGPL.json", + "isDeprecatedLicenseId": false, + "detailsUrl": "./LLGPL.html", + "referenceNumber": 37, + "name": "LLGPL Preamble", + "licenseExceptionId": "LLGPL", + "seeAlso": [ + "http://opensource.franz.com/preamble.html" + ] + }, + { + "reference": "./LLVM-exception.json", + "isDeprecatedLicenseId": false, + "detailsUrl": "./LLVM-exception.html", + "referenceNumber": 1, + "name": "LLVM Exception", + "licenseExceptionId": "LLVM-exception", + "seeAlso": [ + "http://llvm.org/foundation/relicensing/LICENSE.txt" + ] + }, + { + "reference": "./LZMA-exception.json", + "isDeprecatedLicenseId": false, + "detailsUrl": "./LZMA-exception.html", + "referenceNumber": 61, + "name": "LZMA exception", + "licenseExceptionId": "LZMA-exception", + "seeAlso": [ + "http://nsis.sourceforge.net/Docs/AppendixI.html#I.6" + ] + }, + { + "reference": "./mif-exception.json", + "isDeprecatedLicenseId": false, + "detailsUrl": "./mif-exception.html", + "referenceNumber": 7, + "name": "Macros and Inline Functions Exception", + "licenseExceptionId": "mif-exception", + "seeAlso": [ + "http://www.scs.stanford.edu/histar/src/lib/cppsup/exception", + "http://dev.bertos.org/doxygen/", + "https://www.threadingbuildingblocks.org/licensing" + ] + }, + { + "reference": "./Nokia-Qt-exception-1.1.json", + "isDeprecatedLicenseId": true, + "detailsUrl": "./Nokia-Qt-exception-1.1.html", + "referenceNumber": 13, + "name": "Nokia Qt LGPL exception 1.1", + "licenseExceptionId": "Nokia-Qt-exception-1.1", + "seeAlso": [ + "https://www.keepassx.org/dev/projects/keepassx/repository/revisions/b8dfb9cc4d5133e0f09cd7533d15a4f1c19a40f2/entry/LICENSE.NOKIA-LGPL-EXCEPTION" + ] + }, + { + "reference": "./OCaml-LGPL-linking-exception.json", + "isDeprecatedLicenseId": false, + "detailsUrl": "./OCaml-LGPL-linking-exception.html", + "referenceNumber": 2, + "name": "OCaml LGPL Linking Exception", + "licenseExceptionId": "OCaml-LGPL-linking-exception", + "seeAlso": [ + "https://caml.inria.fr/ocaml/license.en.html" + ] + }, + { + "reference": "./OCCT-exception-1.0.json", + "isDeprecatedLicenseId": false, + "detailsUrl": "./OCCT-exception-1.0.html", + "referenceNumber": 49, + "name": "Open CASCADE Exception 1.0", + "licenseExceptionId": "OCCT-exception-1.0", + "seeAlso": [ + "http://www.opencascade.com/content/licensing" + ] + }, + { + "reference": "./OpenJDK-assembly-exception-1.0.json", + "isDeprecatedLicenseId": false, + "detailsUrl": "./OpenJDK-assembly-exception-1.0.html", + "referenceNumber": 44, + "name": "OpenJDK Assembly exception 1.0", + "licenseExceptionId": "OpenJDK-assembly-exception-1.0", + "seeAlso": [ + "http://openjdk.java.net/legal/assembly-exception.html" + ] + }, + { + "reference": "./openvpn-openssl-exception.json", + "isDeprecatedLicenseId": false, + "detailsUrl": "./openvpn-openssl-exception.html", + "referenceNumber": 29, + "name": "OpenVPN OpenSSL Exception", + "licenseExceptionId": "openvpn-openssl-exception", + "seeAlso": [ + "http://openvpn.net/index.php/license.html", + "https://github.com/psycopg/psycopg2/blob/2_9_3/LICENSE#L14" + ] + }, + { + "reference": "./PCRE2-exception.json", + "isDeprecatedLicenseId": false, + "detailsUrl": "./PCRE2-exception.html", + "referenceNumber": 8, + "name": "PCRE2 exception", + "licenseExceptionId": "PCRE2-exception", + "seeAlso": [ + "https://www.pcre.org/licence.txt" + ] + }, + { + "reference": "./PS-or-PDF-font-exception-20170817.json", + "isDeprecatedLicenseId": false, + "detailsUrl": "./PS-or-PDF-font-exception-20170817.html", + "referenceNumber": 16, + "name": "PS/PDF font exception (2017-08-17)", + "licenseExceptionId": "PS-or-PDF-font-exception-20170817", + "seeAlso": [ + "https://github.com/ArtifexSoftware/urw-base35-fonts/blob/65962e27febc3883a17e651cdb23e783668c996f/LICENSE" + ] + }, + { + "reference": "./QPL-1.0-INRIA-2004-exception.json", + "isDeprecatedLicenseId": false, + "detailsUrl": "./QPL-1.0-INRIA-2004-exception.html", + "referenceNumber": 68, + "name": "INRIA QPL 1.0 2004 variant exception", + "licenseExceptionId": "QPL-1.0-INRIA-2004-exception", + "seeAlso": [ + "https://git.frama-c.com/pub/frama-c/-/blob/master/licenses/Q_MODIFIED_LICENSE", + "https://github.com/maranget/hevea/blob/master/LICENSE" + ] + }, + { + "reference": "./Qt-GPL-exception-1.0.json", + "isDeprecatedLicenseId": false, + "detailsUrl": "./Qt-GPL-exception-1.0.html", + "referenceNumber": 50, + "name": "Qt GPL exception 1.0", + "licenseExceptionId": "Qt-GPL-exception-1.0", + "seeAlso": [ + "http://code.qt.io/cgit/qt/qtbase.git/tree/LICENSE.GPL3-EXCEPT" + ] + }, + { + "reference": "./Qt-LGPL-exception-1.1.json", + "isDeprecatedLicenseId": false, + "detailsUrl": "./Qt-LGPL-exception-1.1.html", + "referenceNumber": 38, + "name": "Qt LGPL exception 1.1", + "licenseExceptionId": "Qt-LGPL-exception-1.1", + "seeAlso": [ + "http://code.qt.io/cgit/qt/qtbase.git/tree/LGPL_EXCEPTION.txt" + ] + }, + { + "reference": "./Qwt-exception-1.0.json", + "isDeprecatedLicenseId": false, + "detailsUrl": "./Qwt-exception-1.0.html", + "referenceNumber": 25, + "name": "Qwt exception 1.0", + "licenseExceptionId": "Qwt-exception-1.0", + "seeAlso": [ + "http://qwt.sourceforge.net/qwtlicense.html" + ] + }, + { + "reference": "./romic-exception.json", + "isDeprecatedLicenseId": false, + "detailsUrl": "./romic-exception.html", + "referenceNumber": 22, + "name": "Romic Exception", + "licenseExceptionId": "romic-exception", + "seeAlso": [ + "https://web.archive.org/web/20210124015834/http://mo.morsi.org/blog/2009/08/13/lesser_affero_gplv3/", + "https://sourceforge.net/p/romic/code/ci/3ab2856180cf0d8b007609af53154cf092efc58f/tree/COPYING", + "https://github.com/moll/node-mitm/blob/bbf24b8bd7596dc6e091e625363161ce91984fc7/LICENSE#L8-L11", + "https://github.com/zenbones/SmallMind/blob/3c62b5995fe7f27c453f140ff9b60560a0893f2a/COPYRIGHT#L25-L30", + "https://github.com/CubeArtisan/cubeartisan/blob/2c6ab53455237b88a3ea07be02a838a135c4ab79/LICENSE.LESSER#L10-L15", + "https://github.com/savearray2/py.js/blob/b781273c08c8afa89f4954de4ecf42ec01429bae/README.md#license" + ] + }, + { + "reference": "./RRDtool-FLOSS-exception-2.0.json", + "isDeprecatedLicenseId": false, + "detailsUrl": "./RRDtool-FLOSS-exception-2.0.html", + "referenceNumber": 4, + "name": "RRDtool FLOSS exception 2.0", + "licenseExceptionId": "RRDtool-FLOSS-exception-2.0", + "seeAlso": [ + "https://github.com/oetiker/rrdtool-1.x/blob/master/COPYRIGHT#L25-L90", + "https://oss.oetiker.ch/rrdtool/license.en.html" + ] + }, + { + "reference": "./SANE-exception.json", + "isDeprecatedLicenseId": false, + "detailsUrl": "./SANE-exception.html", + "referenceNumber": 11, + "name": "SANE Exception", + "licenseExceptionId": "SANE-exception", + "seeAlso": [ + "https://github.com/alexpevzner/sane-airscan/blob/master/LICENSE", + "https://gitlab.com/sane-project/backends/-/blob/master/sanei/sanei_pp.c?ref_type\u003dheads", + "https://gitlab.com/sane-project/frontends/-/blob/master/sanei/sanei_codec_ascii.c?ref_type\u003dheads" + ] + }, + { + "reference": "./SHL-2.0.json", + "isDeprecatedLicenseId": false, + "detailsUrl": "./SHL-2.0.html", + "referenceNumber": 56, + "name": "Solderpad Hardware License v2.0", + "licenseExceptionId": "SHL-2.0", + "seeAlso": [ + "https://solderpad.org/licenses/SHL-2.0/" + ] + }, + { + "reference": "./SHL-2.1.json", + "isDeprecatedLicenseId": false, + "detailsUrl": "./SHL-2.1.html", + "referenceNumber": 65, + "name": "Solderpad Hardware License v2.1", + "licenseExceptionId": "SHL-2.1", + "seeAlso": [ + "https://solderpad.org/licenses/SHL-2.1/" + ] + }, + { + "reference": "./stunnel-exception.json", + "isDeprecatedLicenseId": false, + "detailsUrl": "./stunnel-exception.html", + "referenceNumber": 70, + "name": "stunnel Exception", + "licenseExceptionId": "stunnel-exception", + "seeAlso": [ + "https://github.com/mtrojnar/stunnel/blob/master/COPYING.md" + ] + }, + { + "reference": "./SWI-exception.json", + "isDeprecatedLicenseId": false, + "detailsUrl": "./SWI-exception.html", + "referenceNumber": 41, + "name": "SWI exception", + "licenseExceptionId": "SWI-exception", + "seeAlso": [ + "https://github.com/SWI-Prolog/packages-clpqr/blob/bfa80b9270274f0800120d5b8e6fef42ac2dc6a5/clpqr/class.pl" + ] + }, + { + "reference": "./Swift-exception.json", + "isDeprecatedLicenseId": false, + "detailsUrl": "./Swift-exception.html", + "referenceNumber": 33, + "name": "Swift Exception", + "licenseExceptionId": "Swift-exception", + "seeAlso": [ + "https://swift.org/LICENSE.txt", + "https://github.com/apple/swift-package-manager/blob/7ab2275f447a5eb37497ed63a9340f8a6d1e488b/LICENSE.txt#L205" + ] + }, + { + "reference": "./Texinfo-exception.json", + "isDeprecatedLicenseId": false, + "detailsUrl": "./Texinfo-exception.html", + "referenceNumber": 67, + "name": "Texinfo exception", + "licenseExceptionId": "Texinfo-exception", + "seeAlso": [ + "https://git.savannah.gnu.org/cgit/automake.git/tree/lib/texinfo.tex?h\u003dv1.16.5#n23" + ] + }, + { + "reference": "./u-boot-exception-2.0.json", + "isDeprecatedLicenseId": false, + "detailsUrl": "./u-boot-exception-2.0.html", + "referenceNumber": 3, + "name": "U-Boot exception 2.0", + "licenseExceptionId": "u-boot-exception-2.0", + "seeAlso": [ + "http://git.denx.de/?p\u003du-boot.git;a\u003dblob;f\u003dLicenses/Exceptions" + ] + }, + { + "reference": "./UBDL-exception.json", + "isDeprecatedLicenseId": false, + "detailsUrl": "./UBDL-exception.html", + "referenceNumber": 62, + "name": "Unmodified Binary Distribution exception", + "licenseExceptionId": "UBDL-exception", + "seeAlso": [ + "https://github.com/ipxe/ipxe/blob/master/COPYING.UBDL" + ] + }, + { + "reference": "./Universal-FOSS-exception-1.0.json", + "isDeprecatedLicenseId": false, + "detailsUrl": "./Universal-FOSS-exception-1.0.html", + "referenceNumber": 42, + "name": "Universal FOSS Exception, Version 1.0", + "licenseExceptionId": "Universal-FOSS-exception-1.0", + "seeAlso": [ + "https://oss.oracle.com/licenses/universal-foss-exception/" + ] + }, + { + "reference": "./vsftpd-openssl-exception.json", + "isDeprecatedLicenseId": false, + "detailsUrl": "./vsftpd-openssl-exception.html", + "referenceNumber": 32, + "name": "vsftpd OpenSSL exception", + "licenseExceptionId": "vsftpd-openssl-exception", + "seeAlso": [ + "https://git.stg.centos.org/source-git/vsftpd/blob/f727873674d9c9cd7afcae6677aa782eb54c8362/f/LICENSE", + "https://launchpad.net/debian/squeeze/+source/vsftpd/+copyright", + "https://github.com/richardcochran/vsftpd/blob/master/COPYING" + ] + }, + { + "reference": "./WxWindows-exception-3.1.json", + "isDeprecatedLicenseId": false, + "detailsUrl": "./WxWindows-exception-3.1.html", + "referenceNumber": 57, + "name": "WxWindows Library Exception 3.1", + "licenseExceptionId": "WxWindows-exception-3.1", + "seeAlso": [ + "http://www.opensource.org/licenses/WXwindows" + ] + }, + { + "reference": "./x11vnc-openssl-exception.json", + "isDeprecatedLicenseId": false, + "detailsUrl": "./x11vnc-openssl-exception.html", + "referenceNumber": 47, + "name": "x11vnc OpenSSL Exception", + "licenseExceptionId": "x11vnc-openssl-exception", + "seeAlso": [ + "https://github.com/LibVNC/x11vnc/blob/master/src/8to24.c#L22" + ] + } + ], + "releaseDate": "2024-08-19" +} diff --git a/license-list-data/licenses-3.25.json b/license-list-data/licenses-3.25.json new file mode 100644 index 00000000000..5db03b48941 --- /dev/null +++ b/license-list-data/licenses-3.25.json @@ -0,0 +1,8360 @@ +{ + "licenseListVersion": "3.25.0", + "licenses": [ + { + "reference": "https://spdx.org/licenses/0BSD.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/0BSD.json", + "referenceNumber": 582, + "name": "BSD Zero Clause License", + "licenseId": "0BSD", + "seeAlso": [ + "http://landley.net/toybox/license.html", + "https://opensource.org/licenses/0BSD" + ], + "isOsiApproved": true + }, + { + "reference": "https://spdx.org/licenses/3D-Slicer-1.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/3D-Slicer-1.0.json", + "referenceNumber": 466, + "name": "3D Slicer License v1.0", + "licenseId": "3D-Slicer-1.0", + "seeAlso": [ + "https://slicer.org/LICENSE", + "https://github.com/Slicer/Slicer/blob/main/License.txt" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/AAL.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/AAL.json", + "referenceNumber": 252, + "name": "Attribution Assurance License", + "licenseId": "AAL", + "seeAlso": [ + "https://opensource.org/licenses/attribution" + ], + "isOsiApproved": true + }, + { + "reference": "https://spdx.org/licenses/Abstyles.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Abstyles.json", + "referenceNumber": 456, + "name": "Abstyles License", + "licenseId": "Abstyles", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing/Abstyles" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/AdaCore-doc.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/AdaCore-doc.json", + "referenceNumber": 355, + "name": "AdaCore Doc License", + "licenseId": "AdaCore-doc", + "seeAlso": [ + "https://github.com/AdaCore/xmlada/blob/master/docs/index.rst", + "https://github.com/AdaCore/gnatcoll-core/blob/master/docs/index.rst", + "https://github.com/AdaCore/gnatcoll-db/blob/master/docs/index.rst" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Adobe-2006.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Adobe-2006.json", + "referenceNumber": 128, + "name": "Adobe Systems Incorporated Source Code License Agreement", + "licenseId": "Adobe-2006", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing/AdobeLicense" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Adobe-Display-PostScript.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Adobe-Display-PostScript.json", + "referenceNumber": 433, + "name": "Adobe Display PostScript License", + "licenseId": "Adobe-Display-PostScript", + "seeAlso": [ + "https://gitlab.freedesktop.org/xorg/xserver/-/blob/master/COPYING?ref_type\u003dheads#L752" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Adobe-Glyph.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Adobe-Glyph.json", + "referenceNumber": 125, + "name": "Adobe Glyph List License", + "licenseId": "Adobe-Glyph", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing/MIT#AdobeGlyph" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Adobe-Utopia.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Adobe-Utopia.json", + "referenceNumber": 495, + "name": "Adobe Utopia Font License", + "licenseId": "Adobe-Utopia", + "seeAlso": [ + "https://gitlab.freedesktop.org/xorg/font/adobe-utopia-100dpi/-/blob/master/COPYING?ref_type\u003dheads" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/ADSL.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/ADSL.json", + "referenceNumber": 560, + "name": "Amazon Digital Services License", + "licenseId": "ADSL", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing/AmazonDigitalServicesLicense" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/AFL-1.1.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/AFL-1.1.json", + "referenceNumber": 14, + "name": "Academic Free License v1.1", + "licenseId": "AFL-1.1", + "seeAlso": [ + "http://opensource.linux-mirror.org/licenses/afl-1.1.txt", + "http://wayback.archive.org/web/20021004124254/http://www.opensource.org/licenses/academic.php" + ], + "isOsiApproved": true, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/AFL-1.2.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/AFL-1.2.json", + "referenceNumber": 622, + "name": "Academic Free License v1.2", + "licenseId": "AFL-1.2", + "seeAlso": [ + "http://opensource.linux-mirror.org/licenses/afl-1.2.txt", + "http://wayback.archive.org/web/20021204204652/http://www.opensource.org/licenses/academic.php" + ], + "isOsiApproved": true, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/AFL-2.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/AFL-2.0.json", + "referenceNumber": 559, + "name": "Academic Free License v2.0", + "licenseId": "AFL-2.0", + "seeAlso": [ + "http://wayback.archive.org/web/20060924134533/http://www.opensource.org/licenses/afl-2.0.txt" + ], + "isOsiApproved": true, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/AFL-2.1.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/AFL-2.1.json", + "referenceNumber": 570, + "name": "Academic Free License v2.1", + "licenseId": "AFL-2.1", + "seeAlso": [ + "http://opensource.linux-mirror.org/licenses/afl-2.1.txt" + ], + "isOsiApproved": true, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/AFL-3.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/AFL-3.0.json", + "referenceNumber": 332, + "name": "Academic Free License v3.0", + "licenseId": "AFL-3.0", + "seeAlso": [ + "http://www.rosenlaw.com/AFL3.0.htm", + "https://opensource.org/licenses/afl-3.0" + ], + "isOsiApproved": true, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/Afmparse.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Afmparse.json", + "referenceNumber": 163, + "name": "Afmparse License", + "licenseId": "Afmparse", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing/Afmparse" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/AGPL-1.0.html", + "isDeprecatedLicenseId": true, + "detailsUrl": "https://spdx.org/licenses/AGPL-1.0.json", + "referenceNumber": 657, + "name": "Affero General Public License v1.0", + "licenseId": "AGPL-1.0", + "seeAlso": [ + "http://www.affero.org/oagpl.html" + ], + "isOsiApproved": false, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/AGPL-1.0-only.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/AGPL-1.0-only.json", + "referenceNumber": 142, + "name": "Affero General Public License v1.0 only", + "licenseId": "AGPL-1.0-only", + "seeAlso": [ + "http://www.affero.org/oagpl.html" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/AGPL-1.0-or-later.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/AGPL-1.0-or-later.json", + "referenceNumber": 155, + "name": "Affero General Public License v1.0 or later", + "licenseId": "AGPL-1.0-or-later", + "seeAlso": [ + "http://www.affero.org/oagpl.html" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/AGPL-3.0.html", + "isDeprecatedLicenseId": true, + "detailsUrl": "https://spdx.org/licenses/AGPL-3.0.json", + "referenceNumber": 70, + "name": "GNU Affero General Public License v3.0", + "licenseId": "AGPL-3.0", + "seeAlso": [ + "https://www.gnu.org/licenses/agpl.txt", + "https://opensource.org/licenses/AGPL-3.0" + ], + "isOsiApproved": true, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/AGPL-3.0-only.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/AGPL-3.0-only.json", + "referenceNumber": 330, + "name": "GNU Affero General Public License v3.0 only", + "licenseId": "AGPL-3.0-only", + "seeAlso": [ + "https://www.gnu.org/licenses/agpl.txt", + "https://opensource.org/licenses/AGPL-3.0" + ], + "isOsiApproved": true, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/AGPL-3.0-or-later.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/AGPL-3.0-or-later.json", + "referenceNumber": 366, + "name": "GNU Affero General Public License v3.0 or later", + "licenseId": "AGPL-3.0-or-later", + "seeAlso": [ + "https://www.gnu.org/licenses/agpl.txt", + "https://opensource.org/licenses/AGPL-3.0" + ], + "isOsiApproved": true, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/Aladdin.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Aladdin.json", + "referenceNumber": 557, + "name": "Aladdin Free Public License", + "licenseId": "Aladdin", + "seeAlso": [ + "http://pages.cs.wisc.edu/~ghost/doc/AFPL/6.01/Public.htm" + ], + "isOsiApproved": false, + "isFsfLibre": false + }, + { + "reference": "https://spdx.org/licenses/AMD-newlib.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/AMD-newlib.json", + "referenceNumber": 340, + "name": "AMD newlib License", + "licenseId": "AMD-newlib", + "seeAlso": [ + "https://sourceware.org/git/?p\u003dnewlib-cygwin.git;a\u003dblob;f\u003dnewlib/libc/sys/a29khif/_close.S;h\u003d04f52ae00de1dafbd9055ad8d73c5c697a3aae7f;hb\u003dHEAD" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/AMDPLPA.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/AMDPLPA.json", + "referenceNumber": 467, + "name": "AMD\u0027s plpa_map.c License", + "licenseId": "AMDPLPA", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing/AMD_plpa_map_License" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/AML.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/AML.json", + "referenceNumber": 299, + "name": "Apple MIT License", + "licenseId": "AML", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing/Apple_MIT_License" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/AML-glslang.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/AML-glslang.json", + "referenceNumber": 567, + "name": "AML glslang variant License", + "licenseId": "AML-glslang", + "seeAlso": [ + "https://github.com/KhronosGroup/glslang/blob/main/LICENSE.txt#L949", + "https://docs.omniverse.nvidia.com/install-guide/latest/common/licenses.html" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/AMPAS.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/AMPAS.json", + "referenceNumber": 414, + "name": "Academy of Motion Picture Arts and Sciences BSD", + "licenseId": "AMPAS", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing/BSD#AMPASBSD" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/ANTLR-PD.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/ANTLR-PD.json", + "referenceNumber": 460, + "name": "ANTLR Software Rights Notice", + "licenseId": "ANTLR-PD", + "seeAlso": [ + "http://www.antlr2.org/license.html" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/ANTLR-PD-fallback.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/ANTLR-PD-fallback.json", + "referenceNumber": 65, + "name": "ANTLR Software Rights Notice with license fallback", + "licenseId": "ANTLR-PD-fallback", + "seeAlso": [ + "http://www.antlr2.org/license.html" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/any-OSI.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/any-OSI.json", + "referenceNumber": 310, + "name": "Any OSI License", + "licenseId": "any-OSI", + "seeAlso": [ + "https://metacpan.org/pod/Exporter::Tidy#LICENSE" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Apache-1.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Apache-1.0.json", + "referenceNumber": 250, + "name": "Apache License 1.0", + "licenseId": "Apache-1.0", + "seeAlso": [ + "http://www.apache.org/licenses/LICENSE-1.0" + ], + "isOsiApproved": false, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/Apache-1.1.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Apache-1.1.json", + "referenceNumber": 288, + "name": "Apache License 1.1", + "licenseId": "Apache-1.1", + "seeAlso": [ + "http://apache.org/licenses/LICENSE-1.1", + "https://opensource.org/licenses/Apache-1.1" + ], + "isOsiApproved": true, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/Apache-2.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Apache-2.0.json", + "referenceNumber": 143, + "name": "Apache License 2.0", + "licenseId": "Apache-2.0", + "seeAlso": [ + "https://www.apache.org/licenses/LICENSE-2.0", + "https://opensource.org/licenses/Apache-2.0" + ], + "isOsiApproved": true, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/APAFML.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/APAFML.json", + "referenceNumber": 636, + "name": "Adobe Postscript AFM License", + "licenseId": "APAFML", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing/AdobePostscriptAFM" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/APL-1.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/APL-1.0.json", + "referenceNumber": 85, + "name": "Adaptive Public License 1.0", + "licenseId": "APL-1.0", + "seeAlso": [ + "https://opensource.org/licenses/APL-1.0" + ], + "isOsiApproved": true + }, + { + "reference": "https://spdx.org/licenses/App-s2p.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/App-s2p.json", + "referenceNumber": 238, + "name": "App::s2p License", + "licenseId": "App-s2p", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing/App-s2p" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/APSL-1.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/APSL-1.0.json", + "referenceNumber": 335, + "name": "Apple Public Source License 1.0", + "licenseId": "APSL-1.0", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing/Apple_Public_Source_License_1.0" + ], + "isOsiApproved": true, + "isFsfLibre": false + }, + { + "reference": "https://spdx.org/licenses/APSL-1.1.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/APSL-1.1.json", + "referenceNumber": 308, + "name": "Apple Public Source License 1.1", + "licenseId": "APSL-1.1", + "seeAlso": [ + "http://www.opensource.apple.com/source/IOSerialFamily/IOSerialFamily-7/APPLE_LICENSE" + ], + "isOsiApproved": true + }, + { + "reference": "https://spdx.org/licenses/APSL-1.2.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/APSL-1.2.json", + "referenceNumber": 280, + "name": "Apple Public Source License 1.2", + "licenseId": "APSL-1.2", + "seeAlso": [ + "http://www.samurajdata.se/opensource/mirror/licenses/apsl.php" + ], + "isOsiApproved": true + }, + { + "reference": "https://spdx.org/licenses/APSL-2.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/APSL-2.0.json", + "referenceNumber": 592, + "name": "Apple Public Source License 2.0", + "licenseId": "APSL-2.0", + "seeAlso": [ + "http://www.opensource.apple.com/license/apsl/" + ], + "isOsiApproved": true, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/Arphic-1999.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Arphic-1999.json", + "referenceNumber": 32, + "name": "Arphic Public License", + "licenseId": "Arphic-1999", + "seeAlso": [ + "http://ftp.gnu.org/gnu/non-gnu/chinese-fonts-truetype/LICENSE" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Artistic-1.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Artistic-1.0.json", + "referenceNumber": 138, + "name": "Artistic License 1.0", + "licenseId": "Artistic-1.0", + "seeAlso": [ + "https://opensource.org/licenses/Artistic-1.0" + ], + "isOsiApproved": true, + "isFsfLibre": false + }, + { + "reference": "https://spdx.org/licenses/Artistic-1.0-cl8.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Artistic-1.0-cl8.json", + "referenceNumber": 353, + "name": "Artistic License 1.0 w/clause 8", + "licenseId": "Artistic-1.0-cl8", + "seeAlso": [ + "https://opensource.org/licenses/Artistic-1.0" + ], + "isOsiApproved": true + }, + { + "reference": "https://spdx.org/licenses/Artistic-1.0-Perl.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Artistic-1.0-Perl.json", + "referenceNumber": 660, + "name": "Artistic License 1.0 (Perl)", + "licenseId": "Artistic-1.0-Perl", + "seeAlso": [ + "http://dev.perl.org/licenses/artistic.html" + ], + "isOsiApproved": true + }, + { + "reference": "https://spdx.org/licenses/Artistic-2.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Artistic-2.0.json", + "referenceNumber": 277, + "name": "Artistic License 2.0", + "licenseId": "Artistic-2.0", + "seeAlso": [ + "http://www.perlfoundation.org/artistic_license_2_0", + "https://www.perlfoundation.org/artistic-license-20.html", + "https://opensource.org/licenses/artistic-license-2.0" + ], + "isOsiApproved": true, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/ASWF-Digital-Assets-1.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/ASWF-Digital-Assets-1.0.json", + "referenceNumber": 166, + "name": "ASWF Digital Assets License version 1.0", + "licenseId": "ASWF-Digital-Assets-1.0", + "seeAlso": [ + "https://github.com/AcademySoftwareFoundation/foundation/blob/main/digital_assets/aswf_digital_assets_license_v1.0.txt" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/ASWF-Digital-Assets-1.1.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/ASWF-Digital-Assets-1.1.json", + "referenceNumber": 29, + "name": "ASWF Digital Assets License 1.1", + "licenseId": "ASWF-Digital-Assets-1.1", + "seeAlso": [ + "https://github.com/AcademySoftwareFoundation/foundation/blob/main/digital_assets/aswf_digital_assets_license_v1.1.txt" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Baekmuk.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Baekmuk.json", + "referenceNumber": 380, + "name": "Baekmuk License", + "licenseId": "Baekmuk", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing:Baekmuk?rd\u003dLicensing/Baekmuk" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Bahyph.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Bahyph.json", + "referenceNumber": 368, + "name": "Bahyph License", + "licenseId": "Bahyph", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing/Bahyph" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Barr.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Barr.json", + "referenceNumber": 195, + "name": "Barr License", + "licenseId": "Barr", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing/Barr" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/bcrypt-Solar-Designer.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/bcrypt-Solar-Designer.json", + "referenceNumber": 478, + "name": "bcrypt Solar Designer License", + "licenseId": "bcrypt-Solar-Designer", + "seeAlso": [ + "https://github.com/bcrypt-ruby/bcrypt-ruby/blob/master/ext/mri/crypt_blowfish.c" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Beerware.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Beerware.json", + "referenceNumber": 616, + "name": "Beerware License", + "licenseId": "Beerware", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing/Beerware", + "https://people.freebsd.org/~phk/" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Bitstream-Charter.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Bitstream-Charter.json", + "referenceNumber": 455, + "name": "Bitstream Charter Font License", + "licenseId": "Bitstream-Charter", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing/Charter#License_Text", + "https://raw.githubusercontent.com/blackhole89/notekit/master/data/fonts/Charter%20license.txt" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Bitstream-Vera.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Bitstream-Vera.json", + "referenceNumber": 370, + "name": "Bitstream Vera Font License", + "licenseId": "Bitstream-Vera", + "seeAlso": [ + "https://web.archive.org/web/20080207013128/http://www.gnome.org/fonts/", + "https://docubrain.com/sites/default/files/licenses/bitstream-vera.html" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/BitTorrent-1.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/BitTorrent-1.0.json", + "referenceNumber": 106, + "name": "BitTorrent Open Source License v1.0", + "licenseId": "BitTorrent-1.0", + "seeAlso": [ + "http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/licenses/BitTorrent?r1\u003d1.1\u0026r2\u003d1.1.1.1\u0026diff_format\u003ds" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/BitTorrent-1.1.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/BitTorrent-1.1.json", + "referenceNumber": 541, + "name": "BitTorrent Open Source License v1.1", + "licenseId": "BitTorrent-1.1", + "seeAlso": [ + "http://directory.fsf.org/wiki/License:BitTorrentOSL1.1" + ], + "isOsiApproved": false, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/blessing.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/blessing.json", + "referenceNumber": 359, + "name": "SQLite Blessing", + "licenseId": "blessing", + "seeAlso": [ + "https://www.sqlite.org/src/artifact/e33a4df7e32d742a?ln\u003d4-9", + "https://sqlite.org/src/artifact/df5091916dbb40e6" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/BlueOak-1.0.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/BlueOak-1.0.0.json", + "referenceNumber": 606, + "name": "Blue Oak Model License 1.0.0", + "licenseId": "BlueOak-1.0.0", + "seeAlso": [ + "https://blueoakcouncil.org/license/1.0.0" + ], + "isOsiApproved": true + }, + { + "reference": "https://spdx.org/licenses/Boehm-GC.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Boehm-GC.json", + "referenceNumber": 127, + "name": "Boehm-Demers-Weiser GC License", + "licenseId": "Boehm-GC", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing:MIT#Another_Minimal_variant_(found_in_libatomic_ops)", + "https://github.com/uim/libgcroots/blob/master/COPYING", + "https://github.com/ivmai/libatomic_ops/blob/master/LICENSE" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Borceux.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Borceux.json", + "referenceNumber": 571, + "name": "Borceux license", + "licenseId": "Borceux", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing/Borceux" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Brian-Gladman-2-Clause.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Brian-Gladman-2-Clause.json", + "referenceNumber": 416, + "name": "Brian Gladman 2-Clause License", + "licenseId": "Brian-Gladman-2-Clause", + "seeAlso": [ + "https://github.com/krb5/krb5/blob/krb5-1.21.2-final/NOTICE#L140-L156", + "https://web.mit.edu/kerberos/krb5-1.21/doc/mitK5license.html" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Brian-Gladman-3-Clause.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Brian-Gladman-3-Clause.json", + "referenceNumber": 290, + "name": "Brian Gladman 3-Clause License", + "licenseId": "Brian-Gladman-3-Clause", + "seeAlso": [ + "https://github.com/SWI-Prolog/packages-clib/blob/master/sha1/brg_endian.h" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/BSD-1-Clause.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/BSD-1-Clause.json", + "referenceNumber": 419, + "name": "BSD 1-Clause License", + "licenseId": "BSD-1-Clause", + "seeAlso": [ + "https://svnweb.freebsd.org/base/head/include/ifaddrs.h?revision\u003d326823" + ], + "isOsiApproved": true + }, + { + "reference": "https://spdx.org/licenses/BSD-2-Clause.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/BSD-2-Clause.json", + "referenceNumber": 229, + "name": "BSD 2-Clause \"Simplified\" License", + "licenseId": "BSD-2-Clause", + "seeAlso": [ + "https://opensource.org/licenses/BSD-2-Clause" + ], + "isOsiApproved": true, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/BSD-2-Clause-Darwin.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/BSD-2-Clause-Darwin.json", + "referenceNumber": 296, + "name": "BSD 2-Clause - Ian Darwin variant", + "licenseId": "BSD-2-Clause-Darwin", + "seeAlso": [ + "https://github.com/file/file/blob/master/COPYING" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/BSD-2-Clause-first-lines.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/BSD-2-Clause-first-lines.json", + "referenceNumber": 217, + "name": "BSD 2-Clause - first lines requirement", + "licenseId": "BSD-2-Clause-first-lines", + "seeAlso": [ + "https://github.com/krb5/krb5/blob/krb5-1.21.2-final/NOTICE#L664-L690", + "https://web.mit.edu/kerberos/krb5-1.21/doc/mitK5license.html" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/BSD-2-Clause-FreeBSD.html", + "isDeprecatedLicenseId": true, + "detailsUrl": "https://spdx.org/licenses/BSD-2-Clause-FreeBSD.json", + "referenceNumber": 564, + "name": "BSD 2-Clause FreeBSD License", + "licenseId": "BSD-2-Clause-FreeBSD", + "seeAlso": [ + "http://www.freebsd.org/copyright/freebsd-license.html" + ], + "isOsiApproved": false, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/BSD-2-Clause-NetBSD.html", + "isDeprecatedLicenseId": true, + "detailsUrl": "https://spdx.org/licenses/BSD-2-Clause-NetBSD.json", + "referenceNumber": 376, + "name": "BSD 2-Clause NetBSD License", + "licenseId": "BSD-2-Clause-NetBSD", + "seeAlso": [ + "http://www.netbsd.org/about/redistribution.html#default" + ], + "isOsiApproved": false, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/BSD-2-Clause-Patent.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/BSD-2-Clause-Patent.json", + "referenceNumber": 4, + "name": "BSD-2-Clause Plus Patent License", + "licenseId": "BSD-2-Clause-Patent", + "seeAlso": [ + "https://opensource.org/licenses/BSDplusPatent" + ], + "isOsiApproved": true + }, + { + "reference": "https://spdx.org/licenses/BSD-2-Clause-Views.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/BSD-2-Clause-Views.json", + "referenceNumber": 514, + "name": "BSD 2-Clause with views sentence", + "licenseId": "BSD-2-Clause-Views", + "seeAlso": [ + "http://www.freebsd.org/copyright/freebsd-license.html", + "https://people.freebsd.org/~ivoras/wine/patch-wine-nvidia.sh", + "https://github.com/protegeproject/protege/blob/master/license.txt" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/BSD-3-Clause.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/BSD-3-Clause.json", + "referenceNumber": 584, + "name": "BSD 3-Clause \"New\" or \"Revised\" License", + "licenseId": "BSD-3-Clause", + "seeAlso": [ + "https://opensource.org/licenses/BSD-3-Clause", + "https://www.eclipse.org/org/documents/edl-v10.php" + ], + "isOsiApproved": true, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/BSD-3-Clause-acpica.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/BSD-3-Clause-acpica.json", + "referenceNumber": 341, + "name": "BSD 3-Clause acpica variant", + "licenseId": "BSD-3-Clause-acpica", + "seeAlso": [ + "https://github.com/acpica/acpica/blob/master/source/common/acfileio.c#L119" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/BSD-3-Clause-Attribution.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/BSD-3-Clause-Attribution.json", + "referenceNumber": 71, + "name": "BSD with attribution", + "licenseId": "BSD-3-Clause-Attribution", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing/BSD_with_Attribution" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/BSD-3-Clause-Clear.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/BSD-3-Clause-Clear.json", + "referenceNumber": 253, + "name": "BSD 3-Clause Clear License", + "licenseId": "BSD-3-Clause-Clear", + "seeAlso": [ + "http://labs.metacarta.com/license-explanation.html#license" + ], + "isOsiApproved": false, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/BSD-3-Clause-flex.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/BSD-3-Clause-flex.json", + "referenceNumber": 52, + "name": "BSD 3-Clause Flex variant", + "licenseId": "BSD-3-Clause-flex", + "seeAlso": [ + "https://github.com/westes/flex/blob/master/COPYING" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/BSD-3-Clause-HP.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/BSD-3-Clause-HP.json", + "referenceNumber": 215, + "name": "Hewlett-Packard BSD variant license", + "licenseId": "BSD-3-Clause-HP", + "seeAlso": [ + "https://github.com/zdohnal/hplip/blob/master/COPYING#L939" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/BSD-3-Clause-LBNL.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/BSD-3-Clause-LBNL.json", + "referenceNumber": 301, + "name": "Lawrence Berkeley National Labs BSD variant license", + "licenseId": "BSD-3-Clause-LBNL", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing/LBNLBSD" + ], + "isOsiApproved": true + }, + { + "reference": "https://spdx.org/licenses/BSD-3-Clause-Modification.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/BSD-3-Clause-Modification.json", + "referenceNumber": 47, + "name": "BSD 3-Clause Modification", + "licenseId": "BSD-3-Clause-Modification", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing:BSD#Modification_Variant" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/BSD-3-Clause-No-Military-License.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/BSD-3-Clause-No-Military-License.json", + "referenceNumber": 615, + "name": "BSD 3-Clause No Military License", + "licenseId": "BSD-3-Clause-No-Military-License", + "seeAlso": [ + "https://gitlab.syncad.com/hive/dhive/-/blob/master/LICENSE", + "https://github.com/greymass/swift-eosio/blob/master/LICENSE" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/BSD-3-Clause-No-Nuclear-License.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/BSD-3-Clause-No-Nuclear-License.json", + "referenceNumber": 647, + "name": "BSD 3-Clause No Nuclear License", + "licenseId": "BSD-3-Clause-No-Nuclear-License", + "seeAlso": [ + "http://download.oracle.com/otn-pub/java/licenses/bsd.txt" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/BSD-3-Clause-No-Nuclear-License-2014.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/BSD-3-Clause-No-Nuclear-License-2014.json", + "referenceNumber": 377, + "name": "BSD 3-Clause No Nuclear License 2014", + "licenseId": "BSD-3-Clause-No-Nuclear-License-2014", + "seeAlso": [ + "https://java.net/projects/javaeetutorial/pages/BerkeleyLicense" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/BSD-3-Clause-No-Nuclear-Warranty.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/BSD-3-Clause-No-Nuclear-Warranty.json", + "referenceNumber": 54, + "name": "BSD 3-Clause No Nuclear Warranty", + "licenseId": "BSD-3-Clause-No-Nuclear-Warranty", + "seeAlso": [ + "https://jogamp.org/git/?p\u003dgluegen.git;a\u003dblob_plain;f\u003dLICENSE.txt" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/BSD-3-Clause-Open-MPI.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/BSD-3-Clause-Open-MPI.json", + "referenceNumber": 633, + "name": "BSD 3-Clause Open MPI variant", + "licenseId": "BSD-3-Clause-Open-MPI", + "seeAlso": [ + "https://www.open-mpi.org/community/license.php", + "http://www.netlib.org/lapack/LICENSE.txt" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/BSD-3-Clause-Sun.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/BSD-3-Clause-Sun.json", + "referenceNumber": 270, + "name": "BSD 3-Clause Sun Microsystems", + "licenseId": "BSD-3-Clause-Sun", + "seeAlso": [ + "https://github.com/xmlark/msv/blob/b9316e2f2270bc1606952ea4939ec87fbba157f3/xsdlib/src/main/java/com/sun/msv/datatype/regexp/InternalImpl.java" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/BSD-4-Clause.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/BSD-4-Clause.json", + "referenceNumber": 470, + "name": "BSD 4-Clause \"Original\" or \"Old\" License", + "licenseId": "BSD-4-Clause", + "seeAlso": [ + "http://directory.fsf.org/wiki/License:BSD_4Clause" + ], + "isOsiApproved": false, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/BSD-4-Clause-Shortened.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/BSD-4-Clause-Shortened.json", + "referenceNumber": 220, + "name": "BSD 4 Clause Shortened", + "licenseId": "BSD-4-Clause-Shortened", + "seeAlso": [ + "https://metadata.ftp-master.debian.org/changelogs//main/a/arpwatch/arpwatch_2.1a15-7_copyright" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/BSD-4-Clause-UC.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/BSD-4-Clause-UC.json", + "referenceNumber": 175, + "name": "BSD-4-Clause (University of California-Specific)", + "licenseId": "BSD-4-Clause-UC", + "seeAlso": [ + "http://www.freebsd.org/copyright/license.html" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/BSD-4.3RENO.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/BSD-4.3RENO.json", + "referenceNumber": 361, + "name": "BSD 4.3 RENO License", + "licenseId": "BSD-4.3RENO", + "seeAlso": [ + "https://sourceware.org/git/?p\u003dbinutils-gdb.git;a\u003dblob;f\u003dlibiberty/strcasecmp.c;h\u003d131d81c2ce7881fa48c363dc5bf5fb302c61ce0b;hb\u003dHEAD", + "https://git.openldap.org/openldap/openldap/-/blob/master/COPYRIGHT#L55-63" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/BSD-4.3TAHOE.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/BSD-4.3TAHOE.json", + "referenceNumber": 46, + "name": "BSD 4.3 TAHOE License", + "licenseId": "BSD-4.3TAHOE", + "seeAlso": [ + "https://github.com/389ds/389-ds-base/blob/main/ldap/include/sysexits-compat.h#L15", + "https://git.savannah.gnu.org/cgit/indent.git/tree/doc/indent.texi?id\u003da74c6b4ee49397cf330b333da1042bffa60ed14f#n1788" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/BSD-Advertising-Acknowledgement.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/BSD-Advertising-Acknowledgement.json", + "referenceNumber": 297, + "name": "BSD Advertising Acknowledgement License", + "licenseId": "BSD-Advertising-Acknowledgement", + "seeAlso": [ + "https://github.com/python-excel/xlrd/blob/master/LICENSE#L33" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/BSD-Attribution-HPND-disclaimer.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/BSD-Attribution-HPND-disclaimer.json", + "referenceNumber": 86, + "name": "BSD with Attribution and HPND disclaimer", + "licenseId": "BSD-Attribution-HPND-disclaimer", + "seeAlso": [ + "https://github.com/cyrusimap/cyrus-sasl/blob/master/COPYING" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/BSD-Inferno-Nettverk.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/BSD-Inferno-Nettverk.json", + "referenceNumber": 89, + "name": "BSD-Inferno-Nettverk", + "licenseId": "BSD-Inferno-Nettverk", + "seeAlso": [ + "https://www.inet.no/dante/LICENSE" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/BSD-Protection.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/BSD-Protection.json", + "referenceNumber": 394, + "name": "BSD Protection License", + "licenseId": "BSD-Protection", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing/BSD_Protection_License" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/BSD-Source-beginning-file.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/BSD-Source-beginning-file.json", + "referenceNumber": 378, + "name": "BSD Source Code Attribution - beginning of file variant", + "licenseId": "BSD-Source-beginning-file", + "seeAlso": [ + "https://github.com/lattera/freebsd/blob/master/sys/cam/cam.c#L4" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/BSD-Source-Code.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/BSD-Source-Code.json", + "referenceNumber": 605, + "name": "BSD Source Code Attribution", + "licenseId": "BSD-Source-Code", + "seeAlso": [ + "https://github.com/robbiehanson/CocoaHTTPServer/blob/master/LICENSE.txt" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/BSD-Systemics.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/BSD-Systemics.json", + "referenceNumber": 327, + "name": "Systemics BSD variant license", + "licenseId": "BSD-Systemics", + "seeAlso": [ + "https://metacpan.org/release/DPARIS/Crypt-DES-2.07/source/COPYRIGHT" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/BSD-Systemics-W3Works.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/BSD-Systemics-W3Works.json", + "referenceNumber": 427, + "name": "Systemics W3Works BSD variant license", + "licenseId": "BSD-Systemics-W3Works", + "seeAlso": [ + "https://metacpan.org/release/DPARIS/Crypt-Blowfish-2.14/source/COPYRIGHT#L7" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/BSL-1.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/BSL-1.0.json", + "referenceNumber": 334, + "name": "Boost Software License 1.0", + "licenseId": "BSL-1.0", + "seeAlso": [ + "http://www.boost.org/LICENSE_1_0.txt", + "https://opensource.org/licenses/BSL-1.0" + ], + "isOsiApproved": true, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/BUSL-1.1.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/BUSL-1.1.json", + "referenceNumber": 285, + "name": "Business Source License 1.1", + "licenseId": "BUSL-1.1", + "seeAlso": [ + "https://mariadb.com/bsl11/" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/bzip2-1.0.5.html", + "isDeprecatedLicenseId": true, + "detailsUrl": "https://spdx.org/licenses/bzip2-1.0.5.json", + "referenceNumber": 574, + "name": "bzip2 and libbzip2 License v1.0.5", + "licenseId": "bzip2-1.0.5", + "seeAlso": [ + "https://sourceware.org/bzip2/1.0.5/bzip2-manual-1.0.5.html", + "http://bzip.org/1.0.5/bzip2-manual-1.0.5.html" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/bzip2-1.0.6.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/bzip2-1.0.6.json", + "referenceNumber": 534, + "name": "bzip2 and libbzip2 License v1.0.6", + "licenseId": "bzip2-1.0.6", + "seeAlso": [ + "https://sourceware.org/git/?p\u003dbzip2.git;a\u003dblob;f\u003dLICENSE;hb\u003dbzip2-1.0.6", + "http://bzip.org/1.0.5/bzip2-manual-1.0.5.html", + "https://sourceware.org/cgit/valgrind/tree/mpi/libmpiwrap.c" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/C-UDA-1.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/C-UDA-1.0.json", + "referenceNumber": 162, + "name": "Computational Use of Data Agreement v1.0", + "licenseId": "C-UDA-1.0", + "seeAlso": [ + "https://github.com/microsoft/Computational-Use-of-Data-Agreement/blob/master/C-UDA-1.0.md", + "https://cdla.dev/computational-use-of-data-agreement-v1-0/" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/CAL-1.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CAL-1.0.json", + "referenceNumber": 99, + "name": "Cryptographic Autonomy License 1.0", + "licenseId": "CAL-1.0", + "seeAlso": [ + "http://cryptographicautonomylicense.com/license-text.html", + "https://opensource.org/licenses/CAL-1.0" + ], + "isOsiApproved": true + }, + { + "reference": "https://spdx.org/licenses/CAL-1.0-Combined-Work-Exception.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CAL-1.0-Combined-Work-Exception.json", + "referenceNumber": 333, + "name": "Cryptographic Autonomy License 1.0 (Combined Work Exception)", + "licenseId": "CAL-1.0-Combined-Work-Exception", + "seeAlso": [ + "http://cryptographicautonomylicense.com/license-text.html", + "https://opensource.org/licenses/CAL-1.0" + ], + "isOsiApproved": true + }, + { + "reference": "https://spdx.org/licenses/Caldera.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Caldera.json", + "referenceNumber": 528, + "name": "Caldera License", + "licenseId": "Caldera", + "seeAlso": [ + "http://www.lemis.com/grog/UNIX/ancient-source-all.pdf" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Caldera-no-preamble.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Caldera-no-preamble.json", + "referenceNumber": 233, + "name": "Caldera License (without preamble)", + "licenseId": "Caldera-no-preamble", + "seeAlso": [ + "https://github.com/apache/apr/blob/trunk/LICENSE#L298C6-L298C29" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Catharon.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Catharon.json", + "referenceNumber": 337, + "name": "Catharon License", + "licenseId": "Catharon", + "seeAlso": [ + "https://github.com/scummvm/scummvm/blob/v2.8.0/LICENSES/CatharonLicense.txt" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/CATOSL-1.1.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CATOSL-1.1.json", + "referenceNumber": 134, + "name": "Computer Associates Trusted Open Source License 1.1", + "licenseId": "CATOSL-1.1", + "seeAlso": [ + "https://opensource.org/licenses/CATOSL-1.1" + ], + "isOsiApproved": true + }, + { + "reference": "https://spdx.org/licenses/CC-BY-1.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CC-BY-1.0.json", + "referenceNumber": 415, + "name": "Creative Commons Attribution 1.0 Generic", + "licenseId": "CC-BY-1.0", + "seeAlso": [ + "https://creativecommons.org/licenses/by/1.0/legalcode" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/CC-BY-2.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CC-BY-2.0.json", + "referenceNumber": 428, + "name": "Creative Commons Attribution 2.0 Generic", + "licenseId": "CC-BY-2.0", + "seeAlso": [ + "https://creativecommons.org/licenses/by/2.0/legalcode" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/CC-BY-2.5.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CC-BY-2.5.json", + "referenceNumber": 573, + "name": "Creative Commons Attribution 2.5 Generic", + "licenseId": "CC-BY-2.5", + "seeAlso": [ + "https://creativecommons.org/licenses/by/2.5/legalcode" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/CC-BY-2.5-AU.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CC-BY-2.5-AU.json", + "referenceNumber": 388, + "name": "Creative Commons Attribution 2.5 Australia", + "licenseId": "CC-BY-2.5-AU", + "seeAlso": [ + "https://creativecommons.org/licenses/by/2.5/au/legalcode" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/CC-BY-3.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CC-BY-3.0.json", + "referenceNumber": 132, + "name": "Creative Commons Attribution 3.0 Unported", + "licenseId": "CC-BY-3.0", + "seeAlso": [ + "https://creativecommons.org/licenses/by/3.0/legalcode" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/CC-BY-3.0-AT.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CC-BY-3.0-AT.json", + "referenceNumber": 25, + "name": "Creative Commons Attribution 3.0 Austria", + "licenseId": "CC-BY-3.0-AT", + "seeAlso": [ + "https://creativecommons.org/licenses/by/3.0/at/legalcode" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/CC-BY-3.0-AU.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CC-BY-3.0-AU.json", + "referenceNumber": 392, + "name": "Creative Commons Attribution 3.0 Australia", + "licenseId": "CC-BY-3.0-AU", + "seeAlso": [ + "https://creativecommons.org/licenses/by/3.0/au/legalcode" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/CC-BY-3.0-DE.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CC-BY-3.0-DE.json", + "referenceNumber": 21, + "name": "Creative Commons Attribution 3.0 Germany", + "licenseId": "CC-BY-3.0-DE", + "seeAlso": [ + "https://creativecommons.org/licenses/by/3.0/de/legalcode" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/CC-BY-3.0-IGO.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CC-BY-3.0-IGO.json", + "referenceNumber": 596, + "name": "Creative Commons Attribution 3.0 IGO", + "licenseId": "CC-BY-3.0-IGO", + "seeAlso": [ + "https://creativecommons.org/licenses/by/3.0/igo/legalcode" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/CC-BY-3.0-NL.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CC-BY-3.0-NL.json", + "referenceNumber": 157, + "name": "Creative Commons Attribution 3.0 Netherlands", + "licenseId": "CC-BY-3.0-NL", + "seeAlso": [ + "https://creativecommons.org/licenses/by/3.0/nl/legalcode" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/CC-BY-3.0-US.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CC-BY-3.0-US.json", + "referenceNumber": 395, + "name": "Creative Commons Attribution 3.0 United States", + "licenseId": "CC-BY-3.0-US", + "seeAlso": [ + "https://creativecommons.org/licenses/by/3.0/us/legalcode" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/CC-BY-4.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CC-BY-4.0.json", + "referenceNumber": 435, + "name": "Creative Commons Attribution 4.0 International", + "licenseId": "CC-BY-4.0", + "seeAlso": [ + "https://creativecommons.org/licenses/by/4.0/legalcode" + ], + "isOsiApproved": false, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/CC-BY-NC-1.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CC-BY-NC-1.0.json", + "referenceNumber": 641, + "name": "Creative Commons Attribution Non Commercial 1.0 Generic", + "licenseId": "CC-BY-NC-1.0", + "seeAlso": [ + "https://creativecommons.org/licenses/by-nc/1.0/legalcode" + ], + "isOsiApproved": false, + "isFsfLibre": false + }, + { + "reference": "https://spdx.org/licenses/CC-BY-NC-2.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CC-BY-NC-2.0.json", + "referenceNumber": 91, + "name": "Creative Commons Attribution Non Commercial 2.0 Generic", + "licenseId": "CC-BY-NC-2.0", + "seeAlso": [ + "https://creativecommons.org/licenses/by-nc/2.0/legalcode" + ], + "isOsiApproved": false, + "isFsfLibre": false + }, + { + "reference": "https://spdx.org/licenses/CC-BY-NC-2.5.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CC-BY-NC-2.5.json", + "referenceNumber": 465, + "name": "Creative Commons Attribution Non Commercial 2.5 Generic", + "licenseId": "CC-BY-NC-2.5", + "seeAlso": [ + "https://creativecommons.org/licenses/by-nc/2.5/legalcode" + ], + "isOsiApproved": false, + "isFsfLibre": false + }, + { + "reference": "https://spdx.org/licenses/CC-BY-NC-3.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CC-BY-NC-3.0.json", + "referenceNumber": 234, + "name": "Creative Commons Attribution Non Commercial 3.0 Unported", + "licenseId": "CC-BY-NC-3.0", + "seeAlso": [ + "https://creativecommons.org/licenses/by-nc/3.0/legalcode" + ], + "isOsiApproved": false, + "isFsfLibre": false + }, + { + "reference": "https://spdx.org/licenses/CC-BY-NC-3.0-DE.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CC-BY-NC-3.0-DE.json", + "referenceNumber": 354, + "name": "Creative Commons Attribution Non Commercial 3.0 Germany", + "licenseId": "CC-BY-NC-3.0-DE", + "seeAlso": [ + "https://creativecommons.org/licenses/by-nc/3.0/de/legalcode" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/CC-BY-NC-4.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CC-BY-NC-4.0.json", + "referenceNumber": 53, + "name": "Creative Commons Attribution Non Commercial 4.0 International", + "licenseId": "CC-BY-NC-4.0", + "seeAlso": [ + "https://creativecommons.org/licenses/by-nc/4.0/legalcode" + ], + "isOsiApproved": false, + "isFsfLibre": false + }, + { + "reference": "https://spdx.org/licenses/CC-BY-NC-ND-1.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CC-BY-NC-ND-1.0.json", + "referenceNumber": 88, + "name": "Creative Commons Attribution Non Commercial No Derivatives 1.0 Generic", + "licenseId": "CC-BY-NC-ND-1.0", + "seeAlso": [ + "https://creativecommons.org/licenses/by-nd-nc/1.0/legalcode" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/CC-BY-NC-ND-2.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CC-BY-NC-ND-2.0.json", + "referenceNumber": 426, + "name": "Creative Commons Attribution Non Commercial No Derivatives 2.0 Generic", + "licenseId": "CC-BY-NC-ND-2.0", + "seeAlso": [ + "https://creativecommons.org/licenses/by-nc-nd/2.0/legalcode" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/CC-BY-NC-ND-2.5.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CC-BY-NC-ND-2.5.json", + "referenceNumber": 441, + "name": "Creative Commons Attribution Non Commercial No Derivatives 2.5 Generic", + "licenseId": "CC-BY-NC-ND-2.5", + "seeAlso": [ + "https://creativecommons.org/licenses/by-nc-nd/2.5/legalcode" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/CC-BY-NC-ND-3.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CC-BY-NC-ND-3.0.json", + "referenceNumber": 304, + "name": "Creative Commons Attribution Non Commercial No Derivatives 3.0 Unported", + "licenseId": "CC-BY-NC-ND-3.0", + "seeAlso": [ + "https://creativecommons.org/licenses/by-nc-nd/3.0/legalcode" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/CC-BY-NC-ND-3.0-DE.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CC-BY-NC-ND-3.0-DE.json", + "referenceNumber": 121, + "name": "Creative Commons Attribution Non Commercial No Derivatives 3.0 Germany", + "licenseId": "CC-BY-NC-ND-3.0-DE", + "seeAlso": [ + "https://creativecommons.org/licenses/by-nc-nd/3.0/de/legalcode" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/CC-BY-NC-ND-3.0-IGO.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CC-BY-NC-ND-3.0-IGO.json", + "referenceNumber": 171, + "name": "Creative Commons Attribution Non Commercial No Derivatives 3.0 IGO", + "licenseId": "CC-BY-NC-ND-3.0-IGO", + "seeAlso": [ + "https://creativecommons.org/licenses/by-nc-nd/3.0/igo/legalcode" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/CC-BY-NC-ND-4.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CC-BY-NC-ND-4.0.json", + "referenceNumber": 183, + "name": "Creative Commons Attribution Non Commercial No Derivatives 4.0 International", + "licenseId": "CC-BY-NC-ND-4.0", + "seeAlso": [ + "https://creativecommons.org/licenses/by-nc-nd/4.0/legalcode" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/CC-BY-NC-SA-1.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CC-BY-NC-SA-1.0.json", + "referenceNumber": 501, + "name": "Creative Commons Attribution Non Commercial Share Alike 1.0 Generic", + "licenseId": "CC-BY-NC-SA-1.0", + "seeAlso": [ + "https://creativecommons.org/licenses/by-nc-sa/1.0/legalcode" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/CC-BY-NC-SA-2.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CC-BY-NC-SA-2.0.json", + "referenceNumber": 358, + "name": "Creative Commons Attribution Non Commercial Share Alike 2.0 Generic", + "licenseId": "CC-BY-NC-SA-2.0", + "seeAlso": [ + "https://creativecommons.org/licenses/by-nc-sa/2.0/legalcode" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/CC-BY-NC-SA-2.0-DE.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CC-BY-NC-SA-2.0-DE.json", + "referenceNumber": 260, + "name": "Creative Commons Attribution Non Commercial Share Alike 2.0 Germany", + "licenseId": "CC-BY-NC-SA-2.0-DE", + "seeAlso": [ + "https://creativecommons.org/licenses/by-nc-sa/2.0/de/legalcode" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/CC-BY-NC-SA-2.0-FR.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CC-BY-NC-SA-2.0-FR.json", + "referenceNumber": 158, + "name": "Creative Commons Attribution-NonCommercial-ShareAlike 2.0 France", + "licenseId": "CC-BY-NC-SA-2.0-FR", + "seeAlso": [ + "https://creativecommons.org/licenses/by-nc-sa/2.0/fr/legalcode" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/CC-BY-NC-SA-2.0-UK.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CC-BY-NC-SA-2.0-UK.json", + "referenceNumber": 33, + "name": "Creative Commons Attribution Non Commercial Share Alike 2.0 England and Wales", + "licenseId": "CC-BY-NC-SA-2.0-UK", + "seeAlso": [ + "https://creativecommons.org/licenses/by-nc-sa/2.0/uk/legalcode" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/CC-BY-NC-SA-2.5.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CC-BY-NC-SA-2.5.json", + "referenceNumber": 222, + "name": "Creative Commons Attribution Non Commercial Share Alike 2.5 Generic", + "licenseId": "CC-BY-NC-SA-2.5", + "seeAlso": [ + "https://creativecommons.org/licenses/by-nc-sa/2.5/legalcode" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/CC-BY-NC-SA-3.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CC-BY-NC-SA-3.0.json", + "referenceNumber": 255, + "name": "Creative Commons Attribution Non Commercial Share Alike 3.0 Unported", + "licenseId": "CC-BY-NC-SA-3.0", + "seeAlso": [ + "https://creativecommons.org/licenses/by-nc-sa/3.0/legalcode" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/CC-BY-NC-SA-3.0-DE.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CC-BY-NC-SA-3.0-DE.json", + "referenceNumber": 525, + "name": "Creative Commons Attribution Non Commercial Share Alike 3.0 Germany", + "licenseId": "CC-BY-NC-SA-3.0-DE", + "seeAlso": [ + "https://creativecommons.org/licenses/by-nc-sa/3.0/de/legalcode" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/CC-BY-NC-SA-3.0-IGO.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CC-BY-NC-SA-3.0-IGO.json", + "referenceNumber": 244, + "name": "Creative Commons Attribution Non Commercial Share Alike 3.0 IGO", + "licenseId": "CC-BY-NC-SA-3.0-IGO", + "seeAlso": [ + "https://creativecommons.org/licenses/by-nc-sa/3.0/igo/legalcode" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/CC-BY-NC-SA-4.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CC-BY-NC-SA-4.0.json", + "referenceNumber": 513, + "name": "Creative Commons Attribution Non Commercial Share Alike 4.0 International", + "licenseId": "CC-BY-NC-SA-4.0", + "seeAlso": [ + "https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/CC-BY-ND-1.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CC-BY-ND-1.0.json", + "referenceNumber": 474, + "name": "Creative Commons Attribution No Derivatives 1.0 Generic", + "licenseId": "CC-BY-ND-1.0", + "seeAlso": [ + "https://creativecommons.org/licenses/by-nd/1.0/legalcode" + ], + "isOsiApproved": false, + "isFsfLibre": false + }, + { + "reference": "https://spdx.org/licenses/CC-BY-ND-2.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CC-BY-ND-2.0.json", + "referenceNumber": 356, + "name": "Creative Commons Attribution No Derivatives 2.0 Generic", + "licenseId": "CC-BY-ND-2.0", + "seeAlso": [ + "https://creativecommons.org/licenses/by-nd/2.0/legalcode" + ], + "isOsiApproved": false, + "isFsfLibre": false + }, + { + "reference": "https://spdx.org/licenses/CC-BY-ND-2.5.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CC-BY-ND-2.5.json", + "referenceNumber": 259, + "name": "Creative Commons Attribution No Derivatives 2.5 Generic", + "licenseId": "CC-BY-ND-2.5", + "seeAlso": [ + "https://creativecommons.org/licenses/by-nd/2.5/legalcode" + ], + "isOsiApproved": false, + "isFsfLibre": false + }, + { + "reference": "https://spdx.org/licenses/CC-BY-ND-3.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CC-BY-ND-3.0.json", + "referenceNumber": 527, + "name": "Creative Commons Attribution No Derivatives 3.0 Unported", + "licenseId": "CC-BY-ND-3.0", + "seeAlso": [ + "https://creativecommons.org/licenses/by-nd/3.0/legalcode" + ], + "isOsiApproved": false, + "isFsfLibre": false + }, + { + "reference": "https://spdx.org/licenses/CC-BY-ND-3.0-DE.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CC-BY-ND-3.0-DE.json", + "referenceNumber": 214, + "name": "Creative Commons Attribution No Derivatives 3.0 Germany", + "licenseId": "CC-BY-ND-3.0-DE", + "seeAlso": [ + "https://creativecommons.org/licenses/by-nd/3.0/de/legalcode" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/CC-BY-ND-4.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CC-BY-ND-4.0.json", + "referenceNumber": 481, + "name": "Creative Commons Attribution No Derivatives 4.0 International", + "licenseId": "CC-BY-ND-4.0", + "seeAlso": [ + "https://creativecommons.org/licenses/by-nd/4.0/legalcode" + ], + "isOsiApproved": false, + "isFsfLibre": false + }, + { + "reference": "https://spdx.org/licenses/CC-BY-SA-1.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CC-BY-SA-1.0.json", + "referenceNumber": 588, + "name": "Creative Commons Attribution Share Alike 1.0 Generic", + "licenseId": "CC-BY-SA-1.0", + "seeAlso": [ + "https://creativecommons.org/licenses/by-sa/1.0/legalcode" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/CC-BY-SA-2.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CC-BY-SA-2.0.json", + "referenceNumber": 180, + "name": "Creative Commons Attribution Share Alike 2.0 Generic", + "licenseId": "CC-BY-SA-2.0", + "seeAlso": [ + "https://creativecommons.org/licenses/by-sa/2.0/legalcode" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/CC-BY-SA-2.0-UK.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CC-BY-SA-2.0-UK.json", + "referenceNumber": 385, + "name": "Creative Commons Attribution Share Alike 2.0 England and Wales", + "licenseId": "CC-BY-SA-2.0-UK", + "seeAlso": [ + "https://creativecommons.org/licenses/by-sa/2.0/uk/legalcode" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/CC-BY-SA-2.1-JP.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CC-BY-SA-2.1-JP.json", + "referenceNumber": 17, + "name": "Creative Commons Attribution Share Alike 2.1 Japan", + "licenseId": "CC-BY-SA-2.1-JP", + "seeAlso": [ + "https://creativecommons.org/licenses/by-sa/2.1/jp/legalcode" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/CC-BY-SA-2.5.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CC-BY-SA-2.5.json", + "referenceNumber": 607, + "name": "Creative Commons Attribution Share Alike 2.5 Generic", + "licenseId": "CC-BY-SA-2.5", + "seeAlso": [ + "https://creativecommons.org/licenses/by-sa/2.5/legalcode" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/CC-BY-SA-3.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CC-BY-SA-3.0.json", + "referenceNumber": 26, + "name": "Creative Commons Attribution Share Alike 3.0 Unported", + "licenseId": "CC-BY-SA-3.0", + "seeAlso": [ + "https://creativecommons.org/licenses/by-sa/3.0/legalcode" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/CC-BY-SA-3.0-AT.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CC-BY-SA-3.0-AT.json", + "referenceNumber": 398, + "name": "Creative Commons Attribution Share Alike 3.0 Austria", + "licenseId": "CC-BY-SA-3.0-AT", + "seeAlso": [ + "https://creativecommons.org/licenses/by-sa/3.0/at/legalcode" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/CC-BY-SA-3.0-DE.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CC-BY-SA-3.0-DE.json", + "referenceNumber": 120, + "name": "Creative Commons Attribution Share Alike 3.0 Germany", + "licenseId": "CC-BY-SA-3.0-DE", + "seeAlso": [ + "https://creativecommons.org/licenses/by-sa/3.0/de/legalcode" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/CC-BY-SA-3.0-IGO.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CC-BY-SA-3.0-IGO.json", + "referenceNumber": 519, + "name": "Creative Commons Attribution-ShareAlike 3.0 IGO", + "licenseId": "CC-BY-SA-3.0-IGO", + "seeAlso": [ + "https://creativecommons.org/licenses/by-sa/3.0/igo/legalcode" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/CC-BY-SA-4.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CC-BY-SA-4.0.json", + "referenceNumber": 13, + "name": "Creative Commons Attribution Share Alike 4.0 International", + "licenseId": "CC-BY-SA-4.0", + "seeAlso": [ + "https://creativecommons.org/licenses/by-sa/4.0/legalcode" + ], + "isOsiApproved": false, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/CC-PDDC.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CC-PDDC.json", + "referenceNumber": 169, + "name": "Creative Commons Public Domain Dedication and Certification", + "licenseId": "CC-PDDC", + "seeAlso": [ + "https://creativecommons.org/licenses/publicdomain/" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/CC0-1.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CC0-1.0.json", + "referenceNumber": 491, + "name": "Creative Commons Zero v1.0 Universal", + "licenseId": "CC0-1.0", + "seeAlso": [ + "https://creativecommons.org/publicdomain/zero/1.0/legalcode" + ], + "isOsiApproved": false, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/CDDL-1.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CDDL-1.0.json", + "referenceNumber": 185, + "name": "Common Development and Distribution License 1.0", + "licenseId": "CDDL-1.0", + "seeAlso": [ + "https://opensource.org/licenses/cddl1" + ], + "isOsiApproved": true, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/CDDL-1.1.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CDDL-1.1.json", + "referenceNumber": 476, + "name": "Common Development and Distribution License 1.1", + "licenseId": "CDDL-1.1", + "seeAlso": [ + "http://glassfish.java.net/public/CDDL+GPL_1_1.html", + "https://javaee.github.io/glassfish/LICENSE" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/CDL-1.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CDL-1.0.json", + "referenceNumber": 305, + "name": "Common Documentation License 1.0", + "licenseId": "CDL-1.0", + "seeAlso": [ + "http://www.opensource.apple.com/cdl/", + "https://fedoraproject.org/wiki/Licensing/Common_Documentation_License", + "https://www.gnu.org/licenses/license-list.html#ACDL" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/CDLA-Permissive-1.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CDLA-Permissive-1.0.json", + "referenceNumber": 386, + "name": "Community Data License Agreement Permissive 1.0", + "licenseId": "CDLA-Permissive-1.0", + "seeAlso": [ + "https://cdla.io/permissive-1-0" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/CDLA-Permissive-2.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CDLA-Permissive-2.0.json", + "referenceNumber": 590, + "name": "Community Data License Agreement Permissive 2.0", + "licenseId": "CDLA-Permissive-2.0", + "seeAlso": [ + "https://cdla.dev/permissive-2-0" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/CDLA-Sharing-1.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CDLA-Sharing-1.0.json", + "referenceNumber": 190, + "name": "Community Data License Agreement Sharing 1.0", + "licenseId": "CDLA-Sharing-1.0", + "seeAlso": [ + "https://cdla.io/sharing-1-0" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/CECILL-1.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CECILL-1.0.json", + "referenceNumber": 625, + "name": "CeCILL Free Software License Agreement v1.0", + "licenseId": "CECILL-1.0", + "seeAlso": [ + "http://www.cecill.info/licences/Licence_CeCILL_V1-fr.html" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/CECILL-1.1.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CECILL-1.1.json", + "referenceNumber": 326, + "name": "CeCILL Free Software License Agreement v1.1", + "licenseId": "CECILL-1.1", + "seeAlso": [ + "http://www.cecill.info/licences/Licence_CeCILL_V1.1-US.html" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/CECILL-2.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CECILL-2.0.json", + "referenceNumber": 463, + "name": "CeCILL Free Software License Agreement v2.0", + "licenseId": "CECILL-2.0", + "seeAlso": [ + "http://www.cecill.info/licences/Licence_CeCILL_V2-en.html" + ], + "isOsiApproved": false, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/CECILL-2.1.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CECILL-2.1.json", + "referenceNumber": 170, + "name": "CeCILL Free Software License Agreement v2.1", + "licenseId": "CECILL-2.1", + "seeAlso": [ + "http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.html" + ], + "isOsiApproved": true + }, + { + "reference": "https://spdx.org/licenses/CECILL-B.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CECILL-B.json", + "referenceNumber": 196, + "name": "CeCILL-B Free Software License Agreement", + "licenseId": "CECILL-B", + "seeAlso": [ + "http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html" + ], + "isOsiApproved": false, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/CECILL-C.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CECILL-C.json", + "referenceNumber": 178, + "name": "CeCILL-C Free Software License Agreement", + "licenseId": "CECILL-C", + "seeAlso": [ + "http://www.cecill.info/licences/Licence_CeCILL-C_V1-en.html" + ], + "isOsiApproved": false, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/CERN-OHL-1.1.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CERN-OHL-1.1.json", + "referenceNumber": 148, + "name": "CERN Open Hardware Licence v1.1", + "licenseId": "CERN-OHL-1.1", + "seeAlso": [ + "https://www.ohwr.org/project/licenses/wikis/cern-ohl-v1.1" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/CERN-OHL-1.2.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CERN-OHL-1.2.json", + "referenceNumber": 651, + "name": "CERN Open Hardware Licence v1.2", + "licenseId": "CERN-OHL-1.2", + "seeAlso": [ + "https://www.ohwr.org/project/licenses/wikis/cern-ohl-v1.2" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/CERN-OHL-P-2.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CERN-OHL-P-2.0.json", + "referenceNumber": 543, + "name": "CERN Open Hardware Licence Version 2 - Permissive", + "licenseId": "CERN-OHL-P-2.0", + "seeAlso": [ + "https://www.ohwr.org/project/cernohl/wikis/Documents/CERN-OHL-version-2" + ], + "isOsiApproved": true + }, + { + "reference": "https://spdx.org/licenses/CERN-OHL-S-2.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CERN-OHL-S-2.0.json", + "referenceNumber": 396, + "name": "CERN Open Hardware Licence Version 2 - Strongly Reciprocal", + "licenseId": "CERN-OHL-S-2.0", + "seeAlso": [ + "https://www.ohwr.org/project/cernohl/wikis/Documents/CERN-OHL-version-2" + ], + "isOsiApproved": true + }, + { + "reference": "https://spdx.org/licenses/CERN-OHL-W-2.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CERN-OHL-W-2.0.json", + "referenceNumber": 614, + "name": "CERN Open Hardware Licence Version 2 - Weakly Reciprocal", + "licenseId": "CERN-OHL-W-2.0", + "seeAlso": [ + "https://www.ohwr.org/project/cernohl/wikis/Documents/CERN-OHL-version-2" + ], + "isOsiApproved": true + }, + { + "reference": "https://spdx.org/licenses/CFITSIO.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CFITSIO.json", + "referenceNumber": 568, + "name": "CFITSIO License", + "licenseId": "CFITSIO", + "seeAlso": [ + "https://heasarc.gsfc.nasa.gov/docs/software/fitsio/c/f_user/node9.html", + "https://heasarc.gsfc.nasa.gov/docs/software/ftools/fv/doc/license.html" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/check-cvs.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/check-cvs.json", + "referenceNumber": 324, + "name": "check-cvs License", + "licenseId": "check-cvs", + "seeAlso": [ + "http://cvs.savannah.gnu.org/viewvc/cvs/ccvs/contrib/check_cvs.in?revision\u003d1.1.4.3\u0026view\u003dmarkup\u0026pathrev\u003dcvs1-11-23#l2" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/checkmk.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/checkmk.json", + "referenceNumber": 464, + "name": "Checkmk License", + "licenseId": "checkmk", + "seeAlso": [ + "https://github.com/libcheck/check/blob/master/checkmk/checkmk.in" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/ClArtistic.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/ClArtistic.json", + "referenceNumber": 230, + "name": "Clarified Artistic License", + "licenseId": "ClArtistic", + "seeAlso": [ + "http://gianluca.dellavedova.org/2011/01/03/clarified-artistic-license/", + "http://www.ncftp.com/ncftp/doc/LICENSE.txt" + ], + "isOsiApproved": false, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/Clips.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Clips.json", + "referenceNumber": 424, + "name": "Clips License", + "licenseId": "Clips", + "seeAlso": [ + "https://github.com/DrItanium/maya/blob/master/LICENSE.CLIPS" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/CMU-Mach.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CMU-Mach.json", + "referenceNumber": 73, + "name": "CMU Mach License", + "licenseId": "CMU-Mach", + "seeAlso": [ + "https://www.cs.cmu.edu/~410/licenses.html" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/CMU-Mach-nodoc.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CMU-Mach-nodoc.json", + "referenceNumber": 8, + "name": "CMU Mach - no notices-in-documentation variant", + "licenseId": "CMU-Mach-nodoc", + "seeAlso": [ + "https://github.com/krb5/krb5/blob/krb5-1.21.2-final/NOTICE#L718-L728", + "https://web.mit.edu/kerberos/krb5-1.21/doc/mitK5license.html" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/CNRI-Jython.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CNRI-Jython.json", + "referenceNumber": 293, + "name": "CNRI Jython License", + "licenseId": "CNRI-Jython", + "seeAlso": [ + "http://www.jython.org/license.html" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/CNRI-Python.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CNRI-Python.json", + "referenceNumber": 402, + "name": "CNRI Python License", + "licenseId": "CNRI-Python", + "seeAlso": [ + "https://opensource.org/licenses/CNRI-Python" + ], + "isOsiApproved": true + }, + { + "reference": "https://spdx.org/licenses/CNRI-Python-GPL-Compatible.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CNRI-Python-GPL-Compatible.json", + "referenceNumber": 224, + "name": "CNRI Python Open Source GPL Compatible License Agreement", + "licenseId": "CNRI-Python-GPL-Compatible", + "seeAlso": [ + "http://www.python.org/download/releases/1.6.1/download_win/" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/COIL-1.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/COIL-1.0.json", + "referenceNumber": 345, + "name": "Copyfree Open Innovation License", + "licenseId": "COIL-1.0", + "seeAlso": [ + "https://coil.apotheon.org/plaintext/01.0.txt" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Community-Spec-1.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Community-Spec-1.0.json", + "referenceNumber": 56, + "name": "Community Specification License 1.0", + "licenseId": "Community-Spec-1.0", + "seeAlso": [ + "https://github.com/CommunitySpecification/1.0/blob/master/1._Community_Specification_License-v1.md" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Condor-1.1.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Condor-1.1.json", + "referenceNumber": 77, + "name": "Condor Public License v1.1", + "licenseId": "Condor-1.1", + "seeAlso": [ + "http://research.cs.wisc.edu/condor/license.html#condor", + "http://web.archive.org/web/20111123062036/http://research.cs.wisc.edu/condor/license.html#condor" + ], + "isOsiApproved": false, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/copyleft-next-0.3.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/copyleft-next-0.3.0.json", + "referenceNumber": 322, + "name": "copyleft-next 0.3.0", + "licenseId": "copyleft-next-0.3.0", + "seeAlso": [ + "https://github.com/copyleft-next/copyleft-next/blob/master/Releases/copyleft-next-0.3.0" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/copyleft-next-0.3.1.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/copyleft-next-0.3.1.json", + "referenceNumber": 403, + "name": "copyleft-next 0.3.1", + "licenseId": "copyleft-next-0.3.1", + "seeAlso": [ + "https://github.com/copyleft-next/copyleft-next/blob/master/Releases/copyleft-next-0.3.1" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Cornell-Lossless-JPEG.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Cornell-Lossless-JPEG.json", + "referenceNumber": 98, + "name": "Cornell Lossless JPEG License", + "licenseId": "Cornell-Lossless-JPEG", + "seeAlso": [ + "https://android.googlesource.com/platform/external/dng_sdk/+/refs/heads/master/source/dng_lossless_jpeg.cpp#16", + "https://www.mssl.ucl.ac.uk/~mcrw/src/20050920/proto.h", + "https://gitlab.freedesktop.org/libopenraw/libopenraw/blob/master/lib/ljpegdecompressor.cpp#L32" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/CPAL-1.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CPAL-1.0.json", + "referenceNumber": 548, + "name": "Common Public Attribution License 1.0", + "licenseId": "CPAL-1.0", + "seeAlso": [ + "https://opensource.org/licenses/CPAL-1.0" + ], + "isOsiApproved": true, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/CPL-1.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CPL-1.0.json", + "referenceNumber": 114, + "name": "Common Public License 1.0", + "licenseId": "CPL-1.0", + "seeAlso": [ + "https://opensource.org/licenses/CPL-1.0" + ], + "isOsiApproved": true, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/CPOL-1.02.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CPOL-1.02.json", + "referenceNumber": 6, + "name": "Code Project Open License 1.02", + "licenseId": "CPOL-1.02", + "seeAlso": [ + "http://www.codeproject.com/info/cpol10.aspx" + ], + "isOsiApproved": false, + "isFsfLibre": false + }, + { + "reference": "https://spdx.org/licenses/Cronyx.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Cronyx.json", + "referenceNumber": 649, + "name": "Cronyx License", + "licenseId": "Cronyx", + "seeAlso": [ + "https://gitlab.freedesktop.org/xorg/font/alias/-/blob/master/COPYING", + "https://gitlab.freedesktop.org/xorg/font/cronyx-cyrillic/-/blob/master/COPYING", + "https://gitlab.freedesktop.org/xorg/font/misc-cyrillic/-/blob/master/COPYING", + "https://gitlab.freedesktop.org/xorg/font/screen-cyrillic/-/blob/master/COPYING" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Crossword.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Crossword.json", + "referenceNumber": 593, + "name": "Crossword License", + "licenseId": "Crossword", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing/Crossword" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/CrystalStacker.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CrystalStacker.json", + "referenceNumber": 241, + "name": "CrystalStacker License", + "licenseId": "CrystalStacker", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing:CrystalStacker?rd\u003dLicensing/CrystalStacker" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/CUA-OPL-1.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CUA-OPL-1.0.json", + "referenceNumber": 409, + "name": "CUA Office Public License v1.0", + "licenseId": "CUA-OPL-1.0", + "seeAlso": [ + "https://opensource.org/licenses/CUA-OPL-1.0" + ], + "isOsiApproved": true + }, + { + "reference": "https://spdx.org/licenses/Cube.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Cube.json", + "referenceNumber": 141, + "name": "Cube License", + "licenseId": "Cube", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing/Cube" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/curl.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/curl.json", + "referenceNumber": 602, + "name": "curl License", + "licenseId": "curl", + "seeAlso": [ + "https://github.com/bagder/curl/blob/master/COPYING" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/cve-tou.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/cve-tou.json", + "referenceNumber": 656, + "name": "Common Vulnerability Enumeration ToU License", + "licenseId": "cve-tou", + "seeAlso": [ + "https://www.cve.org/Legal/TermsOfUse" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/D-FSL-1.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/D-FSL-1.0.json", + "referenceNumber": 116, + "name": "Deutsche Freie Software Lizenz", + "licenseId": "D-FSL-1.0", + "seeAlso": [ + "http://www.dipp.nrw.de/d-fsl/lizenzen/", + "http://www.dipp.nrw.de/d-fsl/index_html/lizenzen/de/D-FSL-1_0_de.txt", + "http://www.dipp.nrw.de/d-fsl/index_html/lizenzen/en/D-FSL-1_0_en.txt", + "https://www.hbz-nrw.de/produkte/open-access/lizenzen/dfsl", + "https://www.hbz-nrw.de/produkte/open-access/lizenzen/dfsl/deutsche-freie-software-lizenz", + "https://www.hbz-nrw.de/produkte/open-access/lizenzen/dfsl/german-free-software-license", + "https://www.hbz-nrw.de/produkte/open-access/lizenzen/dfsl/D-FSL-1_0_de.txt/at_download/file", + "https://www.hbz-nrw.de/produkte/open-access/lizenzen/dfsl/D-FSL-1_0_en.txt/at_download/file" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/DEC-3-Clause.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/DEC-3-Clause.json", + "referenceNumber": 512, + "name": "DEC 3-Clause License", + "licenseId": "DEC-3-Clause", + "seeAlso": [ + "https://gitlab.freedesktop.org/xorg/xserver/-/blob/master/COPYING?ref_type\u003dheads#L239" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/diffmark.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/diffmark.json", + "referenceNumber": 480, + "name": "diffmark license", + "licenseId": "diffmark", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing/diffmark" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/DL-DE-BY-2.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/DL-DE-BY-2.0.json", + "referenceNumber": 84, + "name": "Data licence Germany – attribution – version 2.0", + "licenseId": "DL-DE-BY-2.0", + "seeAlso": [ + "https://www.govdata.de/dl-de/by-2-0" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/DL-DE-ZERO-2.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/DL-DE-ZERO-2.0.json", + "referenceNumber": 522, + "name": "Data licence Germany – zero – version 2.0", + "licenseId": "DL-DE-ZERO-2.0", + "seeAlso": [ + "https://www.govdata.de/dl-de/zero-2-0" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/DOC.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/DOC.json", + "referenceNumber": 646, + "name": "DOC License", + "licenseId": "DOC", + "seeAlso": [ + "http://www.cs.wustl.edu/~schmidt/ACE-copying.html", + "https://www.dre.vanderbilt.edu/~schmidt/ACE-copying.html" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/DocBook-Schema.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/DocBook-Schema.json", + "referenceNumber": 153, + "name": "DocBook Schema License", + "licenseId": "DocBook-Schema", + "seeAlso": [ + "https://github.com/docbook/xslt10-stylesheets/blob/efd62655c11cc8773708df7a843613fa1e932bf8/xsl/assembly/schema/docbook51b7.rnc" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/DocBook-XML.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/DocBook-XML.json", + "referenceNumber": 493, + "name": "DocBook XML License", + "licenseId": "DocBook-XML", + "seeAlso": [ + "https://github.com/docbook/xslt10-stylesheets/blob/efd62655c11cc8773708df7a843613fa1e932bf8/xsl/COPYING#L27" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Dotseqn.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Dotseqn.json", + "referenceNumber": 533, + "name": "Dotseqn License", + "licenseId": "Dotseqn", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing/Dotseqn" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/DRL-1.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/DRL-1.0.json", + "referenceNumber": 410, + "name": "Detection Rule License 1.0", + "licenseId": "DRL-1.0", + "seeAlso": [ + "https://github.com/Neo23x0/sigma/blob/master/LICENSE.Detection.Rules.md" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/DRL-1.1.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/DRL-1.1.json", + "referenceNumber": 268, + "name": "Detection Rule License 1.1", + "licenseId": "DRL-1.1", + "seeAlso": [ + "https://github.com/SigmaHQ/Detection-Rule-License/blob/6ec7fbde6101d101b5b5d1fcb8f9b69fbc76c04a/LICENSE.Detection.Rules.md" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/DSDP.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/DSDP.json", + "referenceNumber": 164, + "name": "DSDP License", + "licenseId": "DSDP", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing/DSDP" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/dtoa.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/dtoa.json", + "referenceNumber": 263, + "name": "David M. Gay dtoa License", + "licenseId": "dtoa", + "seeAlso": [ + "https://github.com/SWI-Prolog/swipl-devel/blob/master/src/os/dtoa.c", + "https://sourceware.org/git/?p\u003dnewlib-cygwin.git;a\u003dblob;f\u003dnewlib/libc/stdlib/mprec.h;hb\u003dHEAD" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/dvipdfm.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/dvipdfm.json", + "referenceNumber": 61, + "name": "dvipdfm License", + "licenseId": "dvipdfm", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing/dvipdfm" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/ECL-1.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/ECL-1.0.json", + "referenceNumber": 264, + "name": "Educational Community License v1.0", + "licenseId": "ECL-1.0", + "seeAlso": [ + "https://opensource.org/licenses/ECL-1.0" + ], + "isOsiApproved": true + }, + { + "reference": "https://spdx.org/licenses/ECL-2.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/ECL-2.0.json", + "referenceNumber": 363, + "name": "Educational Community License v2.0", + "licenseId": "ECL-2.0", + "seeAlso": [ + "https://opensource.org/licenses/ECL-2.0" + ], + "isOsiApproved": true, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/eCos-2.0.html", + "isDeprecatedLicenseId": true, + "detailsUrl": "https://spdx.org/licenses/eCos-2.0.json", + "referenceNumber": 298, + "name": "eCos license version 2.0", + "licenseId": "eCos-2.0", + "seeAlso": [ + "https://www.gnu.org/licenses/ecos-license.html" + ], + "isOsiApproved": false, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/EFL-1.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/EFL-1.0.json", + "referenceNumber": 137, + "name": "Eiffel Forum License v1.0", + "licenseId": "EFL-1.0", + "seeAlso": [ + "http://www.eiffel-nice.org/license/forum.txt", + "https://opensource.org/licenses/EFL-1.0" + ], + "isOsiApproved": true + }, + { + "reference": "https://spdx.org/licenses/EFL-2.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/EFL-2.0.json", + "referenceNumber": 447, + "name": "Eiffel Forum License v2.0", + "licenseId": "EFL-2.0", + "seeAlso": [ + "http://www.eiffel-nice.org/license/eiffel-forum-license-2.html", + "https://opensource.org/licenses/EFL-2.0" + ], + "isOsiApproved": true, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/eGenix.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/eGenix.json", + "referenceNumber": 348, + "name": "eGenix.com Public License 1.1.0", + "licenseId": "eGenix", + "seeAlso": [ + "http://www.egenix.com/products/eGenix.com-Public-License-1.1.0.pdf", + "https://fedoraproject.org/wiki/Licensing/eGenix.com_Public_License_1.1.0" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Elastic-2.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Elastic-2.0.json", + "referenceNumber": 404, + "name": "Elastic License 2.0", + "licenseId": "Elastic-2.0", + "seeAlso": [ + "https://www.elastic.co/licensing/elastic-license", + "https://github.com/elastic/elasticsearch/blob/master/licenses/ELASTIC-LICENSE-2.0.txt" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Entessa.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Entessa.json", + "referenceNumber": 198, + "name": "Entessa Public License v1.0", + "licenseId": "Entessa", + "seeAlso": [ + "https://opensource.org/licenses/Entessa" + ], + "isOsiApproved": true + }, + { + "reference": "https://spdx.org/licenses/EPICS.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/EPICS.json", + "referenceNumber": 532, + "name": "EPICS Open License", + "licenseId": "EPICS", + "seeAlso": [ + "https://epics.anl.gov/license/open.php" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/EPL-1.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/EPL-1.0.json", + "referenceNumber": 115, + "name": "Eclipse Public License 1.0", + "licenseId": "EPL-1.0", + "seeAlso": [ + "http://www.eclipse.org/legal/epl-v10.html", + "https://opensource.org/licenses/EPL-1.0" + ], + "isOsiApproved": true, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/EPL-2.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/EPL-2.0.json", + "referenceNumber": 282, + "name": "Eclipse Public License 2.0", + "licenseId": "EPL-2.0", + "seeAlso": [ + "https://www.eclipse.org/legal/epl-2.0", + "https://www.opensource.org/licenses/EPL-2.0" + ], + "isOsiApproved": true, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/ErlPL-1.1.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/ErlPL-1.1.json", + "referenceNumber": 530, + "name": "Erlang Public License v1.1", + "licenseId": "ErlPL-1.1", + "seeAlso": [ + "http://www.erlang.org/EPLICENSE" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/etalab-2.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/etalab-2.0.json", + "referenceNumber": 129, + "name": "Etalab Open License 2.0", + "licenseId": "etalab-2.0", + "seeAlso": [ + "https://github.com/DISIC/politique-de-contribution-open-source/blob/master/LICENSE.pdf", + "https://raw.githubusercontent.com/DISIC/politique-de-contribution-open-source/master/LICENSE" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/EUDatagrid.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/EUDatagrid.json", + "referenceNumber": 393, + "name": "EU DataGrid Software License", + "licenseId": "EUDatagrid", + "seeAlso": [ + "http://eu-datagrid.web.cern.ch/eu-datagrid/license.html", + "https://opensource.org/licenses/EUDatagrid" + ], + "isOsiApproved": true, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/EUPL-1.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/EUPL-1.0.json", + "referenceNumber": 389, + "name": "European Union Public License 1.0", + "licenseId": "EUPL-1.0", + "seeAlso": [ + "http://ec.europa.eu/idabc/en/document/7330.html", + "http://ec.europa.eu/idabc/servlets/Doc027f.pdf?id\u003d31096" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/EUPL-1.1.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/EUPL-1.1.json", + "referenceNumber": 503, + "name": "European Union Public License 1.1", + "licenseId": "EUPL-1.1", + "seeAlso": [ + "https://joinup.ec.europa.eu/software/page/eupl/licence-eupl", + "https://joinup.ec.europa.eu/sites/default/files/custom-page/attachment/eupl1.1.-licence-en_0.pdf", + "https://opensource.org/licenses/EUPL-1.1" + ], + "isOsiApproved": true, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/EUPL-1.2.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/EUPL-1.2.json", + "referenceNumber": 12, + "name": "European Union Public License 1.2", + "licenseId": "EUPL-1.2", + "seeAlso": [ + "https://joinup.ec.europa.eu/page/eupl-text-11-12", + "https://joinup.ec.europa.eu/sites/default/files/custom-page/attachment/eupl_v1.2_en.pdf", + "https://joinup.ec.europa.eu/sites/default/files/custom-page/attachment/2020-03/EUPL-1.2%20EN.txt", + "https://joinup.ec.europa.eu/sites/default/files/inline-files/EUPL%20v1_2%20EN(1).txt", + "http://eur-lex.europa.eu/legal-content/EN/TXT/HTML/?uri\u003dCELEX:32017D0863", + "https://opensource.org/licenses/EUPL-1.2" + ], + "isOsiApproved": true, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/Eurosym.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Eurosym.json", + "referenceNumber": 621, + "name": "Eurosym License", + "licenseId": "Eurosym", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing/Eurosym" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Fair.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Fair.json", + "referenceNumber": 258, + "name": "Fair License", + "licenseId": "Fair", + "seeAlso": [ + "https://web.archive.org/web/20150926120323/http://fairlicense.org/", + "https://opensource.org/licenses/Fair" + ], + "isOsiApproved": true + }, + { + "reference": "https://spdx.org/licenses/FBM.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/FBM.json", + "referenceNumber": 626, + "name": "Fuzzy Bitmap License", + "licenseId": "FBM", + "seeAlso": [ + "https://github.com/SWI-Prolog/packages-xpce/blob/161a40cd82004f731ba48024f9d30af388a7edf5/src/img/gifwrite.c#L21-L26" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/FDK-AAC.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/FDK-AAC.json", + "referenceNumber": 344, + "name": "Fraunhofer FDK AAC Codec Library", + "licenseId": "FDK-AAC", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing/FDK-AAC", + "https://directory.fsf.org/wiki/License:Fdk" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Ferguson-Twofish.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Ferguson-Twofish.json", + "referenceNumber": 362, + "name": "Ferguson Twofish License", + "licenseId": "Ferguson-Twofish", + "seeAlso": [ + "https://github.com/wernerd/ZRTPCPP/blob/6b3cd8e6783642292bad0c21e3e5e5ce45ff3e03/cryptcommon/twofish.c#L113C3-L127" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Frameworx-1.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Frameworx-1.0.json", + "referenceNumber": 188, + "name": "Frameworx Open License 1.0", + "licenseId": "Frameworx-1.0", + "seeAlso": [ + "https://opensource.org/licenses/Frameworx-1.0" + ], + "isOsiApproved": true + }, + { + "reference": "https://spdx.org/licenses/FreeBSD-DOC.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/FreeBSD-DOC.json", + "referenceNumber": 151, + "name": "FreeBSD Documentation License", + "licenseId": "FreeBSD-DOC", + "seeAlso": [ + "https://www.freebsd.org/copyright/freebsd-doc-license/" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/FreeImage.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/FreeImage.json", + "referenceNumber": 232, + "name": "FreeImage Public License v1.0", + "licenseId": "FreeImage", + "seeAlso": [ + "http://freeimage.sourceforge.net/freeimage-license.txt" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/FSFAP.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/FSFAP.json", + "referenceNumber": 436, + "name": "FSF All Permissive License", + "licenseId": "FSFAP", + "seeAlso": [ + "https://www.gnu.org/prep/maintain/html_node/License-Notices-for-Other-Files.html" + ], + "isOsiApproved": false, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/FSFAP-no-warranty-disclaimer.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/FSFAP-no-warranty-disclaimer.json", + "referenceNumber": 547, + "name": "FSF All Permissive License (without Warranty)", + "licenseId": "FSFAP-no-warranty-disclaimer", + "seeAlso": [ + "https://git.savannah.gnu.org/cgit/wget.git/tree/util/trunc.c?h\u003dv1.21.3\u0026id\u003d40747a11e44ced5a8ac628a41f879ced3e2ebce9#n6" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/FSFUL.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/FSFUL.json", + "referenceNumber": 2, + "name": "FSF Unlimited License", + "licenseId": "FSFUL", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing/FSF_Unlimited_License" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/FSFULLR.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/FSFULLR.json", + "referenceNumber": 508, + "name": "FSF Unlimited License (with License Retention)", + "licenseId": "FSFULLR", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing/FSF_Unlimited_License#License_Retention_Variant" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/FSFULLRWD.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/FSFULLRWD.json", + "referenceNumber": 640, + "name": "FSF Unlimited License (With License Retention and Warranty Disclaimer)", + "licenseId": "FSFULLRWD", + "seeAlso": [ + "https://lists.gnu.org/archive/html/autoconf/2012-04/msg00061.html" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/FTL.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/FTL.json", + "referenceNumber": 249, + "name": "Freetype Project License", + "licenseId": "FTL", + "seeAlso": [ + "http://freetype.fis.uniroma2.it/FTL.TXT", + "http://git.savannah.gnu.org/cgit/freetype/freetype2.git/tree/docs/FTL.TXT", + "http://gitlab.freedesktop.org/freetype/freetype/-/raw/master/docs/FTL.TXT" + ], + "isOsiApproved": false, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/Furuseth.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Furuseth.json", + "referenceNumber": 273, + "name": "Furuseth License", + "licenseId": "Furuseth", + "seeAlso": [ + "https://git.openldap.org/openldap/openldap/-/blob/master/COPYRIGHT?ref_type\u003dheads#L39-51" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/fwlw.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/fwlw.json", + "referenceNumber": 50, + "name": "fwlw License", + "licenseId": "fwlw", + "seeAlso": [ + "https://mirrors.nic.cz/tex-archive/macros/latex/contrib/fwlw/README" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/GCR-docs.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/GCR-docs.json", + "referenceNumber": 272, + "name": "Gnome GCR Documentation License", + "licenseId": "GCR-docs", + "seeAlso": [ + "https://github.com/GNOME/gcr/blob/master/docs/COPYING" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/GD.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/GD.json", + "referenceNumber": 624, + "name": "GD License", + "licenseId": "GD", + "seeAlso": [ + "https://libgd.github.io/manuals/2.3.0/files/license-txt.html" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/GFDL-1.1.html", + "isDeprecatedLicenseId": true, + "detailsUrl": "https://spdx.org/licenses/GFDL-1.1.json", + "referenceNumber": 177, + "name": "GNU Free Documentation License v1.1", + "licenseId": "GFDL-1.1", + "seeAlso": [ + "https://www.gnu.org/licenses/old-licenses/fdl-1.1.txt" + ], + "isOsiApproved": false, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/GFDL-1.1-invariants-only.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/GFDL-1.1-invariants-only.json", + "referenceNumber": 216, + "name": "GNU Free Documentation License v1.1 only - invariants", + "licenseId": "GFDL-1.1-invariants-only", + "seeAlso": [ + "https://www.gnu.org/licenses/old-licenses/fdl-1.1.txt" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/GFDL-1.1-invariants-or-later.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/GFDL-1.1-invariants-or-later.json", + "referenceNumber": 57, + "name": "GNU Free Documentation License v1.1 or later - invariants", + "licenseId": "GFDL-1.1-invariants-or-later", + "seeAlso": [ + "https://www.gnu.org/licenses/old-licenses/fdl-1.1.txt" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/GFDL-1.1-no-invariants-only.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/GFDL-1.1-no-invariants-only.json", + "referenceNumber": 38, + "name": "GNU Free Documentation License v1.1 only - no invariants", + "licenseId": "GFDL-1.1-no-invariants-only", + "seeAlso": [ + "https://www.gnu.org/licenses/old-licenses/fdl-1.1.txt" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/GFDL-1.1-no-invariants-or-later.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/GFDL-1.1-no-invariants-or-later.json", + "referenceNumber": 289, + "name": "GNU Free Documentation License v1.1 or later - no invariants", + "licenseId": "GFDL-1.1-no-invariants-or-later", + "seeAlso": [ + "https://www.gnu.org/licenses/old-licenses/fdl-1.1.txt" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/GFDL-1.1-only.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/GFDL-1.1-only.json", + "referenceNumber": 654, + "name": "GNU Free Documentation License v1.1 only", + "licenseId": "GFDL-1.1-only", + "seeAlso": [ + "https://www.gnu.org/licenses/old-licenses/fdl-1.1.txt" + ], + "isOsiApproved": false, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/GFDL-1.1-or-later.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/GFDL-1.1-or-later.json", + "referenceNumber": 569, + "name": "GNU Free Documentation License v1.1 or later", + "licenseId": "GFDL-1.1-or-later", + "seeAlso": [ + "https://www.gnu.org/licenses/old-licenses/fdl-1.1.txt" + ], + "isOsiApproved": false, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/GFDL-1.2.html", + "isDeprecatedLicenseId": true, + "detailsUrl": "https://spdx.org/licenses/GFDL-1.2.json", + "referenceNumber": 235, + "name": "GNU Free Documentation License v1.2", + "licenseId": "GFDL-1.2", + "seeAlso": [ + "https://www.gnu.org/licenses/old-licenses/fdl-1.2.txt" + ], + "isOsiApproved": false, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/GFDL-1.2-invariants-only.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/GFDL-1.2-invariants-only.json", + "referenceNumber": 461, + "name": "GNU Free Documentation License v1.2 only - invariants", + "licenseId": "GFDL-1.2-invariants-only", + "seeAlso": [ + "https://www.gnu.org/licenses/old-licenses/fdl-1.2.txt" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/GFDL-1.2-invariants-or-later.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/GFDL-1.2-invariants-or-later.json", + "referenceNumber": 391, + "name": "GNU Free Documentation License v1.2 or later - invariants", + "licenseId": "GFDL-1.2-invariants-or-later", + "seeAlso": [ + "https://www.gnu.org/licenses/old-licenses/fdl-1.2.txt" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/GFDL-1.2-no-invariants-only.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/GFDL-1.2-no-invariants-only.json", + "referenceNumber": 187, + "name": "GNU Free Documentation License v1.2 only - no invariants", + "licenseId": "GFDL-1.2-no-invariants-only", + "seeAlso": [ + "https://www.gnu.org/licenses/old-licenses/fdl-1.2.txt" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/GFDL-1.2-no-invariants-or-later.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/GFDL-1.2-no-invariants-or-later.json", + "referenceNumber": 240, + "name": "GNU Free Documentation License v1.2 or later - no invariants", + "licenseId": "GFDL-1.2-no-invariants-or-later", + "seeAlso": [ + "https://www.gnu.org/licenses/old-licenses/fdl-1.2.txt" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/GFDL-1.2-only.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/GFDL-1.2-only.json", + "referenceNumber": 302, + "name": "GNU Free Documentation License v1.2 only", + "licenseId": "GFDL-1.2-only", + "seeAlso": [ + "https://www.gnu.org/licenses/old-licenses/fdl-1.2.txt" + ], + "isOsiApproved": false, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/GFDL-1.2-or-later.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/GFDL-1.2-or-later.json", + "referenceNumber": 562, + "name": "GNU Free Documentation License v1.2 or later", + "licenseId": "GFDL-1.2-or-later", + "seeAlso": [ + "https://www.gnu.org/licenses/old-licenses/fdl-1.2.txt" + ], + "isOsiApproved": false, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/GFDL-1.3.html", + "isDeprecatedLicenseId": true, + "detailsUrl": "https://spdx.org/licenses/GFDL-1.3.json", + "referenceNumber": 60, + "name": "GNU Free Documentation License v1.3", + "licenseId": "GFDL-1.3", + "seeAlso": [ + "https://www.gnu.org/licenses/fdl-1.3.txt" + ], + "isOsiApproved": false, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/GFDL-1.3-invariants-only.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/GFDL-1.3-invariants-only.json", + "referenceNumber": 184, + "name": "GNU Free Documentation License v1.3 only - invariants", + "licenseId": "GFDL-1.3-invariants-only", + "seeAlso": [ + "https://www.gnu.org/licenses/fdl-1.3.txt" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/GFDL-1.3-invariants-or-later.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/GFDL-1.3-invariants-or-later.json", + "referenceNumber": 346, + "name": "GNU Free Documentation License v1.3 or later - invariants", + "licenseId": "GFDL-1.3-invariants-or-later", + "seeAlso": [ + "https://www.gnu.org/licenses/fdl-1.3.txt" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/GFDL-1.3-no-invariants-only.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/GFDL-1.3-no-invariants-only.json", + "referenceNumber": 59, + "name": "GNU Free Documentation License v1.3 only - no invariants", + "licenseId": "GFDL-1.3-no-invariants-only", + "seeAlso": [ + "https://www.gnu.org/licenses/fdl-1.3.txt" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/GFDL-1.3-no-invariants-or-later.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/GFDL-1.3-no-invariants-or-later.json", + "referenceNumber": 281, + "name": "GNU Free Documentation License v1.3 or later - no invariants", + "licenseId": "GFDL-1.3-no-invariants-or-later", + "seeAlso": [ + "https://www.gnu.org/licenses/fdl-1.3.txt" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/GFDL-1.3-only.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/GFDL-1.3-only.json", + "referenceNumber": 642, + "name": "GNU Free Documentation License v1.3 only", + "licenseId": "GFDL-1.3-only", + "seeAlso": [ + "https://www.gnu.org/licenses/fdl-1.3.txt" + ], + "isOsiApproved": false, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/GFDL-1.3-or-later.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/GFDL-1.3-or-later.json", + "referenceNumber": 494, + "name": "GNU Free Documentation License v1.3 or later", + "licenseId": "GFDL-1.3-or-later", + "seeAlso": [ + "https://www.gnu.org/licenses/fdl-1.3.txt" + ], + "isOsiApproved": false, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/Giftware.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Giftware.json", + "referenceNumber": 618, + "name": "Giftware License", + "licenseId": "Giftware", + "seeAlso": [ + "http://liballeg.org/license.html#allegro-4-the-giftware-license" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/GL2PS.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/GL2PS.json", + "referenceNumber": 231, + "name": "GL2PS License", + "licenseId": "GL2PS", + "seeAlso": [ + "http://www.geuz.org/gl2ps/COPYING.GL2PS" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Glide.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Glide.json", + "referenceNumber": 620, + "name": "3dfx Glide License", + "licenseId": "Glide", + "seeAlso": [ + "http://www.users.on.net/~triforce/glidexp/COPYING.txt" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Glulxe.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Glulxe.json", + "referenceNumber": 429, + "name": "Glulxe License", + "licenseId": "Glulxe", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing/Glulxe" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/GLWTPL.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/GLWTPL.json", + "referenceNumber": 154, + "name": "Good Luck With That Public License", + "licenseId": "GLWTPL", + "seeAlso": [ + "https://github.com/me-shaon/GLWTPL/commit/da5f6bc734095efbacb442c0b31e33a65b9d6e85" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/gnuplot.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/gnuplot.json", + "referenceNumber": 271, + "name": "gnuplot License", + "licenseId": "gnuplot", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing/Gnuplot" + ], + "isOsiApproved": false, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/GPL-1.0.html", + "isDeprecatedLicenseId": true, + "detailsUrl": "https://spdx.org/licenses/GPL-1.0.json", + "referenceNumber": 365, + "name": "GNU General Public License v1.0 only", + "licenseId": "GPL-1.0", + "seeAlso": [ + "https://www.gnu.org/licenses/old-licenses/gpl-1.0-standalone.html" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/GPL-1.0+.html", + "isDeprecatedLicenseId": true, + "detailsUrl": "https://spdx.org/licenses/GPL-1.0+.json", + "referenceNumber": 66, + "name": "GNU General Public License v1.0 or later", + "licenseId": "GPL-1.0+", + "seeAlso": [ + "https://www.gnu.org/licenses/old-licenses/gpl-1.0-standalone.html" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/GPL-1.0-only.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/GPL-1.0-only.json", + "referenceNumber": 563, + "name": "GNU General Public License v1.0 only", + "licenseId": "GPL-1.0-only", + "seeAlso": [ + "https://www.gnu.org/licenses/old-licenses/gpl-1.0-standalone.html" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/GPL-1.0-or-later.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/GPL-1.0-or-later.json", + "referenceNumber": 558, + "name": "GNU General Public License v1.0 or later", + "licenseId": "GPL-1.0-or-later", + "seeAlso": [ + "https://www.gnu.org/licenses/old-licenses/gpl-1.0-standalone.html" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/GPL-2.0.html", + "isDeprecatedLicenseId": true, + "detailsUrl": "https://spdx.org/licenses/GPL-2.0.json", + "referenceNumber": 613, + "name": "GNU General Public License v2.0 only", + "licenseId": "GPL-2.0", + "seeAlso": [ + "https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html", + "https://opensource.org/licenses/GPL-2.0" + ], + "isOsiApproved": true, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/GPL-2.0+.html", + "isDeprecatedLicenseId": true, + "detailsUrl": "https://spdx.org/licenses/GPL-2.0+.json", + "referenceNumber": 83, + "name": "GNU General Public License v2.0 or later", + "licenseId": "GPL-2.0+", + "seeAlso": [ + "https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html", + "https://opensource.org/licenses/GPL-2.0" + ], + "isOsiApproved": true, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/GPL-2.0-only.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/GPL-2.0-only.json", + "referenceNumber": 483, + "name": "GNU General Public License v2.0 only", + "licenseId": "GPL-2.0-only", + "seeAlso": [ + "https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html", + "https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt", + "https://opensource.org/licenses/GPL-2.0" + ], + "isOsiApproved": true, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/GPL-2.0-or-later.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/GPL-2.0-or-later.json", + "referenceNumber": 349, + "name": "GNU General Public License v2.0 or later", + "licenseId": "GPL-2.0-or-later", + "seeAlso": [ + "https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html", + "https://opensource.org/licenses/GPL-2.0" + ], + "isOsiApproved": true, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/GPL-2.0-with-autoconf-exception.html", + "isDeprecatedLicenseId": true, + "detailsUrl": "https://spdx.org/licenses/GPL-2.0-with-autoconf-exception.json", + "referenceNumber": 475, + "name": "GNU General Public License v2.0 w/Autoconf exception", + "licenseId": "GPL-2.0-with-autoconf-exception", + "seeAlso": [ + "http://ac-archive.sourceforge.net/doc/copyright.html" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/GPL-2.0-with-bison-exception.html", + "isDeprecatedLicenseId": true, + "detailsUrl": "https://spdx.org/licenses/GPL-2.0-with-bison-exception.json", + "referenceNumber": 492, + "name": "GNU General Public License v2.0 w/Bison exception", + "licenseId": "GPL-2.0-with-bison-exception", + "seeAlso": [ + "http://git.savannah.gnu.org/cgit/bison.git/tree/data/yacc.c?id\u003d193d7c7054ba7197b0789e14965b739162319b5e#n141" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/GPL-2.0-with-classpath-exception.html", + "isDeprecatedLicenseId": true, + "detailsUrl": "https://spdx.org/licenses/GPL-2.0-with-classpath-exception.json", + "referenceNumber": 144, + "name": "GNU General Public License v2.0 w/Classpath exception", + "licenseId": "GPL-2.0-with-classpath-exception", + "seeAlso": [ + "https://www.gnu.org/software/classpath/license.html" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/GPL-2.0-with-font-exception.html", + "isDeprecatedLicenseId": true, + "detailsUrl": "https://spdx.org/licenses/GPL-2.0-with-font-exception.json", + "referenceNumber": 579, + "name": "GNU General Public License v2.0 w/Font exception", + "licenseId": "GPL-2.0-with-font-exception", + "seeAlso": [ + "https://www.gnu.org/licenses/gpl-faq.html#FontException" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/GPL-2.0-with-GCC-exception.html", + "isDeprecatedLicenseId": true, + "detailsUrl": "https://spdx.org/licenses/GPL-2.0-with-GCC-exception.json", + "referenceNumber": 449, + "name": "GNU General Public License v2.0 w/GCC Runtime Library exception", + "licenseId": "GPL-2.0-with-GCC-exception", + "seeAlso": [ + "https://gcc.gnu.org/git/?p\u003dgcc.git;a\u003dblob;f\u003dgcc/libgcc1.c;h\u003d762f5143fc6eed57b6797c82710f3538aa52b40b;hb\u003dcb143a3ce4fb417c68f5fa2691a1b1b1053dfba9#l10" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/GPL-3.0.html", + "isDeprecatedLicenseId": true, + "detailsUrl": "https://spdx.org/licenses/GPL-3.0.json", + "referenceNumber": 434, + "name": "GNU General Public License v3.0 only", + "licenseId": "GPL-3.0", + "seeAlso": [ + "https://www.gnu.org/licenses/gpl-3.0-standalone.html", + "https://opensource.org/licenses/GPL-3.0" + ], + "isOsiApproved": true, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/GPL-3.0+.html", + "isDeprecatedLicenseId": true, + "detailsUrl": "https://spdx.org/licenses/GPL-3.0+.json", + "referenceNumber": 586, + "name": "GNU General Public License v3.0 or later", + "licenseId": "GPL-3.0+", + "seeAlso": [ + "https://www.gnu.org/licenses/gpl-3.0-standalone.html", + "https://opensource.org/licenses/GPL-3.0" + ], + "isOsiApproved": true, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/GPL-3.0-only.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/GPL-3.0-only.json", + "referenceNumber": 42, + "name": "GNU General Public License v3.0 only", + "licenseId": "GPL-3.0-only", + "seeAlso": [ + "https://www.gnu.org/licenses/gpl-3.0-standalone.html", + "https://opensource.org/licenses/GPL-3.0" + ], + "isOsiApproved": true, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/GPL-3.0-or-later.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/GPL-3.0-or-later.json", + "referenceNumber": 269, + "name": "GNU General Public License v3.0 or later", + "licenseId": "GPL-3.0-or-later", + "seeAlso": [ + "https://www.gnu.org/licenses/gpl-3.0-standalone.html", + "https://opensource.org/licenses/GPL-3.0" + ], + "isOsiApproved": true, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/GPL-3.0-with-autoconf-exception.html", + "isDeprecatedLicenseId": true, + "detailsUrl": "https://spdx.org/licenses/GPL-3.0-with-autoconf-exception.json", + "referenceNumber": 200, + "name": "GNU General Public License v3.0 w/Autoconf exception", + "licenseId": "GPL-3.0-with-autoconf-exception", + "seeAlso": [ + "https://www.gnu.org/licenses/autoconf-exception-3.0.html" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/GPL-3.0-with-GCC-exception.html", + "isDeprecatedLicenseId": true, + "detailsUrl": "https://spdx.org/licenses/GPL-3.0-with-GCC-exception.json", + "referenceNumber": 546, + "name": "GNU General Public License v3.0 w/GCC Runtime Library exception", + "licenseId": "GPL-3.0-with-GCC-exception", + "seeAlso": [ + "https://www.gnu.org/licenses/gcc-exception-3.1.html" + ], + "isOsiApproved": true + }, + { + "reference": "https://spdx.org/licenses/Graphics-Gems.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Graphics-Gems.json", + "referenceNumber": 437, + "name": "Graphics Gems License", + "licenseId": "Graphics-Gems", + "seeAlso": [ + "https://github.com/erich666/GraphicsGems/blob/master/LICENSE.md" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/gSOAP-1.3b.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/gSOAP-1.3b.json", + "referenceNumber": 658, + "name": "gSOAP Public License v1.3b", + "licenseId": "gSOAP-1.3b", + "seeAlso": [ + "http://www.cs.fsu.edu/~engelen/license.html" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/gtkbook.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/gtkbook.json", + "referenceNumber": 397, + "name": "gtkbook License", + "licenseId": "gtkbook", + "seeAlso": [ + "https://github.com/slogan621/gtkbook", + "https://github.com/oetiker/rrdtool-1.x/blob/master/src/plbasename.c#L8-L11" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Gutmann.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Gutmann.json", + "referenceNumber": 103, + "name": "Gutmann License", + "licenseId": "Gutmann", + "seeAlso": [ + "https://www.cs.auckland.ac.nz/~pgut001/dumpasn1.c" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/HaskellReport.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/HaskellReport.json", + "referenceNumber": 357, + "name": "Haskell Language Report License", + "licenseId": "HaskellReport", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing/Haskell_Language_Report_License" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/hdparm.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/hdparm.json", + "referenceNumber": 351, + "name": "hdparm License", + "licenseId": "hdparm", + "seeAlso": [ + "https://github.com/Distrotech/hdparm/blob/4517550db29a91420fb2b020349523b1b4512df2/LICENSE.TXT" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/HIDAPI.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/HIDAPI.json", + "referenceNumber": 318, + "name": "HIDAPI License", + "licenseId": "HIDAPI", + "seeAlso": [ + "https://github.com/signal11/hidapi/blob/master/LICENSE-orig.txt" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Hippocratic-2.1.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Hippocratic-2.1.json", + "referenceNumber": 425, + "name": "Hippocratic License 2.1", + "licenseId": "Hippocratic-2.1", + "seeAlso": [ + "https://firstdonoharm.dev/version/2/1/license.html", + "https://github.com/EthicalSource/hippocratic-license/blob/58c0e646d64ff6fbee275bfe2b9492f914e3ab2a/LICENSE.txt" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/HP-1986.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/HP-1986.json", + "referenceNumber": 477, + "name": "Hewlett-Packard 1986 License", + "licenseId": "HP-1986", + "seeAlso": [ + "https://sourceware.org/git/?p\u003dnewlib-cygwin.git;a\u003dblob;f\u003dnewlib/libc/machine/hppa/memchr.S;h\u003d1cca3e5e8867aa4bffef1f75a5c1bba25c0c441e;hb\u003dHEAD#l2" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/HP-1989.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/HP-1989.json", + "referenceNumber": 653, + "name": "Hewlett-Packard 1989 License", + "licenseId": "HP-1989", + "seeAlso": [ + "https://github.com/bleargh45/Data-UUID/blob/master/LICENSE" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/HPND.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/HPND.json", + "referenceNumber": 75, + "name": "Historical Permission Notice and Disclaimer", + "licenseId": "HPND", + "seeAlso": [ + "https://opensource.org/licenses/HPND", + "http://lists.opensource.org/pipermail/license-discuss_lists.opensource.org/2002-November/006304.html" + ], + "isOsiApproved": true, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/HPND-DEC.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/HPND-DEC.json", + "referenceNumber": 597, + "name": "Historical Permission Notice and Disclaimer - DEC variant", + "licenseId": "HPND-DEC", + "seeAlso": [ + "https://gitlab.freedesktop.org/xorg/app/xkbcomp/-/blob/master/COPYING?ref_type\u003dheads#L69" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/HPND-doc.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/HPND-doc.json", + "referenceNumber": 384, + "name": "Historical Permission Notice and Disclaimer - documentation variant", + "licenseId": "HPND-doc", + "seeAlso": [ + "https://gitlab.freedesktop.org/xorg/lib/libxext/-/blob/master/COPYING?ref_type\u003dheads#L185-197", + "https://gitlab.freedesktop.org/xorg/lib/libxtst/-/blob/master/COPYING?ref_type\u003dheads#L70-77" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/HPND-doc-sell.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/HPND-doc-sell.json", + "referenceNumber": 648, + "name": "Historical Permission Notice and Disclaimer - documentation sell variant", + "licenseId": "HPND-doc-sell", + "seeAlso": [ + "https://gitlab.freedesktop.org/xorg/lib/libxtst/-/blob/master/COPYING?ref_type\u003dheads#L108-117", + "https://gitlab.freedesktop.org/xorg/lib/libxext/-/blob/master/COPYING?ref_type\u003dheads#L153-162" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/HPND-export-US.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/HPND-export-US.json", + "referenceNumber": 551, + "name": "HPND with US Government export control warning", + "licenseId": "HPND-export-US", + "seeAlso": [ + "https://www.kermitproject.org/ck90.html#source" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/HPND-export-US-acknowledgement.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/HPND-export-US-acknowledgement.json", + "referenceNumber": 661, + "name": "HPND with US Government export control warning and acknowledgment", + "licenseId": "HPND-export-US-acknowledgement", + "seeAlso": [ + "https://github.com/krb5/krb5/blob/krb5-1.21.2-final/NOTICE#L831-L852", + "https://web.mit.edu/kerberos/krb5-1.21/doc/mitK5license.html" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/HPND-export-US-modify.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/HPND-export-US-modify.json", + "referenceNumber": 119, + "name": "HPND with US Government export control warning and modification rqmt", + "licenseId": "HPND-export-US-modify", + "seeAlso": [ + "https://github.com/krb5/krb5/blob/krb5-1.21.2-final/NOTICE#L1157-L1182", + "https://github.com/pythongssapi/k5test/blob/v0.10.3/K5TEST-LICENSE.txt" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/HPND-export2-US.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/HPND-export2-US.json", + "referenceNumber": 450, + "name": "HPND with US Government export control and 2 disclaimers", + "licenseId": "HPND-export2-US", + "seeAlso": [ + "https://github.com/krb5/krb5/blob/krb5-1.21.2-final/NOTICE#L111-L133", + "https://web.mit.edu/kerberos/krb5-1.21/doc/mitK5license.html" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/HPND-Fenneberg-Livingston.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/HPND-Fenneberg-Livingston.json", + "referenceNumber": 643, + "name": "Historical Permission Notice and Disclaimer - Fenneberg-Livingston variant", + "licenseId": "HPND-Fenneberg-Livingston", + "seeAlso": [ + "https://github.com/FreeRADIUS/freeradius-client/blob/master/COPYRIGHT#L32", + "https://github.com/radcli/radcli/blob/master/COPYRIGHT#L34" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/HPND-INRIA-IMAG.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/HPND-INRIA-IMAG.json", + "referenceNumber": 583, + "name": "Historical Permission Notice and Disclaimer - INRIA-IMAG variant", + "licenseId": "HPND-INRIA-IMAG", + "seeAlso": [ + "https://github.com/ppp-project/ppp/blob/master/pppd/ipv6cp.c#L75-L83" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/HPND-Intel.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/HPND-Intel.json", + "referenceNumber": 20, + "name": "Historical Permission Notice and Disclaimer - Intel variant", + "licenseId": "HPND-Intel", + "seeAlso": [ + "https://sourceware.org/git/?p\u003dnewlib-cygwin.git;a\u003dblob;f\u003dnewlib/libc/machine/i960/memcpy.S;hb\u003dHEAD" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/HPND-Kevlin-Henney.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/HPND-Kevlin-Henney.json", + "referenceNumber": 637, + "name": "Historical Permission Notice and Disclaimer - Kevlin Henney variant", + "licenseId": "HPND-Kevlin-Henney", + "seeAlso": [ + "https://github.com/mruby/mruby/blob/83d12f8d52522cdb7c8cc46fad34821359f453e6/mrbgems/mruby-dir/src/Win/dirent.c#L127-L140" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/HPND-Markus-Kuhn.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/HPND-Markus-Kuhn.json", + "referenceNumber": 172, + "name": "Historical Permission Notice and Disclaimer - Markus Kuhn variant", + "licenseId": "HPND-Markus-Kuhn", + "seeAlso": [ + "https://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c", + "https://sourceware.org/git/?p\u003dbinutils-gdb.git;a\u003dblob;f\u003dreadline/readline/support/wcwidth.c;h\u003d0f5ec995796f4813abbcf4972aec0378ab74722a;hb\u003dHEAD#l55" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/HPND-merchantability-variant.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/HPND-merchantability-variant.json", + "referenceNumber": 572, + "name": "Historical Permission Notice and Disclaimer - merchantability variant", + "licenseId": "HPND-merchantability-variant", + "seeAlso": [ + "https://sourceware.org/git/?p\u003dnewlib-cygwin.git;a\u003dblob;f\u003dnewlib/libc/misc/fini.c;hb\u003dHEAD" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/HPND-MIT-disclaimer.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/HPND-MIT-disclaimer.json", + "referenceNumber": 609, + "name": "Historical Permission Notice and Disclaimer with MIT disclaimer", + "licenseId": "HPND-MIT-disclaimer", + "seeAlso": [ + "https://metacpan.org/release/NLNETLABS/Net-DNS-SEC-1.22/source/LICENSE" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/HPND-Netrek.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/HPND-Netrek.json", + "referenceNumber": 126, + "name": "Historical Permission Notice and Disclaimer - Netrek variant", + "licenseId": "HPND-Netrek", + "seeAlso": [], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/HPND-Pbmplus.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/HPND-Pbmplus.json", + "referenceNumber": 242, + "name": "Historical Permission Notice and Disclaimer - Pbmplus variant", + "licenseId": "HPND-Pbmplus", + "seeAlso": [ + "https://sourceforge.net/p/netpbm/code/HEAD/tree/super_stable/netpbm.c#l8" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/HPND-sell-MIT-disclaimer-xserver.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/HPND-sell-MIT-disclaimer-xserver.json", + "referenceNumber": 160, + "name": "Historical Permission Notice and Disclaimer - sell xserver variant with MIT disclaimer", + "licenseId": "HPND-sell-MIT-disclaimer-xserver", + "seeAlso": [ + "https://gitlab.freedesktop.org/xorg/xserver/-/blob/master/COPYING?ref_type\u003dheads#L1781" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/HPND-sell-regexpr.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/HPND-sell-regexpr.json", + "referenceNumber": 44, + "name": "Historical Permission Notice and Disclaimer - sell regexpr variant", + "licenseId": "HPND-sell-regexpr", + "seeAlso": [ + "https://gitlab.com/bacula-org/bacula/-/blob/Branch-11.0/bacula/LICENSE-FOSS?ref_type\u003dheads#L245" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/HPND-sell-variant.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/HPND-sell-variant.json", + "referenceNumber": 485, + "name": "Historical Permission Notice and Disclaimer - sell variant", + "licenseId": "HPND-sell-variant", + "seeAlso": [ + "https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/net/sunrpc/auth_gss/gss_generic_token.c?h\u003dv4.19" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/HPND-sell-variant-MIT-disclaimer.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/HPND-sell-variant-MIT-disclaimer.json", + "referenceNumber": 430, + "name": "HPND sell variant with MIT disclaimer", + "licenseId": "HPND-sell-variant-MIT-disclaimer", + "seeAlso": [ + "https://github.com/sigmavirus24/x11-ssh-askpass/blob/master/README" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/HPND-sell-variant-MIT-disclaimer-rev.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/HPND-sell-variant-MIT-disclaimer-rev.json", + "referenceNumber": 10, + "name": "HPND sell variant with MIT disclaimer - reverse", + "licenseId": "HPND-sell-variant-MIT-disclaimer-rev", + "seeAlso": [ + "https://github.com/sigmavirus24/x11-ssh-askpass/blob/master/dynlist.c" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/HPND-UC.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/HPND-UC.json", + "referenceNumber": 423, + "name": "Historical Permission Notice and Disclaimer - University of California variant", + "licenseId": "HPND-UC", + "seeAlso": [ + "https://core.tcl-lang.org/tk/file?name\u003dcompat/unistd.h" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/HPND-UC-export-US.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/HPND-UC-export-US.json", + "referenceNumber": 82, + "name": "Historical Permission Notice and Disclaimer - University of California, US export warning", + "licenseId": "HPND-UC-export-US", + "seeAlso": [ + "https://github.com/RTimothyEdwards/magic/blob/master/LICENSE" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/HTMLTIDY.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/HTMLTIDY.json", + "referenceNumber": 439, + "name": "HTML Tidy License", + "licenseId": "HTMLTIDY", + "seeAlso": [ + "https://github.com/htacg/tidy-html5/blob/next/README/LICENSE.md" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/IBM-pibs.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/IBM-pibs.json", + "referenceNumber": 604, + "name": "IBM PowerPC Initialization and Boot Software", + "licenseId": "IBM-pibs", + "seeAlso": [ + "http://git.denx.de/?p\u003du-boot.git;a\u003dblob;f\u003darch/powerpc/cpu/ppc4xx/miiphy.c;h\u003d297155fdafa064b955e53e9832de93bfb0cfb85b;hb\u003d9fab4bf4cc077c21e43941866f3f2c196f28670d" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/ICU.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/ICU.json", + "referenceNumber": 375, + "name": "ICU License", + "licenseId": "ICU", + "seeAlso": [ + "http://source.icu-project.org/repos/icu/icu/trunk/license.html" + ], + "isOsiApproved": true + }, + { + "reference": "https://spdx.org/licenses/IEC-Code-Components-EULA.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/IEC-Code-Components-EULA.json", + "referenceNumber": 18, + "name": "IEC Code Components End-user licence agreement", + "licenseId": "IEC-Code-Components-EULA", + "seeAlso": [ + "https://www.iec.ch/webstore/custserv/pdf/CC-EULA.pdf", + "https://www.iec.ch/CCv1", + "https://www.iec.ch/copyright" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/IJG.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/IJG.json", + "referenceNumber": 374, + "name": "Independent JPEG Group License", + "licenseId": "IJG", + "seeAlso": [ + "http://dev.w3.org/cvsweb/Amaya/libjpeg/Attic/README?rev\u003d1.2" + ], + "isOsiApproved": false, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/IJG-short.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/IJG-short.json", + "referenceNumber": 152, + "name": "Independent JPEG Group License - short", + "licenseId": "IJG-short", + "seeAlso": [ + "https://sourceforge.net/p/xmedcon/code/ci/master/tree/libs/ljpg/" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/ImageMagick.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/ImageMagick.json", + "referenceNumber": 608, + "name": "ImageMagick License", + "licenseId": "ImageMagick", + "seeAlso": [ + "http://www.imagemagick.org/script/license.php" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/iMatix.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/iMatix.json", + "referenceNumber": 645, + "name": "iMatix Standard Function Library Agreement", + "licenseId": "iMatix", + "seeAlso": [ + "http://legacy.imatix.com/html/sfl/sfl4.htm#license" + ], + "isOsiApproved": false, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/Imlib2.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Imlib2.json", + "referenceNumber": 96, + "name": "Imlib2 License", + "licenseId": "Imlib2", + "seeAlso": [ + "http://trac.enlightenment.org/e/browser/trunk/imlib2/COPYING", + "https://git.enlightenment.org/legacy/imlib2.git/tree/COPYING" + ], + "isOsiApproved": false, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/Info-ZIP.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Info-ZIP.json", + "referenceNumber": 451, + "name": "Info-ZIP License", + "licenseId": "Info-ZIP", + "seeAlso": [ + "http://www.info-zip.org/license.html" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Inner-Net-2.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Inner-Net-2.0.json", + "referenceNumber": 58, + "name": "Inner Net License v2.0", + "licenseId": "Inner-Net-2.0", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing/Inner_Net_License", + "https://sourceware.org/git/?p\u003dglibc.git;a\u003dblob;f\u003dLICENSES;h\u003d530893b1dc9ea00755603c68fb36bd4fc38a7be8;hb\u003dHEAD#l207" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Intel.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Intel.json", + "referenceNumber": 316, + "name": "Intel Open Source License", + "licenseId": "Intel", + "seeAlso": [ + "https://opensource.org/licenses/Intel" + ], + "isOsiApproved": true, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/Intel-ACPI.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Intel-ACPI.json", + "referenceNumber": 309, + "name": "Intel ACPI Software License Agreement", + "licenseId": "Intel-ACPI", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing/Intel_ACPI_Software_License_Agreement" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Interbase-1.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Interbase-1.0.json", + "referenceNumber": 665, + "name": "Interbase Public License v1.0", + "licenseId": "Interbase-1.0", + "seeAlso": [ + "https://web.archive.org/web/20060319014854/http://info.borland.com/devsupport/interbase/opensource/IPL.html" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/IPA.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/IPA.json", + "referenceNumber": 237, + "name": "IPA Font License", + "licenseId": "IPA", + "seeAlso": [ + "https://opensource.org/licenses/IPA" + ], + "isOsiApproved": true, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/IPL-1.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/IPL-1.0.json", + "referenceNumber": 443, + "name": "IBM Public License v1.0", + "licenseId": "IPL-1.0", + "seeAlso": [ + "https://opensource.org/licenses/IPL-1.0" + ], + "isOsiApproved": true, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/ISC.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/ISC.json", + "referenceNumber": 131, + "name": "ISC License", + "licenseId": "ISC", + "seeAlso": [ + "https://www.isc.org/licenses/", + "https://www.isc.org/downloads/software-support-policy/isc-license/", + "https://opensource.org/licenses/ISC" + ], + "isOsiApproved": true, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/ISC-Veillard.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/ISC-Veillard.json", + "referenceNumber": 554, + "name": "ISC Veillard variant", + "licenseId": "ISC-Veillard", + "seeAlso": [ + "https://raw.githubusercontent.com/GNOME/libxml2/4c2e7c651f6c2f0d1a74f350cbda95f7df3e7017/hash.c", + "https://github.com/GNOME/libxml2/blob/master/dict.c", + "https://sourceforge.net/p/ctrio/git/ci/master/tree/README" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Jam.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Jam.json", + "referenceNumber": 338, + "name": "Jam License", + "licenseId": "Jam", + "seeAlso": [ + "https://www.boost.org/doc/libs/1_35_0/doc/html/jam.html", + "https://web.archive.org/web/20160330173339/https://swarm.workshop.perforce.com/files/guest/perforce_software/jam/src/README" + ], + "isOsiApproved": true + }, + { + "reference": "https://spdx.org/licenses/JasPer-2.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/JasPer-2.0.json", + "referenceNumber": 591, + "name": "JasPer License", + "licenseId": "JasPer-2.0", + "seeAlso": [ + "http://www.ece.uvic.ca/~mdadams/jasper/LICENSE" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/JPL-image.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/JPL-image.json", + "referenceNumber": 343, + "name": "JPL Image Use Policy", + "licenseId": "JPL-image", + "seeAlso": [ + "https://www.jpl.nasa.gov/jpl-image-use-policy" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/JPNIC.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/JPNIC.json", + "referenceNumber": 117, + "name": "Japan Network Information Center License", + "licenseId": "JPNIC", + "seeAlso": [ + "https://gitlab.isc.org/isc-projects/bind9/blob/master/COPYRIGHT#L366" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/JSON.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/JSON.json", + "referenceNumber": 174, + "name": "JSON License", + "licenseId": "JSON", + "seeAlso": [ + "http://www.json.org/license.html" + ], + "isOsiApproved": false, + "isFsfLibre": false + }, + { + "reference": "https://spdx.org/licenses/Kastrup.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Kastrup.json", + "referenceNumber": 181, + "name": "Kastrup License", + "licenseId": "Kastrup", + "seeAlso": [ + "https://ctan.math.utah.edu/ctan/tex-archive/macros/generic/kastrup/binhex.dtx" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Kazlib.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Kazlib.json", + "referenceNumber": 197, + "name": "Kazlib License", + "licenseId": "Kazlib", + "seeAlso": [ + "http://git.savannah.gnu.org/cgit/kazlib.git/tree/except.c?id\u003d0062df360c2d17d57f6af19b0e444c51feb99036" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Knuth-CTAN.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Knuth-CTAN.json", + "referenceNumber": 22, + "name": "Knuth CTAN License", + "licenseId": "Knuth-CTAN", + "seeAlso": [ + "https://ctan.org/license/knuth" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/LAL-1.2.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/LAL-1.2.json", + "referenceNumber": 261, + "name": "Licence Art Libre 1.2", + "licenseId": "LAL-1.2", + "seeAlso": [ + "http://artlibre.org/licence/lal/licence-art-libre-12/" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/LAL-1.3.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/LAL-1.3.json", + "referenceNumber": 526, + "name": "Licence Art Libre 1.3", + "licenseId": "LAL-1.3", + "seeAlso": [ + "https://artlibre.org/" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Latex2e.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Latex2e.json", + "referenceNumber": 3, + "name": "Latex2e License", + "licenseId": "Latex2e", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing/Latex2e" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Latex2e-translated-notice.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Latex2e-translated-notice.json", + "referenceNumber": 104, + "name": "Latex2e with translated notice permission", + "licenseId": "Latex2e-translated-notice", + "seeAlso": [ + "https://git.savannah.gnu.org/cgit/indent.git/tree/doc/indent.texi?id\u003da74c6b4ee49397cf330b333da1042bffa60ed14f#n74" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Leptonica.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Leptonica.json", + "referenceNumber": 221, + "name": "Leptonica License", + "licenseId": "Leptonica", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing/Leptonica" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/LGPL-2.0.html", + "isDeprecatedLicenseId": true, + "detailsUrl": "https://spdx.org/licenses/LGPL-2.0.json", + "referenceNumber": 81, + "name": "GNU Library General Public License v2 only", + "licenseId": "LGPL-2.0", + "seeAlso": [ + "https://www.gnu.org/licenses/old-licenses/lgpl-2.0-standalone.html" + ], + "isOsiApproved": true + }, + { + "reference": "https://spdx.org/licenses/LGPL-2.0+.html", + "isDeprecatedLicenseId": true, + "detailsUrl": "https://spdx.org/licenses/LGPL-2.0+.json", + "referenceNumber": 265, + "name": "GNU Library General Public License v2 or later", + "licenseId": "LGPL-2.0+", + "seeAlso": [ + "https://www.gnu.org/licenses/old-licenses/lgpl-2.0-standalone.html" + ], + "isOsiApproved": true + }, + { + "reference": "https://spdx.org/licenses/LGPL-2.0-only.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/LGPL-2.0-only.json", + "referenceNumber": 517, + "name": "GNU Library General Public License v2 only", + "licenseId": "LGPL-2.0-only", + "seeAlso": [ + "https://www.gnu.org/licenses/old-licenses/lgpl-2.0-standalone.html" + ], + "isOsiApproved": true + }, + { + "reference": "https://spdx.org/licenses/LGPL-2.0-or-later.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/LGPL-2.0-or-later.json", + "referenceNumber": 458, + "name": "GNU Library General Public License v2 or later", + "licenseId": "LGPL-2.0-or-later", + "seeAlso": [ + "https://www.gnu.org/licenses/old-licenses/lgpl-2.0-standalone.html" + ], + "isOsiApproved": true + }, + { + "reference": "https://spdx.org/licenses/LGPL-2.1.html", + "isDeprecatedLicenseId": true, + "detailsUrl": "https://spdx.org/licenses/LGPL-2.1.json", + "referenceNumber": 659, + "name": "GNU Lesser General Public License v2.1 only", + "licenseId": "LGPL-2.1", + "seeAlso": [ + "https://www.gnu.org/licenses/old-licenses/lgpl-2.1-standalone.html", + "https://opensource.org/licenses/LGPL-2.1" + ], + "isOsiApproved": true, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/LGPL-2.1+.html", + "isDeprecatedLicenseId": true, + "detailsUrl": "https://spdx.org/licenses/LGPL-2.1+.json", + "referenceNumber": 69, + "name": "GNU Lesser General Public License v2.1 or later", + "licenseId": "LGPL-2.1+", + "seeAlso": [ + "https://www.gnu.org/licenses/old-licenses/lgpl-2.1-standalone.html", + "https://opensource.org/licenses/LGPL-2.1" + ], + "isOsiApproved": true, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/LGPL-2.1-only.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/LGPL-2.1-only.json", + "referenceNumber": 524, + "name": "GNU Lesser General Public License v2.1 only", + "licenseId": "LGPL-2.1-only", + "seeAlso": [ + "https://www.gnu.org/licenses/old-licenses/lgpl-2.1-standalone.html", + "https://opensource.org/licenses/LGPL-2.1" + ], + "isOsiApproved": true, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/LGPL-2.1-or-later.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/LGPL-2.1-or-later.json", + "referenceNumber": 336, + "name": "GNU Lesser General Public License v2.1 or later", + "licenseId": "LGPL-2.1-or-later", + "seeAlso": [ + "https://www.gnu.org/licenses/old-licenses/lgpl-2.1-standalone.html", + "https://opensource.org/licenses/LGPL-2.1" + ], + "isOsiApproved": true, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/LGPL-3.0.html", + "isDeprecatedLicenseId": true, + "detailsUrl": "https://spdx.org/licenses/LGPL-3.0.json", + "referenceNumber": 381, + "name": "GNU Lesser General Public License v3.0 only", + "licenseId": "LGPL-3.0", + "seeAlso": [ + "https://www.gnu.org/licenses/lgpl-3.0-standalone.html", + "https://www.gnu.org/licenses/lgpl+gpl-3.0.txt", + "https://opensource.org/licenses/LGPL-3.0" + ], + "isOsiApproved": true, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/LGPL-3.0+.html", + "isDeprecatedLicenseId": true, + "detailsUrl": "https://spdx.org/licenses/LGPL-3.0+.json", + "referenceNumber": 303, + "name": "GNU Lesser General Public License v3.0 or later", + "licenseId": "LGPL-3.0+", + "seeAlso": [ + "https://www.gnu.org/licenses/lgpl-3.0-standalone.html", + "https://www.gnu.org/licenses/lgpl+gpl-3.0.txt", + "https://opensource.org/licenses/LGPL-3.0" + ], + "isOsiApproved": true, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/LGPL-3.0-only.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/LGPL-3.0-only.json", + "referenceNumber": 225, + "name": "GNU Lesser General Public License v3.0 only", + "licenseId": "LGPL-3.0-only", + "seeAlso": [ + "https://www.gnu.org/licenses/lgpl-3.0-standalone.html", + "https://www.gnu.org/licenses/lgpl+gpl-3.0.txt", + "https://opensource.org/licenses/LGPL-3.0" + ], + "isOsiApproved": true, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/LGPL-3.0-or-later.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/LGPL-3.0-or-later.json", + "referenceNumber": 411, + "name": "GNU Lesser General Public License v3.0 or later", + "licenseId": "LGPL-3.0-or-later", + "seeAlso": [ + "https://www.gnu.org/licenses/lgpl-3.0-standalone.html", + "https://www.gnu.org/licenses/lgpl+gpl-3.0.txt", + "https://opensource.org/licenses/LGPL-3.0" + ], + "isOsiApproved": true, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/LGPLLR.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/LGPLLR.json", + "referenceNumber": 87, + "name": "Lesser General Public License For Linguistic Resources", + "licenseId": "LGPLLR", + "seeAlso": [ + "http://www-igm.univ-mlv.fr/~unitex/lgpllr.html" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Libpng.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Libpng.json", + "referenceNumber": 531, + "name": "libpng License", + "licenseId": "Libpng", + "seeAlso": [ + "http://www.libpng.org/pub/png/src/libpng-LICENSE.txt" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/libpng-2.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/libpng-2.0.json", + "referenceNumber": 149, + "name": "PNG Reference Library version 2", + "licenseId": "libpng-2.0", + "seeAlso": [ + "http://www.libpng.org/pub/png/src/libpng-LICENSE.txt" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/libselinux-1.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/libselinux-1.0.json", + "referenceNumber": 320, + "name": "libselinux public domain notice", + "licenseId": "libselinux-1.0", + "seeAlso": [ + "https://github.com/SELinuxProject/selinux/blob/master/libselinux/LICENSE" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/libtiff.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/libtiff.json", + "referenceNumber": 24, + "name": "libtiff License", + "licenseId": "libtiff", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing/libtiff" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/libutil-David-Nugent.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/libutil-David-Nugent.json", + "referenceNumber": 662, + "name": "libutil David Nugent License", + "licenseId": "libutil-David-Nugent", + "seeAlso": [ + "http://web.mit.edu/freebsd/head/lib/libutil/login_ok.3", + "https://cgit.freedesktop.org/libbsd/tree/man/setproctitle.3bsd" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/LiLiQ-P-1.1.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/LiLiQ-P-1.1.json", + "referenceNumber": 150, + "name": "Licence Libre du Québec – Permissive version 1.1", + "licenseId": "LiLiQ-P-1.1", + "seeAlso": [ + "https://forge.gouv.qc.ca/licence/fr/liliq-v1-1/", + "http://opensource.org/licenses/LiLiQ-P-1.1" + ], + "isOsiApproved": true + }, + { + "reference": "https://spdx.org/licenses/LiLiQ-R-1.1.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/LiLiQ-R-1.1.json", + "referenceNumber": 203, + "name": "Licence Libre du Québec – Réciprocité version 1.1", + "licenseId": "LiLiQ-R-1.1", + "seeAlso": [ + "https://www.forge.gouv.qc.ca/participez/licence-logicielle/licence-libre-du-quebec-liliq-en-francais/licence-libre-du-quebec-reciprocite-liliq-r-v1-1/", + "http://opensource.org/licenses/LiLiQ-R-1.1" + ], + "isOsiApproved": true + }, + { + "reference": "https://spdx.org/licenses/LiLiQ-Rplus-1.1.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/LiLiQ-Rplus-1.1.json", + "referenceNumber": 314, + "name": "Licence Libre du Québec – Réciprocité forte version 1.1", + "licenseId": "LiLiQ-Rplus-1.1", + "seeAlso": [ + "https://www.forge.gouv.qc.ca/participez/licence-logicielle/licence-libre-du-quebec-liliq-en-francais/licence-libre-du-quebec-reciprocite-forte-liliq-r-v1-1/", + "http://opensource.org/licenses/LiLiQ-Rplus-1.1" + ], + "isOsiApproved": true + }, + { + "reference": "https://spdx.org/licenses/Linux-man-pages-1-para.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Linux-man-pages-1-para.json", + "referenceNumber": 577, + "name": "Linux man-pages - 1 paragraph", + "licenseId": "Linux-man-pages-1-para", + "seeAlso": [ + "https://git.kernel.org/pub/scm/docs/man-pages/man-pages.git/tree/man2/getcpu.2#n4" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Linux-man-pages-copyleft.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Linux-man-pages-copyleft.json", + "referenceNumber": 213, + "name": "Linux man-pages Copyleft", + "licenseId": "Linux-man-pages-copyleft", + "seeAlso": [ + "https://www.kernel.org/doc/man-pages/licenses.html" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Linux-man-pages-copyleft-2-para.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Linux-man-pages-copyleft-2-para.json", + "referenceNumber": 352, + "name": "Linux man-pages Copyleft - 2 paragraphs", + "licenseId": "Linux-man-pages-copyleft-2-para", + "seeAlso": [ + "https://git.kernel.org/pub/scm/docs/man-pages/man-pages.git/tree/man2/move_pages.2#n5", + "https://git.kernel.org/pub/scm/docs/man-pages/man-pages.git/tree/man2/migrate_pages.2#n8" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Linux-man-pages-copyleft-var.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Linux-man-pages-copyleft-var.json", + "referenceNumber": 186, + "name": "Linux man-pages Copyleft Variant", + "licenseId": "Linux-man-pages-copyleft-var", + "seeAlso": [ + "https://git.kernel.org/pub/scm/docs/man-pages/man-pages.git/tree/man2/set_mempolicy.2#n5" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Linux-OpenIB.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Linux-OpenIB.json", + "referenceNumber": 278, + "name": "Linux Kernel Variant of OpenIB.org license", + "licenseId": "Linux-OpenIB", + "seeAlso": [ + "https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/infiniband/core/sa.h" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/LOOP.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/LOOP.json", + "referenceNumber": 521, + "name": "Common Lisp LOOP License", + "licenseId": "LOOP", + "seeAlso": [ + "https://gitlab.com/embeddable-common-lisp/ecl/-/blob/develop/src/lsp/loop.lsp", + "http://git.savannah.gnu.org/cgit/gcl.git/tree/gcl/lsp/gcl_loop.lsp?h\u003dVersion_2_6_13pre", + "https://sourceforge.net/p/sbcl/sbcl/ci/master/tree/src/code/loop.lisp", + "https://github.com/cl-adams/adams/blob/master/LICENSE.md", + "https://github.com/blakemcbride/eclipse-lisp/blob/master/lisp/loop.lisp", + "https://gitlab.common-lisp.net/cmucl/cmucl/-/blob/master/src/code/loop.lisp" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/LPD-document.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/LPD-document.json", + "referenceNumber": 561, + "name": "LPD Documentation License", + "licenseId": "LPD-document", + "seeAlso": [ + "https://github.com/Cyan4973/xxHash/blob/dev/doc/xxhash_spec.md", + "https://www.ietf.org/rfc/rfc1952.txt" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/LPL-1.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/LPL-1.0.json", + "referenceNumber": 267, + "name": "Lucent Public License Version 1.0", + "licenseId": "LPL-1.0", + "seeAlso": [ + "https://opensource.org/licenses/LPL-1.0" + ], + "isOsiApproved": true + }, + { + "reference": "https://spdx.org/licenses/LPL-1.02.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/LPL-1.02.json", + "referenceNumber": 122, + "name": "Lucent Public License v1.02", + "licenseId": "LPL-1.02", + "seeAlso": [ + "http://plan9.bell-labs.com/plan9/license.html", + "https://opensource.org/licenses/LPL-1.02" + ], + "isOsiApproved": true, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/LPPL-1.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/LPPL-1.0.json", + "referenceNumber": 133, + "name": "LaTeX Project Public License v1.0", + "licenseId": "LPPL-1.0", + "seeAlso": [ + "http://www.latex-project.org/lppl/lppl-1-0.txt" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/LPPL-1.1.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/LPPL-1.1.json", + "referenceNumber": 284, + "name": "LaTeX Project Public License v1.1", + "licenseId": "LPPL-1.1", + "seeAlso": [ + "http://www.latex-project.org/lppl/lppl-1-1.txt" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/LPPL-1.2.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/LPPL-1.2.json", + "referenceNumber": 407, + "name": "LaTeX Project Public License v1.2", + "licenseId": "LPPL-1.2", + "seeAlso": [ + "http://www.latex-project.org/lppl/lppl-1-2.txt" + ], + "isOsiApproved": false, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/LPPL-1.3a.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/LPPL-1.3a.json", + "referenceNumber": 510, + "name": "LaTeX Project Public License v1.3a", + "licenseId": "LPPL-1.3a", + "seeAlso": [ + "http://www.latex-project.org/lppl/lppl-1-3a.txt" + ], + "isOsiApproved": false, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/LPPL-1.3c.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/LPPL-1.3c.json", + "referenceNumber": 300, + "name": "LaTeX Project Public License v1.3c", + "licenseId": "LPPL-1.3c", + "seeAlso": [ + "http://www.latex-project.org/lppl/lppl-1-3c.txt", + "https://opensource.org/licenses/LPPL-1.3c" + ], + "isOsiApproved": true + }, + { + "reference": "https://spdx.org/licenses/lsof.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/lsof.json", + "referenceNumber": 76, + "name": "lsof License", + "licenseId": "lsof", + "seeAlso": [ + "https://github.com/lsof-org/lsof/blob/master/COPYING" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Lucida-Bitmap-Fonts.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Lucida-Bitmap-Fonts.json", + "referenceNumber": 383, + "name": "Lucida Bitmap Fonts License", + "licenseId": "Lucida-Bitmap-Fonts", + "seeAlso": [ + "https://gitlab.freedesktop.org/xorg/font/bh-100dpi/-/blob/master/COPYING?ref_type\u003dheads" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/LZMA-SDK-9.11-to-9.20.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/LZMA-SDK-9.11-to-9.20.json", + "referenceNumber": 239, + "name": "LZMA SDK License (versions 9.11 to 9.20)", + "licenseId": "LZMA-SDK-9.11-to-9.20", + "seeAlso": [ + "https://www.7-zip.org/sdk.html", + "https://sourceforge.net/projects/sevenzip/files/LZMA%20SDK/" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/LZMA-SDK-9.22.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/LZMA-SDK-9.22.json", + "referenceNumber": 600, + "name": "LZMA SDK License (versions 9.22 and beyond)", + "licenseId": "LZMA-SDK-9.22", + "seeAlso": [ + "https://www.7-zip.org/sdk.html", + "https://sourceforge.net/projects/sevenzip/files/LZMA%20SDK/" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Mackerras-3-Clause.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Mackerras-3-Clause.json", + "referenceNumber": 540, + "name": "Mackerras 3-Clause License", + "licenseId": "Mackerras-3-Clause", + "seeAlso": [ + "https://github.com/ppp-project/ppp/blob/master/pppd/chap_ms.c#L6-L28" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Mackerras-3-Clause-acknowledgment.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Mackerras-3-Clause-acknowledgment.json", + "referenceNumber": 176, + "name": "Mackerras 3-Clause - acknowledgment variant", + "licenseId": "Mackerras-3-Clause-acknowledgment", + "seeAlso": [ + "https://github.com/ppp-project/ppp/blob/master/pppd/auth.c#L6-L28" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/magaz.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/magaz.json", + "referenceNumber": 93, + "name": "magaz License", + "licenseId": "magaz", + "seeAlso": [ + "https://mirrors.nic.cz/tex-archive/macros/latex/contrib/magaz/magaz.tex" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/mailprio.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/mailprio.json", + "referenceNumber": 292, + "name": "mailprio License", + "licenseId": "mailprio", + "seeAlso": [ + "https://fossies.org/linux/sendmail/contrib/mailprio" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/MakeIndex.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/MakeIndex.json", + "referenceNumber": 552, + "name": "MakeIndex License", + "licenseId": "MakeIndex", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing/MakeIndex" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Martin-Birgmeier.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Martin-Birgmeier.json", + "referenceNumber": 364, + "name": "Martin Birgmeier License", + "licenseId": "Martin-Birgmeier", + "seeAlso": [ + "https://github.com/Perl/perl5/blob/blead/util.c#L6136" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/McPhee-slideshow.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/McPhee-slideshow.json", + "referenceNumber": 511, + "name": "McPhee Slideshow License", + "licenseId": "McPhee-slideshow", + "seeAlso": [ + "https://mirror.las.iastate.edu/tex-archive/graphics/metapost/contrib/macros/slideshow/slideshow.mp" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/metamail.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/metamail.json", + "referenceNumber": 325, + "name": "metamail License", + "licenseId": "metamail", + "seeAlso": [ + "https://github.com/Dual-Life/mime-base64/blob/master/Base64.xs#L12" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Minpack.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Minpack.json", + "referenceNumber": 634, + "name": "Minpack License", + "licenseId": "Minpack", + "seeAlso": [ + "http://www.netlib.org/minpack/disclaimer", + "https://gitlab.com/libeigen/eigen/-/blob/master/COPYING.MINPACK" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/MirOS.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/MirOS.json", + "referenceNumber": 202, + "name": "The MirOS Licence", + "licenseId": "MirOS", + "seeAlso": [ + "https://opensource.org/licenses/MirOS" + ], + "isOsiApproved": true + }, + { + "reference": "https://spdx.org/licenses/MIT.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/MIT.json", + "referenceNumber": 601, + "name": "MIT License", + "licenseId": "MIT", + "seeAlso": [ + "https://opensource.org/license/mit/" + ], + "isOsiApproved": true, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/MIT-0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/MIT-0.json", + "referenceNumber": 587, + "name": "MIT No Attribution", + "licenseId": "MIT-0", + "seeAlso": [ + "https://github.com/aws/mit-0", + "https://romanrm.net/mit-zero", + "https://github.com/awsdocs/aws-cloud9-user-guide/blob/master/LICENSE-SAMPLECODE" + ], + "isOsiApproved": true + }, + { + "reference": "https://spdx.org/licenses/MIT-advertising.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/MIT-advertising.json", + "referenceNumber": 39, + "name": "Enlightenment License (e16)", + "licenseId": "MIT-advertising", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing/MIT_With_Advertising" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/MIT-CMU.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/MIT-CMU.json", + "referenceNumber": 36, + "name": "CMU License", + "licenseId": "MIT-CMU", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing:MIT?rd\u003dLicensing/MIT#CMU_Style", + "https://github.com/python-pillow/Pillow/blob/fffb426092c8db24a5f4b6df243a8a3c01fb63cd/LICENSE" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/MIT-enna.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/MIT-enna.json", + "referenceNumber": 207, + "name": "enna License", + "licenseId": "MIT-enna", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing/MIT#enna" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/MIT-feh.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/MIT-feh.json", + "referenceNumber": 146, + "name": "feh License", + "licenseId": "MIT-feh", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing/MIT#feh" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/MIT-Festival.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/MIT-Festival.json", + "referenceNumber": 431, + "name": "MIT Festival Variant", + "licenseId": "MIT-Festival", + "seeAlso": [ + "https://github.com/festvox/flite/blob/master/COPYING", + "https://github.com/festvox/speech_tools/blob/master/COPYING" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/MIT-Khronos-old.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/MIT-Khronos-old.json", + "referenceNumber": 68, + "name": "MIT Khronos - old variant", + "licenseId": "MIT-Khronos-old", + "seeAlso": [ + "https://github.com/KhronosGroup/SPIRV-Cross/blob/main/LICENSES/LicenseRef-KhronosFreeUse.txt" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/MIT-Modern-Variant.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/MIT-Modern-Variant.json", + "referenceNumber": 92, + "name": "MIT License Modern Variant", + "licenseId": "MIT-Modern-Variant", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing:MIT#Modern_Variants", + "https://ptolemy.berkeley.edu/copyright.htm", + "https://pirlwww.lpl.arizona.edu/resources/guide/software/PerlTk/Tixlic.html" + ], + "isOsiApproved": true + }, + { + "reference": "https://spdx.org/licenses/MIT-open-group.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/MIT-open-group.json", + "referenceNumber": 520, + "name": "MIT Open Group variant", + "licenseId": "MIT-open-group", + "seeAlso": [ + "https://gitlab.freedesktop.org/xorg/app/iceauth/-/blob/master/COPYING", + "https://gitlab.freedesktop.org/xorg/app/xvinfo/-/blob/master/COPYING", + "https://gitlab.freedesktop.org/xorg/app/xsetroot/-/blob/master/COPYING", + "https://gitlab.freedesktop.org/xorg/app/xauth/-/blob/master/COPYING" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/MIT-testregex.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/MIT-testregex.json", + "referenceNumber": 578, + "name": "MIT testregex Variant", + "licenseId": "MIT-testregex", + "seeAlso": [ + "https://github.com/dotnet/runtime/blob/55e1ac7c07df62c4108d4acedf78f77574470ce5/src/libraries/System.Text.RegularExpressions/tests/FunctionalTests/AttRegexTests.cs#L12-L28" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/MIT-Wu.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/MIT-Wu.json", + "referenceNumber": 156, + "name": "MIT Tom Wu Variant", + "licenseId": "MIT-Wu", + "seeAlso": [ + "https://github.com/chromium/octane/blob/master/crypto.js" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/MITNFA.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/MITNFA.json", + "referenceNumber": 650, + "name": "MIT +no-false-attribs license", + "licenseId": "MITNFA", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing/MITNFA" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/MMIXware.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/MMIXware.json", + "referenceNumber": 444, + "name": "MMIXware License", + "licenseId": "MMIXware", + "seeAlso": [ + "https://gitlab.lrz.de/mmix/mmixware/-/blob/master/boilerplate.w" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Motosoto.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Motosoto.json", + "referenceNumber": 31, + "name": "Motosoto License", + "licenseId": "Motosoto", + "seeAlso": [ + "https://opensource.org/licenses/Motosoto" + ], + "isOsiApproved": true + }, + { + "reference": "https://spdx.org/licenses/MPEG-SSG.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/MPEG-SSG.json", + "referenceNumber": 323, + "name": "MPEG Software Simulation", + "licenseId": "MPEG-SSG", + "seeAlso": [ + "https://sourceforge.net/p/netpbm/code/HEAD/tree/super_stable/converter/ppm/ppmtompeg/jrevdct.c#l1189" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/mpi-permissive.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/mpi-permissive.json", + "referenceNumber": 459, + "name": "mpi Permissive License", + "licenseId": "mpi-permissive", + "seeAlso": [ + "https://sources.debian.org/src/openmpi/4.1.0-10/ompi/debuggers/msgq_interface.h/?hl\u003d19#L19" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/mpich2.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/mpich2.json", + "referenceNumber": 448, + "name": "mpich2 License", + "licenseId": "mpich2", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing/MIT" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/MPL-1.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/MPL-1.0.json", + "referenceNumber": 248, + "name": "Mozilla Public License 1.0", + "licenseId": "MPL-1.0", + "seeAlso": [ + "http://www.mozilla.org/MPL/MPL-1.0.html", + "https://opensource.org/licenses/MPL-1.0" + ], + "isOsiApproved": true + }, + { + "reference": "https://spdx.org/licenses/MPL-1.1.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/MPL-1.1.json", + "referenceNumber": 219, + "name": "Mozilla Public License 1.1", + "licenseId": "MPL-1.1", + "seeAlso": [ + "http://www.mozilla.org/MPL/MPL-1.1.html", + "https://opensource.org/licenses/MPL-1.1" + ], + "isOsiApproved": true, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/MPL-2.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/MPL-2.0.json", + "referenceNumber": 147, + "name": "Mozilla Public License 2.0", + "licenseId": "MPL-2.0", + "seeAlso": [ + "https://www.mozilla.org/MPL/2.0/", + "https://opensource.org/licenses/MPL-2.0" + ], + "isOsiApproved": true, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/MPL-2.0-no-copyleft-exception.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/MPL-2.0-no-copyleft-exception.json", + "referenceNumber": 529, + "name": "Mozilla Public License 2.0 (no copyleft exception)", + "licenseId": "MPL-2.0-no-copyleft-exception", + "seeAlso": [ + "https://www.mozilla.org/MPL/2.0/", + "https://opensource.org/licenses/MPL-2.0" + ], + "isOsiApproved": true + }, + { + "reference": "https://spdx.org/licenses/mplus.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/mplus.json", + "referenceNumber": 553, + "name": "mplus Font License", + "licenseId": "mplus", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing:Mplus?rd\u003dLicensing/mplus" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/MS-LPL.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/MS-LPL.json", + "referenceNumber": 412, + "name": "Microsoft Limited Public License", + "licenseId": "MS-LPL", + "seeAlso": [ + "https://www.openhub.net/licenses/mslpl", + "https://github.com/gabegundy/atlserver/blob/master/License.txt", + "https://en.wikipedia.org/wiki/Shared_Source_Initiative#Microsoft_Limited_Public_License_(Ms-LPL)" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/MS-PL.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/MS-PL.json", + "referenceNumber": 360, + "name": "Microsoft Public License", + "licenseId": "MS-PL", + "seeAlso": [ + "http://www.microsoft.com/opensource/licenses.mspx", + "https://opensource.org/licenses/MS-PL" + ], + "isOsiApproved": true, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/MS-RL.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/MS-RL.json", + "referenceNumber": 212, + "name": "Microsoft Reciprocal License", + "licenseId": "MS-RL", + "seeAlso": [ + "http://www.microsoft.com/opensource/licenses.mspx", + "https://opensource.org/licenses/MS-RL" + ], + "isOsiApproved": true, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/MTLL.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/MTLL.json", + "referenceNumber": 610, + "name": "Matrix Template Library License", + "licenseId": "MTLL", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing/Matrix_Template_Library_License" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/MulanPSL-1.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/MulanPSL-1.0.json", + "referenceNumber": 236, + "name": "Mulan Permissive Software License, Version 1", + "licenseId": "MulanPSL-1.0", + "seeAlso": [ + "https://license.coscl.org.cn/MulanPSL/", + "https://github.com/yuwenlong/longphp/blob/25dfb70cc2a466dc4bb55ba30901cbce08d164b5/LICENSE" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/MulanPSL-2.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/MulanPSL-2.0.json", + "referenceNumber": 523, + "name": "Mulan Permissive Software License, Version 2", + "licenseId": "MulanPSL-2.0", + "seeAlso": [ + "https://license.coscl.org.cn/MulanPSL2" + ], + "isOsiApproved": true + }, + { + "reference": "https://spdx.org/licenses/Multics.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Multics.json", + "referenceNumber": 462, + "name": "Multics License", + "licenseId": "Multics", + "seeAlso": [ + "https://opensource.org/licenses/Multics" + ], + "isOsiApproved": true + }, + { + "reference": "https://spdx.org/licenses/Mup.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Mup.json", + "referenceNumber": 515, + "name": "Mup License", + "licenseId": "Mup", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing/Mup" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/NAIST-2003.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/NAIST-2003.json", + "referenceNumber": 118, + "name": "Nara Institute of Science and Technology License (2003)", + "licenseId": "NAIST-2003", + "seeAlso": [ + "https://enterprise.dejacode.com/licenses/public/naist-2003/#license-text", + "https://github.com/nodejs/node/blob/4a19cc8947b1bba2b2d27816ec3d0edf9b28e503/LICENSE#L343" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/NASA-1.3.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/NASA-1.3.json", + "referenceNumber": 488, + "name": "NASA Open Source Agreement 1.3", + "licenseId": "NASA-1.3", + "seeAlso": [ + "http://ti.arc.nasa.gov/opensource/nosa/", + "https://opensource.org/licenses/NASA-1.3" + ], + "isOsiApproved": true, + "isFsfLibre": false + }, + { + "reference": "https://spdx.org/licenses/Naumen.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Naumen.json", + "referenceNumber": 400, + "name": "Naumen Public License", + "licenseId": "Naumen", + "seeAlso": [ + "https://opensource.org/licenses/Naumen" + ], + "isOsiApproved": true + }, + { + "reference": "https://spdx.org/licenses/NBPL-1.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/NBPL-1.0.json", + "referenceNumber": 168, + "name": "Net Boolean Public License v1", + "licenseId": "NBPL-1.0", + "seeAlso": [ + "http://www.openldap.org/devel/gitweb.cgi?p\u003dopenldap.git;a\u003dblob;f\u003dLICENSE;hb\u003d37b4b3f6cc4bf34e1d3dec61e69914b9819d8894" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/NCBI-PD.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/NCBI-PD.json", + "referenceNumber": 599, + "name": "NCBI Public Domain Notice", + "licenseId": "NCBI-PD", + "seeAlso": [ + "https://github.com/ncbi/sra-tools/blob/e8e5b6af4edc460156ad9ce5902d0779cffbf685/LICENSE", + "https://github.com/ncbi/datasets/blob/0ea4cd16b61e5b799d9cc55aecfa016d6c9bd2bf/LICENSE.md", + "https://github.com/ncbi/gprobe/blob/de64d30fee8b4c4013094d7d3139ea89b5dd1ace/LICENSE", + "https://github.com/ncbi/egapx/blob/08930b9dec0c69b2d1a05e5153c7b95ef0a3eb0f/LICENSE", + "https://github.com/ncbi/datasets/blob/master/LICENSE.md" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/NCGL-UK-2.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/NCGL-UK-2.0.json", + "referenceNumber": 130, + "name": "Non-Commercial Government Licence", + "licenseId": "NCGL-UK-2.0", + "seeAlso": [ + "http://www.nationalarchives.gov.uk/doc/non-commercial-government-licence/version/2/" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/NCL.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/NCL.json", + "referenceNumber": 516, + "name": "NCL Source Code License", + "licenseId": "NCL", + "seeAlso": [ + "https://gitlab.freedesktop.org/pipewire/pipewire/-/blob/master/src/modules/module-filter-chain/pffft.c?ref_type\u003dheads#L1-52" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/NCSA.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/NCSA.json", + "referenceNumber": 652, + "name": "University of Illinois/NCSA Open Source License", + "licenseId": "NCSA", + "seeAlso": [ + "http://otm.illinois.edu/uiuc_openSource", + "https://opensource.org/licenses/NCSA" + ], + "isOsiApproved": true, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/Net-SNMP.html", + "isDeprecatedLicenseId": true, + "detailsUrl": "https://spdx.org/licenses/Net-SNMP.json", + "referenceNumber": 469, + "name": "Net-SNMP License", + "licenseId": "Net-SNMP", + "seeAlso": [ + "http://net-snmp.sourceforge.net/about/license.html" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/NetCDF.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/NetCDF.json", + "referenceNumber": 189, + "name": "NetCDF license", + "licenseId": "NetCDF", + "seeAlso": [ + "http://www.unidata.ucar.edu/software/netcdf/copyright.html" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Newsletr.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Newsletr.json", + "referenceNumber": 499, + "name": "Newsletr License", + "licenseId": "Newsletr", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing/Newsletr" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/NGPL.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/NGPL.json", + "referenceNumber": 167, + "name": "Nethack General Public License", + "licenseId": "NGPL", + "seeAlso": [ + "https://opensource.org/licenses/NGPL" + ], + "isOsiApproved": true + }, + { + "reference": "https://spdx.org/licenses/NICTA-1.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/NICTA-1.0.json", + "referenceNumber": 486, + "name": "NICTA Public Software License, Version 1.0", + "licenseId": "NICTA-1.0", + "seeAlso": [ + "https://opensource.apple.com/source/mDNSResponder/mDNSResponder-320.10/mDNSPosix/nss_ReadMe.txt" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/NIST-PD.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/NIST-PD.json", + "referenceNumber": 194, + "name": "NIST Public Domain Notice", + "licenseId": "NIST-PD", + "seeAlso": [ + "https://github.com/tcheneau/simpleRPL/blob/e645e69e38dd4e3ccfeceb2db8cba05b7c2e0cd3/LICENSE.txt", + "https://github.com/tcheneau/Routing/blob/f09f46fcfe636107f22f2c98348188a65a135d98/README.md" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/NIST-PD-fallback.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/NIST-PD-fallback.json", + "referenceNumber": 223, + "name": "NIST Public Domain Notice with license fallback", + "licenseId": "NIST-PD-fallback", + "seeAlso": [ + "https://github.com/usnistgov/jsip/blob/59700e6926cbe96c5cdae897d9a7d2656b42abe3/LICENSE", + "https://github.com/usnistgov/fipy/blob/86aaa5c2ba2c6f1be19593c5986071cf6568cc34/LICENSE.rst" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/NIST-Software.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/NIST-Software.json", + "referenceNumber": 251, + "name": "NIST Software License", + "licenseId": "NIST-Software", + "seeAlso": [ + "https://github.com/open-quantum-safe/liboqs/blob/40b01fdbb270f8614fde30e65d30e9da18c02393/src/common/rand/rand_nist.c#L1-L15" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/NLOD-1.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/NLOD-1.0.json", + "referenceNumber": 294, + "name": "Norwegian Licence for Open Government Data (NLOD) 1.0", + "licenseId": "NLOD-1.0", + "seeAlso": [ + "http://data.norge.no/nlod/en/1.0" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/NLOD-2.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/NLOD-2.0.json", + "referenceNumber": 566, + "name": "Norwegian Licence for Open Government Data (NLOD) 2.0", + "licenseId": "NLOD-2.0", + "seeAlso": [ + "http://data.norge.no/nlod/en/2.0" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/NLPL.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/NLPL.json", + "referenceNumber": 367, + "name": "No Limit Public License", + "licenseId": "NLPL", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing/NLPL" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Nokia.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Nokia.json", + "referenceNumber": 145, + "name": "Nokia Open Source License", + "licenseId": "Nokia", + "seeAlso": [ + "https://opensource.org/licenses/nokia" + ], + "isOsiApproved": true, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/NOSL.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/NOSL.json", + "referenceNumber": 254, + "name": "Netizen Open Source License", + "licenseId": "NOSL", + "seeAlso": [ + "http://bits.netizen.com.au/licenses/NOSL/nosl.txt" + ], + "isOsiApproved": false, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/Noweb.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Noweb.json", + "referenceNumber": 30, + "name": "Noweb License", + "licenseId": "Noweb", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing/Noweb" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/NPL-1.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/NPL-1.0.json", + "referenceNumber": 211, + "name": "Netscape Public License v1.0", + "licenseId": "NPL-1.0", + "seeAlso": [ + "http://www.mozilla.org/MPL/NPL/1.0/" + ], + "isOsiApproved": false, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/NPL-1.1.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/NPL-1.1.json", + "referenceNumber": 595, + "name": "Netscape Public License v1.1", + "licenseId": "NPL-1.1", + "seeAlso": [ + "http://www.mozilla.org/MPL/NPL/1.1/" + ], + "isOsiApproved": false, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/NPOSL-3.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/NPOSL-3.0.json", + "referenceNumber": 664, + "name": "Non-Profit Open Software License 3.0", + "licenseId": "NPOSL-3.0", + "seeAlso": [ + "https://opensource.org/licenses/NOSL3.0" + ], + "isOsiApproved": true + }, + { + "reference": "https://spdx.org/licenses/NRL.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/NRL.json", + "referenceNumber": 113, + "name": "NRL License", + "licenseId": "NRL", + "seeAlso": [ + "http://web.mit.edu/network/isakmp/nrllicense.html" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/NTP.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/NTP.json", + "referenceNumber": 390, + "name": "NTP License", + "licenseId": "NTP", + "seeAlso": [ + "https://opensource.org/licenses/NTP" + ], + "isOsiApproved": true + }, + { + "reference": "https://spdx.org/licenses/NTP-0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/NTP-0.json", + "referenceNumber": 64, + "name": "NTP No Attribution", + "licenseId": "NTP-0", + "seeAlso": [ + "https://github.com/tytso/e2fsprogs/blob/master/lib/et/et_name.c" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Nunit.html", + "isDeprecatedLicenseId": true, + "detailsUrl": "https://spdx.org/licenses/Nunit.json", + "referenceNumber": 27, + "name": "Nunit License", + "licenseId": "Nunit", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing/Nunit" + ], + "isOsiApproved": false, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/O-UDA-1.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/O-UDA-1.0.json", + "referenceNumber": 161, + "name": "Open Use of Data Agreement v1.0", + "licenseId": "O-UDA-1.0", + "seeAlso": [ + "https://github.com/microsoft/Open-Use-of-Data-Agreement/blob/v1.0/O-UDA-1.0.md", + "https://cdla.dev/open-use-of-data-agreement-v1-0/" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/OAR.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/OAR.json", + "referenceNumber": 100, + "name": "OAR License", + "licenseId": "OAR", + "seeAlso": [ + "https://sourceware.org/git/?p\u003dnewlib-cygwin.git;a\u003dblob;f\u003dnewlib/libc/string/strsignal.c;hb\u003dHEAD#l35" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/OCCT-PL.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/OCCT-PL.json", + "referenceNumber": 408, + "name": "Open CASCADE Technology Public License", + "licenseId": "OCCT-PL", + "seeAlso": [ + "http://www.opencascade.com/content/occt-public-license" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/OCLC-2.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/OCLC-2.0.json", + "referenceNumber": 468, + "name": "OCLC Research Public License 2.0", + "licenseId": "OCLC-2.0", + "seeAlso": [ + "http://www.oclc.org/research/activities/software/license/v2final.htm", + "https://opensource.org/licenses/OCLC-2.0" + ], + "isOsiApproved": true + }, + { + "reference": "https://spdx.org/licenses/ODbL-1.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/ODbL-1.0.json", + "referenceNumber": 611, + "name": "Open Data Commons Open Database License v1.0", + "licenseId": "ODbL-1.0", + "seeAlso": [ + "http://www.opendatacommons.org/licenses/odbl/1.0/", + "https://opendatacommons.org/licenses/odbl/1-0/" + ], + "isOsiApproved": false, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/ODC-By-1.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/ODC-By-1.0.json", + "referenceNumber": 15, + "name": "Open Data Commons Attribution License v1.0", + "licenseId": "ODC-By-1.0", + "seeAlso": [ + "https://opendatacommons.org/licenses/by/1.0/" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/OFFIS.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/OFFIS.json", + "referenceNumber": 418, + "name": "OFFIS License", + "licenseId": "OFFIS", + "seeAlso": [ + "https://sourceforge.net/p/xmedcon/code/ci/master/tree/libs/dicom/README" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/OFL-1.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/OFL-1.0.json", + "referenceNumber": 603, + "name": "SIL Open Font License 1.0", + "licenseId": "OFL-1.0", + "seeAlso": [ + "http://scripts.sil.org/cms/scripts/page.php?item_id\u003dOFL10_web" + ], + "isOsiApproved": false, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/OFL-1.0-no-RFN.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/OFL-1.0-no-RFN.json", + "referenceNumber": 545, + "name": "SIL Open Font License 1.0 with no Reserved Font Name", + "licenseId": "OFL-1.0-no-RFN", + "seeAlso": [ + "http://scripts.sil.org/cms/scripts/page.php?item_id\u003dOFL10_web" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/OFL-1.0-RFN.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/OFL-1.0-RFN.json", + "referenceNumber": 446, + "name": "SIL Open Font License 1.0 with Reserved Font Name", + "licenseId": "OFL-1.0-RFN", + "seeAlso": [ + "http://scripts.sil.org/cms/scripts/page.php?item_id\u003dOFL10_web" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/OFL-1.1.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/OFL-1.1.json", + "referenceNumber": 0, + "name": "SIL Open Font License 1.1", + "licenseId": "OFL-1.1", + "seeAlso": [ + "http://scripts.sil.org/cms/scripts/page.php?item_id\u003dOFL_web", + "https://opensource.org/licenses/OFL-1.1" + ], + "isOsiApproved": true, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/OFL-1.1-no-RFN.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/OFL-1.1-no-RFN.json", + "referenceNumber": 110, + "name": "SIL Open Font License 1.1 with no Reserved Font Name", + "licenseId": "OFL-1.1-no-RFN", + "seeAlso": [ + "http://scripts.sil.org/cms/scripts/page.php?item_id\u003dOFL_web", + "https://opensource.org/licenses/OFL-1.1" + ], + "isOsiApproved": true + }, + { + "reference": "https://spdx.org/licenses/OFL-1.1-RFN.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/OFL-1.1-RFN.json", + "referenceNumber": 90, + "name": "SIL Open Font License 1.1 with Reserved Font Name", + "licenseId": "OFL-1.1-RFN", + "seeAlso": [ + "http://scripts.sil.org/cms/scripts/page.php?item_id\u003dOFL_web", + "https://opensource.org/licenses/OFL-1.1" + ], + "isOsiApproved": true + }, + { + "reference": "https://spdx.org/licenses/OGC-1.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/OGC-1.0.json", + "referenceNumber": 504, + "name": "OGC Software License, Version 1.0", + "licenseId": "OGC-1.0", + "seeAlso": [ + "https://www.ogc.org/ogc/software/1.0" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/OGDL-Taiwan-1.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/OGDL-Taiwan-1.0.json", + "referenceNumber": 23, + "name": "Taiwan Open Government Data License, version 1.0", + "licenseId": "OGDL-Taiwan-1.0", + "seeAlso": [ + "https://data.gov.tw/license" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/OGL-Canada-2.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/OGL-Canada-2.0.json", + "referenceNumber": 40, + "name": "Open Government Licence - Canada", + "licenseId": "OGL-Canada-2.0", + "seeAlso": [ + "https://open.canada.ca/en/open-government-licence-canada" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/OGL-UK-1.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/OGL-UK-1.0.json", + "referenceNumber": 497, + "name": "Open Government Licence v1.0", + "licenseId": "OGL-UK-1.0", + "seeAlso": [ + "http://www.nationalarchives.gov.uk/doc/open-government-licence/version/1/" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/OGL-UK-2.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/OGL-UK-2.0.json", + "referenceNumber": 556, + "name": "Open Government Licence v2.0", + "licenseId": "OGL-UK-2.0", + "seeAlso": [ + "http://www.nationalarchives.gov.uk/doc/open-government-licence/version/2/" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/OGL-UK-3.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/OGL-UK-3.0.json", + "referenceNumber": 585, + "name": "Open Government Licence v3.0", + "licenseId": "OGL-UK-3.0", + "seeAlso": [ + "http://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/OGTSL.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/OGTSL.json", + "referenceNumber": 97, + "name": "Open Group Test Suite License", + "licenseId": "OGTSL", + "seeAlso": [ + "http://www.opengroup.org/testing/downloads/The_Open_Group_TSL.txt", + "https://opensource.org/licenses/OGTSL" + ], + "isOsiApproved": true + }, + { + "reference": "https://spdx.org/licenses/OLDAP-1.1.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/OLDAP-1.1.json", + "referenceNumber": 420, + "name": "Open LDAP Public License v1.1", + "licenseId": "OLDAP-1.1", + "seeAlso": [ + "http://www.openldap.org/devel/gitweb.cgi?p\u003dopenldap.git;a\u003dblob;f\u003dLICENSE;hb\u003d806557a5ad59804ef3a44d5abfbe91d706b0791f" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/OLDAP-1.2.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/OLDAP-1.2.json", + "referenceNumber": 487, + "name": "Open LDAP Public License v1.2", + "licenseId": "OLDAP-1.2", + "seeAlso": [ + "http://www.openldap.org/devel/gitweb.cgi?p\u003dopenldap.git;a\u003dblob;f\u003dLICENSE;hb\u003d42b0383c50c299977b5893ee695cf4e486fb0dc7" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/OLDAP-1.3.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/OLDAP-1.3.json", + "referenceNumber": 627, + "name": "Open LDAP Public License v1.3", + "licenseId": "OLDAP-1.3", + "seeAlso": [ + "http://www.openldap.org/devel/gitweb.cgi?p\u003dopenldap.git;a\u003dblob;f\u003dLICENSE;hb\u003de5f8117f0ce088d0bd7a8e18ddf37eaa40eb09b1" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/OLDAP-1.4.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/OLDAP-1.4.json", + "referenceNumber": 45, + "name": "Open LDAP Public License v1.4", + "licenseId": "OLDAP-1.4", + "seeAlso": [ + "http://www.openldap.org/devel/gitweb.cgi?p\u003dopenldap.git;a\u003dblob;f\u003dLICENSE;hb\u003dc9f95c2f3f2ffb5e0ae55fe7388af75547660941" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/OLDAP-2.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/OLDAP-2.0.json", + "referenceNumber": 537, + "name": "Open LDAP Public License v2.0 (or possibly 2.0A and 2.0B)", + "licenseId": "OLDAP-2.0", + "seeAlso": [ + "http://www.openldap.org/devel/gitweb.cgi?p\u003dopenldap.git;a\u003dblob;f\u003dLICENSE;hb\u003dcbf50f4e1185a21abd4c0a54d3f4341fe28f36ea" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/OLDAP-2.0.1.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/OLDAP-2.0.1.json", + "referenceNumber": 179, + "name": "Open LDAP Public License v2.0.1", + "licenseId": "OLDAP-2.0.1", + "seeAlso": [ + "http://www.openldap.org/devel/gitweb.cgi?p\u003dopenldap.git;a\u003dblob;f\u003dLICENSE;hb\u003db6d68acd14e51ca3aab4428bf26522aa74873f0e" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/OLDAP-2.1.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/OLDAP-2.1.json", + "referenceNumber": 342, + "name": "Open LDAP Public License v2.1", + "licenseId": "OLDAP-2.1", + "seeAlso": [ + "http://www.openldap.org/devel/gitweb.cgi?p\u003dopenldap.git;a\u003dblob;f\u003dLICENSE;hb\u003db0d176738e96a0d3b9f85cb51e140a86f21be715" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/OLDAP-2.2.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/OLDAP-2.2.json", + "referenceNumber": 347, + "name": "Open LDAP Public License v2.2", + "licenseId": "OLDAP-2.2", + "seeAlso": [ + "http://www.openldap.org/devel/gitweb.cgi?p\u003dopenldap.git;a\u003dblob;f\u003dLICENSE;hb\u003d470b0c18ec67621c85881b2733057fecf4a1acc3" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/OLDAP-2.2.1.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/OLDAP-2.2.1.json", + "referenceNumber": 208, + "name": "Open LDAP Public License v2.2.1", + "licenseId": "OLDAP-2.2.1", + "seeAlso": [ + "http://www.openldap.org/devel/gitweb.cgi?p\u003dopenldap.git;a\u003dblob;f\u003dLICENSE;hb\u003d4bc786f34b50aa301be6f5600f58a980070f481e" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/OLDAP-2.2.2.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/OLDAP-2.2.2.json", + "referenceNumber": 312, + "name": "Open LDAP Public License 2.2.2", + "licenseId": "OLDAP-2.2.2", + "seeAlso": [ + "http://www.openldap.org/devel/gitweb.cgi?p\u003dopenldap.git;a\u003dblob;f\u003dLICENSE;hb\u003ddf2cc1e21eb7c160695f5b7cffd6296c151ba188" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/OLDAP-2.3.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/OLDAP-2.3.json", + "referenceNumber": 276, + "name": "Open LDAP Public License v2.3", + "licenseId": "OLDAP-2.3", + "seeAlso": [ + "http://www.openldap.org/devel/gitweb.cgi?p\u003dopenldap.git;a\u003dblob;f\u003dLICENSE;hb\u003dd32cf54a32d581ab475d23c810b0a7fbaf8d63c3" + ], + "isOsiApproved": false, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/OLDAP-2.4.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/OLDAP-2.4.json", + "referenceNumber": 108, + "name": "Open LDAP Public License v2.4", + "licenseId": "OLDAP-2.4", + "seeAlso": [ + "http://www.openldap.org/devel/gitweb.cgi?p\u003dopenldap.git;a\u003dblob;f\u003dLICENSE;hb\u003dcd1284c4a91a8a380d904eee68d1583f989ed386" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/OLDAP-2.5.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/OLDAP-2.5.json", + "referenceNumber": 518, + "name": "Open LDAP Public License v2.5", + "licenseId": "OLDAP-2.5", + "seeAlso": [ + "http://www.openldap.org/devel/gitweb.cgi?p\u003dopenldap.git;a\u003dblob;f\u003dLICENSE;hb\u003d6852b9d90022e8593c98205413380536b1b5a7cf" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/OLDAP-2.6.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/OLDAP-2.6.json", + "referenceNumber": 275, + "name": "Open LDAP Public License v2.6", + "licenseId": "OLDAP-2.6", + "seeAlso": [ + "http://www.openldap.org/devel/gitweb.cgi?p\u003dopenldap.git;a\u003dblob;f\u003dLICENSE;hb\u003d1cae062821881f41b73012ba816434897abf4205" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/OLDAP-2.7.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/OLDAP-2.7.json", + "referenceNumber": 79, + "name": "Open LDAP Public License v2.7", + "licenseId": "OLDAP-2.7", + "seeAlso": [ + "http://www.openldap.org/devel/gitweb.cgi?p\u003dopenldap.git;a\u003dblob;f\u003dLICENSE;hb\u003d47c2415c1df81556eeb39be6cad458ef87c534a2" + ], + "isOsiApproved": false, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/OLDAP-2.8.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/OLDAP-2.8.json", + "referenceNumber": 72, + "name": "Open LDAP Public License v2.8", + "licenseId": "OLDAP-2.8", + "seeAlso": [ + "http://www.openldap.org/software/release/license.html" + ], + "isOsiApproved": true + }, + { + "reference": "https://spdx.org/licenses/OLFL-1.3.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/OLFL-1.3.json", + "referenceNumber": 204, + "name": "Open Logistics Foundation License Version 1.3", + "licenseId": "OLFL-1.3", + "seeAlso": [ + "https://openlogisticsfoundation.org/licenses/", + "https://opensource.org/license/olfl-1-3/" + ], + "isOsiApproved": true + }, + { + "reference": "https://spdx.org/licenses/OML.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/OML.json", + "referenceNumber": 505, + "name": "Open Market License", + "licenseId": "OML", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing/Open_Market_License" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/OpenPBS-2.3.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/OpenPBS-2.3.json", + "referenceNumber": 159, + "name": "OpenPBS v2.3 Software License", + "licenseId": "OpenPBS-2.3", + "seeAlso": [ + "https://github.com/adaptivecomputing/torque/blob/master/PBS_License.txt", + "https://www.mcs.anl.gov/research/projects/openpbs/PBS_License.txt" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/OpenSSL.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/OpenSSL.json", + "referenceNumber": 445, + "name": "OpenSSL License", + "licenseId": "OpenSSL", + "seeAlso": [ + "http://www.openssl.org/source/license.html" + ], + "isOsiApproved": false, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/OpenSSL-standalone.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/OpenSSL-standalone.json", + "referenceNumber": 635, + "name": "OpenSSL License - standalone", + "licenseId": "OpenSSL-standalone", + "seeAlso": [ + "https://library.netapp.com/ecm/ecm_download_file/ECMP1196395", + "https://hstechdocs.helpsystems.com/manuals/globalscape/archive/cuteftp6/open_ssl_license_agreement.htm" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/OpenVision.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/OpenVision.json", + "referenceNumber": 589, + "name": "OpenVision License", + "licenseId": "OpenVision", + "seeAlso": [ + "https://github.com/krb5/krb5/blob/krb5-1.21.2-final/NOTICE#L66-L98", + "https://web.mit.edu/kerberos/krb5-1.21/doc/mitK5license.html", + "https://fedoraproject.org/wiki/Licensing:MIT#OpenVision_Variant" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/OPL-1.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/OPL-1.0.json", + "referenceNumber": 80, + "name": "Open Public License v1.0", + "licenseId": "OPL-1.0", + "seeAlso": [ + "http://old.koalateam.com/jackaroo/OPL_1_0.TXT", + "https://fedoraproject.org/wiki/Licensing/Open_Public_License" + ], + "isOsiApproved": false, + "isFsfLibre": false + }, + { + "reference": "https://spdx.org/licenses/OPL-UK-3.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/OPL-UK-3.0.json", + "referenceNumber": 19, + "name": "United Kingdom Open Parliament Licence v3.0", + "licenseId": "OPL-UK-3.0", + "seeAlso": [ + "https://www.parliament.uk/site-information/copyright-parliament/open-parliament-licence/" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/OPUBL-1.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/OPUBL-1.0.json", + "referenceNumber": 266, + "name": "Open Publication License v1.0", + "licenseId": "OPUBL-1.0", + "seeAlso": [ + "http://opencontent.org/openpub/", + "https://www.debian.org/opl", + "https://www.ctan.org/license/opl" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/OSET-PL-2.1.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/OSET-PL-2.1.json", + "referenceNumber": 307, + "name": "OSET Public License version 2.1", + "licenseId": "OSET-PL-2.1", + "seeAlso": [ + "http://www.osetfoundation.org/public-license", + "https://opensource.org/licenses/OPL-2.1" + ], + "isOsiApproved": true + }, + { + "reference": "https://spdx.org/licenses/OSL-1.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/OSL-1.0.json", + "referenceNumber": 306, + "name": "Open Software License 1.0", + "licenseId": "OSL-1.0", + "seeAlso": [ + "https://opensource.org/licenses/OSL-1.0" + ], + "isOsiApproved": true, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/OSL-1.1.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/OSL-1.1.json", + "referenceNumber": 111, + "name": "Open Software License 1.1", + "licenseId": "OSL-1.1", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing/OSL1.1" + ], + "isOsiApproved": false, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/OSL-2.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/OSL-2.0.json", + "referenceNumber": 457, + "name": "Open Software License 2.0", + "licenseId": "OSL-2.0", + "seeAlso": [ + "http://web.archive.org/web/20041020171434/http://www.rosenlaw.com/osl2.0.html" + ], + "isOsiApproved": true, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/OSL-2.1.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/OSL-2.1.json", + "referenceNumber": 247, + "name": "Open Software License 2.1", + "licenseId": "OSL-2.1", + "seeAlso": [ + "http://web.archive.org/web/20050212003940/http://www.rosenlaw.com/osl21.htm", + "https://opensource.org/licenses/OSL-2.1" + ], + "isOsiApproved": true, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/OSL-3.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/OSL-3.0.json", + "referenceNumber": 432, + "name": "Open Software License 3.0", + "licenseId": "OSL-3.0", + "seeAlso": [ + "https://web.archive.org/web/20120101081418/http://rosenlaw.com:80/OSL3.0.htm", + "https://opensource.org/licenses/OSL-3.0" + ], + "isOsiApproved": true, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/PADL.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/PADL.json", + "referenceNumber": 43, + "name": "PADL License", + "licenseId": "PADL", + "seeAlso": [ + "https://git.openldap.org/openldap/openldap/-/blob/master/libraries/libldap/os-local.c?ref_type\u003dheads#L19-23" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Parity-6.0.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Parity-6.0.0.json", + "referenceNumber": 49, + "name": "The Parity Public License 6.0.0", + "licenseId": "Parity-6.0.0", + "seeAlso": [ + "https://paritylicense.com/versions/6.0.0.html" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Parity-7.0.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Parity-7.0.0.json", + "referenceNumber": 482, + "name": "The Parity Public License 7.0.0", + "licenseId": "Parity-7.0.0", + "seeAlso": [ + "https://paritylicense.com/versions/7.0.0.html" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/PDDL-1.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/PDDL-1.0.json", + "referenceNumber": 210, + "name": "Open Data Commons Public Domain Dedication \u0026 License 1.0", + "licenseId": "PDDL-1.0", + "seeAlso": [ + "http://opendatacommons.org/licenses/pddl/1.0/", + "https://opendatacommons.org/licenses/pddl/" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/PHP-3.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/PHP-3.0.json", + "referenceNumber": 580, + "name": "PHP License v3.0", + "licenseId": "PHP-3.0", + "seeAlso": [ + "http://www.php.net/license/3_0.txt", + "https://opensource.org/licenses/PHP-3.0" + ], + "isOsiApproved": true + }, + { + "reference": "https://spdx.org/licenses/PHP-3.01.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/PHP-3.01.json", + "referenceNumber": 594, + "name": "PHP License v3.01", + "licenseId": "PHP-3.01", + "seeAlso": [ + "http://www.php.net/license/3_01.txt" + ], + "isOsiApproved": true, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/Pixar.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Pixar.json", + "referenceNumber": 619, + "name": "Pixar License", + "licenseId": "Pixar", + "seeAlso": [ + "https://github.com/PixarAnimationStudios/OpenSubdiv/raw/v3_5_0/LICENSE.txt", + "https://graphics.pixar.com/opensubdiv/docs/license.html", + "https://github.com/PixarAnimationStudios/OpenSubdiv/blob/v3_5_0/opensubdiv/version.cpp#L2-L22" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/pkgconf.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/pkgconf.json", + "referenceNumber": 16, + "name": "pkgconf License", + "licenseId": "pkgconf", + "seeAlso": [ + "https://github.com/pkgconf/pkgconf/blob/master/cli/main.c#L8" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Plexus.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Plexus.json", + "referenceNumber": 442, + "name": "Plexus Classworlds License", + "licenseId": "Plexus", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing/Plexus_Classworlds_License" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/pnmstitch.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/pnmstitch.json", + "referenceNumber": 502, + "name": "pnmstitch License", + "licenseId": "pnmstitch", + "seeAlso": [ + "https://sourceforge.net/p/netpbm/code/HEAD/tree/super_stable/editor/pnmstitch.c#l2" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/PolyForm-Noncommercial-1.0.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/PolyForm-Noncommercial-1.0.0.json", + "referenceNumber": 575, + "name": "PolyForm Noncommercial License 1.0.0", + "licenseId": "PolyForm-Noncommercial-1.0.0", + "seeAlso": [ + "https://polyformproject.org/licenses/noncommercial/1.0.0" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/PolyForm-Small-Business-1.0.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/PolyForm-Small-Business-1.0.0.json", + "referenceNumber": 9, + "name": "PolyForm Small Business License 1.0.0", + "licenseId": "PolyForm-Small-Business-1.0.0", + "seeAlso": [ + "https://polyformproject.org/licenses/small-business/1.0.0" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/PostgreSQL.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/PostgreSQL.json", + "referenceNumber": 94, + "name": "PostgreSQL License", + "licenseId": "PostgreSQL", + "seeAlso": [ + "http://www.postgresql.org/about/licence", + "https://opensource.org/licenses/PostgreSQL" + ], + "isOsiApproved": true + }, + { + "reference": "https://spdx.org/licenses/PPL.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/PPL.json", + "referenceNumber": 454, + "name": "Peer Production License", + "licenseId": "PPL", + "seeAlso": [ + "https://wiki.p2pfoundation.net/Peer_Production_License", + "http://www.networkcultures.org/_uploads/%233notebook_telekommunist.pdf" + ], + "isOsiApproved": false, + "isFsfLibre": false + }, + { + "reference": "https://spdx.org/licenses/PSF-2.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/PSF-2.0.json", + "referenceNumber": 62, + "name": "Python Software Foundation License 2.0", + "licenseId": "PSF-2.0", + "seeAlso": [ + "https://opensource.org/licenses/Python-2.0" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/psfrag.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/psfrag.json", + "referenceNumber": 279, + "name": "psfrag License", + "licenseId": "psfrag", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing/psfrag" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/psutils.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/psutils.json", + "referenceNumber": 387, + "name": "psutils License", + "licenseId": "psutils", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing/psutils" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Python-2.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Python-2.0.json", + "referenceNumber": 498, + "name": "Python License 2.0", + "licenseId": "Python-2.0", + "seeAlso": [ + "https://opensource.org/licenses/Python-2.0" + ], + "isOsiApproved": true, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/Python-2.0.1.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Python-2.0.1.json", + "referenceNumber": 453, + "name": "Python License 2.0.1", + "licenseId": "Python-2.0.1", + "seeAlso": [ + "https://www.python.org/download/releases/2.0.1/license/", + "https://docs.python.org/3/license.html", + "https://github.com/python/cpython/blob/main/LICENSE" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/python-ldap.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/python-ldap.json", + "referenceNumber": 422, + "name": "Python ldap License", + "licenseId": "python-ldap", + "seeAlso": [ + "https://github.com/python-ldap/python-ldap/blob/main/LICENCE" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Qhull.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Qhull.json", + "referenceNumber": 123, + "name": "Qhull License", + "licenseId": "Qhull", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing/Qhull" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/QPL-1.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/QPL-1.0.json", + "referenceNumber": 329, + "name": "Q Public License 1.0", + "licenseId": "QPL-1.0", + "seeAlso": [ + "http://doc.qt.nokia.com/3.3/license.html", + "https://opensource.org/licenses/QPL-1.0", + "https://doc.qt.io/archives/3.3/license.html" + ], + "isOsiApproved": true, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/QPL-1.0-INRIA-2004.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/QPL-1.0-INRIA-2004.json", + "referenceNumber": 479, + "name": "Q Public License 1.0 - INRIA 2004 variant", + "licenseId": "QPL-1.0-INRIA-2004", + "seeAlso": [ + "https://github.com/maranget/hevea/blob/master/LICENSE" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/radvd.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/radvd.json", + "referenceNumber": 182, + "name": "radvd License", + "licenseId": "radvd", + "seeAlso": [ + "https://github.com/radvd-project/radvd/blob/master/COPYRIGHT" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Rdisc.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Rdisc.json", + "referenceNumber": 101, + "name": "Rdisc License", + "licenseId": "Rdisc", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing/Rdisc_License" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/RHeCos-1.1.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/RHeCos-1.1.json", + "referenceNumber": 373, + "name": "Red Hat eCos Public License v1.1", + "licenseId": "RHeCos-1.1", + "seeAlso": [ + "http://ecos.sourceware.org/old-license.html" + ], + "isOsiApproved": false, + "isFsfLibre": false + }, + { + "reference": "https://spdx.org/licenses/RPL-1.1.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/RPL-1.1.json", + "referenceNumber": 369, + "name": "Reciprocal Public License 1.1", + "licenseId": "RPL-1.1", + "seeAlso": [ + "https://opensource.org/licenses/RPL-1.1" + ], + "isOsiApproved": true + }, + { + "reference": "https://spdx.org/licenses/RPL-1.5.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/RPL-1.5.json", + "referenceNumber": 102, + "name": "Reciprocal Public License 1.5", + "licenseId": "RPL-1.5", + "seeAlso": [ + "https://opensource.org/licenses/RPL-1.5" + ], + "isOsiApproved": true + }, + { + "reference": "https://spdx.org/licenses/RPSL-1.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/RPSL-1.0.json", + "referenceNumber": 663, + "name": "RealNetworks Public Source License v1.0", + "licenseId": "RPSL-1.0", + "seeAlso": [ + "https://helixcommunity.org/content/rpsl", + "https://opensource.org/licenses/RPSL-1.0" + ], + "isOsiApproved": true, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/RSA-MD.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/RSA-MD.json", + "referenceNumber": 139, + "name": "RSA Message-Digest License", + "licenseId": "RSA-MD", + "seeAlso": [ + "http://www.faqs.org/rfcs/rfc1321.html" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/RSCPL.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/RSCPL.json", + "referenceNumber": 405, + "name": "Ricoh Source Code Public License", + "licenseId": "RSCPL", + "seeAlso": [ + "http://wayback.archive.org/web/20060715140826/http://www.risource.org/RPL/RPL-1.0A.shtml", + "https://opensource.org/licenses/RSCPL" + ], + "isOsiApproved": true + }, + { + "reference": "https://spdx.org/licenses/Ruby.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Ruby.json", + "referenceNumber": 192, + "name": "Ruby License", + "licenseId": "Ruby", + "seeAlso": [ + "https://www.ruby-lang.org/en/about/license.txt" + ], + "isOsiApproved": false, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/Ruby-pty.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Ruby-pty.json", + "referenceNumber": 473, + "name": "Ruby pty extension license", + "licenseId": "Ruby-pty", + "seeAlso": [ + "https://github.com/ruby/ruby/blob/9f6deaa6888a423720b4b127b5314f0ad26cc2e6/ext/pty/pty.c#L775-L786", + "https://github.com/ruby/ruby/commit/0a64817fb80016030c03518fb9459f63c11605ea#diff-ef5fa30838d6d0cecad9e675cc50b24628cfe2cb277c346053fafcc36c91c204", + "https://github.com/ruby/ruby/commit/0a64817fb80016030c03518fb9459f63c11605ea#diff-fedf217c1ce44bda01f0a678d3ff8b198bed478754d699c527a698ad933979a0" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/SAX-PD.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/SAX-PD.json", + "referenceNumber": 205, + "name": "Sax Public Domain Notice", + "licenseId": "SAX-PD", + "seeAlso": [ + "http://www.saxproject.org/copying.html" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/SAX-PD-2.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/SAX-PD-2.0.json", + "referenceNumber": 209, + "name": "Sax Public Domain Notice 2.0", + "licenseId": "SAX-PD-2.0", + "seeAlso": [ + "http://www.saxproject.org/copying.html" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Saxpath.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Saxpath.json", + "referenceNumber": 67, + "name": "Saxpath License", + "licenseId": "Saxpath", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing/Saxpath_License" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/SCEA.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/SCEA.json", + "referenceNumber": 617, + "name": "SCEA Shared Source License", + "licenseId": "SCEA", + "seeAlso": [ + "http://research.scea.com/scea_shared_source_license.html" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/SchemeReport.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/SchemeReport.json", + "referenceNumber": 472, + "name": "Scheme Language Report License", + "licenseId": "SchemeReport", + "seeAlso": [], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Sendmail.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Sendmail.json", + "referenceNumber": 135, + "name": "Sendmail License", + "licenseId": "Sendmail", + "seeAlso": [ + "http://www.sendmail.com/pdfs/open_source/sendmail_license.pdf", + "https://web.archive.org/web/20160322142305/https://www.sendmail.com/pdfs/open_source/sendmail_license.pdf" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Sendmail-8.23.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Sendmail-8.23.json", + "referenceNumber": 226, + "name": "Sendmail License 8.23", + "licenseId": "Sendmail-8.23", + "seeAlso": [ + "https://www.proofpoint.com/sites/default/files/sendmail-license.pdf", + "https://web.archive.org/web/20181003101040/https://www.proofpoint.com/sites/default/files/sendmail-license.pdf" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/SGI-B-1.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/SGI-B-1.0.json", + "referenceNumber": 631, + "name": "SGI Free Software License B v1.0", + "licenseId": "SGI-B-1.0", + "seeAlso": [ + "http://oss.sgi.com/projects/FreeB/SGIFreeSWLicB.1.0.html" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/SGI-B-1.1.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/SGI-B-1.1.json", + "referenceNumber": 48, + "name": "SGI Free Software License B v1.1", + "licenseId": "SGI-B-1.1", + "seeAlso": [ + "http://oss.sgi.com/projects/FreeB/" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/SGI-B-2.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/SGI-B-2.0.json", + "referenceNumber": 193, + "name": "SGI Free Software License B v2.0", + "licenseId": "SGI-B-2.0", + "seeAlso": [ + "http://oss.sgi.com/projects/FreeB/SGIFreeSWLicB.2.0.pdf" + ], + "isOsiApproved": false, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/SGI-OpenGL.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/SGI-OpenGL.json", + "referenceNumber": 565, + "name": "SGI OpenGL License", + "licenseId": "SGI-OpenGL", + "seeAlso": [ + "https://gitlab.freedesktop.org/mesa/glw/-/blob/master/README?ref_type\u003dheads" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/SGP4.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/SGP4.json", + "referenceNumber": 291, + "name": "SGP4 Permission Notice", + "licenseId": "SGP4", + "seeAlso": [ + "https://celestrak.org/publications/AIAA/2006-6753/faq.php" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/SHL-0.5.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/SHL-0.5.json", + "referenceNumber": 623, + "name": "Solderpad Hardware License v0.5", + "licenseId": "SHL-0.5", + "seeAlso": [ + "https://solderpad.org/licenses/SHL-0.5/" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/SHL-0.51.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/SHL-0.51.json", + "referenceNumber": 34, + "name": "Solderpad Hardware License, Version 0.51", + "licenseId": "SHL-0.51", + "seeAlso": [ + "https://solderpad.org/licenses/SHL-0.51/" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/SimPL-2.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/SimPL-2.0.json", + "referenceNumber": 630, + "name": "Simple Public License 2.0", + "licenseId": "SimPL-2.0", + "seeAlso": [ + "https://opensource.org/licenses/SimPL-2.0" + ], + "isOsiApproved": true + }, + { + "reference": "https://spdx.org/licenses/SISSL.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/SISSL.json", + "referenceNumber": 655, + "name": "Sun Industry Standards Source License v1.1", + "licenseId": "SISSL", + "seeAlso": [ + "http://www.openoffice.org/licenses/sissl_license.html", + "https://opensource.org/licenses/SISSL" + ], + "isOsiApproved": true, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/SISSL-1.2.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/SISSL-1.2.json", + "referenceNumber": 401, + "name": "Sun Industry Standards Source License v1.2", + "licenseId": "SISSL-1.2", + "seeAlso": [ + "http://gridscheduler.sourceforge.net/Gridengine_SISSL_license.html" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/SL.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/SL.json", + "referenceNumber": 632, + "name": "SL License", + "licenseId": "SL", + "seeAlso": [ + "https://github.com/mtoyoda/sl/blob/master/LICENSE" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Sleepycat.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Sleepycat.json", + "referenceNumber": 283, + "name": "Sleepycat License", + "licenseId": "Sleepycat", + "seeAlso": [ + "https://opensource.org/licenses/Sleepycat" + ], + "isOsiApproved": true, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/SMLNJ.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/SMLNJ.json", + "referenceNumber": 413, + "name": "Standard ML of New Jersey License", + "licenseId": "SMLNJ", + "seeAlso": [ + "https://www.smlnj.org/license.html" + ], + "isOsiApproved": false, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/SMPPL.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/SMPPL.json", + "referenceNumber": 321, + "name": "Secure Messaging Protocol Public License", + "licenseId": "SMPPL", + "seeAlso": [ + "https://github.com/dcblake/SMP/blob/master/Documentation/License.txt" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/SNIA.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/SNIA.json", + "referenceNumber": 41, + "name": "SNIA Public License 1.1", + "licenseId": "SNIA", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing/SNIA_Public_License" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/snprintf.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/snprintf.json", + "referenceNumber": 507, + "name": "snprintf License", + "licenseId": "snprintf", + "seeAlso": [ + "https://github.com/openssh/openssh-portable/blob/master/openbsd-compat/bsd-snprintf.c#L2" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/softSurfer.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/softSurfer.json", + "referenceNumber": 496, + "name": "softSurfer License", + "licenseId": "softSurfer", + "seeAlso": [ + "https://github.com/mm2/Little-CMS/blob/master/src/cmssm.c#L207", + "https://fedoraproject.org/wiki/Licensing/softSurfer" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Soundex.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Soundex.json", + "referenceNumber": 1, + "name": "Soundex License", + "licenseId": "Soundex", + "seeAlso": [ + "https://metacpan.org/release/RJBS/Text-Soundex-3.05/source/Soundex.pm#L3-11" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Spencer-86.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Spencer-86.json", + "referenceNumber": 257, + "name": "Spencer License 86", + "licenseId": "Spencer-86", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing/Henry_Spencer_Reg-Ex_Library_License" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Spencer-94.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Spencer-94.json", + "referenceNumber": 228, + "name": "Spencer License 94", + "licenseId": "Spencer-94", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing/Henry_Spencer_Reg-Ex_Library_License", + "https://metacpan.org/release/KNOK/File-MMagic-1.30/source/COPYING#L28" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Spencer-99.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Spencer-99.json", + "referenceNumber": 287, + "name": "Spencer License 99", + "licenseId": "Spencer-99", + "seeAlso": [ + "http://www.opensource.apple.com/source/tcl/tcl-5/tcl/generic/regfronts.c" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/SPL-1.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/SPL-1.0.json", + "referenceNumber": 576, + "name": "Sun Public License v1.0", + "licenseId": "SPL-1.0", + "seeAlso": [ + "https://opensource.org/licenses/SPL-1.0" + ], + "isOsiApproved": true, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/ssh-keyscan.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/ssh-keyscan.json", + "referenceNumber": 78, + "name": "ssh-keyscan License", + "licenseId": "ssh-keyscan", + "seeAlso": [ + "https://github.com/openssh/openssh-portable/blob/master/LICENCE#L82" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/SSH-OpenSSH.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/SSH-OpenSSH.json", + "referenceNumber": 536, + "name": "SSH OpenSSH license", + "licenseId": "SSH-OpenSSH", + "seeAlso": [ + "https://github.com/openssh/openssh-portable/blob/1b11ea7c58cd5c59838b5fa574cd456d6047b2d4/LICENCE#L10" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/SSH-short.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/SSH-short.json", + "referenceNumber": 438, + "name": "SSH short notice", + "licenseId": "SSH-short", + "seeAlso": [ + "https://github.com/openssh/openssh-portable/blob/1b11ea7c58cd5c59838b5fa574cd456d6047b2d4/pathnames.h", + "http://web.mit.edu/kolya/.f/root/athena.mit.edu/sipb.mit.edu/project/openssh/OldFiles/src/openssh-2.9.9p2/ssh-add.1", + "https://joinup.ec.europa.eu/svn/lesoll/trunk/italc/lib/src/dsa_key.cpp" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/SSLeay-standalone.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/SSLeay-standalone.json", + "referenceNumber": 421, + "name": "SSLeay License - standalone", + "licenseId": "SSLeay-standalone", + "seeAlso": [ + "https://www.tq-group.com/filedownloads/files/software-license-conditions/OriginalSSLeay/OriginalSSLeay.pdf" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/SSPL-1.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/SSPL-1.0.json", + "referenceNumber": 295, + "name": "Server Side Public License, v 1", + "licenseId": "SSPL-1.0", + "seeAlso": [ + "https://www.mongodb.com/licensing/server-side-public-license" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/StandardML-NJ.html", + "isDeprecatedLicenseId": true, + "detailsUrl": "https://spdx.org/licenses/StandardML-NJ.json", + "referenceNumber": 201, + "name": "Standard ML of New Jersey License", + "licenseId": "StandardML-NJ", + "seeAlso": [ + "https://www.smlnj.org/license.html" + ], + "isOsiApproved": false, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/SugarCRM-1.1.3.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/SugarCRM-1.1.3.json", + "referenceNumber": 11, + "name": "SugarCRM Public License v1.1.3", + "licenseId": "SugarCRM-1.1.3", + "seeAlso": [ + "http://www.sugarcrm.com/crm/SPL" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Sun-PPP.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Sun-PPP.json", + "referenceNumber": 313, + "name": "Sun PPP License", + "licenseId": "Sun-PPP", + "seeAlso": [ + "https://github.com/ppp-project/ppp/blob/master/pppd/eap.c#L7-L16" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Sun-PPP-2000.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Sun-PPP-2000.json", + "referenceNumber": 489, + "name": "Sun PPP License (2000)", + "licenseId": "Sun-PPP-2000", + "seeAlso": [ + "https://github.com/ppp-project/ppp/blob/master/modules/ppp_ahdlc.c#L7-L19" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/SunPro.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/SunPro.json", + "referenceNumber": 440, + "name": "SunPro License", + "licenseId": "SunPro", + "seeAlso": [ + "https://github.com/freebsd/freebsd-src/blob/main/lib/msun/src/e_acosh.c", + "https://github.com/freebsd/freebsd-src/blob/main/lib/msun/src/e_lgammal.c" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/SWL.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/SWL.json", + "referenceNumber": 331, + "name": "Scheme Widget Library (SWL) Software License Agreement", + "licenseId": "SWL", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing/SWL" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/swrule.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/swrule.json", + "referenceNumber": 206, + "name": "swrule License", + "licenseId": "swrule", + "seeAlso": [ + "https://ctan.math.utah.edu/ctan/tex-archive/macros/generic/misc/swrule.sty" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Symlinks.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Symlinks.json", + "referenceNumber": 136, + "name": "Symlinks License", + "licenseId": "Symlinks", + "seeAlso": [ + "https://www.mail-archive.com/debian-bugs-rc@lists.debian.org/msg11494.html" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/TAPR-OHL-1.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/TAPR-OHL-1.0.json", + "referenceNumber": 317, + "name": "TAPR Open Hardware License v1.0", + "licenseId": "TAPR-OHL-1.0", + "seeAlso": [ + "https://www.tapr.org/OHL" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/TCL.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/TCL.json", + "referenceNumber": 644, + "name": "TCL/TK License", + "licenseId": "TCL", + "seeAlso": [ + "http://www.tcl.tk/software/tcltk/license.html", + "https://fedoraproject.org/wiki/Licensing/TCL" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/TCP-wrappers.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/TCP-wrappers.json", + "referenceNumber": 245, + "name": "TCP Wrappers License", + "licenseId": "TCP-wrappers", + "seeAlso": [ + "http://rc.quest.com/topics/openssh/license.php#tcpwrappers" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/TermReadKey.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/TermReadKey.json", + "referenceNumber": 37, + "name": "TermReadKey License", + "licenseId": "TermReadKey", + "seeAlso": [ + "https://github.com/jonathanstowe/TermReadKey/blob/master/README#L9-L10" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/TGPPL-1.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/TGPPL-1.0.json", + "referenceNumber": 112, + "name": "Transitive Grace Period Public Licence 1.0", + "licenseId": "TGPPL-1.0", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing/TGPPL", + "https://tahoe-lafs.org/trac/tahoe-lafs/browser/trunk/COPYING.TGPPL.rst" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/threeparttable.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/threeparttable.json", + "referenceNumber": 319, + "name": "threeparttable License", + "licenseId": "threeparttable", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing/Threeparttable" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/TMate.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/TMate.json", + "referenceNumber": 509, + "name": "TMate Open Source License", + "licenseId": "TMate", + "seeAlso": [ + "http://svnkit.com/license.html" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/TORQUE-1.1.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/TORQUE-1.1.json", + "referenceNumber": 105, + "name": "TORQUE v2.5+ Software License v1.1", + "licenseId": "TORQUE-1.1", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing/TORQUEv1.1" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/TOSL.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/TOSL.json", + "referenceNumber": 107, + "name": "Trusster Open Source License", + "licenseId": "TOSL", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing/TOSL" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/TPDL.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/TPDL.json", + "referenceNumber": 124, + "name": "Time::ParseDate License", + "licenseId": "TPDL", + "seeAlso": [ + "https://metacpan.org/pod/Time::ParseDate#LICENSE" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/TPL-1.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/TPL-1.0.json", + "referenceNumber": 490, + "name": "THOR Public License 1.0", + "licenseId": "TPL-1.0", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing:ThorPublicLicense" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/TTWL.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/TTWL.json", + "referenceNumber": 35, + "name": "Text-Tabs+Wrap License", + "licenseId": "TTWL", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing/TTWL", + "https://github.com/ap/Text-Tabs/blob/master/lib.modern/Text/Tabs.pm#L148" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/TTYP0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/TTYP0.json", + "referenceNumber": 542, + "name": "TTYP0 License", + "licenseId": "TTYP0", + "seeAlso": [ + "https://people.mpi-inf.mpg.de/~uwe/misc/uw-ttyp0/" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/TU-Berlin-1.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/TU-Berlin-1.0.json", + "referenceNumber": 372, + "name": "Technische Universitaet Berlin License 1.0", + "licenseId": "TU-Berlin-1.0", + "seeAlso": [ + "https://github.com/swh/ladspa/blob/7bf6f3799fdba70fda297c2d8fd9f526803d9680/gsm/COPYRIGHT" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/TU-Berlin-2.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/TU-Berlin-2.0.json", + "referenceNumber": 246, + "name": "Technische Universitaet Berlin License 2.0", + "licenseId": "TU-Berlin-2.0", + "seeAlso": [ + "https://github.com/CorsixTH/deps/blob/fd339a9f526d1d9c9f01ccf39e438a015da50035/licences/libgsm.txt" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Ubuntu-font-1.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Ubuntu-font-1.0.json", + "referenceNumber": 191, + "name": "Ubuntu Font Licence v1.0", + "licenseId": "Ubuntu-font-1.0", + "seeAlso": [ + "https://ubuntu.com/legal/font-licence", + "https://assets.ubuntu.com/v1/81e5605d-ubuntu-font-licence-1.0.txt" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/UCAR.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/UCAR.json", + "referenceNumber": 452, + "name": "UCAR License", + "licenseId": "UCAR", + "seeAlso": [ + "https://github.com/Unidata/UDUNITS-2/blob/master/COPYRIGHT" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/UCL-1.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/UCL-1.0.json", + "referenceNumber": 550, + "name": "Upstream Compatibility License v1.0", + "licenseId": "UCL-1.0", + "seeAlso": [ + "https://opensource.org/licenses/UCL-1.0" + ], + "isOsiApproved": true + }, + { + "reference": "https://spdx.org/licenses/ulem.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/ulem.json", + "referenceNumber": 399, + "name": "ulem License", + "licenseId": "ulem", + "seeAlso": [ + "https://mirrors.ctan.org/macros/latex/contrib/ulem/README" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/UMich-Merit.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/UMich-Merit.json", + "referenceNumber": 581, + "name": "Michigan/Merit Networks License", + "licenseId": "UMich-Merit", + "seeAlso": [ + "https://github.com/radcli/radcli/blob/master/COPYRIGHT#L64" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Unicode-3.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Unicode-3.0.json", + "referenceNumber": 262, + "name": "Unicode License v3", + "licenseId": "Unicode-3.0", + "seeAlso": [ + "https://www.unicode.org/license.txt" + ], + "isOsiApproved": true + }, + { + "reference": "https://spdx.org/licenses/Unicode-DFS-2015.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Unicode-DFS-2015.json", + "referenceNumber": 328, + "name": "Unicode License Agreement - Data Files and Software (2015)", + "licenseId": "Unicode-DFS-2015", + "seeAlso": [ + "https://web.archive.org/web/20151224134844/http://unicode.org/copyright.html" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Unicode-DFS-2016.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Unicode-DFS-2016.json", + "referenceNumber": 484, + "name": "Unicode License Agreement - Data Files and Software (2016)", + "licenseId": "Unicode-DFS-2016", + "seeAlso": [ + "https://www.unicode.org/license.txt", + "http://web.archive.org/web/20160823201924/http://www.unicode.org/copyright.html#License", + "http://www.unicode.org/copyright.html" + ], + "isOsiApproved": true + }, + { + "reference": "https://spdx.org/licenses/Unicode-TOU.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Unicode-TOU.json", + "referenceNumber": 628, + "name": "Unicode Terms of Use", + "licenseId": "Unicode-TOU", + "seeAlso": [ + "http://web.archive.org/web/20140704074106/http://www.unicode.org/copyright.html", + "http://www.unicode.org/copyright.html" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/UnixCrypt.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/UnixCrypt.json", + "referenceNumber": 95, + "name": "UnixCrypt License", + "licenseId": "UnixCrypt", + "seeAlso": [ + "https://foss.heptapod.net/python-libs/passlib/-/blob/branch/stable/LICENSE#L70", + "https://opensource.apple.com/source/JBoss/JBoss-737/jboss-all/jetty/src/main/org/mortbay/util/UnixCrypt.java.auto.html", + "https://archive.eclipse.org/jetty/8.0.1.v20110908/xref/org/eclipse/jetty/http/security/UnixCrypt.html" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Unlicense.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Unlicense.json", + "referenceNumber": 218, + "name": "The Unlicense", + "licenseId": "Unlicense", + "seeAlso": [ + "https://unlicense.org/" + ], + "isOsiApproved": true, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/UPL-1.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/UPL-1.0.json", + "referenceNumber": 5, + "name": "Universal Permissive License v1.0", + "licenseId": "UPL-1.0", + "seeAlso": [ + "https://opensource.org/licenses/UPL" + ], + "isOsiApproved": true, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/URT-RLE.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/URT-RLE.json", + "referenceNumber": 165, + "name": "Utah Raster Toolkit Run Length Encoded License", + "licenseId": "URT-RLE", + "seeAlso": [ + "https://sourceforge.net/p/netpbm/code/HEAD/tree/super_stable/converter/other/pnmtorle.c", + "https://sourceforge.net/p/netpbm/code/HEAD/tree/super_stable/converter/other/rletopnm.c" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Vim.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Vim.json", + "referenceNumber": 549, + "name": "Vim License", + "licenseId": "Vim", + "seeAlso": [ + "http://vimdoc.sourceforge.net/htmldoc/uganda.html" + ], + "isOsiApproved": false, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/VOSTROM.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/VOSTROM.json", + "referenceNumber": 544, + "name": "VOSTROM Public License for Open Source", + "licenseId": "VOSTROM", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing/VOSTROM" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/VSL-1.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/VSL-1.0.json", + "referenceNumber": 109, + "name": "Vovida Software License v1.0", + "licenseId": "VSL-1.0", + "seeAlso": [ + "https://opensource.org/licenses/VSL-1.0" + ], + "isOsiApproved": true + }, + { + "reference": "https://spdx.org/licenses/W3C.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/W3C.json", + "referenceNumber": 28, + "name": "W3C Software Notice and License (2002-12-31)", + "licenseId": "W3C", + "seeAlso": [ + "http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231.html", + "https://opensource.org/licenses/W3C" + ], + "isOsiApproved": true, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/W3C-19980720.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/W3C-19980720.json", + "referenceNumber": 629, + "name": "W3C Software Notice and License (1998-07-20)", + "licenseId": "W3C-19980720", + "seeAlso": [ + "http://www.w3.org/Consortium/Legal/copyright-software-19980720.html" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/W3C-20150513.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/W3C-20150513.json", + "referenceNumber": 315, + "name": "W3C Software Notice and Document License (2015-05-13)", + "licenseId": "W3C-20150513", + "seeAlso": [ + "https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document", + "https://www.w3.org/copyright/software-license-2015/", + "https://www.w3.org/copyright/software-license-2023/" + ], + "isOsiApproved": true + }, + { + "reference": "https://spdx.org/licenses/w3m.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/w3m.json", + "referenceNumber": 379, + "name": "w3m License", + "licenseId": "w3m", + "seeAlso": [ + "https://github.com/tats/w3m/blob/master/COPYING" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Watcom-1.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Watcom-1.0.json", + "referenceNumber": 612, + "name": "Sybase Open Watcom Public License 1.0", + "licenseId": "Watcom-1.0", + "seeAlso": [ + "https://opensource.org/licenses/Watcom-1.0" + ], + "isOsiApproved": true, + "isFsfLibre": false + }, + { + "reference": "https://spdx.org/licenses/Widget-Workshop.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Widget-Workshop.json", + "referenceNumber": 256, + "name": "Widget Workshop License", + "licenseId": "Widget-Workshop", + "seeAlso": [ + "https://github.com/novnc/noVNC/blob/master/core/crypto/des.js#L24" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Wsuipa.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Wsuipa.json", + "referenceNumber": 199, + "name": "Wsuipa License", + "licenseId": "Wsuipa", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing/Wsuipa" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/WTFPL.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/WTFPL.json", + "referenceNumber": 173, + "name": "Do What The F*ck You Want To Public License", + "licenseId": "WTFPL", + "seeAlso": [ + "http://www.wtfpl.net/about/", + "http://sam.zoy.org/wtfpl/COPYING" + ], + "isOsiApproved": false, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/wxWindows.html", + "isDeprecatedLicenseId": true, + "detailsUrl": "https://spdx.org/licenses/wxWindows.json", + "referenceNumber": 350, + "name": "wxWindows Library License", + "licenseId": "wxWindows", + "seeAlso": [ + "https://opensource.org/licenses/WXwindows" + ], + "isOsiApproved": true + }, + { + "reference": "https://spdx.org/licenses/X11.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/X11.json", + "referenceNumber": 274, + "name": "X11 License", + "licenseId": "X11", + "seeAlso": [ + "http://www.xfree86.org/3.3.6/COPYRIGHT2.html#3" + ], + "isOsiApproved": false, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/X11-distribute-modifications-variant.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/X11-distribute-modifications-variant.json", + "referenceNumber": 286, + "name": "X11 License Distribution Modification Variant", + "licenseId": "X11-distribute-modifications-variant", + "seeAlso": [ + "https://github.com/mirror/ncurses/blob/master/COPYING" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/X11-swapped.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/X11-swapped.json", + "referenceNumber": 7, + "name": "X11 swapped final paragraphs", + "licenseId": "X11-swapped", + "seeAlso": [ + "https://github.com/fedeinthemix/chez-srfi/blob/master/srfi/LICENSE" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Xdebug-1.03.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Xdebug-1.03.json", + "referenceNumber": 471, + "name": "Xdebug License v 1.03", + "licenseId": "Xdebug-1.03", + "seeAlso": [ + "https://github.com/xdebug/xdebug/blob/master/LICENSE" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Xerox.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Xerox.json", + "referenceNumber": 417, + "name": "Xerox License", + "licenseId": "Xerox", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing/Xerox" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Xfig.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Xfig.json", + "referenceNumber": 63, + "name": "Xfig License", + "licenseId": "Xfig", + "seeAlso": [ + "https://github.com/Distrotech/transfig/blob/master/transfig/transfig.c", + "https://fedoraproject.org/wiki/Licensing:MIT#Xfig_Variant", + "https://sourceforge.net/p/mcj/xfig/ci/master/tree/src/Makefile.am" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/XFree86-1.1.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/XFree86-1.1.json", + "referenceNumber": 311, + "name": "XFree86 License 1.1", + "licenseId": "XFree86-1.1", + "seeAlso": [ + "http://www.xfree86.org/current/LICENSE4.html" + ], + "isOsiApproved": false, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/xinetd.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/xinetd.json", + "referenceNumber": 406, + "name": "xinetd License", + "licenseId": "xinetd", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing/Xinetd_License" + ], + "isOsiApproved": false, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/xkeyboard-config-Zinoviev.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/xkeyboard-config-Zinoviev.json", + "referenceNumber": 55, + "name": "xkeyboard-config Zinoviev License", + "licenseId": "xkeyboard-config-Zinoviev", + "seeAlso": [ + "https://gitlab.freedesktop.org/xkeyboard-config/xkeyboard-config/-/blob/master/COPYING?ref_type\u003dheads#L178" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/xlock.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/xlock.json", + "referenceNumber": 140, + "name": "xlock License", + "licenseId": "xlock", + "seeAlso": [ + "https://fossies.org/linux/tiff/contrib/ras/ras2tif.c" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Xnet.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Xnet.json", + "referenceNumber": 639, + "name": "X.Net License", + "licenseId": "Xnet", + "seeAlso": [ + "https://opensource.org/licenses/Xnet" + ], + "isOsiApproved": true + }, + { + "reference": "https://spdx.org/licenses/xpp.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/xpp.json", + "referenceNumber": 243, + "name": "XPP License", + "licenseId": "xpp", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing/xpp" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/XSkat.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/XSkat.json", + "referenceNumber": 535, + "name": "XSkat License", + "licenseId": "XSkat", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing/XSkat_License" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/xzoom.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/xzoom.json", + "referenceNumber": 339, + "name": "xzoom License", + "licenseId": "xzoom", + "seeAlso": [ + "https://metadata.ftp-master.debian.org/changelogs//main/x/xzoom/xzoom_0.3-27_copyright" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/YPL-1.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/YPL-1.0.json", + "referenceNumber": 506, + "name": "Yahoo! Public License v1.0", + "licenseId": "YPL-1.0", + "seeAlso": [ + "http://www.zimbra.com/license/yahoo_public_license_1.0.html" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/YPL-1.1.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/YPL-1.1.json", + "referenceNumber": 538, + "name": "Yahoo! Public License v1.1", + "licenseId": "YPL-1.1", + "seeAlso": [ + "http://www.zimbra.com/license/yahoo_public_license_1.1.html" + ], + "isOsiApproved": false, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/Zed.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Zed.json", + "referenceNumber": 500, + "name": "Zed License", + "licenseId": "Zed", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing/Zed" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Zeeff.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Zeeff.json", + "referenceNumber": 382, + "name": "Zeeff License", + "licenseId": "Zeeff", + "seeAlso": [ + "ftp://ftp.tin.org/pub/news/utils/newsx/newsx-1.6.tar.gz" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Zend-2.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Zend-2.0.json", + "referenceNumber": 51, + "name": "Zend License v2.0", + "licenseId": "Zend-2.0", + "seeAlso": [ + "https://web.archive.org/web/20130517195954/http://www.zend.com/license/2_00.txt" + ], + "isOsiApproved": false, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/Zimbra-1.3.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Zimbra-1.3.json", + "referenceNumber": 555, + "name": "Zimbra Public License v1.3", + "licenseId": "Zimbra-1.3", + "seeAlso": [ + "http://web.archive.org/web/20100302225219/http://www.zimbra.com/license/zimbra-public-license-1-3.html" + ], + "isOsiApproved": false, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/Zimbra-1.4.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Zimbra-1.4.json", + "referenceNumber": 227, + "name": "Zimbra Public License v1.4", + "licenseId": "Zimbra-1.4", + "seeAlso": [ + "http://www.zimbra.com/legal/zimbra-public-license-1-4" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Zlib.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Zlib.json", + "referenceNumber": 74, + "name": "zlib License", + "licenseId": "Zlib", + "seeAlso": [ + "http://www.zlib.net/zlib_license.html", + "https://opensource.org/licenses/Zlib" + ], + "isOsiApproved": true, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/zlib-acknowledgement.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/zlib-acknowledgement.json", + "referenceNumber": 371, + "name": "zlib/libpng License with Acknowledgement", + "licenseId": "zlib-acknowledgement", + "seeAlso": [ + "https://fedoraproject.org/wiki/Licensing/ZlibWithAcknowledgement" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/ZPL-1.1.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/ZPL-1.1.json", + "referenceNumber": 598, + "name": "Zope Public License 1.1", + "licenseId": "ZPL-1.1", + "seeAlso": [ + "http://old.zope.org/Resources/License/ZPL-1.1" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/ZPL-2.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/ZPL-2.0.json", + "referenceNumber": 539, + "name": "Zope Public License 2.0", + "licenseId": "ZPL-2.0", + "seeAlso": [ + "http://old.zope.org/Resources/License/ZPL-2.0", + "https://opensource.org/licenses/ZPL-2.0" + ], + "isOsiApproved": true, + "isFsfLibre": true + }, + { + "reference": "https://spdx.org/licenses/ZPL-2.1.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/ZPL-2.1.json", + "referenceNumber": 638, + "name": "Zope Public License 2.1", + "licenseId": "ZPL-2.1", + "seeAlso": [ + "http://old.zope.org/Resources/ZPL/" + ], + "isOsiApproved": true, + "isFsfLibre": true + } + ], + "releaseDate": "2024-08-19" +} diff --git a/project-cabal/ghc-latest.config b/project-cabal/ghc-latest.config index 5f8d40290db..24810b986a4 100644 --- a/project-cabal/ghc-latest.config +++ b/project-cabal/ghc-latest.config @@ -8,7 +8,7 @@ -- NOTE: don't forget to update the compiler version in the conditional -- when upgrading to a newer GHC -if impl(ghc >= 9.10.0) +if impl(ghc >= 9.12.0) allow-newer: --windns:*, rere:*, tree-diff:*, uuid-types:*, these:*, hashable:*, assoc:*, semialign:*, indexed-traversable-instances:*, indexed-traversable:*, OneTuple:*, scientific:*, time-compat:*, text-short:*, integer-conversion:*, generically:*, data-fix:*, binary:* -- Artem, 2024-04-21: I started and then gave up... diff --git a/project-cabal/pkgs/tests.config b/project-cabal/pkgs/tests.config index a9cec9c596f..75fe4af5ad7 100644 --- a/project-cabal/pkgs/tests.config +++ b/project-cabal/pkgs/tests.config @@ -2,3 +2,4 @@ packages: Cabal-QuickCheck , Cabal-tests , Cabal-tree-diff + , cabal-validate diff --git a/release-notes/Cabal-3.12.0.0.md b/release-notes/Cabal-3.12.0.0.md index f177338c6ec..23c416aab75 100644 --- a/release-notes/Cabal-3.12.0.0.md +++ b/release-notes/Cabal-3.12.0.0.md @@ -55,7 +55,7 @@ Cabal and Cabal-syntax 3.12.0.0 changelog and release notes `filterPackageChecksById`, this can be used by third-party tools to filter warnings. -- Add support for `GHC2024` [#9736](https://github.com/haskell/cabal/issues/9736) +- Add support for `GHC2024` [#9736](https://github.com/haskell/cabal/issues/9736) [#9791](https://github.com/haskell/cabal/pull/9791) Support for the `GHC2024` language edition, introduced by GHC 9.10, has been added. It can now be used in the `default-language` and `other-languages` @@ -77,14 +77,54 @@ Cabal and Cabal-syntax 3.12.0.0 changelog and release notes Support for all previous GHC versions is deprecated. +- Label error messages with codes (following GHC, Stack) + + As with GHC and Stack, Cabal and cabal-install now generate warnings and errors prefixed with error codes of the form `[Cabal-xxxxx]`. These will be documented on https://errors.haskell.org, although very few are as yet. + ### Other changes -- `cabal init` should not suggest Cabal < 2.0 [#8680](https://github.com/haskell/cabal/issues/8680) +- Installing a library with a Custom setup no longer requires building the executable [#9777](https://github.com/haskell/cabal/issues/9777) [#9650](https://github.com/haskell/cabal/pull/9650) [#10311](https://github.com/haskell/cabal/pull/10311) + + For example, if we have `pkg-a.cabal`: + + ``` + library + build-depends: pkg-b + ``` + + and `pkg-b.cabal`: + + ``` + library + exposed-modules: ... + + executable pkg-b-exe + main-is: ... + ``` + + + An invocation `cabal build pkg-a` will build `lib:pkg-a` and `lib:pkg-b`, but + not `exe:pkg-b-exe` because it is not needed for building `pkg-a`! Previously the executable would be built unnecessarily. + + If the invocation were `cabal build pkg-a exe:pkg-b-exe` then all `lib:pkg-a`, `lib:pkg-b`, and `exe:pkg-b-exe` would be built. + + Note: There may be a package whose Custom setup expects the executable to be + built together with the library always. Unfortunately, this is a breaking + change for them. To migrate, packages should no longer assume the executable is + built when only the library is requested (e.g. `cabal install --lib Agda` will + *not* build the `Agda` executable, while `cabal install Agda` will). + + Agda is an example of a package which expected in its `Setup.hs` copy hook the + executable to already be built. This was fixed by inspecting the copy arguments + and making sure we only use the executable when it is built, since it is only + needed when the executable too is needed. + +- `cabal init` should not suggest Cabal < 2.0 [#8680](https://github.com/haskell/cabal/issues/8680) [#8700](https://github.com/haskell/cabal/pull/8700) 'cabal init' no longer suggests users to set cabal-version to less than 2.0. -- Remove Distribution.Utils.TempTestDir module from Cabal library [#9453](https://github.com/haskell/cabal/issues/9453) [#9454](https://github.com/haskell/cabal/pull/9454) +- Remove `Distribution.Utils.TempTestDir` module from Cabal library [#9453](https://github.com/haskell/cabal/issues/9453) [#9454](https://github.com/haskell/cabal/pull/9454) This library was only used by internal tests, and now lives in the `Cabal-tests` library which is shared across test components. @@ -110,7 +150,7 @@ Cabal and Cabal-syntax 3.12.0.0 changelog and release notes - `checkPackage` signature has been simplified, you do not need to pass a specific configuration of the package, since - we do not flatten GenericPackageDescription any more. + we do not flatten `GenericPackageDescription` any more. - `checkPackageFileNames` has been removed, use `checkPackageFiles` instead. - `checkPackageFilesGPD` has been introduced, @@ -122,7 +162,7 @@ Cabal and Cabal-syntax 3.12.0.0 changelog and release notes GHC plugins now can store custom data in the 'extra-compilation-artifacts' directory which gets installed with the package. -- Add option to ./Setup repl to write repl arguments to file [#8726](https://github.com/haskell/cabal/pull/8726) +- Add option to `./Setup repl` to write repl arguments to file [#8726](https://github.com/haskell/cabal/pull/8726) The `./Setup repl` command is modified to allow a user to defer starting the repl and instead instruct the command to write the necessary build @@ -137,7 +177,7 @@ Cabal and Cabal-syntax 3.12.0.0 changelog and release notes Cabal: Distribution now recognises Haiku as a valid platform, and also implements Haiku's unique directory layout. -- Installation of .hie files [#8685](https://github.com/haskell/cabal/issues/8685) [#9019](https://github.com/haskell/cabal/pull/9019) +- Installation of `.hie` files [#8685](https://github.com/haskell/cabal/issues/8685) [#9019](https://github.com/haskell/cabal/pull/9019) Hie files generated by GHC are now stored in the `extra-compilation-artifacts` directory which gets installed with the @@ -180,7 +220,7 @@ Cabal and Cabal-syntax 3.12.0.0 changelog and release notes - Document `remote-repo-cache` as implemented. [#8737](https://github.com/haskell/cabal/issues/8737) [#8738](https://github.com/haskell/cabal/pull/8738) -- Deduplicate LD_LIBRARY_PATH when running tests [#8728](https://github.com/haskell/cabal/pull/8728) +- Deduplicate `LD_LIBRARY_PATH` when running tests [#8728](https://github.com/haskell/cabal/pull/8728) - Add support for a number of architectures: @@ -190,7 +230,7 @@ Cabal and Cabal-syntax 3.12.0.0 changelog and release notes - Don't report `index.html` file as created, if not created by Haddock [#5120](https://github.com/haskell/cabal/issues/5120) [#9332](https://github.com/haskell/cabal/pull/9332) -- Enable using $ORIGIN in RPATH on GNU/Hurd [#9441](https://github.com/haskell/cabal/pull/9441) +- Enable using `$ORIGIN` in `RPATH` on GNU/Hurd [#9441](https://github.com/haskell/cabal/pull/9441) - Make check comply with Hackage requirements [#8897](https://github.com/haskell/cabal/pull/8897) @@ -198,13 +238,11 @@ Cabal and Cabal-syntax 3.12.0.0 changelog and release notes - `cabal check` will only return exitcode 1 when the package is not fit for Hackage. E.g. it will not error anymore when your `synopsis:` is larger than `description:`, just emit a warning. - - Cabal: Distribution.Client.Check now exports `isHackageDistError`, for + - Cabal: `Distribution.Client.Check` now exports `isHackageDistError`, for third-party tools to know if a specific error will preclude a package from being uploaded to Hacakge. -- Add language extension `ExtendedLiterals` [#8992](https://github.com/haskell/cabal/pull/8992) - - Adds support for the `ExtendedLiterals` language extension (GHC proposal #451) +- Add language extension `ExtendedLiterals` (GHC proposal #451) [#8992](https://github.com/haskell/cabal/pull/8992) - Warn about inconsistent indentation [#8975](https://github.com/haskell/cabal/pull/8975) @@ -253,9 +291,7 @@ Cabal and Cabal-syntax 3.12.0.0 changelog and release notes `cabal` invokes `pkg-config` individually for each lib if querying for all doesn't return the expected result -- Add language extension `ListTuplePuns` [#8854](https://github.com/haskell/cabal/pull/8854) - - Adds support for the `ListTuplePuns` language extension (GHC proposal #475) +- Add language extension `ListTuplePuns` (GHC proposal #475) [#8854](https://github.com/haskell/cabal/pull/8854) - Add `mkVersionIntervals` for creating a `VersionIntervals` from a list [#9034](https://github.com/haskell/cabal/pull/9034) diff --git a/release-notes/Cabal-3.12.1.0.md b/release-notes/Cabal-3.12.1.0.md new file mode 100644 index 00000000000..8f37e2c0454 --- /dev/null +++ b/release-notes/Cabal-3.12.1.0.md @@ -0,0 +1,54 @@ +Cabal and Cabal-syntax 3.12.1.0 changelog and release notes +--- + + +### Significant changes + +- Update GHC arguments normalization and GHC options rendering [#9729](https://github.com/haskell/cabal/issues/9729) [#10014](https://github.com/haskell/cabal/pull/10014) + + The flags `-fdiagnostics-as-json`, `-fprint-error-index-lists`, `-fbreak-points`, `-dipe-stats`, `-ffamily-application-cache`, `-fprint-redundant-promotion-ticks`, `-fshow-error-context` and `-funoptimized-core-for-interpreter` have been added to the flags that do not cause recompilation. + +- Warn on missing `default-language` [#9620](https://github.com/haskell/cabal/issues/9620) [#9766](https://github.com/haskell/cabal/pull/9766) + + - To help the adoption of GHC language editions, `cabal check` will now + warn about missing `default-language`. + +- Add MHS ([MicroHS](https://github.com/augustss/MicroHs)) as a known Haskell compiler [#9878](https://github.com/haskell/cabal/pull/9878) + +- Re-instate `initialBuildSteps` [#9856](https://github.com/haskell/cabal/issues/9856) [#9950](https://github.com/haskell/cabal/pull/9950) + + The `initialBuildSteps` function from `Distribution.Simple.Build`, which had + been hastily removed, has been reinstated. + + It now comes with a deprecation warning: calling that function does not suffice + to prepare the sources for a package, as there are other steps that one might + also need to perform: + + - running pre-processors (such as alex/happy); + - running pre-build hooks or custom logic + (in build-type: Hooks or build-type: Custom or Configure). + + Consumers wanting to prepare the sources of a package, e.g. in order to launch a + REPL session, are advised to run `setup repl --repl-multi-file=` instead. + +- Label error messages with codes (following GHC, Stack) + + As with GHC and Stack, Cabal and cabal-install now generate warnings and errors prefixed with error codes of the form `[Cabal-xxxxx]`. These will be documented on https://errors.haskell.org, although very few are as yet. + + This change was actually present in Cabal-3.12.0.0, but was inadvertently omitted from the changelog. + +### Other changes + +- Don't recommend deprecated/removed `extensions` field [#10042](https://github.com/haskell/cabal/issues/10042) [#10044](https://github.com/haskell/cabal/pull/10044) + + When applicable, field `default-extensions` is recommended (rather than + deprecated/removed `extensions:`). + +- Make `Setup copy` and `Setup install` succeed when there's no executable or library [#6750](https://github.com/haskell/cabal/issues/6750) [#9926](https://github.com/haskell/cabal/pull/9926) + + Historically the Setup copy and install steps would fail if the package didn't + contain an executable or library component. In this case there's nothing to do. + + This required workarounds for downstream users of Cabal to handle this edge case. + Now that this error has been downgraded to a warning, Cabal will succeed if + there's nothing to do. diff --git a/release-notes/Cabal-3.14.0.0.md b/release-notes/Cabal-3.14.0.0.md new file mode 100644 index 00000000000..004a462db8f --- /dev/null +++ b/release-notes/Cabal-3.14.0.0.md @@ -0,0 +1,163 @@ +Cabal and Cabal-syntax 3.14.0.0 changelog and release notes +--- + + +### Significant changes + +- Neutral field to add files to sdist [#8817](https://github.com/haskell/cabal/issues/8817) [#10107](https://github.com/haskell/cabal/pull/10107) + + Adds the `extra-files` field to the cabal file specification. This is like + the other `extra-*` fields in that it is copied with the `sdist` command, + except there are no other semantics. Compare to: + + * `extra-source-files`: Tracked by `cabal build`. + + * `extra-doc-files`: Copied by Haddock to the html directory. + +### Other changes + +- Include package version when passing `--promised-dependency` flag [#10166](https://github.com/haskell/cabal/issues/10166) [#10248](https://github.com/haskell/cabal/pull/10248) + + The `--promised-dependency` flag now expects an argument in the format + + ``` + NAME-VER[:COMPONENT_NAME]=CID + ``` + + rather than + + ``` + NAME[:COMPONENT_NAME]=CID + ``` + +- Add support for building profiled dynamic way [#4816](https://github.com/haskell/cabal/issues/4816) [#9900](https://github.com/haskell/cabal/pull/9900) + + Add support for profiled dynamic way + + New options for `cabal.project` and `./Setup` interface: + + * `profiling-shared`: Enable building profiling dynamic way + * Passing `--enable-profiling` and `--enable-executable-dynamic` builds + profiled dynamic executables. + + Support for using `profiling-shared` is guarded behind a constraint + which ensures you are using `Cabal >= 3.13`. + + In the cabal file: + + * `ghc-prof-shared-options`, for passing options when building in + profiling dynamic way + +- Working directory support for `Cabal` [#9702](https://github.com/haskell/cabal/issues/9702) [#9718](https://github.com/haskell/cabal/pull/9718) + + The `Cabal` library is now able to handle a passed-in working directory, instead + of always relying on the current working directory of the parent process. + + In order to achieve this, the `SymbolicPath` abstraction was fleshed out, and + all fields of `PackageDescription` that, if relative, should be interpreted + with respect to e.g. the package root, use `SymbolicPath` instead of `FilePath`. + + This means that many library functions in `Cabal` take an extra argument of type + `Maybe (SymbolicPath CWD (Dir "Package"))`, which is an optional (relative or + absolute) path to the package root (if relative, relative to the current working + directory). In addition, many functions that used to manipulate `FilePath`s now + manipulate `SymbolicPath`s, require explicit conversion using e.g. `getSymbolicPath`. + + To illustrate with file searching, the `Cabal` library defines: + + ```haskell + findFileCwd + :: forall dir1 dir2 file + . Verbosity + -> Maybe (SymbolicPath CWD (Dir dir1)) + + -> [SymbolicPath dir1 (Dir dir2)] + + -> RelativePath dir2 File + + -> IO (SymbolicPath dir1 File) + ``` + + See Note [Symbolic paths] in `Distribution.Utils.Path` for further information + on the design of this API. + +- Add `MultilineStrings` extension (GHC proposal #637) [#10245](https://github.com/haskell/cabal/pull/10245) + +- Add `NamedDefaults` extension (GHC proposal #409) [#9740](https://github.com/haskell/cabal/pull/9740) + +- Add `OrPatterns` extension (GHC proposal #958) [#10339](https://github.com/haskell/cabal/pull/10339) + + +### Other changes + +- Add flag `--ignore-build-tools` [#10128](https://github.com/haskell/cabal/pull/10128) + + - Adds flag `--ignore-build-tools` which allows a user to ignore the tool + dependencies declared in `build-tool-depends`. For general use, this flag + should never be needed, but it may be useful for packagers. + +- Do not try to build dynamic executables on Windows [#10217](https://github.com/haskell/cabal/pull/10217) + + - Cabal will now exit with a descriptive error message instead of attempting to + build a dynamic executable on Windows. + +- Always pass `ghc-options` to GHC [#8717](https://github.com/haskell/cabal/pull/8717) + + Previously, options set in the package field `ghc-options` would not be passed + to GHC during the link phase for shared objects (where multiple `.o` or + `.dyn_o` files are merged into a single object file). This made it impossible + to use `ghc-options` to use a different linker by setting (for example) + `ghc-options: -optl-fuse-ld=mold -optlm-fuse-ld=mold`; the options would be + dropped in the link phase, falling back to the default linker. + + It was possible to work around this by duplicating the `ghc-options` to + `ghc-shared-options`, which _are_ passed in the shared link phase, but that had + the undocumented and unfortunate side-effect of disabling the GHC + `-dynamic-too` flag, effectively doubling compilation times when + `ghc-shared-options` are set. + + Now, `ghc-options` are combined with `ghc-shared-options` (to accurately + reflect the documentation on this feature) and the fact that + `ghc-shared-options` disables `-dynamic-too` is documented. + +- Introduce `SetupHooks` [#9551](https://github.com/haskell/cabal/pull/9551) + + Introduction of a new build type: `Hooks`. + This build type, intended to eventually replace the `Custom` build type, integrates + better with the rest of the ecosystem (`cabal-install`, Haskell Language Server). + + The motivation and full design of this new build-type are specified in the + Haskell Foundation Tech Proposal + [Replacing the Cabal Custom build-type](https://github.com/haskellfoundation/tech-proposals/pull/60). + + Package authors willing to use this feature should declare `cabal-version: 3.14` and `build-type: Hooks` + in their `.cabal` file, declare a `custom-setup` stanza with a dependency on the + `Cabal-hooks` package, and define a module `SetupHooks` that exports a value + `setupHooks :: SetupHooks`, using the API exported by `Distribution.Simple.SetupHooks` + from the `Cabal-hooks` package. Refer to the Haddock documentation of + `Distribution.Simple.SetupHooks` for example usage. + +- Redefine `build-type: Configure` in terms of `Hooks` [#9969](https://github.com/haskell/cabal/pull/9969) + + The `build-type: Configure` is now implemented in terms of `build-type: Hooks` + rather than in terms of `build-type: Custom`. This moves the `Configure` + build-type away from the `Custom` issues. Eventually, `build-type: Hooks` will + no longer imply packages are built in legacy-fallback mode. When that + happens, `Configure` will also stop implying `legacy-fallback`. + + The observable aspect of this change is `runConfigureScript` now having a + different type, and `autoconfSetupHooks` being exposed by `Distribution.Simple`. + The former is motivated by internal implementation details, while the latter + provides the `SetupHooks` value for the `Configure` build type, which can be + consumed by other `Hooks` clients (e.g. eventually HLS). + +- Cabal can issue a number of error messages referencing "Setup configure", + but it simply references "configure" which could mean any of three + things (Setup configure, the package's "configure" script, or "cabal + configure"). This has recently caught out even Cabal devs. Clarify these + messages. [#9476](https://github.com/haskell/cabal/pull/9476) + +- Update the SPDX License List to version 3.25 + + The LicenseId and LicenseExceptionId types are updated to reflect the SPDX + License List version 3.25 (2024-08-19). diff --git a/release-notes/WIP-cabal-install-3.12.x.0.md b/release-notes/cabal-install-3.12.1.0.md similarity index 83% rename from release-notes/WIP-cabal-install-3.12.x.0.md rename to release-notes/cabal-install-3.12.1.0.md index 34d84982806..8d7055eb95b 100644 --- a/release-notes/WIP-cabal-install-3.12.x.0.md +++ b/release-notes/cabal-install-3.12.1.0.md @@ -1,12 +1,18 @@ -Pre-release cabal-install 3.12.0.0/3.11.0.0 changelog and release notes. - -This file will be edited and the changes incorprated into the official -3.12.1.0 cabal-install and cabal-install-solver release notes. - +cabal-install 3.12.1.0 changelog and release notes. --- ### Significant changes +- Cabal 3.12 support [#9917](https://github.com/haskell/cabal/issues/9917) + + This is the first release of `cabal-install` that is fully compatible with `Cabal` 3.12.0.0 as released with GHC 9.10.1. In particular, it means custom setup builds will work with GHC 9.10. + +- `cabal-install` has been built against `tar` 0.6.3.0 [#10123](https://github.com/haskell/cabal/pull/10123) + + The new release of `tar` has significant performance improvements, making `cabal update` in particular much faster. + + For anyone building from the source, we suggest making sure that the version of `tar` in your plan is at least 0.6.3.0. (For example, we bumped the `index-state` in our `cabal.project.release` in the `Cabal` repository.) + - Add support for asm, cmm, and js sources in executable components [#8639](https://github.com/haskell/cabal/issues/8639) [#9061](https://github.com/haskell/cabal/pull/9061) Executable components now support the inclusion of asm, cmm, and js source @@ -36,17 +42,14 @@ This file will be edited and the changes incorprated into the official a flag which specifies which libraries should be included in the coverage report for some testsuite. -- Add `cabal path` command [#8879](https://github.com/haskell/cabal/pull/8879) +- Add `cabal path` command [#8879](https://github.com/haskell/cabal/pull/8879) [#9673](https://github.com/haskell/cabal/pull/9673) The `cabal path` command prints the file system paths used by Cabal. It is intended for use by tooling that needs to read or modify Cabal data, such that it does not need to replicate the complicated logic for respecting `CABAL_DIR`, `CABAL_CONFIG`, etc. -- Redesign `cabal path` command to account for projects [#9673](https://github.com/haskell/cabal/pull/9673) - - Previously, `cabal path` was only able to query from the global configuration file, e.g., `~/.cabal/config` or the XDG equivalent. - We take the foundations and enhance `cabal path` to take project configuration, such as `cabal.project`, into account. + It will obey a `cabal.project` if present. Additionally, we add support for multiple output formats, such as key-value pairs and json. @@ -62,7 +65,7 @@ This file will be edited and the changes incorprated into the official The json output format is versioned by the cabal-install version, which is part of the json object. Thus, all result objects contain at least the key "cabal-install-version". - We expand the `cabal path` to also produce information of the compiler that is going to be used in a `cabal build` or `cabal repl` invocation. + It also produces information of the compiler that is going to be used in a `cabal build` or `cabal repl` invocation. To do that, we re-configure the compiler program, and outputs the location, version and compiler flavour. This is helpful for downstream tools, such as HLS, to figure out the GHC version required to compile a project with, without dependency solving. @@ -121,7 +124,7 @@ This file will be edited and the changes incorprated into the official name did not match exactly. Now they will be cached even if the header's capitalization is different. -- Clarify the semantics of the `--package-db` flag [#9678](https://github.com/haskell/cabal/issues/9678) +- Clarify the semantics of the `--package-db` flag [#9678](https://github.com/haskell/cabal/issues/9678) [#9683](https://github.com/haskell/cabal/pull/9683) The `--package-db` flag now only applies to the default immutable initial package stack rather than also applying to the store @@ -257,7 +260,7 @@ This file will be edited and the changes incorprated into the official This relies on the "Project Unit Id" which is available since GHC 9.8.1, older versions of GHC do not benefit from this change. -- Add support for `GHC2024` [#9736](https://github.com/haskell/cabal/issues/9736) +- Add support for `GHC2024` [#9736](https://github.com/haskell/cabal/issues/9736) [#9791](https://github.com/haskell/cabal/pull/9791) Support for the `GHC2024` language edition, introduced by GHC 9.10, has been added. It can now be used in the `default-language` and `other-languages` @@ -273,6 +276,23 @@ This file will be edited and the changes incorprated into the official - Add language extension `TypeAbstractions` [#9496](https://github.com/haskell/cabal/issues/9496) [#9502](https://github.com/haskell/cabal/pull/9502) +- Label error messages with codes (following GHC, Stack) + + As with GHC and Stack, Cabal and cabal-install now generate warnings and errors prefixed with error codes of the form `[Cabal-xxxxx]`. These will be documented on https://errors.haskell.org, although very few are as yet. + +- The `--offline` flag applied to `source-repository-package`s [#9641](https://github.com/haskell/cabal/issues/9641) [#9771](https://github.com/haskell/cabal/pull/9771) + + The `--offline` flag is already used to block access to Hackage. Now with this PR, this also applies to remote dependency `source-repository-package` in `cabal.project`. + +- Fix `--program-suffix` resulting in invalid installation [#8823](https://github.com/haskell/cabal/issues/8823) [#9919](https://github.com/haskell/cabal/issues/9919) [#10056](https://github.com/haskell/cabal/pull/10056) + + Formerly, using `--program-suffix` resulted in bad symlinks into the store. This has been corrected. + +- Warn on missing `default-language` [#9620](https://github.com/haskell/cabal/issues/9620) [#9766](https://github.com/haskell/cabal/pull/9766) + + - To help the adoption of GHC language editions, `cabal check` will now + warn about missing `default-language`. + ### Other changes - Script cache dir is the base16 hash of the canonical path of the script. [#9459](https://github.com/haskell/cabal/pull/9459) @@ -341,3 +361,19 @@ This file will be edited and the changes incorprated into the official The "Executing·install·plan··serially" and other similar "Executing install plan··..." outputs no longer contain double spaces. + +- Allow whitespace in targets [#8875](https://github.com/haskell/cabal/issues/8875) [#10032](https://github.com/haskell/cabal/pull/10032) + + Allow spaces in the final component of target selectors. This resolves an issue + where using absolute paths in selectors can fail if there is whitespace in the + parent directories of the project. + +- Renders project configuration provenance as a list of canonical paths [#9971](https://github.com/haskell/cabal/issues/9971) [#9985](https://github.com/haskell/cabal/pull/9985) + + Removes interleaved rendering of project imports. + +- Abbreviate solver rejection messages with installed versions [#9823](https://github.com/haskell/cabal/issues/9823) [#9824](https://github.com/haskell/cabal/pull/9824) + +- solver: Prevent `ghc-internal` from being reinstalled [#10108](https://github.com/haskell/cabal/pull/10108) + + GHC 9.10 ships with a new wired-in package, `ghc-internal`, which cannot be reinstalled. This commit prevents cabal-install from attempting it. diff --git a/release-notes/cabal-install-3.14.0.0.md b/release-notes/cabal-install-3.14.0.0.md new file mode 100644 index 00000000000..3a890db9acc --- /dev/null +++ b/release-notes/cabal-install-3.14.0.0.md @@ -0,0 +1,141 @@ +cabal-install 3.14.0.0 changelog and release notes. +--- + + +### Significant changes + +- `haddock-project` support for subcomponents [#9821](https://github.com/haskell/cabal/pull/9821) + + - `haddock-project` handles sublibraries, test suites and benchmarks. + - `haddock` receives `--package-name` flag which allows to set names of + components which are included in the main `index.html` file. + - added `--use-unicode` flag to `haddock` and `haddock-project` commands. + - The directory structure of `./dist-newstyle` has changed. `haddock` + subcommand will install `package:sublib` component in a directory + `package/sublib` under `l/sublib/doc/html/`. This is important for + `haddock-project` command and in the future might will be useful for hackage + support of sublibraries. See + https://github.com/haskell/cabal/pull/9821#discussion_r1548557115. + +- Redefine `build-type: Configure` in terms of `Hooks` [#9969](https://github.com/haskell/cabal/pull/9969) + + The `build-type: Configure` is now implemented in terms of `build-type: Hooks` + rather than in terms of `build-type: Custom`. This moves the `Configure` + build-type away from the `Custom` issues. Eventually, `build-type: Hooks` will + no longer imply packages are built in legacy-fallback mode. When that + happens, `Configure` will also stop implying `legacy-fallback`. + + The observable aspect of this change is `runConfigureScript` now having a + different type, and `autoconfSetupHooks` being exposed from `Distribution.Simple`. + The former is motivated by internal implementation details, while the latter + provides the `SetupHooks` value for the `Configure` build type, which can be + consumed by other `Hooks` clients (e.g. eventually HLS). + +### Other changes + +- Add support for building profiled dynamic way [#4816](https://github.com/haskell/cabal/issues/4816) [#9900](https://github.com/haskell/cabal/pull/9900) + + + New options for `cabal.project` and `./Setup` interface: + + * `profiling-shared`: Enable building profiling dynamic way + * Passing `--enable-profiling` and `--enable-executable-dynamic` builds + profiled dynamic executables. + + Support for using `profiling-shared` is guarded behind a constraint + which ensures you are using `Cabal >= 3.13`. + + In the `.cabal` file: + + * `ghc-prof-shared-options`, for passing options when building in + profiling dynamic way + +- Fix interaction of `--*-shared` and `--*-executable-dynamic` options. [#10050](https://github.com/haskell/cabal/issues/10050) [#9900](https://github.com/haskell/cabal/pull/9900) + + If you explicitly request `--disable-shared` it should disable the building of + a shared library and override any automatic ways this option is turned on. + + Passing `--enable-executable-dynamic` turns on `--enable-shared` if the option is + not specified explicitly. + + Before this patch, writing `--disable-shared` on its own would not disable the building of shared libraries. Writing `--disable-shared` and `--disable-executable-dynamic` would disable shared library + creation (despite `--disable-executable-dynamic` being the default). + + Now: + + * If you specify `--enable-shared` then shared objects are built. + * If you specify `--disabled-shared` then shared objects are not built. + * If you don't explicitly specify whether you want to build shared libraries then + * `--enable-executable-dynamic` will automatically turn on building shared libraries + * `--enable-executable-dynamic --enable-profiling` will automatically turn on building + shared profiling libraries (if supported by your compiler). + +- `curl` transport now supports Basic authentication [#10089](https://github.com/haskell/cabal/pull/10089) + + - The `curl` HTTP transport previously only supported the HTTP Digest + authentication scheme. Basic authentication is now supported + when using HTTPS; Curl will use the scheme offered by the server. + The `wget` transport already supports HTTPS. + +- Enhance error detection for cabal root project files, including broken symlinks [#9937](https://github.com/haskell/cabal/issues/9937) [#10103](https://github.com/haskell/cabal/pull/10103) + + - Added proper detection and reporting for issues with cabal root project files. Previously, these files were silently ignored if they were broken symlinks. Now, `cabal` will exit + with an error in such case. + +- Let cabal init remember chosen language within current session [#10096](https://github.com/haskell/cabal/issues/10096) [#10115](https://github.com/haskell/cabal/pull/10115) + + When `cabal init` asks for a language, the last choice made will be used as the new default for the current prompt. + +- Filter out `-dinitial-unique` and `-dunique-increment` from package hash [#10122](https://github.com/haskell/cabal/pull/10122) + + `-dinitial-unique` and `-dunique-increment` are now filtered out when computing the + store hash of a package. + + These options shouldn't affect the output of the package and hence + shouldn't affect the store hash of a package. + +- Warn about `git://` protocol [#10261](https://github.com/haskell/cabal/pull/10261) + + `cabal check` will warn about the insecure (and no longer supported by GitHub or Gitlab, among others) `git://` protocol in `source-repository`. + + See [Git Book](https://git-scm.com/book/en/v2/Git-on-the-Server-The-Protocols#_the_cons_4) + for an explanation. + +- Enable recompilation avoidance during Haddock generation [#9175](https://github.com/haskell/cabal/issues/9175) [#9177](https://github.com/haskell/cabal/pull/9177) + + * Haddock no longer writes compilation files by default, so we do not need to + pass tmp dirs for `-hidir`, `-stubdir`, and `-odir` via `--optghc`. Indeed, we + do not *want* to do so, since it results in recompilation for every invocation + of Haddock via Cabal. We now stop this from happening for Haddock versions + 2.28 and greater, since that is when Hi Haddock was introduced. + + * We no longer define the `__HADDOCK_VERSION__` macro when invoking GHC through + Haddock, since doing so essentially guarantees recompilation during + documentation generation. We audited all uses of `__HADDOCK_VERSION__` in + hackage, ensuring there was a reasonable path forward to migrate away from + using `__HADDOCK_VERSION__` for each, while generating the same documentation + as it did before. + If you are a user of `__HADDOCK_VERSION__`, please take a look at the + discussion in https://github.com/haskell/cabal/pull/9177 and reach out to us + if your use case is not covered. + + * Rename the `--haddock-lib` flag to `--haddock-resources-dir` (and + `haddock-lib:` cabal.project field to `haddock-resources-dir:`), and add this + flag to the users guide since it was missing an entry. + + * `documentation: true` or `--enable-documentation` now implies `-haddock` for + GHC. + +- Bug fix - Don't pass `--coverage-for` for non-dependency libs of testsuite [#10046](https://github.com/haskell/cabal/issues/10046) [#10250](https://github.com/haskell/cabal/pull/10250) + +- Added `--all` and `--haddock-all` switches to `haddock-project` subcommand [#10051](https://github.com/haskell/cabal/issues/10051) [#10163](https://github.com/haskell/cabal/pull/10163) + +- Clarify error message when `pkg-config` is not found [#10122](https://github.com/haskell/cabal/pull/10122) + + - The error message when `pkg-config` is not found or querying it fails will no + longer incorrectly claim that the package is missing in the database. + +- Update the SPDX License List to version 3.25 + + The LicenseId and LicenseExceptionId types are updated to reflect the SPDX + License List version 3.25 (2024-08-19). diff --git a/solver-benchmarks/solver-benchmarks.cabal b/solver-benchmarks/solver-benchmarks.cabal index 42ebd616f9a..0595a5bd229 100644 --- a/solver-benchmarks/solver-benchmarks.cabal +++ b/solver-benchmarks/solver-benchmarks.cabal @@ -31,7 +31,7 @@ library base, bytestring, containers, - Cabal-syntax ^>= 3.13, + Cabal-syntax ^>= 3.15, directory, filepath, optparse-applicative, diff --git a/templates/Paths_pkg.template.hs b/templates/Paths_pkg.template.hs index 8e1e03d27e4..bea7d6813e3 100644 --- a/templates/Paths_pkg.template.hs +++ b/templates/Paths_pkg.template.hs @@ -26,7 +26,6 @@ import Foreign.C {% endif %} import qualified Control.Exception as Exception -import qualified Data.List as List import Data.Version (Version(..)) import System.Environment (getEnv) import Prelude @@ -175,9 +174,14 @@ joinFileName :: String -> String -> FilePath joinFileName "" fname = fname joinFileName "." fname = fname joinFileName dir "" = dir -joinFileName dir fname - | isPathSeparator (List.last dir) = dir ++ fname +joinFileName dir@(c:cs) fname + | isPathSeparator (lastChar c cs) = dir ++ fname | otherwise = dir ++ pathSeparator : fname + where + -- We do not use Data.List.NonEmpty.last, as that would limit the module to + -- base >= 4.9.0.0 (GHC >= 8.0.1). + lastChar x [] = x + lastChar _ (x:xs) = lastChar x xs pathSeparator :: Char {% if isWindows %} diff --git a/templates/SPDX.LicenseExceptionId.template.hs b/templates/SPDX.LicenseExceptionId.template.hs index c2fcd1462b9..aea2fedb586 100644 --- a/templates/SPDX.LicenseExceptionId.template.hs +++ b/templates/SPDX.LicenseExceptionId.template.hs @@ -29,7 +29,7 @@ import qualified Text.PrettyPrint as Disp -- LicenseExceptionId ------------------------------------------------------------------------------- --- | SPDX License Exceptions identifiers list v3.23 +-- | SPDX License Exceptions identifiers list v3.25 data LicenseExceptionId {{ licenseIds }} deriving (Eq, Ord, Enum, Bounded, Show, Read, Typeable, Data, Generic) @@ -101,6 +101,9 @@ licenseExceptionIdList LicenseListVersion_3_16 = licenseExceptionIdList LicenseListVersion_3_23 = {{licenseList_perv.v_3_23}} ++ bulkOfLicenses +licenseExceptionIdList LicenseListVersion_3_25 = +{{licenseList_perv.v_3_25}} + ++ bulkOfLicenses -- | Create a 'LicenseExceptionId' from a 'String'. mkLicenseExceptionId :: LicenseListVersion -> String -> Maybe LicenseExceptionId @@ -111,6 +114,7 @@ mkLicenseExceptionId LicenseListVersion_3_9 s = Map.lookup s stringLookup_3_9 mkLicenseExceptionId LicenseListVersion_3_10 s = Map.lookup s stringLookup_3_10 mkLicenseExceptionId LicenseListVersion_3_16 s = Map.lookup s stringLookup_3_16 mkLicenseExceptionId LicenseListVersion_3_23 s = Map.lookup s stringLookup_3_23 +mkLicenseExceptionId LicenseListVersion_3_25 s = Map.lookup s stringLookup_3_25 stringLookup_3_0 :: Map String LicenseExceptionId stringLookup_3_0 = Map.fromList $ map (\i -> (licenseExceptionId i, i)) $ @@ -140,6 +144,10 @@ stringLookup_3_23 :: Map String LicenseExceptionId stringLookup_3_23 = Map.fromList $ map (\i -> (licenseExceptionId i, i)) $ licenseExceptionIdList LicenseListVersion_3_23 +stringLookup_3_25 :: Map String LicenseExceptionId +stringLookup_3_25 = Map.fromList $ map (\i -> (licenseExceptionId i, i)) $ + licenseExceptionIdList LicenseListVersion_3_25 + -- | License exceptions in all SPDX License lists bulkOfLicenses :: [LicenseExceptionId] bulkOfLicenses = diff --git a/templates/SPDX.LicenseId.template.hs b/templates/SPDX.LicenseId.template.hs index 6ee2bf6ede3..58e04801398 100644 --- a/templates/SPDX.LicenseId.template.hs +++ b/templates/SPDX.LicenseId.template.hs @@ -32,7 +32,7 @@ import qualified Text.PrettyPrint as Disp -- LicenseId ------------------------------------------------------------------------------- --- | SPDX License identifiers list v3.23 +-- | SPDX License identifiers list v3.25 data LicenseId {{ licenseIds }} deriving (Eq, Ord, Enum, Bounded, Show, Read, Typeable, Data) @@ -178,6 +178,9 @@ licenseIdList LicenseListVersion_3_16 = licenseIdList LicenseListVersion_3_23 = {{licenseList_perv.v_3_23}} ++ bulkOfLicenses +licenseIdList LicenseListVersion_3_25 = +{{licenseList_perv.v_3_25}} + ++ bulkOfLicenses -- | Create a 'LicenseId' from a 'String'. mkLicenseId :: LicenseListVersion -> String -> Maybe LicenseId @@ -188,6 +191,7 @@ mkLicenseId LicenseListVersion_3_9 s = Map.lookup s stringLookup_3_9 mkLicenseId LicenseListVersion_3_10 s = Map.lookup s stringLookup_3_10 mkLicenseId LicenseListVersion_3_16 s = Map.lookup s stringLookup_3_16 mkLicenseId LicenseListVersion_3_23 s = Map.lookup s stringLookup_3_23 +mkLicenseId LicenseListVersion_3_25 s = Map.lookup s stringLookup_3_25 stringLookup_3_0 :: Map String LicenseId stringLookup_3_0 = Map.fromList $ map (\i -> (licenseId i, i)) $ @@ -217,6 +221,10 @@ stringLookup_3_23 :: Map String LicenseId stringLookup_3_23 = Map.fromList $ map (\i -> (licenseId i, i)) $ licenseIdList LicenseListVersion_3_23 +stringLookup_3_25 :: Map String LicenseId +stringLookup_3_25 = Map.fromList $ map (\i -> (licenseId i, i)) $ + licenseIdList LicenseListVersion_3_25 + -- | Licenses in all SPDX License lists bulkOfLicenses :: [LicenseId] bulkOfLicenses = diff --git a/test/IntegrationTests2/config/default-config b/test/IntegrationTests2/config/default-config index e74a2c97764..57ae6f847ec 100644 --- a/test/IntegrationTests2/config/default-config +++ b/test/IntegrationTests2/config/default-config @@ -143,6 +143,7 @@ haddock -- base-url: -- resources-dir: -- output-dir: + -- use-unicode: False init -- interactive: False diff --git a/test/IntegrationTests2/nix-config/default-config b/test/IntegrationTests2/nix-config/default-config index e74a2c97764..57ae6f847ec 100644 --- a/test/IntegrationTests2/nix-config/default-config +++ b/test/IntegrationTests2/nix-config/default-config @@ -143,6 +143,7 @@ haddock -- base-url: -- resources-dir: -- output-dir: + -- use-unicode: False init -- interactive: False diff --git a/tests/IntegrationTests2/config/default-config b/tests/IntegrationTests2/config/default-config index 8d5b2ea1df6..94a10d9c113 100644 --- a/tests/IntegrationTests2/config/default-config +++ b/tests/IntegrationTests2/config/default-config @@ -145,6 +145,7 @@ haddock -- base-url: -- resources-dir: -- output-dir: + -- use-unicode: False init -- interactive: False diff --git a/tests/IntegrationTests2/nix-config/default-config b/tests/IntegrationTests2/nix-config/default-config index e74a2c97764..57ae6f847ec 100644 --- a/tests/IntegrationTests2/nix-config/default-config +++ b/tests/IntegrationTests2/nix-config/default-config @@ -143,6 +143,7 @@ haddock -- base-url: -- resources-dir: -- output-dir: + -- use-unicode: False init -- interactive: False diff --git a/validate.sh b/validate.sh index 3b56a945c84..b887b724e8f 100755 --- a/validate.sh +++ b/validate.sh @@ -1,517 +1,3 @@ -#!/bin/sh -# shellcheck disable=SC2086 +#!/usr/bin/env sh -# default config -####################################################################### - -# We use the default ghc in PATH as default -# Use the ghc-x.y.z trigger several errors in windows: -# * It triggers the max path length issue: -# See https://github.com/haskell/cabal/issues/6271#issuecomment-1065102255 -# * It triggers a `createProcess: does not exist` error in units tests -# See https://github.com/haskell/cabal/issues/8049 -HC=ghc -CABAL=cabal -JOBS=4 -LIBTESTS=true -CLITESTS=true -CABALSUITETESTS=true -LIBONLY=false -DEPSONLY=false -DOCTEST=false -BENCHMARKS=false -VERBOSE=false -HACKAGETESTSALL=false - -TARGETS="" -STEPS="" -EXTRAHCS="" - -LISTSTEPS=false - -# Help -####################################################################### - -show_usage() { -cat <&1 - else - "$@" > "$OUTPUT" 2>&1 - fi - # echo "MOCK" > "$OUTPUT" - RET=$? - - end_time=$(date +%s) - duration=$((end_time - start_time)) - tduration=$((end_time - JOB_START_TIME)) - - if [ $RET -eq 0 ]; then - if ! $VERBOSE; then - # if output is relatively short, show everything - if [ "$(wc -l < "$OUTPUT")" -le 50 ]; then - cat "$OUTPUT" - else - echo "..." - tail -n 20 "$OUTPUT" - fi - - rm -f "$OUTPUT" - fi - - green "<<< $PRETTYCMD" "($duration/$tduration sec)" - - # bottom-margin - echo "" - else - if ! $VERBOSE; then - cat "$OUTPUT" - fi - - red "<<< $PRETTYCMD" "($duration/$tduration sec, $RET)" - red "<<< $*" "($duration/$tduration sec, $RET)" - rm -f "$OUTPUT" - exit 1 - fi -} - -print_header() { - TITLE=$1 - TITLEPAT="$(echo "$TITLE"|sed 's:.:=:g')" - cyan "===X========================================================================== $(date +%T) ===" \ - | sed "s#X$TITLEPAT=# $TITLE #" - -} - -# getopt -####################################################################### - -while [ $# -gt 0 ]; do - arg=$1 - case $arg in - --help) - show_usage - exit - ;; - -j|--jobs) - JOBS="$2" - shift - shift - ;; - --lib-only) - LIBONLY=true - shift - ;; - --cli) - LIBONLY=false - shift - ;; - --run-lib-tests) - LIBTESTS=true - shift - ;; - --no-run-lib-tests) - LIBTESTS=false - shift - ;; - --run-cli-tests) - CLITESTS=true - shift - ;; - --no-run-cli-tests) - CLITESTS=false - shift - ;; - --run-lib-suite) - LIBSUITE=true - shift - ;; - --no-run-lib-suite) - LIBSUITE=false - shift - ;; - --run-cli-suite) - CLISUITE=true - shift - ;; - --no-run-cli-suite) - CLISUITE=false - shift - ;; - -w|--with-compiler) - HC=$2 - shift - shift - ;; - --with-cabal) - CABAL=$2 - shift - shift - ;; - --extra-hc) - EXTRAHCS="$EXTRAHCS $2" - shift - shift - ;; - --doctest) - DOCTEST=true - shift - ;; - --no-doctest) - DOCTEST=false - shift - ;; - --solver-benchmarks) - BENCHMARKS=true - shift - ;; - --no-solver-benchmarks) - BENCHMARKS=false - shift - ;; - --complete-hackage-tests) - HACKAGETESTSALL=true - shift - ;; - --partial-hackage-tests) - HACKAGETESTSALL=false - shift - ;; - -v|--verbose) - VERBOSE=true - shift - ;; - -q|--quiet) - VERBOSE=false - shift - ;; - -s|--step) - STEPS="$STEPS $2" - shift - shift - ;; - --list-steps) - LISTSTEPS=true - shift - ;; - *) - echo "Unknown option $arg" - exit 1 - esac -done - -# calculate steps and build targets -####################################################################### - -# If there are no explicit steps given calculate them -if $LIBONLY; then - CLITESTS=false - CLISUITE=false - BENCHMARKS=false -fi - -if [ -z "$STEPS" ]; then - STEPS="print-config print-tool-versions" - STEPS="$STEPS build" - if $DOCTEST; then STEPS="$STEPS doctest"; fi - if $LIBTESTS; then STEPS="$STEPS lib-tests"; fi - if $LIBSUITE; then STEPS="$STEPS lib-suite"; fi - if $LIBSUITE && [ -n "$EXTRAHCS" ]; - then STEPS="$STEPS lib-suite-extras"; fi - if $CLITESTS; then STEPS="$STEPS cli-tests"; fi - if $CLISUITE; then STEPS="$STEPS cli-suite"; fi - if $BENCHMARKS; then STEPS="$STEPS solver-benchmarks-tests solver-benchmarks-run"; fi - STEPS="$STEPS time-summary" -fi - -TARGETS="Cabal Cabal-hooks cabal-testsuite Cabal-tests Cabal-QuickCheck Cabal-tree-diff Cabal-described" -if ! $LIBONLY; then TARGETS="$TARGETS cabal-install cabal-install-solver cabal-benchmarks"; fi -if $BENCHMARKS; then TARGETS="$TARGETS solver-benchmarks"; fi - -if $LISTSTEPS; then - echo "Targets: $TARGETS" - echo "Steps: $STEPS" - exit -fi - -# Adjust runtime configuration -####################################################################### - -TESTSUITEJOBS="-j$JOBS" -JOBS="-j$JOBS" - -# assume compiler is GHC -RUNHASKELL=$(echo "$HC" | sed -E 's/ghc(-[0-9.]*)$/runghc\1/') - -case "$(uname)" in - MINGW64*) - ARCH="x86_64-windows" - ;; - Linux ) - ARCH="x86_64-linux" - ;; - *) - ARCH="x86_64-osx" - ;; -esac - -if $LIBONLY; then - PROJECTFILE=cabal.validate-libonly.project -else - PROJECTFILE=cabal.validate.project -fi - -BASEHC=ghc-$($HC --numeric-version) -BUILDDIR=dist-newstyle-validate-$BASEHC -CABAL_TESTSUITE_BDIR="$(pwd)/$BUILDDIR/build/$ARCH/$BASEHC/cabal-testsuite-3" - -CABALNEWBUILD="${CABAL} build $JOBS -w $HC --builddir=$BUILDDIR --project-file=$PROJECTFILE" -CABALLISTBIN="${CABAL} list-bin --builddir=$BUILDDIR --project-file=$PROJECTFILE" - -# header -####################################################################### - -step_print_config() { -print_header print-config - -cat <