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

wrong list of dependencies for ghc-variant #3084

Closed
PierreVDL opened this issue Mar 22, 2017 · 13 comments
Closed

wrong list of dependencies for ghc-variant #3084

PierreVDL opened this issue Mar 22, 2017 · 13 comments

Comments

@PierreVDL
Copy link

PierreVDL commented Mar 22, 2017

With stack
Version 1.4.0, Git revision e714f1d x86_64 hpack-0.17.0
on windows,
I ran
stack new simple
Thereafter, I changed the simple\stack.yaml file by inserting

ghc-variant: integersimple

after

resolver: lts-8.5

resulting in the following stack.yaml file (zipped)
stack.zip

After running stack setup,
I can run stack list-dependencies.
However, I get the wrong output:

Warning: File listed in simple.cabal file does not exist: README.md
base 4.9.1.0
ghc-prim 0.5.0.0
integer-gmp 1.0.0.1
rts 1.0
simple 0.1.0.0

I had not expect the dependency on integer-gmp, but a dependency on integer-simple!

@mgsloan
Copy link
Contributor

mgsloan commented Mar 28, 2017

I've made a change that ought to fix this, but can't test it on this case (not on windows). Can you please try with the master version of stack and confirm that it's fixed?

@PierreVDL
Copy link
Author

How do I get a master version of stack?
Do I need to build stack myself? Or is there a nightly build to be downloaded?
Or should I call stack upgrade with some additional parameters?

@sjakobi
Copy link
Member

sjakobi commented Mar 29, 2017

@PierreVDL stack upgrade --git should do the trick.

@PierreVDL
Copy link
Author

C:\Users\pilaar>stack upgrade --git
git: readCreateProcess: does not exist (No such file or directory)

Do I need to install git?
We use svn....

@sjakobi
Copy link
Member

sjakobi commented Mar 29, 2017

Do I need to install git?

Yes.

@sjakobi
Copy link
Member

sjakobi commented Mar 29, 2017

Alternatively you can probably download an archive of stack's source code from GitHub and stack install that.

@PierreVDL
Copy link
Author

First attempt

C:\Users\pilaar>stack upgrade --git
Cloning stack
Cloning into 'stack'...
remote: Counting objects: 499, done.
remote: Compressing objects: 100% (386/386), done.
remote: Total 499 (delta 35), reused 257 (delta 17), pack-reused 0
Receiving objects: 100% (499/499), 624.64 KiB | 0 bytes/s, done.
Resolving deltas: 100% (35/35), done.
No compiler found, expected minor version match with ghc-8.0.2 (x86_64) (based on resolver s
etting in C:\Users\pilaar\AppData\Local\Temp\stack-upgrade4196\stack\stack.yaml).
Try rerunning with --install-ghc to install the correct GHC into C:\Users\pilaar\AppData\Loc
al\Programs\stack\x86_64-windows\

Second attempt

C:\Users\pilaar>stack upgrade --git --install-ghc
...
Everything is Ok

Folders: 408
Files: 8819
Size:       1428387108
Compressed: 1435371520
GHC installed to C:\Users\pilaar\AppData\Local\Programs\stack\x86_64-windows\ghc-8.0.2\
[1 of 2] Compiling Main             ( C:\sr\setup-exe-src\setup-Z6RU0evB.hs, C:\sr\setup-exe
-src\setup-Z6RU0evB.o ) [Distribution.Simple changed]
[2 of 2] Compiling StackSetupShim   ( C:\sr\setup-exe-src\setup-shim-Z6RU0evB.hs, C:\sr\setu
p-exe-src\setup-shim-Z6RU0evB.o ) [Distribution.PackageDescription changed]
Linking C:\sr\setup-exe-cache\x86_64-windows\tmp-Cabal-simple_Z6RU0evB_1.24.2.0_ghc-8.0.2.ex
e ...
ansi-terminal-0.6.2.3: configure
SHA-1.6.4.2: download
annotated-wl-pprint-0.7.0: download
Win32-notify-0.3.0.1: download
ansi-terminal-0.6.2.3: build
annotated-wl-pprint-0.7.0: configure
annotated-wl-pprint-0.7.0: build
Win32-notify-0.3.0.1: configure
annotated-wl-pprint-0.7.0: copy/register
SHA-1.6.4.2: configure
Win32-notify-0.3.0.1: build
auto-update-0.1.4: download
SHA-1.6.4.2: build
auto-update-0.1.4: configure
ansi-terminal-0.6.2.3: copy/register
Win32-notify-0.3.0.1: copy/register
ansi-wl-pprint-0.6.7.3: download
auto-update-0.1.4: build
ansi-wl-pprint-0.6.7.3: configure
base-compat-0.9.1: download
auto-update-0.1.4: copy/register
ansi-wl-pprint-0.6.7.3: build
base-compat-0.9.1: configure
base-orphans-0.5.4: download
ansi-wl-pprint-0.6.7.3: copy/register
base-orphans-0.5.4: configure
base-compat-0.9.1: build
base16-bytestring-0.1.1.6: download
base-orphans-0.5.4: build
base16-bytestring-0.1.1.6: configure
base-orphans-0.5.4: copy/register
base16-bytestring-0.1.1.6: build
base-compat-0.9.1: copy/register
base16-bytestring-0.1.1.6: copy/register
SHA-1.6.4.2: copy/register
Progress: 12/175HttpExceptionRequest Request {
  host                 = "s3.amazonaws.com"
  port                 = 443
  secure               = True
  requestHeaders       = []
  path                 = "/hackage.fpcomplete.com/package/bitarray-0.0.1.1.tar.gz"
  queryString          = ""
  method               = "GET"
  proxy                = Nothing
  rawBody              = False
  redirectCount        = 10
  responseTimeout      = ResponseTimeoutDefault
  requestVersion       = HTTP/1.1
}
 (ConnectionFailure getAddrInfo: does not exist (error 11001))

HttpExceptionRequest Request {
  host                 = "s3.amazonaws.com"
  port                 = 443
  secure               = True
  requestHeaders       = []
  path                 = "/hackage.fpcomplete.com/package/base64-bytestring-1.0.0.1.tar.gz"
  queryString          = ""
  method               = "GET"
  proxy                = Nothing
  rawBody              = False
  redirectCount        = 10
  responseTimeout      = ResponseTimeoutDefault
  requestVersion       = HTTP/1.1
}
 (ConnectionFailure getAddrInfo: does not exist (error 11001))

HttpExceptionRequest Request {
  host                 = "s3.amazonaws.com"
  port                 = 443
  secure               = True
  requestHeaders       = []
  path                 = "/hackage.fpcomplete.com/package/byteable-0.1.1.tar.gz"
  queryString          = ""
  method               = "GET"
  proxy                = Nothing
  rawBody              = False
  redirectCount        = 10
  responseTimeout      = ResponseTimeoutDefault
  requestVersion       = HTTP/1.1
}
 (ConnectionFailure getAddrInfo: does not exist (error 11001))

Network issues...

I keep trying

@pjljvandelaar
Copy link

At another location (not behind a proxy) I tried to install stack, but failed again...

stack upgrade --git --install-ghc

I got a few warnings, like:

network-2.6.3.1: configure
Package network uses a custom Cabal build, but does not use a custom-setup stanza
Not using the explicit setup deps approach based on configuration
Strongly recommend fixing the package's cabal file

should the cabal file of stack be changed?
Or is the error in the included package (network, old-time, stm-chans)?

And one error

--  While building package cookie-0.4.2.1 using:
      C:\sr\setup-exe-cache\x86_64-windows\Cabal-simple_Z6RU0evB_1.24.2.0_ghc-8.0.2.exe --builddir=.stack-work\dist\ca59d0ab register
    Process exited with code: ExitFailure 1
    Logs have been written to: C:\Users\LAARPJ~1\AppData\Local\Temp\stack-upgrade10720\stack\.stack-work\logs\cookie-0.4.2.1.log

    Configuring cookie-0.4.2.1...
    Building cookie-0.4.2.1...
    Preprocessing library cookie-0.4.2.1...
    [1 of 1] Compiling Web.Cookie       ( Web\Cookie.hs, .stack-work\dist\ca59d0ab\build\Web\Cookie.o )

    Web\Cookie.hs:92:18: warning: [-Wdeprecations]
        In the use of `breakByte' (imported from Data.ByteString):
        Deprecated: "It is an internal function and should never have been exported. Use 'break (== x)' instead. (There are rewrite rules that handle this special case of 'break'.)"

    Web\Cookie.hs:241:21: warning: [-Wdeprecations]
        In the use of `parseTime'
        (imported from Data.Time, but defined in time-1.6.0.1:Data.Time.Format.Parse):
        Deprecated: "use "parseTimeM True" instead"
    Installing library in
    C:\sr\snapshots\b201cfe6\lib\x86_64-windows-ghc-8.0.2\cookie-0.4.2.1-K68NuFIZ07nEstxwB6c3aL
    Registering cookie-0.4.2.1...
    Cabal-simple_Z6RU0evB_1.24.2.0_ghc-8.0.2.exe:
    'C:\Users\laarpjljvd\AppData\Local\Programs\stack\x86_64-windows\ghc-8.0.2\bin\ghc-pkg.EXE'
    exited with an error:
    cookie-0.4.2.1: Warning: haddock-interfaces:
    C:\sr\snapshots\b201cfe6\doc\cookie-0.4.2.1\cookie.haddock doesn't exist or
    isn't a file
    ghc-pkg.EXE: C:\sr\snapshots\b201cfe6\pkgdb\package.cache: you don't have
    permission to modify this file

@pjljvandelaar
Copy link

The error seems to be a temporary issue:
executing
stack upgrade --git --install-ghc
again resulted in a lot of additional steps, yet not a successful build: stack doesn't compile itself:

[ 60 of 126] Compiling Stack.Config.Docker ( src\Stack\Config\Docker.hs, .stack-work\dist\ca59d0ab\build\Stack\Config\Docker.o )
[ 61 of 126] Compiling Stack.Constants  ( src\Stack\Constants.hs, .stack-work\dist\ca59d0ab\build\Stack\Constants.o )
Segmentation fault/access violation in generated code
Completed 83 action(s).

--  While building package stack-1.4.1 using:
      C:\Users\LAARPJ~1\AppData\Local\Temp\stack-upgrade10488\stack\.stack-work\dist\ca59d0ab\setup\setup --builddir=.stack-work\dist\ca59d0ab build lib:stack exe:stack --ghc-options " -ddump-hi -ddump-to-file"
    Process exited with code: ExitFailure 1

@pjljvandelaar
Copy link

trying again yields:

C:\Users\laarpjljvd>stack upgrade --git --install-ghc
Cloning stack
Cloning into 'stack'...
remote: Counting objects: 506, done.
remote: Compressing objects: 100% (392/392), done.
remote: Total 506 (delta 36), reused 261 (delta 17), pack-reused 0
Receiving objects: 100% (506/506), 625.61 KiB | 0 bytes/s, done.
Resolving deltas: 100% (36/36), done.
Checking out files: 100% (368/368), done.
store-0.4.1: configure
store-0.4.1: build
store-0.4.1: copy/register
stack-1.4.1: configure (lib + exe)
[1 of 2] Compiling Main             ( C:\Users\LAARPJ~1\AppData\Local\Temp\stack-upgrade9768\stack\Setup.hs, C:\Users\LAARPJ~1\AppData\Local\Temp\stack-upgrade9768\stack\.stack-work\dist\ca59d0ab\setup\Main.o )
[2 of 2] Compiling StackSetupShim   ( C:\sr\setup-exe-src\setup-shim-Z6RU0evB.hs, C:\Users\LAARPJ~1\AppData\Local\Temp\stack-upgrade9768\stack\.stack-work\dist\ca59d0ab\setup\StackSetupShim.o )
Linking C:\Users\LAARPJ~1\AppData\Local\Temp\stack-upgrade9768\stack\.stack-work\dist\ca59d0ab\setup\setup.exe ...
Configuring stack-1.4.1...
stack-1.4.1: build (lib + exe)
Preprocessing library stack-1.4.1...
[  1 of 126] Compiling Text.PrettyPrint.Leijen.Extended ( src\Text\PrettyPrint\Leijen\Extended.hs, .stack-work\dist\ca59d0ab\build\Text\PrettyPrint\Leijen\Extended.o )
[  2 of 126] Compiling System.Process.PagerEditor ( src\System\Process\PagerEditor.hs, .stack-work\dist\ca59d0ab\build\System\Process\PagerEditor.o )
[  3 of 126] Compiling System.Process.Log ( src\System\Process\Log.hs, .stack-work\dist\ca59d0ab\build\System\Process\Log.o )
[  4 of 126] Compiling Stack.Types.StringError ( src\Stack\Types\StringError.hs, .stack-work\dist\ca59d0ab\build\Stack\Types\StringError.o )
...
[125 of 126] Compiling Stack.Upgrade    ( src\Stack\Upgrade.hs, .stack-work\dist\ca59d0ab\build\Stack\Upgrade.o )
[126 of 126] Compiling Stack.SDist      ( src\Stack\SDist.hs, .stack-work\dist\ca59d0ab\build\Stack\SDist.o )
Preprocessing executable 'stack' for stack-1.4.1...
[1 of 2] Compiling Paths_stack      ( .stack-work\dist\ca59d0ab\build\autogen\Paths_stack.hs, .stack-work\dist\ca59d0ab\build\stack\stack-tmp\Paths_stack.o )
[2 of 2] Compiling Main             ( src\main\Main.hs, .stack-work\dist\ca59d0ab\build\stack\stack-tmp\Main.o )
Linking .stack-work\dist\ca59d0ab\build\stack\stack.exe ...
stack-1.4.1: copy/register
Installing library in
C:\Users\LAARPJ~1\AppData\Local\Temp\stack-upgrade9768\stack\.stack-work\install\65995373\lib\x86_64-windows-ghc-8.0.2\stack-1.4.1-KcElF5VcxRhIJ0vuV152X0
Installing executable(s) in
C:\Users\LAARPJ~1\AppData\Local\Temp\stack-upgrade9768\stack\.stack-work\install\65995373\bin
Registering stack-1.4.1...
Completed 2 action(s).
Copying from C:\Users\LAARPJ~1\AppData\Local\Temp\stack-upgrade9768\stack\.stack-work\install\65995373\bin\stack.exe to C:\Users\laarpjljvd\AppData\Roaming\local\bin\stack.exe

Copied executables to C:\Users\laarpjljvd\AppData\Roaming\local\bin\:
- stack.exe

So installation feels buggy, yet it succeeds:

C:\Users\laarpjljvd>stack --version
Version 1.4.1, Git revision 63d08a96c669cb9a87f298e87a862307fbd96dff x86_64 hpack-0.17.0

@pjljvandelaar
Copy link

executed again
stack new simple
inserted
ghc-variant: integersimple
after
resolver: lts-8.6 (the current lts was originally 8.5 yet I assume it shouldn't matter)

after running
stack setup
I get on executing
stack list-dependencies
the expected:

Warning: File listed in simple.cabal file does not exist: README.md
base 4.9.1.0
ghc-prim 0.5.0.0
integer-simple 0.1.1.1
rts 1.0
simple 0.1.0.0

Thanks for fixing this issue!

@pjljvandelaar
Copy link

There still seems to be a license issue:

c:\tmp\simple>stack list-dependencies --license
Warning: File listed in simple.cabal file does not exist: README.md
base BSD3
ghc-prim BSD3
integer-simple <unknown>
rts BSD3
simple BSD3

or is the license of integer-simple really unknown?

@mgsloan
Copy link
Contributor

mgsloan commented Apr 3, 2017

@pjljvandelaar Thanks for pointing that out! I was taking the license info from the source map (parsing of cabal files), since our DumpPackage type didn't have license info. A better fix, which I've just pushed, is to add the license info to our DumpPackage type and use it.

@mgsloan mgsloan closed this as completed Apr 3, 2017
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