Closed waddlaw closed 5 years ago
Is this a bug? Or is it just me?
Looks like a bug!? :bug:
I can reproduce this:
λ ~/ stack script Main.hs --resolver lts-9.3 --package ghc --package ghc-paths
Using resolver: lts-9.3 specified on command line
Didn't see ghc-8.0.2 in your package indices.
Updating and trying again.
Selected mirror https://s3.amazonaws.com/hackage.fpcomplete.com/
Downloading timestamp
No updates to your package index were found
Update complete
The following package identifiers were not found in your indices: ghc-8.0.2
Possible candidates: ghc-8.2.1.
The following did work though:
λ ~/ stack script Main.hs --resolver nightly-2017-09-06 --package ghc --package ghc-paths
Using resolver: nightly-2017-09-06 specified on command line
Downloaded nightly-2017-09-06 build plan.
Preparing to install GHC to an isolated location.
This will not interfere with any system-level installation.
Downloaded ghc-8.2.1.
Installed GHC.
[1 of 2] Compiling Main ( /home/lwm/.stack/setup-exe-src/setup-mPHDZzAJ.hs, /home/lwm/.stack/setup-exe-src/setup-mPHDZzAJ.o )
[2 of 2] Compiling StackSetupShim ( /home/lwm/.stack/setup-exe-src/setup-shim-mPHDZzAJ.hs, /home/lwm/.stack/setup-exe-src/setup-shim-mPHDZzAJ.o )
Linking /home/lwm/.stack/setup-exe-cache/x86_64-linux/tmp-Cabal-simple_mPHDZzAJ_2.0.0.2_ghc-8.2.1 ...
ghc-paths-0.1.0.9: download
ghc-paths-0.1.0.9: configure
ghc-paths-0.1.0.9: build
ghc-paths-0.1.0.9: copy/register
Main.hs: Prelude.undefined
CallStack (from HasCallStack):
error, called at libraries/base/GHC/Err.hs:79:14 in base:GHC.Err
undefined, called at /home/lwm/Main.hs:4:8 in main:Main
@lwm thank you for reply.
I understand that ghc
package version equal to GHC
version why doesn't work using lts-9.3
?
lts-9.3
nightly-2017-09-06
stack script Main.hs --resolver nightly-2017-09-06 --package ghc --package ghc-paths
is working.
But, stack script Main.hs --resolver ghc-8.2.1 --package ghc --package ghc-paths
doesn't work. why?
$ stack script Main.hs --resolver ghc-8.2.1 --package ghc --package ghc-paths
Using resolver: ghc-8.2.1 specified on command line
Preparing to install GHC to an isolated location.
This will not interfere with any system-level installation.
Downloaded ghc-8.2.1.
Installed GHC.
Selected mirror https://s3.amazonaws.com/hackage.fpcomplete.com/
Downloading root
Selected mirror https://s3.amazonaws.com/hackage.fpcomplete.com/
Downloading timestamp
Downloading snapshot
Downloading mirrors
Cannot update index (no local copy)
Downloading index
Updated package index downloaded
Update complete
Populated index cache.
Local packages are not allowed when using the script command. Packages found:
- ghc-paths-0.1.0.9
I believe this problem occurs because the ghc
package is a special global package and does not always exist correctly on Hackage. It's not the only package like this. More generally, some packages that ship with GHC are different from their versions on Hackage. We've made a number of improvements around this on master
, and AFAICT this problem has been fixed there. Closing, please ping if you can still reproduce with Stack master
.
Failure bolow command.
But, success below command.
Steps to reproduce
rm -rf ~/.stack
Main.hs
main :: IO () main = undefined
Success case
step 1.
step 2
Stack version
Method of installation