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

stack path #95

Closed
snoyberg opened this issue May 28, 2015 · 10 comments
Closed

stack path #95

snoyberg opened this issue May 28, 2015 · 10 comments
Assignees
Milestone

Comments

@snoyberg
Copy link
Contributor

I closed an issue about this previously, but after discussing with @chrisdone we should implement it. Will have information about:

  • Which GHC is being used
  • Where log files are stored
  • Package databases
@DanBurton
Copy link
Contributor

@snoyberg @chrisdone the implementation was not obvious to me, so I stubbed it out. I presume you two probably have the knowledge to trivially implement it from here, or give me some pointers on how to go about discovering these values?

Also, I believe the code as written will create a project file if it doesn't exist, and that's probably not what we want it to do. But I don't see any other way to get a BuildConfig, which I presume has the necessary components to determine these paths.

@snoyberg snoyberg assigned snoyberg and unassigned DanBurton Jun 3, 2015
@snoyberg
Copy link
Contributor Author

snoyberg commented Jun 3, 2015

@DanBurton Reassigning to you actually. Please ping me on Slack to ask whatever questions you have about where to get this information.

@snoyberg snoyberg assigned DanBurton and unassigned snoyberg Jun 3, 2015
@snoyberg snoyberg modified the milestones: Third release, Second release Jun 7, 2015
@snoyberg snoyberg assigned DanBurton and snoyberg and unassigned DanBurton Jun 9, 2015
@snoyberg snoyberg assigned chrisdone and unassigned snoyberg Jun 16, 2015
@3noch
Copy link
Member

3noch commented Jun 17, 2015

Also would be nice to know the path to built binaries.

@3noch
Copy link
Member

3noch commented Jun 18, 2015

I'm just one person, but I'd really like to have this, at least for GHC. I tried to figure it out, but it's over my head. I'd be happy to take some pointers.

@3noch
Copy link
Member

3noch commented Jun 18, 2015

For now I can just do stack exec -- which ghc.

chrisdone added a commit that referenced this issue Jun 21, 2015
@chrisdone
Copy link
Member

Done. Passing over to @snoyberg to review. Here's how it looks:

chris@retina:~/Work/stack$ stack path --help
Usage: stack path [--global-stack-root] [--project-root] [--config-location]
                  [--bin-path] [--ghc-paths] [--local-bin-path]
                  [--extra-include-dirs] [--extra-library-dirs]
                  [--snapshot-pkg-db] [--local-pkg-db] [--snapshot-install-root]
                  [--local-install-root] [--dist-dir]
  Print out handy path information

Available options:
  --global-stack-root      Global stack root directory
  --project-root           Project root (derived from stack.yaml file)
  --config-location        Configuration location (where the stack.yaml file is)
  --bin-path               PATH environment variable
  --ghc-paths              Installed GHCs (unpacked and archives)
  --local-bin-path         Local bin path where stack installs executables
  --extra-include-dirs     Extra include directories
  --extra-library-dirs     Extra library directories
  --snapshot-pkg-db        Snapshot package database
  --local-pkg-db           Local project package database
  --snapshot-install-root  Snapshot installation root
  --local-install-root     Local project installation root
  --dist-dir               Dist work directory
chris@retina:~/Work/stack$ stack path 
Caching build plan
Populated index cache.
global-stack-root: /home/chris/.stack/
project-root: /home/chris/Work/stack/
config-location: /home/chris/Work/stack/stack.yaml
bin-path: /home/chris/.stack/snapshots/x86_64-linux/lts-2.9/7.8.4/bin:/home/chris/.local/bin/:/opt/firefox/:/opt/ghc/7.8.4/bin:/home/chris/Projects/xmonad-chrisdone/dist/build/xmonad-chrisdone:/home/chris/.local/bin/:/opt/firefox/:/opt/ghc/7.8.4/bin:/home/chris/Projects/xmonad-chrisdone/dist/build/xmonad-chrisdone:/home/chris/.cabal/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
ghc-paths: /home/chris/.stack/programs/x86_64-linux/
local-bin-path: /home/chris/.local/bin/
extra-include-dirs: 
extra-library-dirs: 
snapshot-pkg-db: /home/chris/.stack/snapshots/x86_64-linux/lts-2.9/7.8.4/pkgdb/
local-pkg-db: /home/chris/Work/stack/.stack-work/install/x86_64-linux/lts-2.9/7.8.4/pkgdb/
snapshot-install-root: /home/chris/.stack/snapshots/x86_64-linux/lts-2.9/7.8.4/
local-install-root: /home/chris/Work/stack/.stack-work/install/x86_64-linux/lts-2.9/7.8.4/
dist-dir: .stack-work/dist/x86_64-linux/Cabal-1.18.1.5/
chris@retina:~/Work/stack$ stack path --snapshot-pkg-db 
snapshot-pkg-db: /home/chris/.stack/snapshots/x86_64-linux/lts-2.9/7.8.4/pkgdb/
chris@retina:~/Work/stack$ 

@snoyberg
Copy link
Contributor Author

LGTM. Can you update the ChangeLog about this?

chrisdone added a commit that referenced this issue Jun 22, 2015
@chrisdone
Copy link
Member

Done!

@3noch
Copy link
Member

3noch commented Jun 22, 2015

Can we add an option that shows the path to the version of GHC that will actually be used to build?

@chrisdone
Copy link
Member

Yeah, that can be included.

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

No branches or pull requests

4 participants