[GHC] #16271: Building stage1:lib:text target is not robust

#16271: Building stage1:lib:text target is not robust -------------------------------------+------------------------------------- Reporter: mpickering | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Build System | Version: 8.6.3 (Hadrian) | Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- It seems the dependency on `cabal_macros.h` is not properly specified in the logic to build the libraries. If I start a build, build a library and then remove the library dir, the target fails to build. {{{ ./hadrian/build.sh stage1:lib:text rm -r _build/stage1/ ./hadrian/build.sh stage1:lib:text }}} {{{ cc1: fatal error: integersimple/stage1/libraries/text/build/autogen/cabal_macros.h: No such file or directory compilation terminated. `cc' failed in phase `C pre-processor'. (Exit code: 1) shakeArgsWith 0.000s 0% Function shake 0.006s 0% Database read 0.831s 23% ======== With database 0.100s 2% Running rules 2.545s 73% ========================= Total 3.482s 100% Error when running Shake build system: at src/Main.hs:58:30-42: * Depends on: stage1:lib:text at src/Rules/SimpleTargets.hs:31:5-15: * Depends on: integersimple/stage1/lib/package.conf.d/text-1.2.3.1.conf * Depends on: integersimple/stage1/libraries/text/build/libHStext-1.2.3.1.a * Depends on: integersimple/stage1/libraries/text/build/Data/Text/Show.o * Depends on: OracleQ (KeyValues ("integersimple/stage1/libraries/text/.dependencies","integersimple/stage1/libraries/text/build/Data/Text/Show.o")) * Depends on: integersimple/stage1/libraries/text/.dependencies * Depends on: integersimple/stage1/libraries/text/.dependencies.mk * Raised the exception: user error (Development.Shake.cmd, system command failed Command: integersimple/stage0/bin/ghc -M -hisuf hi -osuf o -hcsuf hc -static -hide-all-packages -no-user-package-db '-package-db integersimple/stage1/lib/package.conf.d' '-this-unit-id text-1.2.3.1' '-package-id array-0.5.2.0' '-package-id base-4.12.0.0' '-package-id binary-0.8.6.0' '-package-id bytestring-0.10.9.0' '-package-id deepseq-1.4.4.0' '-package-id ghc-prim-0.5.3' '-package-id integer- simple-0.1.1.1' -i -iintegersimple/stage1/libraries/text/build -iintegersimple/stage1/libraries/text/build/autogen -ilibraries/text/. -Iincludes -Iintegersimple/generated -Iintegersimple/stage1/libraries/text/build -I/nix/store /f97ls1qx6vxf75304874843ysdcyimnn-ghc-build-environment/include -Iintegersimple/stage1/libraries/text/build/include -Ilibraries/text/include -I/root/ghc/integersimple/stage1/lib/x86_64 -linux-ghc-8.7.20190124/bytestring-0.10.9.0/include -I/root/ghc/integersimple/stage1/lib/x86_64-linux- ghc-8.7.20190124/base-4.12.0.0/include -I/root/ghc/integersimple/stage1/lib/x86_64-linux- ghc-8.7.20190124/rts-1.0/include -Iintegersimple/generated -optc- Iintegersimple/generated -optP-include -optPintegersimple/stage1/libraries/text/build/autogen/cabal_macros.h -optP-DINTEGER_SIMPLE -outputdir integersimple/stage1/libraries/text/build -include-pkg-deps -dep-makefile integersimple/stage1/libraries/text/.dependencies.mk -dep-suffix '' -dep- suffix dyn_ libraries/text/Data/Text.hs libraries/text/Data/Text/Array.hs libraries/text/Data/Text/Encoding.hs libraries/text/Data/Text/Encoding/Error.hs libraries/text/Data/Text/Foreign.hs libraries/text/Data/Text/IO.hs libraries/text/Data/Text/Internal.hs libraries/text/Data/Text/Internal/Builder.hs libraries/text/Data/Text/Internal/Builder/Functions.hs libraries/text/Data/Text/Internal/Builder/Int/Digits.hs libraries/text/Data/Text/Internal/Builder/RealFloat/Functions.hs libraries/text/Data/Text/Internal/Encoding/Fusion.hs libraries/text/Data/Text/Internal/Encoding/Fusion/Common.hs libraries/text/Data/Text/Internal/Encoding/Utf16.hs libraries/text/Data/Text/Internal/Encoding/Utf32.hs libraries/text/Data/Text/Internal/Encoding/Utf8.hs libraries/text/Data/Text/Internal/Functions.hs libraries/text/Data/Text/Internal/Fusion.hs libraries/text/Data/Text/Internal/Fusion/CaseMapping.hs libraries/text/Data/Text/Internal/Fusion/Common.hs libraries/text/Data/Text/Internal/Fusion/Size.hs libraries/text/Data/Text/Internal/Fusion/Types.hs libraries/text/Data/Text/Internal/IO.hs libraries/text/Data/Text/Internal/Lazy.hs libraries/text/Data/Text/Internal/Lazy/Encoding/Fusion.hs libraries/text/Data/Text/Internal/Lazy/Fusion.hs libraries/text/Data/Text/Internal/Lazy/Search.hs libraries/text/Data/Text/Internal/Private.hs libraries/text/Data/Text/Internal/Read.hs libraries/text/Data/Text/Internal/Search.hs libraries/text/Data/Text/Internal/Unsafe.hs libraries/text/Data/Text/Internal/Unsafe/Char.hs libraries/text/Data/Text/Internal/Unsafe/Shift.hs libraries/text/Data/Text/Lazy.hs libraries/text/Data/Text/Lazy/Builder.hs libraries/text/Data/Text/Lazy/Builder/Int.hs libraries/text/Data/Text/Lazy/Builder/RealFloat.hs libraries/text/Data/Text/Lazy/Encoding.hs libraries/text/Data/Text/Lazy/IO.hs libraries/text/Data/Text/Lazy/Internal.hs libraries/text/Data/Text/Lazy/Read.hs libraries/text/Data/Text/Read.hs libraries/text/Data/Text/Show.hs libraries/text/Data/Text/Unsafe.hs -O0 -H64m -Wall -fwarn-tabs -funbox-strict-fields -O2 -XHaskell98 -ghcversion- file=/root/ghc/integersimple/generated/ghcversion.h -O -Wno-deprecated- flags -Wno-unused-imports -Werror Exit code: 1 Stderr: cc1: fatal error: integersimple/stage1/libraries/text/build/autogen/cabal_macros.h: No such file or directory compilation terminated. `cc' failed in phase `C pre-processor'. (Exit code: 1) ) }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/16271 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#16271: Building stage1:lib:text target is not robust -------------------------------------+------------------------------------- Reporter: mpickering | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Build System | Version: 8.6.3 (Hadrian) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by mpickering): It works starting from scratch thankfully. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/16271#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#16271: Building stage1:lib:text target is not robust -------------------------------------+------------------------------------- Reporter: mpickering | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Build System | Version: 8.6.3 (Hadrian) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by snowleopard): * cc: snowleopard (added) Comment: I am currently looking into this in the context of enabling cached Hadrian builds using Shake's caching feature. For caching to work, we need to accurately record all dependencies or at least to report all files produced withing each rule by using `produces` function: http://hackage.haskell.org/package/shake/docs/Development- Shake.html#v:produces I'll report back when I have a working cached build, which should bring us closer to fixing this issue too. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/16271#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#16271: Building stage1:lib:text target is not robust -------------------------------------+------------------------------------- Reporter: mpickering | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Build System | Version: 8.6.3 (Hadrian) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by mpickering): Thanks Andrey, could you perhaps make a ticket to track this? #16272 is related. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/16271#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#16271: Building stage1:lib:text target is not robust -------------------------------------+------------------------------------- Reporter: mpickering | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Build System | Version: 8.6.3 (Hadrian) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by snowleopard): Sure, done: https://ghc.haskell.org/trac/ghc/ticket/16295. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/16271#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#16271: Building stage1:lib:text target is not robust -------------------------------------+------------------------------------- Reporter: mpickering | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Build System | Version: 8.6.3 (Hadrian) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by NeilMitchell): * cc: NeilMitchell (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/16271#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#16271: Building stage1:lib:text target is not robust -------------------------------------+------------------------------------- Reporter: mpickering | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: Component: Build System | Version: 8.6.3 (Hadrian) | Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by snowleopard): * status: new => closed * resolution: => fixed Comment: Fixed by this commit: https://gitlab.haskell.org/ghc/ghc/commit/1dad4fc27ea128a11ba0077f459494c2a1... @mpickering: Please reopen if closed incorrectly. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/16271#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#16271: Building stage1:lib:text target is not robust
-------------------------------------+-------------------------------------
Reporter: mpickering | Owner: (none)
Type: bug | Status: closed
Priority: normal | Milestone:
Component: Build System | Version: 8.6.3
(Hadrian) |
Resolution: fixed | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Marge Bot
participants (1)
-
GHC