Skip to content

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

Closed

Description

@ygale

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:

Activity

  1. borsboom commented on Mar 22, 2018

    @borsboom
    Contributor

    This sounds like a good approach to me.

  2. DanBurton commented on Mar 22, 2018

    @DanBurton
    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"?

  3. borsboom commented on Mar 22, 2018

    @borsboom
    Contributor
  4. ygale commented on Mar 23, 2018

    @ygale
    Author

    @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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions