haskell/haskell-ide-engine

timegm symbol missing on windows installation

Totoro83 opened this issue · 4 comments

I'm trying to install hie with stack 2.1.3, powershell 7 and windows 10, but I have a problem building the hoogle dependence:

PS D:\bot\haskell\haskell-ide-engine> stack ./install.hs hie-8.6.5
# stack (for check)
# git (for submodules)
# git (for submodules)
Options:
    Verbosity level: Info
# stack (for hie-8.6.5)
Using archive from https://github.com/DanielG/cabal-helper/archive/a18bbb2af92e9b4337e7f930cb80754f2408bcfd.tar.gz without a specified cryptographic hash
Cached hash is b29190ddfb9cbacf5ba46c0aae59ed47b2bed00f4ec1e62a0f8acd643ff19d04, file size 67865
For security and reproducibility, please add a hash and file size to your configuration
Preparing to install GHC to an isolated location.
This will not interfere with any system-level installation.
Downloaded ghc-8.6.5.
Already downloaded.
Already downloaded.
Decompressing ghc-8.6.5.tar.xz...

7-Zip 9.20  Copyright (c) 1999-2010 Igor Pavlov  2010-11-18

Processing archive: C:\Users\Totoro\AppData\Local\Programs\stack\x86_64-windows\ghc-8.6.5.tar.xz

Extracting  ghc-8.6.5.tar

Everything is Ok

Size:       1773445120
Compressed: 280280296
Extracting ghc-8.6.5.tar...
Extracted total of 9780 files from ghc-8.6.5.tar
GHC installed to C:\Users\Totoro\AppData\Local\Programs\stack\x86_64-windows\ghc-8.6.5\
hie-plugin-api    > configure (lib)
hie-plugin-api    > Configuring hie-plugin-api-1.3...
hoogle            > configure
hie-plugin-api    > build (lib)
hie-plugin-api    > Preprocessing library for hie-plugin-api-1.3..
hie-plugin-api    > Building library for hie-plugin-api-1.3..
hie-plugin-api    > [ 1 of 18] Compiling Haskell.Ide.Engine.Compat
hie-plugin-api    > [ 2 of 18] Compiling Haskell.Ide.Engine.Config
hoogle            > Configuring hoogle-5.0.17.15...
hie-plugin-api    > [ 3 of 18] Compiling Haskell.Ide.Engine.GhcCompat
hie-plugin-api    > [ 4 of 18] Compiling Haskell.Ide.Engine.ArtifactMap
hoogle            > build
hoogle            > Preprocessing library for hoogle-5.0.17.15..
hoogle            > Building library for hoogle-5.0.17.15..
hie-plugin-api    > [ 5 of 18] Compiling Haskell.Ide.Engine.Logger
hie-plugin-api    > [ 6 of 18] Compiling Haskell.Ide.Engine.Cradle
hoogle            > [ 1 of 28] Compiling General.Str
hie-plugin-api    > [ 7 of 18] Compiling Haskell.Ide.Engine.GhcModuleCache
hoogle            > [ 2 of 28] Compiling General.IString
hie-plugin-api    > [ 8 of 18] Compiling Haskell.Ide.Engine.MultiThreadState
hoogle            > [ 3 of 28] Compiling General.Conduit
hie-plugin-api    > [ 9 of 18] Compiling Haskell.Ide.Engine.PluginsIdeMonads
hoogle            > [ 4 of 28] Compiling General.Template
hoogle            > [ 5 of 28] Compiling General.Util
hoogle            > [ 6 of 28] Compiling General.Timing
hoogle            > [ 7 of 28] Compiling General.Log
hie-plugin-api    > [10 of 18] Compiling Haskell.Ide.Engine.MonadFunctions
hoogle            > [ 8 of 28] Compiling Input.Download
hie-plugin-api    > [11 of 18] Compiling Haskell.Ide.Engine.PluginUtils
hoogle            > [ 9 of 28] Compiling Input.Item
hie-plugin-api    > [12 of 18] Compiling Haskell.Ide.Engine.GhcUtils
hie-plugin-api    > [13 of 18] Compiling Haskell.Ide.Engine.Context
hie-plugin-api    > [14 of 18] Compiling Haskell.Ide.Engine.TypeMap
hie-plugin-api    > [15 of 18] Compiling Haskell.Ide.Engine.ModuleCache
hoogle            > [10 of 28] Compiling Input.Haddock
hie-plugin-api    > [16 of 18] Compiling Haskell.Ide.Engine.MonadTypes
hie-plugin-api    > [17 of 18] Compiling Haskell.Ide.Engine.Ghc
hoogle            > [11 of 28] Compiling Input.Set
hoogle            > [12 of 28] Compiling Paths_hoogle
hoogle            > [13 of 28] Compiling Input.Settings
hie-plugin-api    > [18 of 18] Compiling Haskell.Ide.Engine.PluginApi
hoogle            > ghc.exe: unable to load package `unix-time-0.4.7'
hoogle            > ghc.exe:  | C:\sr\snapshots\7dcfb02b\lib\x86_64-windows-ghc-8.6.5\unix-time-0.4.7-59qhjWOWGlPC1MPvUtkKAw\HSunix-time-0.4.7-59qhjWOWGlPC1MPvUtkKAw.o: unknown symbol `timegm'
hie-plugin-api    > copy/register
hie-plugin-api    > Installing library in D:\bot\haskell\haskell-ide-engine\.stack-work\install\435057d5\lib\x86_64-windows-ghc-8.6.5\hie-plugin-api-1.3-KEIQWOA6jnQIMvCc5Zh4aR
hie-plugin-api    > Registering library for hie-plugin-api-1.3..

--  While building package hoogle-5.0.17.15 using:
      C:\sr\setup-exe-cache\x86_64-windows\Cabal-simple_Z6RU0evB_2.4.0.1_ghc-8.6.5.exe --builddir=.stack-work\dist\e626a42b build --ghc-options " -fdiagnostics-color=always"
    Process exited with code: ExitFailure 1
Progress 2/3

********************************************************************************
Building failed, Try running `stack clean` and restart the build
If this does not work, open an issue at
        https://github.com/haskell/haskell-ide-engine
********************************************************************************

Error when running Shake build system:
  at want, called at src\Development\Shake\Internal\Args.hs:83:69 in shake-0.18.5-9E0S8BrSRaT9A5NJsfNgQQ:Development.Shake.Internal.Args
* Depends on: hie-8.6.5
  at command, called at src\\Stack.hs:80:3 in hie-install-0.8.1.0-8Jy4v550UKe8qlDiuLIDHw:Stack
* Raised the exception:
Development.Shake.command, system command failed
Command line: stack --stack-yaml=stack-8.6.5.yaml install --verbosity=info
Exit code: 1
Stderr:
Using archive from https://github.com/DanielG/cabal-helper/archive/a18bbb2af92e9b4337e7f930cb80754f2408bcfd.tar.gz without a specified cryptographic hash
Cached hash is b29190ddfb9cbacf5ba46c0aae59ed47b2bed00f4ec1e62a0f8acd643ff19d04, file size 67865
For security and reproducibility, please add a hash and file size to your configuration
Preparing to install GHC to an isolated location.
This will not interfere with any system-level installation.
Downloaded ghc-8.6.5.
Already downloaded.
Already downloaded.
Decompressing ghc-8.6.5.tar.xz...
Extracting ghc-8.6.5.tar...
Extracted total of 9780 files from ghc-8.6.5.tar
GHC installed to C:\Users\Totoro\AppData\Local\Programs\stack\x86_64-windows\ghc-8.6.5\
hie-plugin-api    > configure (lib)
hie-plugin-api    > Configuring hie-plugin-api-1.3...
hoogle            > configure
hie-plugin-api    > build (lib)
hie-plugin-api    > Preprocessing library for hie-plugin-api-1.3..
hie-plugin-api    > Building library for hie-plugin-api-1.3..
hie-plugin-api    > [ 1 of 18] Compiling Haskell.Ide.Engine.Compat
hie-plugin-api    > [ 2 of 18] Compiling Haskell.Ide.Engine.Config
hoogle            > Configuring hoogle-5.0.17.15...
hie-plugin-api    > [ 3 of 18] Compiling Haskell.Ide.Engine.GhcCompat
hie-plugin-api    > [ 4 of 18] Compiling Haskell.Ide.Engine.ArtifactMap
hoogle            > build
hoogle            > Preprocessing library for hoogle-5.0.17.15..
hoogle            > Building library for hoogle-5.0.17.15..
hie-plugin-api    > [ 5 of 18] Compiling Haskell.Ide.Engine.Logger
hie-plugin-api    > [ 6 of 18] Compiling Haskell.Ide.Engine.Cradle
hoogle            > [ 1 of 28] Compiling General.Str
hie-plugin-api    > [ 7 of 18] Compiling Haskell.Ide.Engine.GhcModuleCache
hoogle            > [ 2 of 28] Compiling General.IString
hie-plugin-api    > [ 8 of 18] Compiling Haskell.Ide.Engine.MultiThreadState
hoogle            > [ 3 of 28] Compiling General.Conduit
hie-plugin-api    > [ 9 of 18] Compiling Haskell.Ide.Engine.PluginsIdeMonads
hoogle            > [ 4 of 28] Compiling General.Template
hoogle            > [ 5 of 28] Compiling General.Util
hoogle            > [ 6 of 28] Compiling General.Timing
hoogle            > [ 7 of 28] Compiling General.Log
hie-plugin-api    > [10 of 18] Compiling Haskell.Ide.Engine.MonadFunctions
hoogle            > [ 8 of 28] Compiling Input.Download
hie-plugin-api    > [11 of 18] Compiling Haskell.Ide.Engine.PluginUtils
hoogle            > [ 9 of 28] Compiling Input.Item
hie-plugin-api    > [12 of 18] Compiling Haskell.Ide.Engine.GhcUtils
hie-plugin-api    > [13 of 18] Compiling Haskell.Ide.Engine.Context
hie-plugin-api    > [14 of 18] Compiling Haskell.Ide.Engine.TypeMap
hie-plugin-api    > [15 of 18] Compiling Haskell.Ide.Engine.ModuleCache
hoogle            > [10 of 28] Compiling Input.Haddock
hie-plugin-api    > [16 of 18] Compiling Haskell.Ide.Engine.MonadTypes
hie-plugin-api    > [17 of 18] Compiling Haskell.Ide.Engine.Ghc
hoogle            > [11 of 28] Compiling Input.Set
hoogle            > [12 of 28] Compiling Paths_hoogle
hoogle            > [13 of 28] Compiling Input.Settings
hie-plugin-api    > [18 of 18] Compiling Haskell.Ide.Engine.PluginApi
hoogle            > ghc.exe: unable to load package `unix-time-0.4.7'
hoogle            > ghc.exe:  | C:\sr\snapshots\7dcfb02b\lib\x86_64-windows-ghc-8.6.5\unix-time-0.4.7-59qhjWOWGlPC1MPvUtkKAw\HSunix-time-0.4.7-59qhjWOWGlPC1MPvUtkKAw.o: unknown symbol `timegm'
hie-plugin-api    > copy/register
hie-plugin-api    > Installing library in D:\bot\haskell\haskell-ide-engine\.stack-work\install\435057d5\lib\x86_64-windows-ghc-8.6.5\hie-plugin-api-1.3-KEIQWOA6jnQIMvCc5Zh4aR
hie-plugin-api    > Registering library for hie-plugin-api-1.3..

--  While building package hoogle-5.0.17.15 using:
      C:\sr\setup-exe-cache\x86_64-windows\Cabal-simple_Z6RU0evB_2.4.0.1_ghc-8.6.5.exe --builddir=.stack-work\dist\e626a42b build --ghc-options " -fdiagnostics-color=always"
    Process exited with code: ExitFailure 1
Progress 2/3

I'm using git commit tagged as 1.3 (but I tried the master one too) and win32 long paths are enabled.

Uh, really weird, could you tried, just in case, to delete C:\sr\snapshots\7dcfb02b directory to make stack regenerate it?

I tried to remove all of stack, removing all C:\sr entirely, and reinstall it. Nothing changed

Hi again, i am afraid i am not able to reproduce in my windows 10 or in azure ci
To help debug the issue we can force a fresh build of unix-time-0.4.7:

  • Renaming C:\sr\snapshots to make stack use a new one (but to let us recover it after the test)
  • Executing stack build unix-time-0.4.7 --stack-yaml .\stack-8.6.5.yaml -v inside the hie project root dir
  • Executing stack build hoogle --stack-yaml .\stack-8.6.5.yaml -vto check if the error is reproduced if the first build finished succesfully

From the unix-time build log we can see in the configure step:

2020-04-25 15:28:22.781802: [info] unix-time > checking for timegm... no
2020-04-25 15:28:23.760802: [info] unix-time > checking for _mkgmtime... yes

So the package should not use a preexisting timegm (it seems it does nos exist in win envs).

Ok, I tried to build unix-time like you suggested, and it worked, so I tried to rebuild hie and it worked.
I don't really know why this worked, but I suppose it could be considered closed.