Skip to content
This repository has been archived by the owner on Jan 5, 2024. It is now read-only.

Fix #130: ensure cabal installdir is in the PATH #165

Merged
merged 3 commits into from
Jan 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ jobs:
cabal-version: ${{ matrix.cabal }}
cabal-update: ${{ matrix.cabal_update }}

- name: Show installed versions
run: |
cabal --version
ghc --version

- name: Test runghc
run: |
runghc --version
Expand All @@ -91,16 +96,19 @@ jobs:
working-directory: setup/__tests__/project
run: cabal run

- name: Install test project
working-directory: setup/__tests__/project
run: cabal install

- name: Run installed test project
run: hello-haskell-setup
# This tests whether the default installdir has been added to the PATH (issue #130).

- name: Build and run test with Hackage dependency
if: ${{ matrix.cabal_update != 'false' }}
working-directory: setup/__tests__/project-with-hackage-dependency
run: cabal build && cabal run

- name: Show installed versions
run: |
cabal --version
ghc --version

- name: Confirm installed and expected versions match
shell: bash
# check that if given in the matrix, the actual version matches:
Expand Down
2 changes: 1 addition & 1 deletion setup/__tests__/project/project.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: project
version: 0.1.0.0
build-type: Simple

executable project
executable hello-haskell-setup
main-is: Main.hs
build-depends: base
default-language: Haskell2010
4 changes: 4 additions & 0 deletions setup/dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions setup/lib/setup-haskell.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions setup/src/setup-haskell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ export default async function run(
core.setOutput('cabal-store', 'C:\\sr');
} else {
core.setOutput('cabal-store', `${process.env.HOME}/.cabal/store`);
// Issue #130: for non-choco installs, add ~/.cabal/bin to PATH
const installdir = `${process.env.HOME}/.cabal/bin`;
core.info(`Adding ${installdir} to PATH`);
core.addPath(installdir);
}

// Workaround the GHC nopie linking errors for ancient GHC versions
Expand Down