haskell / haskell/cabal

arm64/Termux/Ubuntu: inability to limit cabal resource-use reaps Termux due to ?OOM? or something...

Open
#8,190 34 comments 0 reactions 0 assignees View on GitHub
status: consider closing type: user-question
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

aarch64/tablet/Android
Termux
Ubuntu jammy server
( my learning-development environment )

The Glorious Glasgow Haskell Compilation System, version 8.8.4
( installed via
apt install haskell-platform )

cabal-install version 3.0.0.0
compiled using version 3.0.1.0 of the Cabal library

---

1st time I run ...
cabal install hindent
... includes this:

```
Resolving dependencies...
Build profile: -w ghc-8.8.4 -O1
In order, the following will be built (use -v for more details):
- ansi-wl-pprint-0.6.9 (lib) (requires download & build)
- base-compat-0.12.1 (lib) (requires download & build)
- base-orphans-0.8.6 (lib) (requires download & build)
- data-fix-0.3.2 (lib) (requires download & build)
- dlist-1.0 (lib) (requires download & build)
- exceptions-0.10.5 (lib) (requires download & build)
- happy-1.20.0 (exe:happy) (requires download & build)
- indexed-traversable-0.1.2 (lib) (requires download & build)
- monad-loops-0.4.3 (lib) (requires download & build)
- tagged-0.8.6.1 (lib) (requires download & build)
- th-abstraction-0.4.3.0 (lib) (requires download & build)
- transformers-compat-0.7.1 (lib) (requires download & build)
- unix-compat-0.6 (lib) (requires download & build)
- unliftio-core-0.2.0.1 (lib) (requires download & build)
- utf8-string-1.0.2 (lib) (requires download & build)
- uuid-types-1.0.5 (lib) (requires download & build)
- vector-algorithms-0.8.0.4 (lib) (requires download & build)
- time-compat-1.9.5 (lib) (requires download & build)
- OneTuple-0.3 (lib) (requires download & build)
- temporary-1.3 (lib) (requires download & build)
- haskell-src-exts-1.23.1 (lib) (requires download & build)
- distributive-0.6.2.1 (lib) (requires download & build)
- optparse-applicative-0.17.0.0 (lib) (requires download & build)
- resourcet-1.2.5 (lib) (requires download & build)
- mono-traversable-1.0.15.3 (lib) (requires download & build)
- base-compat-batteries-0.12.1 (lib) (requires download & build)
- comonad-5.0.8 (lib) (requires download & build)
- conduit-1.3.4.2 (lib) (requires download & build)
- bifunctors-5.5.12 (lib) (requires download & build)
- libyaml-0.1.2 (lib) (requires download & build)
- assoc-1.0.2 (lib) (requires download & build)
- these-1.1.1.1 (lib) (requires download & build)
- strict-0.4.0.1 (lib) (requires download & build)
- aeson-1.5.6.0 (lib) (requires download & build)
- yaml-0.11.8.0 (lib) (requires download & build)
- path-0.9.2 (lib) (requires download & build)
- hindent-5.3.2 (lib) (requires download & build)
- path-io-1.7.0 (lib) (requires download & build)
- hindent-5.3.2 (exe:hindent) (requires download & build)
```

later the Termux session that the build was happening in,
got reaped by Android.

So did the next,
& the next...

the most-recent 10-ish reapings looked like this:

```Resolving dependencies...
Build profile: -w ghc-8.8.4 -O1
In order, the following will be built (use -v for more details):
- aeson-1.5.6.0 (lib) (requires build)
- haskell-src-exts-1.23.1 (lib) (requires build)
- yaml-0.11.8.0 (lib) (requires build)
- path-0.9.2 (lib) (requires build)
- hindent-5.3.2 (lib) (requires build)
- path-io-1.7.0 (lib) (requires build)
- hindent-5.3.2 (exe:hindent) (requires build)
Starting aeson-1.5.6.0 (lib)
Starting haskell-src-exts-1.23.1 (lib)
Building aeson-1.5.6.0 (lib)
Building haskell-src-exts-1.23.1 (lib)
```

... then ... POOF the Termux instance disappeared,
1 minute after starting.

: (

I was *not permitted* by cabal to reduce the # of CPU's it uses in building stuff
( the -j 4 option is not recognized by
cabal install,
nor is -jobs 4
I'd wrongly-assumed it was a CPU-saturated-for-too-long issue, at 1st.

Please fix it so that the .cabal/config file's ...
```
jobs: 4
```
... *gets respected*.
( formerly the .cabal/config file was auto-set to
jobs: $ncpus
or something like that )

---

Eventually it dawned on me that it *might* be possible to get hindent installed IF:
I did it only 1 piece at a time?

So:

```
cabal list aeson
```
scroll through results, & see that the version that *that* would install
is outside the required-by hindent version...

```
nice -n 20 cabal install aeson-1.5.6.0
```

took 22 minutes, but worked, CPU usage,
shown by top in another Termux session, showed 800%

```
nice -n 20 cabal install haskell-src-exts
nice -n 20 cabal install yaml
nice -n 20 cabal install path
nice -n 20 cabal install hindent # finally worked!!
```

Many people cannot afford housing, nowadays,
so finding more & more people learning programming
entirely out of their tablet/phone/ARM-based netbook,
because that is all that many have, *must* work.

The fact that my Termux session was being reaped
by cabal's commitment to compile both aeson & haskell-src-exts *simultaneously*
proved to be the problem,
& it took me a half-day to figure-out how to try getting around cabal's blocking of my limiting its resourc-usage, to get this to work..

Our world needs as many good Haskell programmers as possible,
not only materially-wealthy ones, right?

I'm presuming it is Out-Of-Memory condition that was inducing the reaping.

---

Please get the
.cabal/config
file's
jobs: *whatever*
line to be respected, even when installing system-wide packages.

please consider making
-j *whatever*
&
-jobs *whatever*
switches work

please make it possible to compile only *1* package at a time,
automatically,
instead of forcing we whose machines cannot provide enough RAM
to somehow all discover, independently,
the manual/arbitrary method of doing it

( will my aeson-1.5.6.0 upgrade itself to 1.5.6.1, automatically?
or do I now have to do that manually,
after having specified the *patchlevel* of the required one?

cabal install 1.5
... *didn't* work, so I presume the complete patchlevel-specification is required.

Why should any of us even face the question? It should Just Work(tm), right?
: )

Anyways, I hope this helps you people make cabal work better for everybody!

It is amazing!

Kaizen, eh?

( :

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.