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

Feature request: Option to make a compiler available for all users #3935

Closed
ygale opened this issue Mar 21, 2018 · 5 comments
Closed

Feature request: Option to make a compiler available for all users #3935

ygale opened this issue Mar 21, 2018 · 5 comments

Comments

@ygale
Copy link

ygale commented Mar 21, 2018

On a build server used by many devs, the number of compilers installed by stack is basically O(n^2) - number of compilers needed times number of devs.

Proposal:

  • Support a global programs directory in the same place where the global config.yaml lives, e.g. /etc/stack/programs.
  • The global programs directory is structured the same way as the user programs directory (e.g. ~/.stack/programs).
  • If stack doesn't find the compiler it is looking for in the user programs directory, then instead of immediately failing it first looks in the global programs directory.
  • The --global option to stack setup tells stack to install the compiler in the global programs directory instead of the user programs directory.

Notes:

@borsboom
Copy link
Contributor

This sounds like a good approach to me.

@DanBurton
Copy link
Contributor

I don't quite understand. Doesn't this functionality basically already exist, in the form of the STACK_ROOT environment variable?

As an added bonus, not only are the compilers shared, but all libraries built in a snapshot package-db are shared as well.

https://docs.haskellstack.org/en/stable/GUIDE/#setting-stack-root-location

The only potential downside is that users presumably need write access to the shared location in order to use it this way. Is the idea here that users only have read access to the "global programs"?

@borsboom
Copy link
Contributor

borsboom commented Mar 22, 2018 via email

@ygale
Copy link
Author

ygale commented Mar 23, 2018

@DanBurton Right, normally the global programs will be accessed read-only. When a new GHC version is about to come into play, an admin would run sudo stack setup ... --global once, and we're set.

@borsboom Yes. And besides that, we want to avoid the complexities of per-user configuration, and shell-script/environment-variable hackery.

@snoyberg
Copy link
Contributor

snoyberg commented Apr 2, 2019

@snoyberg snoyberg closed this as completed Apr 2, 2019
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

No branches or pull requests

4 participants