Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ghcup-prereleases-0.0.7.yaml for Stack 2.11.0.1 #90

Merged
merged 1 commit into from
May 6, 2023

Conversation

mpilgrem
Copy link
Collaborator

@mpilgrem mpilgrem commented May 5, 2023

No description provided.

@hasufell
Copy link
Member

hasufell commented May 6, 2023

We want to keep all prereleases, so this file is add only.

@hasufell
Copy link
Member

hasufell commented May 6, 2023

I'm trying to build an M1 binary:

But it fails:

https://github.com/haskell/stack/actions/runs/4900632138/jobs/8751414664#step:5:10101

With no useful error:

Installing library in /Users/worker/actions-runner/_work/stack/stack/.stack-work/install/aarch64-osx/f5d31dc53d5b009daf7a394f854d4653f93a68b4676b9f763cc3e8690327beb4/9.2.7/lib/aarch64-osx-ghc-9.2.7/stack-2.11.0.1-Acfw8ksMMBo6LynJ7LY37D
Installing executable stack in /Users/worker/actions-runner/_work/stack/stack/.stack-work/install/aarch64-osx/f5d31dc53d5b009daf7a394f854d4653f93a68b4676b9f763cc3e8690327beb4/9.2.7/bin
Installing executable stack-integration-test in /Users/worker/actions-runner/_work/stack/stack/.stack-work/install/aarch64-osx/f5d31dc53d5b009daf7a394f854d4653f93a68b4676b9f763cc3e8690327beb4/9.2.7/bin
Registering library for stack-2.11.0.1..
stack         > test (suite: stack-test)




stack         > Test suite stack-test failed
Completed 5 action(s).

Error: [S-7282]
       Stack failed to execute the build plan.
       
       While executing the build plan, Stack encountered the error:
       
       Error: [S-1995]
       Test suite failure for package stack-2.11.0.1
           stack-test:  exited with: ExitFailure 1
       Logs printed to console
       



Error: Process completed with exit code 1.

Not sure why stack is swallowing the logs.

@mpilgrem
Copy link
Collaborator Author

mpilgrem commented May 6, 2023

@hasufell, taking the second issue first, I have access to a Mac Mini with Apple silicon. I'll investigate on that.

On the first issue: understood. The viChangeLog: https://github.com/commercialhaskell/stack/blob/rc/v2.9/ChangeLog.md#v2921-release-candidate was emphemeral - it is a required key?

@hasufell
Copy link
Member

hasufell commented May 6, 2023

@hasufell, taking the second issue first, I have access to a Mac Mini with Apple silicon. I'll investigate on that.

On the first issue: understood. The viChangeLog: https://github.com/commercialhaskell/stack/blob/rc/v2.9/ChangeLog.md#v2921-release-candidate was emphemeral - it is a required key?

It's optional:

https://github.com/haskell/ghcup-hs/blob/278a3005d1a45ef3365aa121990dbc61684d7333/lib/GHCup/Types.hs#L139

@mpilgrem
Copy link
Collaborator Author

mpilgrem commented May 6, 2023

@hasufell, on the M1 issue, I tried (on Mac mini (M1, 2020)/macOS Ventura 13.3.1; in Stack's release candidate branch rc/v2.11) stack build --dry-run and received only a 'bus error':

[1]    1439 bus error  stack build --dry-run

However, when I immediately repeated the same Stack command, the bus error did not occur again, and I've not been able to generate another bus error (even after 'starting from scratch', with stack purge and deleting all snapshots from the Stack root). So, whatever that was, it seems to have been a one-off glitch for me. That initial experience aside, I have no problems with stack test or stack install and can build Stack (and its test suite) with Stack resulting in an arm64 executable:

$ which stack
/Users/mpilgrem/.local/bin/stack
$ stack --numeric-version #The version is bumped to 2.11.0.2, after the release of 2.11.0.1
2.11.0.2
$ file /Users/mpilgrem/.local/bin/stack
/Users/mpilgrem/.local/bin/stack: Mach-O 64-bit executable arm64

@mpilgrem
Copy link
Collaborator Author

mpilgrem commented May 6, 2023

@hasufell, on the maintaining of old prereleases, I think that has now been addressed.

@hasufell
Copy link
Member

hasufell commented May 6, 2023

@hasufell
Copy link
Member

hasufell commented May 6, 2023

I even have this error on Linux locally, when running stack etc/scripts/release.hs check --allow-dirty.

@hasufell hasufell merged commit ffc8c38 into haskell:master May 6, 2023
@hasufell
Copy link
Member

hasufell commented May 6, 2023

Ah, I found it:

Failures:

  src/test/Stack/NixSpec.hs:77:9:
  1) Stack.Nix, nix disabled in config file, --nix given on command line, sees that the nix shell is enabled
       uncaught exception: ConfigException
       NixRequiresSystemGhc

  To rerun use: --match "/Stack.Nix/nix disabled in config file/--nix given on command line/sees that the nix shell is enabled/"

  src/test/Stack/NixSpec.hs:81:9:
  2) Stack.Nix, nix disabled in config file, --nix-pure given on command line, sees that the nix shell is enabled
       uncaught exception: ConfigException
       NixRequiresSystemGhc

  To rerun use: --match "/Stack.Nix/nix disabled in config file/--nix-pure given on command line/sees that the nix shell is enabled/"

Randomized with seed 1652141530

Finished in 0.4207 seconds
673 examples, 2 failures



stack> Test suite stack-test failed
Completed 2 action(s).

Error: [S-7282]
       Stack failed to execute the build plan.

       While executing the build plan, Stack encountered the error:

       Error: [S-1995]
       Test suite failure for package stack-2.11.0.1
           stack-test:  exited with: ExitFailure 1
       Logs printed to console

Error when running Shake build system:
  at want, called at /home/hasufell/git/stack/etc/scripts/release.hs:124:14 in main:Main
* Depends on: check
  at apply1, called at src/Development/Shake/Internal/Rules/Rerun.hs:41:5 in shake-0.19.7-LXqVWJaQJExFZtsu41Jxzq:Development.Shake.Internal.Rules.Rerun
* Depends on: _release/check/stack-2.11.0.1-linux-x86_64-bin
  at cmd, called at /home/hasufell/git/stack/etc/scripts/release.hs:149:15 in main:Main
* Raised the exception:
Development.Shake.cmd, system command failed
Command line: /home/hasufell/git/stack/_release/bin/stack-2.11.0.1-linux-x86_64/stack --arch=x86_64 --interleaved-output build --flag stack:-developer-mode --flag=stack:integration-tests --flag=stack:hide-dependency-versions --flag=stack:supported-build --pedantic --no-haddock-deps --test --haddock stack
Exit code: 1
Stderr:

@hasufell
Copy link
Member

hasufell commented May 6, 2023

Here's the patch I applied to fix it: haskell/stack@49c8b7b#diff-9120a70fdfe8243e4ec0b59b1081f9a3e7784ca9e1e3fb298b682e70e9e720c4

I'm not sure how it ever worked without it.

@hasufell
Copy link
Member

hasufell commented May 7, 2023

@mpilgrem mpilgrem deleted the patch-1 branch May 7, 2023 15:23
@mpilgrem
Copy link
Collaborator Author

mpilgrem commented May 7, 2023

It seems we need to bump the internal Cabal library? How does this work?

Stack is built against the version of Cabal determined by its stack.yaml file. In the case of Stack 2.11.0.1, that is Cabal-3.8.1.0, specified as an extra-dep.

@hasufell
Copy link
Member

hasufell commented May 7, 2023

It seems we need to bump the internal Cabal library? How does this work?

Stack is built against the version of Cabal determined by its stack.yaml file. In the case of Stack 2.11.0.1, that is Cabal-3.8.1.0, specified as an extra-dep.

But it seems to use 3.2.1.0:

Building foreign libraries is currently only supported on OSX, Linux and

@mpilgrem
Copy link
Collaborator Author

mpilgrem commented May 7, 2023

@hasufell, the Cabal package comes into play in two ways:

(1) Stack's own dependency on Cabal (Stack 2.11.0.1 depends on Cabal-3.8.1.0) - that is what I understood (likely wrongly) by your previous reference to 'the internal Cabal library'; and

(2) Stack's building of the small Cabal-simple_<hash>_<Cabal version>_ghc-<GHC version> executable through which Stack accesses the functionality of Cabal (the library) when Stack is building packages - that 'shim' executable is built with the version of Cabal that ships with the relevant version of GHC (the one specified in the snapshot).

In the case of the Stack integration test internal-libraries, that test is run with GHC 8.10.7 (which ships with Cabal-3.2.1.0) - for the reasons documented in the test's stack.yaml file, namely:

# See https://github.com/haskell/cabal/issues/7763, which includes "Cabal is
# currently unable to build foreign libraries with GHC 9.0 or 9.2." 'Currently'
# refers to Cabal versions before 3.8.

So, in summary, with this integration test, Stack is using GHC 8.10.7/Cabal-3.2.1.0 because it works on macOS (Intel), Linux and Windows; and you have discovered that using GHC 8.10.7/Cabal-3.2.1.0 fails on macOS (Apple silicon/M1).

@mpilgrem
Copy link
Collaborator Author

mpilgrem commented May 7, 2023

In the Stack repository, I am going to change the Main.hs of the problematic integration test to:

import Control.Monad ( unless )
import StackTest

main :: IO ()
-- See https://github.com/haskell/cabal/issues/7763. On macOS (Apple silicon),
-- fails with Cabal error:
-- "Cabal-simple_SvXsv1f__3.2.1.0_ghc-8.10.7: Cannot build some foreign libraries:
-- Building foreign libraries is currently only supported on OSX, Linux and
-- Windows"
main = unless (isAarch64 && isMacOSX) $ do
  -- The '--install-ghc' flag is passed here, because etc/scripts/release.hs
  -- passes `--no-install-ghc` when `--alpine` is passed to its 'check'
  -- command.
  stack ["--install-ghc", "setup"] -- See stack.yaml; using GHC 8.10.7
  stack ["build"]

and add the following exported function to StackTest.hs:

-- | Is the architecture Aarch64?
isAarch64 :: Bool
isAarch64 = arch == "aarch64"

@hasufell
Copy link
Member

hasufell commented May 8, 2023

Why exclude it? Why not bump the GHC/resolver?

@hasufell
Copy link
Member

hasufell commented May 8, 2023

@mpilgrem
Copy link
Collaborator Author

mpilgrem commented May 9, 2023

@hasufell, bumping is the better way to fix it. I've put that through the Stack repository.

@hasufell
Copy link
Member

Finally, binaries built: https://github.com/haskell/stack/actions/runs/4927781725

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants