Skip to content
This repository has been archived by the owner on Oct 7, 2020. It is now read-only.

Thread blocked in an STM transaction #1328

Closed
Proximyst opened this issue Jul 10, 2019 · 16 comments · Fixed by #1338
Closed

Thread blocked in an STM transaction #1328

Proximyst opened this issue Jul 10, 2019 · 16 comments · Fixed by #1338

Comments

@Proximyst
Copy link

Hi, I'm an Arch user (relevant neofetch + glibc? https://owo.whats-th.is/5zu65ff.png) and I've installed cabal using the bootstrap script. I then used cabal to install stack, and stack is now trying to install HIE. However, when it gets around to unpacking ghc-tinfo6-8.6.4 (and once even got that and went on to installing but failed with the same error), it errs with thread blocked indefinitely in an STM transaction and error code 1. This is done with stack install.hs. It always manages to download ghc-tinfo6, but it never manages to actually use it.
I'm new to Haskell as a whole and for sure don't know much about the ecosystem, so I might be missing something but I'm fairly sure I've been doing it correctly so far.

@samuelpilz
Copy link
Contributor

could you try to run stack build --stack-yaml stack-8.6.4.yaml manually?

@fendor
Copy link
Collaborator

fendor commented Jul 10, 2019

Does a normal stack project work? E.g.execute stack new test, will create a test directory with a project. Can you then try to use stack build in the newly created directory? I think this error is stack and arch related.
Also, does stack setup succeed?

Last but not least, welcome to haskell!

@Anrock Anrock added build Continuous integration and building status: info needed type: question labels Jul 10, 2019
@mb720
Copy link
Contributor

mb720 commented Jul 11, 2019

I just ran into this on Arch Linux 5.1.16:

/home/mb$ sudo aura -A haskell-ide-engine
[sudo] password for mb: 
aura >>= Determining dependencies...
aura >>= AUR Packages:
haskell-ide-engine

aura >>= Continue? [Y/n] 
aura >>= Building `haskell-ide-engine`...
aura >>= Well, building `haskell-ide-engine` failed.
aura >>= Dumping makepkg output in 3.. 2.. 1..
==> Making package: haskell-ide-engine 0.10.0.0-2 (Thu 11 Jul 2019 11:55:50 AM CEST)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Cloning haskell-ide-engine-0.10.0.0 git repo...
Cloning into bare repository '/var/cache/pacman/pkg/haskell-ide-engine2770/haskell-ide-engine/haskell-ide-engine-0.10.0.0'...
==> Validating source files with md5sums...
    haskell-ide-engine-0.10.0.0 ... Skipped
==> Extracting sources...
  -> Creating working copy of haskell-ide-engine-0.10.0.0 git repo...
Cloning into 'haskell-ide-engine-0.10.0.0'...
done.
Switched to a new branch 'makepkg'
==> Starting prepare()...
Submodule 'submodules/HaRe' (https://github.com/alanz/HaRe.git) registered for path 'submodules/HaRe'
Submodule 'submodules/brittany' (https://github.com/lspitzner/brittany.git) registered for path 'submodules/brittany'
Submodule 'submodules/cabal-helper' (https://github.com/alanz/cabal-helper.git) registered for path 'submodules/cabal-helper'
Submodule 'submodules/ghc-mod' (https://github.com/alanz/ghc-mod.git) registered for path 'submodules/ghc-mod'
Cloning into '/var/cache/pacman/pkg/haskell-ide-engine2770/haskell-ide-engine/src/haskell-ide-engine-0.10.0.0/submodules/HaRe'...
Cloning into '/var/cache/pacman/pkg/haskell-ide-engine2770/haskell-ide-engine/src/haskell-ide-engine-0.10.0.0/submodules/brittany'...
Cloning into '/var/cache/pacman/pkg/haskell-ide-engine2770/haskell-ide-engine/src/haskell-ide-engine-0.10.0.0/submodules/cabal-helper'...
Cloning into '/var/cache/pacman/pkg/haskell-ide-engine2770/haskell-ide-engine/src/haskell-ide-engine-0.10.0.0/submodules/ghc-mod'...
==> Starting build()...
Preparing to install GHC (tinfo6) to an isolated location.
This will not interfere with any system-level installation.
Preparing to download ghc-tinfo6-8.2.2 ...
Already downloaded.
Unpacking GHC into /home/mb/.stack/programs/x86_64-linux/ghc-tinfo6-8.2.2.temp/ ...
thread blocked indefinitely in an STM transaction
==> ERROR: A failure occurred in build().
    Aborting...

Submodule path 'submodules/HaRe': checked out 'dfab0004320c28e1aa0331a507a9428952f2c938'
Submodule path 'submodules/brittany': checked out '6c187da8f8166d595f36d6aaf419370283b3d1e9'
Submodule path 'submodules/cabal-helper': checked out 'eafed5e8c1d82b8daa35775b52361132f2e70261'
Submodule path 'submodules/ghc-mod': checked out '43476965b5d715f7fcdadd9e14d5e0c53cdb9385'

aura >>= Would you like to continue anyway? [Y/n] 

@samuelpilz
Copy link
Contributor

This seems to be a problem with stack. Could you try running stack setup anywhere?

@mb720
Copy link
Contributor

mb720 commented Jul 11, 2019

stack setup in a directory with a Stack project produces

stack will use a sandboxed GHC it installed
For more information on paths, see 'stack path' and 'stack exec env'
To use this GHC and packages outside of a project, consider using:
stack ghc, stack ghci, stack runghc, or stack exec

stack setup outside a Stack project:

Writing implicit global project config file to: /home/mb/.stack/global-project/stack.yaml
Note: You can change the snapshot via the resolver field there.
Using latest snapshot resolver: lts-13.27
stack will use a sandboxed GHC it installed
For more information on paths, see 'stack path' and 'stack exec env'
To use this GHC and packages outside of a project, consider using:
stack ghc, stack ghci, stack runghc, or stack exec

@fendor
Copy link
Collaborator

fendor commented Jul 11, 2019

This seems like a problem with stack, maybe somebody reported this upstream already. Can you try to manually invoke stack install.hs hie-8.2.2 and stack install.hs hie-8.6.5?

@mb720
Copy link
Contributor

mb720 commented Jul 12, 2019

Thanks for your quick responses. Where can I find install.hs?

@jneira
Copy link
Member

jneira commented Jul 12, 2019

@mb720 the path where aura downloaded the haskell-ide-engine seems to be /var/cache/pacman/pkg/haskell-ide-engine2770/haskell-ide-engine/src/haskell-ide-engine-0.10.0.0 so the install.hs script should be there

@fendor
Copy link
Collaborator

fendor commented Jul 12, 2019

Or clone this repo and execute the command in the top level of this repo

@mb720
Copy link
Contributor

mb720 commented Jul 12, 2019

Thanks @jneira. aura did not keep the code in /var/cache/pacman/pkg/.

I cloned the repo and ran

stack install.hs hie-8.2.2

which resulted in

Unpacking GHC into /home/mb/.stack/programs/x86_64-linux/ghc-tinfo6-8.6.4.temp/ ...
thread blocked indefinitely in an STM transaction

On the other hand, judging from the output of

stack install.hs hie-8.6.5

it built and configured all kinds of packages (e.g., network-uri-2.6.1.0, async-2.2.1). The last messages are

hlint-2.2: copy/register                 
Building all executables for `haskell-ide-engine' once. After a successful build of all of them, only specified executables will be rebuilt.
haskell-ide-engine-0.11.0.0: configure (lib + internal-lib + exe)
haskell-ide-engine-0.11.0.0: build (lib + internal-lib + exe)
haskell-ide-engine-0.11.0.0: copy/register   
Completed 160 action(s).                     
Log files have been written to: /home/mb/extra_repos/haskell-ide-engine/.stack-work/logs/
# stack (for hie-8.6.5)
z-haskell-ide-engine-z-hie-test-utils-0.11.0.0: unregistering (Dependency being unregistered: haskell-ide-engine-0.11.0.0)
haskell-ide-engine-0.11.0.0: unregistering (local file changes: .git/index)
haskell-ide-engine-0.11.0.0: configure (lib + internal-lib + exe)
haskell-ide-engine-0.11.0.0: build (lib + internal-lib + exe)
haskell-ide-engine-0.11.0.0: copy/register
Log files have been written to: /home/mb/extra_repos/haskell-ide-engine/.stack-work/logs/
Copying from /home/mb/extra_repos/haskell-ide-engine/.stack-work/install/x86_64-linux-tinfo6/lts-13.27/8.6.5/bin/hie to /home/mb/.local/bin/hie
Copying from /home/mb/extra_repos/haskell-ide-engine/.stack-work/install/x86_64-linux-tinfo6/lts-13.27/8.6.5/bin/hie-wrapper to /home/mb/.local/bin/hie-wrapper

Copied executables to /home/mb/.local/bin:
- hie
- hie-wrapper
# stack (for hie-8.6.5)
# stack (for hie-8.6.5)
Build completed in 44m37s

indicating that the build succeeded. :-)


Stack version:

Version 1.9.3.1, Git revision 43ff632b030f50898bff793c9e6c634637ba6001 (6217 commits) x86_6

@fendor
Copy link
Collaborator

fendor commented Jul 12, 2019

So, this is a problem upstream, that stack fails to install ghc-8.2.2 on arch linux.

@Proximyst
Copy link
Author

For the record, if you install ghc from the static binaries distributed by the Haskell team alongside all the other ghc dependencies, you should be able to compile ghc. Use this new ghc to compile ghc once more, then use the new ghc to compile the rest of the toolchain. This took me on a Ryzen 2600 a bit more than an hour in total (ghc, ghc again, cabal, then use cabal to install stack). Stack will properly download its own GHC as it should.

@caioalonso
Copy link

Running sudo stack upgrade fixed it for me on Arch Linux.

@samuelpilz
Copy link
Contributor

It seems that the package for stack on the pacman repository is outdated

@fendor
Copy link
Collaborator

fendor commented Jul 21, 2019

What does outdated mean? Do we have to bump our required version for stack? Why does it fail though? What can we do, that this does not happen again?

@samuelpilz
Copy link
Contributor

I guess we have to bump the version to 2.1.1

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

Successfully merging a pull request may close this issue.

7 participants