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

Add Install Rules #312

Merged
merged 1 commit into from Jun 25, 2017

Conversation

Projects
None yet
2 participants
@izgzhen
Collaborator

izgzhen commented May 14, 2017

See #219

@izgzhen

This comment has been minimized.

Show comment
Hide comment
@izgzhen

izgzhen May 14, 2017

Collaborator

Work in progress, with a basic skeleton

Collaborator

izgzhen commented May 14, 2017

Work in progress, with a basic skeleton

@snowleopard

This comment has been minimized.

Show comment
Hide comment
@snowleopard

snowleopard May 15, 2017

Owner

@izgzhen Great start! Let me know if you need any help with this.

Owner

snowleopard commented May 15, 2017

@izgzhen Great start! Let me know if you need any help with this.

@izgzhen

This comment has been minimized.

Show comment
Hide comment
@izgzhen

izgzhen May 15, 2017

Collaborator

I got a pretty long list of potential binaries to be installed:

inplace/bin/Cabal
inplace/lib/bin/Cabal
inplace/bin/Win32
inplace/lib/bin/Win32
inplace/bin/array
inplace/lib/bin/array
inplace/bin/base
.....
inplace/lib/bin/xhtml
inplace/bin/ghc-stage2
inplace/lib/bin/ghc-stage2
inplace/bin/ghc-stage3
inplace/lib/bin/ghc-stage3
inplace/bin/ghc-stage4
inplace/lib/bin/ghc-stage4

Here is how I get this (by mimicking Rules/Program.hs:

  let programContexts = liftM2 programContext [minBound..] knownPackages
  forM_ programContexts $ \context@Context{..} -> do
    when (stage == Stage0 || package == ghc) $ do
        putNormal (programInplacePath -/- programName context <.> exe)
        putNormal (programInplaceLibPath -/- programName context <.> exe)

However, we don't really build (or will install) all of them in practice. I wonder if I missed something?

Collaborator

izgzhen commented May 15, 2017

I got a pretty long list of potential binaries to be installed:

inplace/bin/Cabal
inplace/lib/bin/Cabal
inplace/bin/Win32
inplace/lib/bin/Win32
inplace/bin/array
inplace/lib/bin/array
inplace/bin/base
.....
inplace/lib/bin/xhtml
inplace/bin/ghc-stage2
inplace/lib/bin/ghc-stage2
inplace/bin/ghc-stage3
inplace/lib/bin/ghc-stage3
inplace/bin/ghc-stage4
inplace/lib/bin/ghc-stage4

Here is how I get this (by mimicking Rules/Program.hs:

  let programContexts = liftM2 programContext [minBound..] knownPackages
  forM_ programContexts $ \context@Context{..} -> do
    when (stage == Stage0 || package == ghc) $ do
        putNormal (programInplacePath -/- programName context <.> exe)
        putNormal (programInplaceLibPath -/- programName context <.> exe)

However, we don't really build (or will install) all of them in practice. I wonder if I missed something?

@izgzhen

This comment has been minimized.

Show comment
Hide comment
@izgzhen

izgzhen May 15, 2017

Collaborator

Maybe this activePackages <- interpretInContext context getPackages will shrink the list?

Collaborator

izgzhen commented May 15, 2017

Maybe this activePackages <- interpretInContext context getPackages will shrink the list?

@izgzhen

This comment has been minimized.

Show comment
Hide comment
@izgzhen

izgzhen May 15, 2017

Collaborator

Oh, I think I am probably right ...

Collaborator

izgzhen commented May 15, 2017

Oh, I think I am probably right ...

@snowleopard

This comment has been minimized.

Show comment
Hide comment
@snowleopard

snowleopard May 15, 2017

Owner

Indeed, activePackages <- interpretInContext context getPackages is the right way to go.

Owner

snowleopard commented May 15, 2017

Indeed, activePackages <- interpretInContext context getPackages is the right way to go.

@izgzhen

This comment has been minimized.

Show comment
Hide comment
@izgzhen

izgzhen May 15, 2017

Collaborator

I met some trouble when I simply need the inplace/bin/ghc-cabal before installing it:

# ginstall (for install)
# ginstall (for install)
# ginstall (for install)
# ginstall (for install)
# ginstall (for install)
# ginstall (for install)
/--------------------------------------------------------------------\
| Run Make "_build/stage1/libffi" (stage = Stage1, package = libffi) |
|      input: none                                                   |
|  => output: none                                                   |
\--------------------------------------------------------------------/
MAKE x86_64-apple-darwin16.5.0 :        0 * install
Making install in include
make[3]: Nothing to be done for `install-exec-am'.
 /usr/local/bin/gmkdir -p '/Users/zz/Desktop/Playground/dest/Users/zz/Repos/ghc2/_build/stage1/libffi/inst/lib/libffi-3.2.1/include'
 /usr/local/bin/ginstall -c -m 644 ffi.h ffitarget.h '/Users/zz/Desktop/Playground/dest/Users/zz/Repos/ghc2/_build/stage1/libffi/inst/lib/libffi-3.2.1/include'
Making install in testsuite
make[3]: Nothing to be done for `install-exec-am'.
make[3]: Nothing to be done for `install-data-am'.
Making install in man
make[3]: Nothing to be done for `install-exec-am'.
 /usr/local/bin/gmkdir -p '/Users/zz/Desktop/Playground/dest/Users/zz/Repos/ghc2/_build/stage1/libffi/inst/share/man/man3'
 /usr/local/bin/ginstall -c -m 644 ../../man/ffi.3 ../../man/ffi_call.3 ../../man/ffi_prep_cif.3 ../../man/ffi_prep_cif_var.3 '/Users/zz/Desktop/Playground/dest/Users/zz/Repos/ghc2/_build/stage1/libffi/inst/share/man/man3'
 /usr/local/bin/gmkdir -p '/Users/zz/Desktop/Playground/dest/Users/zz/Repos/ghc2/_build/stage1/libffi/inst/lib/pkgconfig'
 /usr/local/bin/gmkdir -p '/Users/zz/Desktop/Playground/dest/Users/zz/Repos/ghc2/_build/stage1/libffi/inst/lib'
 /bin/bash ./libtool   --mode=install /usr/local/bin/ginstall -c   libffi.la '/Users/zz/Desktop/Playground/dest/Users/zz/Repos/ghc2/_build/stage1/libffi/inst/lib'
 /usr/local/bin/gmkdir -p '/Users/zz/Desktop/Playground/dest/Users/zz/Repos/ghc2/_build/stage1/libffi/inst/share/info'
 /usr/local/bin/ginstall -c -m 644 libffi.pc '/Users/zz/Desktop/Playground/dest/Users/zz/Repos/ghc2/_build/stage1/libffi/inst/lib/pkgconfig'
libtool: install: /usr/local/bin/ginstall -c .libs/libffi.lai /Users/zz/Desktop/Playground/dest/Users/zz/Repos/ghc2/_build/stage1/libffi/inst/lib/libffi.la
 /usr/local/bin/ginstall -c -m 644 ../doc/libffi.info '/Users/zz/Desktop/Playground/dest/Users/zz/Repos/ghc2/_build/stage1/libffi/inst/share/info'
libtool: install: /usr/local/bin/ginstall -c .libs/libffi.a /Users/zz/Desktop/Playground/dest/Users/zz/Repos/ghc2/_build/stage1/libffi/inst/lib/libffi.a
libtool: install: chmod 644 /Users/zz/Desktop/Playground/dest/Users/zz/Repos/ghc2/_build/stage1/libffi/inst/lib/libffi.a
libtool: install: /usr/bin/ranlib /Users/zz/Desktop/Playground/dest/Users/zz/Repos/ghc2/_build/stage1/libffi/inst/lib/libffi.a
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: /Users/zz/Desktop/Playground/dest/Users/zz/Repos/ghc2/_build/stage1/libffi/inst/lib/libffi.a(ffi.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: /Users/zz/Desktop/Playground/dest/Users/zz/Repos/ghc2/_build/stage1/libffi/inst/lib/libffi.a(darwin.o) has no symbols
libtool: install: warning: remember to run `libtool --finish /Users/zz/Repos/ghc2/_build/stage1/libffi/inst/lib'
 install-info --info-dir='/Users/zz/Desktop/Playground/dest/Users/zz/Repos/ghc2/_build/stage1/libffi/inst/share/info' '/Users/zz/Desktop/Playground/dest/Users/zz/Repos/ghc2/_build/stage1/libffi/inst/share/info/libffi.info'
shakeArgsWith         0.007s    0%                           
Function shake        0.410s   13%  =====                    
Database read         0.447s   14%  =====                    
Database compression  0.079s    2%                           
With database         0.015s    0%                           
Running rules         2.047s   68%  =========================
Total                 3.005s   99%                           
Error when running Shake build system:
* install
* inplace/bin/ghc-cabal
* OracleQ (PackageDataKey ("_build/stage1/libraries/Cabal/Cabal/package-data.mk","COMPONENT_ID"))
* _build/stage1/libraries/Cabal/Cabal/package-data.mk
* OracleQ (PackageDataKey ("_build/stage1/libraries/array/package-data.mk","COMPONENT_ID"))
* _build/stage1/libraries/array/package-data.mk
* OracleQ (PackageDataKey ("_build/stage1/libraries/base/package-data.mk","COMPONENT_ID"))
* _build/stage1/libraries/base/package-data.mk
* OracleQ (PackageDataKey ("_build/stage1/libraries/ghc-prim/package-data.mk","COMPONENT_ID"))
* _build/stage1/libraries/ghc-prim/package-data.mk
* OracleQ (PackageDataKey ("_build/stage1/rts/package-data.mk","COMPONENT_ID"))
* _build/stage1/rts/package-data.mk
* _build/stage1/rts/ffitarget.h
* _build/stage1/rts/ffi.h _build/stage1/rts/ffitarget.h
* _build/stage1/libffi/inst/lib/libffi.a
Error, file does not exist and no rule available:
  _build/stage1/libffi/inst/lib/libffi.a
CallStack (from HasCallStack):
  error, called at src/Development/Shake/Rules/File.hs:103:58 in shake-0.15.11-562ddf05df5bd9b1509a4b9c26ccbe7cb695d34fb08d2bd231a8e5c166313a98:Development.Shake.Rules.File

It looks like ghc-cabal would depend on libffi, plus its Makefile is invoked in a wrong way, plus no rules for it...

My current implementation:

installBins :: Action ()
installBins = do
  dir <- bindir
  dest <- destDir
  installDir (dest ++ dir)
  let programContexts = liftM2 programContext [minBound..] knownPackages
  forM_ programContexts $ \context@Context{..} -> do
    activePackages <- interpretInContext context getPackages
    when (stage == Stage0 || package == ghc) $ do
      when (not (isLibrary package) && package `elem` activePackages) $ do
        let bin = programInplacePath -/- programName context <.> exe
        need [bin]
        installProgram bin (dest ++ dir)
Collaborator

izgzhen commented May 15, 2017

I met some trouble when I simply need the inplace/bin/ghc-cabal before installing it:

# ginstall (for install)
# ginstall (for install)
# ginstall (for install)
# ginstall (for install)
# ginstall (for install)
# ginstall (for install)
/--------------------------------------------------------------------\
| Run Make "_build/stage1/libffi" (stage = Stage1, package = libffi) |
|      input: none                                                   |
|  => output: none                                                   |
\--------------------------------------------------------------------/
MAKE x86_64-apple-darwin16.5.0 :        0 * install
Making install in include
make[3]: Nothing to be done for `install-exec-am'.
 /usr/local/bin/gmkdir -p '/Users/zz/Desktop/Playground/dest/Users/zz/Repos/ghc2/_build/stage1/libffi/inst/lib/libffi-3.2.1/include'
 /usr/local/bin/ginstall -c -m 644 ffi.h ffitarget.h '/Users/zz/Desktop/Playground/dest/Users/zz/Repos/ghc2/_build/stage1/libffi/inst/lib/libffi-3.2.1/include'
Making install in testsuite
make[3]: Nothing to be done for `install-exec-am'.
make[3]: Nothing to be done for `install-data-am'.
Making install in man
make[3]: Nothing to be done for `install-exec-am'.
 /usr/local/bin/gmkdir -p '/Users/zz/Desktop/Playground/dest/Users/zz/Repos/ghc2/_build/stage1/libffi/inst/share/man/man3'
 /usr/local/bin/ginstall -c -m 644 ../../man/ffi.3 ../../man/ffi_call.3 ../../man/ffi_prep_cif.3 ../../man/ffi_prep_cif_var.3 '/Users/zz/Desktop/Playground/dest/Users/zz/Repos/ghc2/_build/stage1/libffi/inst/share/man/man3'
 /usr/local/bin/gmkdir -p '/Users/zz/Desktop/Playground/dest/Users/zz/Repos/ghc2/_build/stage1/libffi/inst/lib/pkgconfig'
 /usr/local/bin/gmkdir -p '/Users/zz/Desktop/Playground/dest/Users/zz/Repos/ghc2/_build/stage1/libffi/inst/lib'
 /bin/bash ./libtool   --mode=install /usr/local/bin/ginstall -c   libffi.la '/Users/zz/Desktop/Playground/dest/Users/zz/Repos/ghc2/_build/stage1/libffi/inst/lib'
 /usr/local/bin/gmkdir -p '/Users/zz/Desktop/Playground/dest/Users/zz/Repos/ghc2/_build/stage1/libffi/inst/share/info'
 /usr/local/bin/ginstall -c -m 644 libffi.pc '/Users/zz/Desktop/Playground/dest/Users/zz/Repos/ghc2/_build/stage1/libffi/inst/lib/pkgconfig'
libtool: install: /usr/local/bin/ginstall -c .libs/libffi.lai /Users/zz/Desktop/Playground/dest/Users/zz/Repos/ghc2/_build/stage1/libffi/inst/lib/libffi.la
 /usr/local/bin/ginstall -c -m 644 ../doc/libffi.info '/Users/zz/Desktop/Playground/dest/Users/zz/Repos/ghc2/_build/stage1/libffi/inst/share/info'
libtool: install: /usr/local/bin/ginstall -c .libs/libffi.a /Users/zz/Desktop/Playground/dest/Users/zz/Repos/ghc2/_build/stage1/libffi/inst/lib/libffi.a
libtool: install: chmod 644 /Users/zz/Desktop/Playground/dest/Users/zz/Repos/ghc2/_build/stage1/libffi/inst/lib/libffi.a
libtool: install: /usr/bin/ranlib /Users/zz/Desktop/Playground/dest/Users/zz/Repos/ghc2/_build/stage1/libffi/inst/lib/libffi.a
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: /Users/zz/Desktop/Playground/dest/Users/zz/Repos/ghc2/_build/stage1/libffi/inst/lib/libffi.a(ffi.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: /Users/zz/Desktop/Playground/dest/Users/zz/Repos/ghc2/_build/stage1/libffi/inst/lib/libffi.a(darwin.o) has no symbols
libtool: install: warning: remember to run `libtool --finish /Users/zz/Repos/ghc2/_build/stage1/libffi/inst/lib'
 install-info --info-dir='/Users/zz/Desktop/Playground/dest/Users/zz/Repos/ghc2/_build/stage1/libffi/inst/share/info' '/Users/zz/Desktop/Playground/dest/Users/zz/Repos/ghc2/_build/stage1/libffi/inst/share/info/libffi.info'
shakeArgsWith         0.007s    0%                           
Function shake        0.410s   13%  =====                    
Database read         0.447s   14%  =====                    
Database compression  0.079s    2%                           
With database         0.015s    0%                           
Running rules         2.047s   68%  =========================
Total                 3.005s   99%                           
Error when running Shake build system:
* install
* inplace/bin/ghc-cabal
* OracleQ (PackageDataKey ("_build/stage1/libraries/Cabal/Cabal/package-data.mk","COMPONENT_ID"))
* _build/stage1/libraries/Cabal/Cabal/package-data.mk
* OracleQ (PackageDataKey ("_build/stage1/libraries/array/package-data.mk","COMPONENT_ID"))
* _build/stage1/libraries/array/package-data.mk
* OracleQ (PackageDataKey ("_build/stage1/libraries/base/package-data.mk","COMPONENT_ID"))
* _build/stage1/libraries/base/package-data.mk
* OracleQ (PackageDataKey ("_build/stage1/libraries/ghc-prim/package-data.mk","COMPONENT_ID"))
* _build/stage1/libraries/ghc-prim/package-data.mk
* OracleQ (PackageDataKey ("_build/stage1/rts/package-data.mk","COMPONENT_ID"))
* _build/stage1/rts/package-data.mk
* _build/stage1/rts/ffitarget.h
* _build/stage1/rts/ffi.h _build/stage1/rts/ffitarget.h
* _build/stage1/libffi/inst/lib/libffi.a
Error, file does not exist and no rule available:
  _build/stage1/libffi/inst/lib/libffi.a
CallStack (from HasCallStack):
  error, called at src/Development/Shake/Rules/File.hs:103:58 in shake-0.15.11-562ddf05df5bd9b1509a4b9c26ccbe7cb695d34fb08d2bd231a8e5c166313a98:Development.Shake.Rules.File

It looks like ghc-cabal would depend on libffi, plus its Makefile is invoked in a wrong way, plus no rules for it...

My current implementation:

installBins :: Action ()
installBins = do
  dir <- bindir
  dest <- destDir
  installDir (dest ++ dir)
  let programContexts = liftM2 programContext [minBound..] knownPackages
  forM_ programContexts $ \context@Context{..} -> do
    activePackages <- interpretInContext context getPackages
    when (stage == Stage0 || package == ghc) $ do
      when (not (isLibrary package) && package `elem` activePackages) $ do
        let bin = programInplacePath -/- programName context <.> exe
        need [bin]
        installProgram bin (dest ++ dir)
@snowleopard

This comment has been minimized.

Show comment
Hide comment
@snowleopard

snowleopard May 15, 2017

Owner

I believe the issue is in the Rules/Libffi.hs. The library filename is defined here:

https://github.com/snowleopard/hadrian/blob/master/src/Rules/Libffi.hs#L12

But as I can see it is not registered as a build result in the rules.

Could you try to modify this line:

https://github.com/snowleopard/hadrian/blob/master/src/Rules/Libffi.hs#L42

as follows?

    (libffiLibrary : libffiDependencies) &%> \_ -> do
Owner

snowleopard commented May 15, 2017

I believe the issue is in the Rules/Libffi.hs. The library filename is defined here:

https://github.com/snowleopard/hadrian/blob/master/src/Rules/Libffi.hs#L12

But as I can see it is not registered as a build result in the rules.

Could you try to modify this line:

https://github.com/snowleopard/hadrian/blob/master/src/Rules/Libffi.hs#L42

as follows?

    (libffiLibrary : libffiDependencies) &%> \_ -> do
@izgzhen

This comment has been minimized.

Show comment
Hide comment
@izgzhen

izgzhen May 15, 2017

Collaborator

After modification, it complains:

MAKE x86_64-apple-darwin16.5.0 :        0 * install
Making install in include
make[3]: Nothing to be done for `install-exec-am'.
 /usr/local/bin/gmkdir -p '/Users/zz/Desktop/Playground/dest/Users/zz/Repos/ghc2/_build/stage1/libffi/inst/lib/libffi-3.2.1/include'
 /usr/local/bin/ginstall -c -m 644 ffi.h ffitarget.h '/Users/zz/Desktop/Playground/dest/Users/zz/Repos/ghc2/_build/stage1/libffi/inst/lib/libffi-3.2.1/include'
Making install in testsuite
make[3]: Nothing to be done for `install-exec-am'.
make[3]: Nothing to be done for `install-data-am'.
Making install in man
make[3]: Nothing to be done for `install-exec-am'.
 /usr/local/bin/gmkdir -p '/Users/zz/Desktop/Playground/dest/Users/zz/Repos/ghc2/_build/stage1/libffi/inst/share/man/man3'
 /usr/local/bin/ginstall -c -m 644 ../../man/ffi.3 ../../man/ffi_call.3 ../../man/ffi_prep_cif.3 ../../man/ffi_prep_cif_var.3 '/Users/zz/Desktop/Playground/dest/Users/zz/Repos/ghc2/_build/stage1/libffi/inst/share/man/man3'
 /usr/local/bin/gmkdir -p '/Users/zz/Desktop/Playground/dest/Users/zz/Repos/ghc2/_build/stage1/libffi/inst/lib'
 /usr/local/bin/gmkdir -p '/Users/zz/Desktop/Playground/dest/Users/zz/Repos/ghc2/_build/stage1/libffi/inst/lib/pkgconfig'
 /bin/bash ./libtool   --mode=install /usr/local/bin/ginstall -c   libffi.la '/Users/zz/Desktop/Playground/dest/Users/zz/Repos/ghc2/_build/stage1/libffi/inst/lib'
 /usr/local/bin/gmkdir -p '/Users/zz/Desktop/Playground/dest/Users/zz/Repos/ghc2/_build/stage1/libffi/inst/share/info'
 /usr/local/bin/ginstall -c -m 644 libffi.pc '/Users/zz/Desktop/Playground/dest/Users/zz/Repos/ghc2/_build/stage1/libffi/inst/lib/pkgconfig'
 /usr/local/bin/ginstall -c -m 644 ../doc/libffi.info '/Users/zz/Desktop/Playground/dest/Users/zz/Repos/ghc2/_build/stage1/libffi/inst/share/info'
libtool: install: /usr/local/bin/ginstall -c .libs/libffi.lai /Users/zz/Desktop/Playground/dest/Users/zz/Repos/ghc2/_build/stage1/libffi/inst/lib/libffi.la
libtool: install: /usr/local/bin/ginstall -c .libs/libffi.a /Users/zz/Desktop/Playground/dest/Users/zz/Repos/ghc2/_build/stage1/libffi/inst/lib/libffi.a
libtool: install: chmod 644 /Users/zz/Desktop/Playground/dest/Users/zz/Repos/ghc2/_build/stage1/libffi/inst/lib/libffi.a
 install-info --info-dir='/Users/zz/Desktop/Playground/dest/Users/zz/Repos/ghc2/_build/stage1/libffi/inst/share/info' '/Users/zz/Desktop/Playground/dest/Users/zz/Repos/ghc2/_build/stage1/libffi/inst/share/info/libffi.info'
libtool: install: /usr/bin/ranlib /Users/zz/Desktop/Playground/dest/Users/zz/Repos/ghc2/_build/stage1/libffi/inst/lib/libffi.a
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: /Users/zz/Desktop/Playground/dest/Users/zz/Repos/ghc2/_build/stage1/libffi/inst/lib/libffi.a(ffi.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: /Users/zz/Desktop/Playground/dest/Users/zz/Repos/ghc2/_build/stage1/libffi/inst/lib/libffi.a(darwin.o) has no symbols
libtool: install: warning: remember to run `libtool --finish /Users/zz/Repos/ghc2/_build/stage1/libffi/inst/lib'
shakeArgsWith   0.007s    0%                           
Function shake  0.462s   13%  ====                     
Database read   0.358s   10%  ===                      
With database   0.014s    0%                           
Running rules   2.537s   75%  =========================
Total           3.378s  100%                           
Error when running Shake build system:
* install
* inplace/bin/ghc-cabal
* OracleQ (PackageDataKey ("_build/stage1/libraries/Cabal/Cabal/package-data.mk","COMPONENT_ID"))
* _build/stage1/libraries/Cabal/Cabal/package-data.mk
* OracleQ (PackageDataKey ("_build/stage1/libraries/array/package-data.mk","COMPONENT_ID"))
* _build/stage1/libraries/array/package-data.mk
* OracleQ (PackageDataKey ("_build/stage1/libraries/base/package-data.mk","COMPONENT_ID"))
* _build/stage1/libraries/base/package-data.mk
* OracleQ (PackageDataKey ("_build/stage1/libraries/ghc-prim/package-data.mk","COMPONENT_ID"))
* _build/stage1/libraries/ghc-prim/package-data.mk
* OracleQ (PackageDataKey ("_build/stage1/rts/package-data.mk","COMPONENT_ID"))
* _build/stage1/rts/package-data.mk
* _build/stage1/rts/ffitarget.h
* _build/stage1/libffi/inst/lib/libffi.a _build/stage1/rts/ffi.h _build/stage1/rts/ffitarget.h
* _build/stage1/libffi/inst/lib/libffi.a
* _build/stage1/libffi/inst/lib/libffi.a _build/stage1/rts/ffi.h _build/stage1/rts/ffitarget.h
Build system error - recursion detected:
  Key type:   FilesQ
  Key value:  _build/stage1/libffi/inst/lib/libffi.a _build/stage1/rts/ffi.h _build/stage1/rts/ffitarget.h
Rules may not be recursive
Collaborator

izgzhen commented May 15, 2017

After modification, it complains:

MAKE x86_64-apple-darwin16.5.0 :        0 * install
Making install in include
make[3]: Nothing to be done for `install-exec-am'.
 /usr/local/bin/gmkdir -p '/Users/zz/Desktop/Playground/dest/Users/zz/Repos/ghc2/_build/stage1/libffi/inst/lib/libffi-3.2.1/include'
 /usr/local/bin/ginstall -c -m 644 ffi.h ffitarget.h '/Users/zz/Desktop/Playground/dest/Users/zz/Repos/ghc2/_build/stage1/libffi/inst/lib/libffi-3.2.1/include'
Making install in testsuite
make[3]: Nothing to be done for `install-exec-am'.
make[3]: Nothing to be done for `install-data-am'.
Making install in man
make[3]: Nothing to be done for `install-exec-am'.
 /usr/local/bin/gmkdir -p '/Users/zz/Desktop/Playground/dest/Users/zz/Repos/ghc2/_build/stage1/libffi/inst/share/man/man3'
 /usr/local/bin/ginstall -c -m 644 ../../man/ffi.3 ../../man/ffi_call.3 ../../man/ffi_prep_cif.3 ../../man/ffi_prep_cif_var.3 '/Users/zz/Desktop/Playground/dest/Users/zz/Repos/ghc2/_build/stage1/libffi/inst/share/man/man3'
 /usr/local/bin/gmkdir -p '/Users/zz/Desktop/Playground/dest/Users/zz/Repos/ghc2/_build/stage1/libffi/inst/lib'
 /usr/local/bin/gmkdir -p '/Users/zz/Desktop/Playground/dest/Users/zz/Repos/ghc2/_build/stage1/libffi/inst/lib/pkgconfig'
 /bin/bash ./libtool   --mode=install /usr/local/bin/ginstall -c   libffi.la '/Users/zz/Desktop/Playground/dest/Users/zz/Repos/ghc2/_build/stage1/libffi/inst/lib'
 /usr/local/bin/gmkdir -p '/Users/zz/Desktop/Playground/dest/Users/zz/Repos/ghc2/_build/stage1/libffi/inst/share/info'
 /usr/local/bin/ginstall -c -m 644 libffi.pc '/Users/zz/Desktop/Playground/dest/Users/zz/Repos/ghc2/_build/stage1/libffi/inst/lib/pkgconfig'
 /usr/local/bin/ginstall -c -m 644 ../doc/libffi.info '/Users/zz/Desktop/Playground/dest/Users/zz/Repos/ghc2/_build/stage1/libffi/inst/share/info'
libtool: install: /usr/local/bin/ginstall -c .libs/libffi.lai /Users/zz/Desktop/Playground/dest/Users/zz/Repos/ghc2/_build/stage1/libffi/inst/lib/libffi.la
libtool: install: /usr/local/bin/ginstall -c .libs/libffi.a /Users/zz/Desktop/Playground/dest/Users/zz/Repos/ghc2/_build/stage1/libffi/inst/lib/libffi.a
libtool: install: chmod 644 /Users/zz/Desktop/Playground/dest/Users/zz/Repos/ghc2/_build/stage1/libffi/inst/lib/libffi.a
 install-info --info-dir='/Users/zz/Desktop/Playground/dest/Users/zz/Repos/ghc2/_build/stage1/libffi/inst/share/info' '/Users/zz/Desktop/Playground/dest/Users/zz/Repos/ghc2/_build/stage1/libffi/inst/share/info/libffi.info'
libtool: install: /usr/bin/ranlib /Users/zz/Desktop/Playground/dest/Users/zz/Repos/ghc2/_build/stage1/libffi/inst/lib/libffi.a
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: /Users/zz/Desktop/Playground/dest/Users/zz/Repos/ghc2/_build/stage1/libffi/inst/lib/libffi.a(ffi.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: /Users/zz/Desktop/Playground/dest/Users/zz/Repos/ghc2/_build/stage1/libffi/inst/lib/libffi.a(darwin.o) has no symbols
libtool: install: warning: remember to run `libtool --finish /Users/zz/Repos/ghc2/_build/stage1/libffi/inst/lib'
shakeArgsWith   0.007s    0%                           
Function shake  0.462s   13%  ====                     
Database read   0.358s   10%  ===                      
With database   0.014s    0%                           
Running rules   2.537s   75%  =========================
Total           3.378s  100%                           
Error when running Shake build system:
* install
* inplace/bin/ghc-cabal
* OracleQ (PackageDataKey ("_build/stage1/libraries/Cabal/Cabal/package-data.mk","COMPONENT_ID"))
* _build/stage1/libraries/Cabal/Cabal/package-data.mk
* OracleQ (PackageDataKey ("_build/stage1/libraries/array/package-data.mk","COMPONENT_ID"))
* _build/stage1/libraries/array/package-data.mk
* OracleQ (PackageDataKey ("_build/stage1/libraries/base/package-data.mk","COMPONENT_ID"))
* _build/stage1/libraries/base/package-data.mk
* OracleQ (PackageDataKey ("_build/stage1/libraries/ghc-prim/package-data.mk","COMPONENT_ID"))
* _build/stage1/libraries/ghc-prim/package-data.mk
* OracleQ (PackageDataKey ("_build/stage1/rts/package-data.mk","COMPONENT_ID"))
* _build/stage1/rts/package-data.mk
* _build/stage1/rts/ffitarget.h
* _build/stage1/libffi/inst/lib/libffi.a _build/stage1/rts/ffi.h _build/stage1/rts/ffitarget.h
* _build/stage1/libffi/inst/lib/libffi.a
* _build/stage1/libffi/inst/lib/libffi.a _build/stage1/rts/ffi.h _build/stage1/rts/ffitarget.h
Build system error - recursion detected:
  Key type:   FilesQ
  Key value:  _build/stage1/libffi/inst/lib/libffi.a _build/stage1/rts/ffi.h _build/stage1/rts/ffitarget.h
Rules may not be recursive
@snowleopard

This comment has been minimized.

Show comment
Hide comment
@snowleopard

snowleopard May 15, 2017

Owner

Hmm, not entirely sure what's going on, but another possible fix is to add this rule:

    libffiLibrary %> \_ -> need libffiDependencies

This can't possibly introduce new cycles.

Owner

snowleopard commented May 15, 2017

Hmm, not entirely sure what's going on, but another possible fix is to add this rule:

    libffiLibrary %> \_ -> need libffiDependencies

This can't possibly introduce new cycles.

@izgzhen

This comment has been minimized.

Show comment
Hide comment
@izgzhen

izgzhen May 15, 2017

Collaborator

Well, it does

* OracleQ (PackageDataKey ("_build/stage1/rts/package-data.mk","COMPONENT_ID"))
* _build/stage1/rts/package-data.mk
* _build/stage1/rts/ffitarget.h
* _build/stage1/rts/ffi.h _build/stage1/rts/ffitarget.h
* _build/stage1/libffi/inst/lib/libffi.a
* _build/stage1/rts/ffitarget.h
Build system error - recursion detected:
  Key type:   FileQ
  Key value:  _build/stage1/rts/ffitarget.h
Rules may not be recursive

there is a line which might be blamed: https://github.com/snowleopard/hadrian/blob/master/src/Rules/Libffi.hs#L60

Collaborator

izgzhen commented May 15, 2017

Well, it does

* OracleQ (PackageDataKey ("_build/stage1/rts/package-data.mk","COMPONENT_ID"))
* _build/stage1/rts/package-data.mk
* _build/stage1/rts/ffitarget.h
* _build/stage1/rts/ffi.h _build/stage1/rts/ffitarget.h
* _build/stage1/libffi/inst/lib/libffi.a
* _build/stage1/rts/ffitarget.h
Build system error - recursion detected:
  Key type:   FileQ
  Key value:  _build/stage1/rts/ffitarget.h
Rules may not be recursive

there is a line which might be blamed: https://github.com/snowleopard/hadrian/blob/master/src/Rules/Libffi.hs#L60

@snowleopard

This comment has been minimized.

Show comment
Hide comment
@snowleopard

snowleopard May 15, 2017

Owner

Ah, indeed! We need a non-tracking copyFile here. The implementation we have tracks the source, which leads to a circular need on libffiLibrary:

https://github.com/snowleopard/hadrian/blob/master/src/Util.hs#L92

Perhaps, we should add a non-tracking equivalent, e.g. copyFileUntracked? Then I believe we should be able to use the first solution with (libffiLibrary : libffiDependencies) &%> \_ -> do.

Owner

snowleopard commented May 15, 2017

Ah, indeed! We need a non-tracking copyFile here. The implementation we have tracks the source, which leads to a circular need on libffiLibrary:

https://github.com/snowleopard/hadrian/blob/master/src/Util.hs#L92

Perhaps, we should add a non-tracking equivalent, e.g. copyFileUntracked? Then I believe we should be able to use the first solution with (libffiLibrary : libffiDependencies) &%> \_ -> do.

@izgzhen

This comment has been minimized.

Show comment
Hide comment
@izgzhen

izgzhen May 15, 2017

Collaborator

I added an untracking one, but now its complain is even more strange:

Error when running Shake build system:
* libffi/inst/lib/libffi.a
Error, file does not exist and no rule available:
  libffi/inst/lib/libffi.a
CallStack (from HasCallStack):
  error, called at src/Development/Shake/Rules/File.hs:103:58 in shake-0.15.11-562ddf05df5bd9b1509a4b9c26ccbe7cb695d34fb08d2bd231a8e5c166313a98:Development.Shake.Rules.File

this required file is definitely not libffiLibrary, which has a build path prefix.

the copyFileUntracked:

-- Same as copyFile, but not tracking the source as a build dependency
copyFileUntracked :: FilePath -> FilePath -> Action ()
copyFileUntracked source target = do
    let dir = takeDirectory target
    unlessM (liftIO $ IO.doesDirectoryExist dir) $ createDirectory dir
    putProgressInfo $ renderAction "Copy file" source target
    liftIO $ IO.copyFile source target
Collaborator

izgzhen commented May 15, 2017

I added an untracking one, but now its complain is even more strange:

Error when running Shake build system:
* libffi/inst/lib/libffi.a
Error, file does not exist and no rule available:
  libffi/inst/lib/libffi.a
CallStack (from HasCallStack):
  error, called at src/Development/Shake/Rules/File.hs:103:58 in shake-0.15.11-562ddf05df5bd9b1509a4b9c26ccbe7cb695d34fb08d2bd231a8e5c166313a98:Development.Shake.Rules.File

this required file is definitely not libffiLibrary, which has a build path prefix.

the copyFileUntracked:

-- Same as copyFile, but not tracking the source as a build dependency
copyFileUntracked :: FilePath -> FilePath -> Action ()
copyFileUntracked source target = do
    let dir = takeDirectory target
    unlessM (liftIO $ IO.doesDirectoryExist dir) $ createDirectory dir
    putProgressInfo $ renderAction "Copy file" source target
    liftIO $ IO.copyFile source target
@izgzhen

This comment has been minimized.

Show comment
Hide comment
@izgzhen

izgzhen May 15, 2017

Collaborator

I guess it has something to do the wrong working path for make. I will investigate a bit

Collaborator

izgzhen commented May 15, 2017

I guess it has something to do the wrong working path for make. I will investigate a bit

@izgzhen

This comment has been minimized.

Show comment
Hide comment
@izgzhen

izgzhen May 15, 2017

Collaborator

Yes .... I polluted the libffi's make environment with exported DESTDIR, so it puts stuff in the wrong place, which caused the chained effects.... for what I tried out now, I guess this is the root cause for all the hassle, sorry.

Collaborator

izgzhen commented May 15, 2017

Yes .... I polluted the libffi's make environment with exported DESTDIR, so it puts stuff in the wrong place, which caused the chained effects.... for what I tried out now, I guess this is the root cause for all the hassle, sorry.

@snowleopard

This comment has been minimized.

Show comment
Hide comment
@snowleopard

snowleopard May 15, 2017

Owner

@izgzhen Right, so is the libffi issue resolved? If yes, could you create a separate PR for copyFileUntracked and associated changes?

Owner

snowleopard commented May 15, 2017

@izgzhen Right, so is the libffi issue resolved? If yes, could you create a separate PR for copyFileUntracked and associated changes?

@izgzhen

This comment has been minimized.

Show comment
Hide comment
@izgzhen

izgzhen May 15, 2017

Collaborator

Right, so is the libffi issue resolved? If yes, could you create a separate PR for copyFileUntracked and associated changes?

Yes it is resolved, and I will create another PR.

Collaborator

izgzhen commented May 15, 2017

Right, so is the libffi issue resolved? If yes, could you create a separate PR for copyFileUntracked and associated changes?

Yes it is resolved, and I will create another PR.

@izgzhen

This comment has been minimized.

Show comment
Hide comment
@izgzhen

izgzhen May 16, 2017

Collaborator

In the latest change, the design of another kind of wrapper is mostly a HACK. In local build directories, we have inplace here and there, which is hardcoded in a lot of surprising places. I don't know if it is possible to unify them in future, but I guess I will delay the efforts for now

Collaborator

izgzhen commented May 16, 2017

In the latest change, the design of another kind of wrapper is mostly a HACK. In local build directories, we have inplace here and there, which is hardcoded in a lot of surprising places. I don't know if it is possible to unify them in future, but I guess I will delay the efforts for now

@snowleopard

This comment has been minimized.

Show comment
Hide comment
@snowleopard

snowleopard May 16, 2017

Owner

Let's unify wrappers right now -- it doesn't seem too difficult. We can switch to your version with two FilePath parameters and simply provide the right path during the local build. If you prefer to keep this change outside of this PR, feel free to send a separate PR fixing wrappers.

Owner

snowleopard commented May 16, 2017

Let's unify wrappers right now -- it doesn't seem too difficult. We can switch to your version with two FilePath parameters and simply provide the right path during the local build. If you prefer to keep this change outside of this PR, feel free to send a separate PR fixing wrappers.

@izgzhen

This comment has been minimized.

Show comment
Hide comment
@izgzhen

izgzhen May 16, 2017

Collaborator

I prefer unifying the wrappers in another PR. I tried this twice but failed twice, due to some unexpected problems beyond the scope of this PR.

Collaborator

izgzhen commented May 16, 2017

I prefer unifying the wrappers in another PR. I tried this twice but failed twice, due to some unexpected problems beyond the scope of this PR.

@izgzhen

This comment has been minimized.

Show comment
Hide comment
@izgzhen

izgzhen May 17, 2017

Collaborator

My current way of choosing things to be installed to bindir is far from being correct. The reference build will produce this:

        │   ├── ghc -> ghc-8.3.20170413
        │   ├── ghc-8.3.20170413
        │   ├── ghc-pkg -> ghc-pkg-8.3.20170413
        │   ├── ghc-pkg-8.3.20170413
        │   ├── ghci -> ghci-8.3.20170413
        │   ├── ghci-8.3.20170413
        │   ├── hp2ps
        │   ├── hpc
        │   ├── hsc2hs
        │   ├── runghc -> runghc-8.3.20170413
        │   ├── runghc-8.3.20170413
        │   └── runhaskell -> runghc

So, I think first I need to add wrappers for hp2ps, hpc and hsc2hs, and second, in installLibExecs, the packager filter should be (installStage package == Some stage) rather than (stage == Stage0 || package == ghc) from Rules/Program.hs. Then only for those who has wrappers, we will install them to bindir.

Here the core is to add a new package property installStage :: Package -> Maybe Stage.

Collaborator

izgzhen commented May 17, 2017

My current way of choosing things to be installed to bindir is far from being correct. The reference build will produce this:

        │   ├── ghc -> ghc-8.3.20170413
        │   ├── ghc-8.3.20170413
        │   ├── ghc-pkg -> ghc-pkg-8.3.20170413
        │   ├── ghc-pkg-8.3.20170413
        │   ├── ghci -> ghci-8.3.20170413
        │   ├── ghci-8.3.20170413
        │   ├── hp2ps
        │   ├── hpc
        │   ├── hsc2hs
        │   ├── runghc -> runghc-8.3.20170413
        │   ├── runghc-8.3.20170413
        │   └── runhaskell -> runghc

So, I think first I need to add wrappers for hp2ps, hpc and hsc2hs, and second, in installLibExecs, the packager filter should be (installStage package == Some stage) rather than (stage == Stage0 || package == ghc) from Rules/Program.hs. Then only for those who has wrappers, we will install them to bindir.

Here the core is to add a new package property installStage :: Package -> Maybe Stage.

@izgzhen

This comment has been minimized.

Show comment
Hide comment
@izgzhen

izgzhen May 17, 2017

Collaborator

In ghc/ghc.mk, for example, we have:

ghc_stage1_SHELL_WRAPPER = YES
ghc_stage2_SHELL_WRAPPER = YES
ghc_stage3_SHELL_WRAPPER = YES
ghc_stage1_SHELL_WRAPPER_NAME = ghc/ghc.wrapper
ghc_stage2_SHELL_WRAPPER_NAME = ghc/ghc.wrapper
ghc_stage3_SHELL_WRAPPER_NAME = ghc/ghc.wrapper
ghc_stage1_INSTALL_INPLACE = YES
ghc_stage2_INSTALL_INPLACE = YES
ghc_stage3_INSTALL_INPLACE = YES

ghc_stage$(INSTALL_GHC_STAGE)_INSTALL = YES
ghc_stage$(INSTALL_GHC_STAGE)_INSTALL_SHELL_WRAPPER_NAME = ghc-$(ProjectVersion)

which gives definitions for $1_$2_INSTALL_INPLACE, $1_$2_INSTALL, $1_$2_INSTALL_SHELL_WRAPPER_NAME etc.

Collaborator

izgzhen commented May 17, 2017

In ghc/ghc.mk, for example, we have:

ghc_stage1_SHELL_WRAPPER = YES
ghc_stage2_SHELL_WRAPPER = YES
ghc_stage3_SHELL_WRAPPER = YES
ghc_stage1_SHELL_WRAPPER_NAME = ghc/ghc.wrapper
ghc_stage2_SHELL_WRAPPER_NAME = ghc/ghc.wrapper
ghc_stage3_SHELL_WRAPPER_NAME = ghc/ghc.wrapper
ghc_stage1_INSTALL_INPLACE = YES
ghc_stage2_INSTALL_INPLACE = YES
ghc_stage3_INSTALL_INPLACE = YES

ghc_stage$(INSTALL_GHC_STAGE)_INSTALL = YES
ghc_stage$(INSTALL_GHC_STAGE)_INSTALL_SHELL_WRAPPER_NAME = ghc-$(ProjectVersion)

which gives definitions for $1_$2_INSTALL_INPLACE, $1_$2_INSTALL, $1_$2_INSTALL_SHELL_WRAPPER_NAME etc.

@izgzhen

This comment has been minimized.

Show comment
Hide comment
@izgzhen

izgzhen May 18, 2017

Collaborator

Note that:

    let installStage = do
            latest <- latestBuildStage package -- fromJust below is safe
            return $ if package == ghc then stage else fromJust latest

should better be refined as inplaceInstallStage

Collaborator

izgzhen commented May 18, 2017

Note that:

    let installStage = do
            latest <- latestBuildStage package -- fromJust below is safe
            return $ if package == ghc then stage else fromJust latest

should better be refined as inplaceInstallStage

@snowleopard

This comment has been minimized.

Show comment
Hide comment
@snowleopard

snowleopard May 18, 2017

Owner

@izgzhen Yes, I think you are on the right track. installStage should indeed be inplaceInstallStage.

Owner

snowleopard commented May 18, 2017

@izgzhen Yes, I think you are on the right track. installStage should indeed be inplaceInstallStage.

@izgzhen

This comment has been minimized.

Show comment
Hide comment
@izgzhen

izgzhen May 19, 2017

Collaborator

Finding that there is none, I am about to add a new util for creating symbolic link (when OS is not Windows).

Collaborator

izgzhen commented May 19, 2017

Finding that there is none, I am about to add a new util for creating symbolic link (when OS is not Windows).

import Oracles.Config.Setting
import Oracles.PackageData
import Oracles.Path

This comment has been minimized.

@snowleopard

snowleopard Jun 12, 2017

Owner

We need an overview comment somewhere here describing what's going on. At minimum, please describe the resulting tree structure, linking it to various path/dir settings.

@snowleopard

snowleopard Jun 12, 2017

Owner

We need an overview comment somewhere here describing what's going on. At minimum, please describe the resulting tree structure, linking it to various path/dir settings.

This comment has been minimized.

@izgzhen

izgzhen Jun 13, 2017

Collaborator

No problem

@izgzhen

izgzhen Jun 13, 2017

Collaborator

No problem

@snowleopard

This comment has been minimized.

Show comment
Hide comment
@snowleopard

snowleopard Jun 12, 2017

Owner

@izgzhen I've added some comments. Most of them are about unclear/missing comments in the code -- could you please go through the code and try to make comments more detailed? I've been lost a few times.

Owner

snowleopard commented Jun 12, 2017

@izgzhen I've added some comments. Most of them are about unclear/missing comments in the code -- could you please go through the code and try to make comments more detailed? I've been lost a few times.

@izgzhen

This comment has been minimized.

Show comment
Hide comment
@izgzhen

izgzhen Jun 13, 2017

Collaborator

Thanks a lot -- I will ping you back once I resolved the issues

Collaborator

izgzhen commented Jun 13, 2017

Thanks a lot -- I will ping you back once I resolved the issues

@izgzhen

This comment has been minimized.

Show comment
Hide comment
@izgzhen

izgzhen Jun 13, 2017

Collaborator

Fixed, waiting for the next round of review :)

Collaborator

izgzhen commented Jun 13, 2017

Fixed, waiting for the next round of review :)

@snowleopard

This comment has been minimized.

Show comment
Hide comment
@snowleopard

snowleopard Jun 16, 2017

Owner

I am concerned about references to the Make build system. It's still in development, so these references are very fragile. Could we explain things directly in Hadrian instead? It could be as simple as copying explanations from Make for now, although some explanations could benefit from adapting them to Hadrian.

Owner

snowleopard commented Jun 16, 2017

I am concerned about references to the Make build system. It's still in development, so these references are very fragile. Could we explain things directly in Hadrian instead? It could be as simple as copying explanations from Make for now, although some explanations could benefit from adapting them to Hadrian.

@izgzhen

This comment has been minimized.

Show comment
Hide comment
@izgzhen

izgzhen Jun 16, 2017

Collaborator

It's still in development, so these references are very fragile

Sure, the line number will break very soon, but I think the idea is to give an approximate range.

Could we explain things directly in Hadrian instead?

If Hadrian get into the GHC tree, then these refs will be mostly useless. But before that, it can be a great source of learning, if the contributor wants to implement a similar functionality by using make-system as a spec.

Collaborator

izgzhen commented Jun 16, 2017

It's still in development, so these references are very fragile

Sure, the line number will break very soon, but I think the idea is to give an approximate range.

Could we explain things directly in Hadrian instead?

If Hadrian get into the GHC tree, then these refs will be mostly useless. But before that, it can be a great source of learning, if the contributor wants to implement a similar functionality by using make-system as a spec.

@snowleopard

This comment has been minimized.

Show comment
Hide comment
@snowleopard

snowleopard Jun 19, 2017

Owner

but I think the idea is to give an approximate range

I'm not sure: even a +1/-1 line error can lead to a lot of confusion.

Owner

snowleopard commented Jun 19, 2017

but I think the idea is to give an approximate range

I'm not sure: even a +1/-1 line error can lead to a lot of confusion.

@izgzhen

This comment has been minimized.

Show comment
Hide comment
@izgzhen

izgzhen Jun 22, 2017

Collaborator

even a +1/-1 line error can lead to a lot of confusion.

What about just the .mk file path maybe?

Collaborator

izgzhen commented Jun 22, 2017

even a +1/-1 line error can lead to a lot of confusion.

What about just the .mk file path maybe?

@izgzhen

This comment has been minimized.

Show comment
Hide comment
@izgzhen

izgzhen Jun 22, 2017

Collaborator

Regarding another problem of installing compiler package: The root cause is this: https://github.com/ghc/ghc/blob/master/compiler/ghc.cabal.in#L81

This hardcoded include-dirs again assumes the layout of the built artifacts.

A quick hack, which I would do, is to copy ghc_boot_platform.h to the compiler. But we might need to open another issue for future fix of this.

Collaborator

izgzhen commented Jun 22, 2017

Regarding another problem of installing compiler package: The root cause is this: https://github.com/ghc/ghc/blob/master/compiler/ghc.cabal.in#L81

This hardcoded include-dirs again assumes the layout of the built artifacts.

A quick hack, which I would do, is to copy ghc_boot_platform.h to the compiler. But we might need to open another issue for future fix of this.

@snowleopard

This comment has been minimized.

Show comment
Hide comment
@snowleopard

snowleopard Jun 23, 2017

Owner

What about just the .mk file path maybe?

I think it's best to do both: 1) link to the .mk file, and 2) copy/adapt the corresponding comments.

Owner

snowleopard commented Jun 23, 2017

What about just the .mk file path maybe?

I think it's best to do both: 1) link to the .mk file, and 2) copy/adapt the corresponding comments.

@snowleopard

This comment has been minimized.

Show comment
Hide comment
@snowleopard

snowleopard Jun 23, 2017

Owner

A quick hack, which I would do, is to copy ghc_boot_platform.h to the compiler.

That should work too, but to be more consistent with how Hadrian deals with such problems elsewhere, see my response in #327.

Owner

snowleopard commented Jun 23, 2017

A quick hack, which I would do, is to copy ghc_boot_platform.h to the compiler.

That should work too, but to be more consistent with how Hadrian deals with such problems elsewhere, see my response in #327.

@izgzhen

This comment has been minimized.

Show comment
Hide comment
@izgzhen

izgzhen Jun 25, 2017

Collaborator
  1. link to the .mk file, and 2) copy/adapt the corresponding comments.

Line number is dropped. The previous comments are adequate, I think.

I tested install rule on Linux as well.

I rebased this PR on #328 (drop-hoopl), so we need to get that merged before this one.

Collaborator

izgzhen commented Jun 25, 2017

  1. link to the .mk file, and 2) copy/adapt the corresponding comments.

Line number is dropped. The previous comments are adequate, I think.

I tested install rule on Linux as well.

I rebased this PR on #328 (drop-hoopl), so we need to get that merged before this one.

@snowleopard

This comment has been minimized.

Show comment
Hide comment
@snowleopard

snowleopard Jun 25, 2017

Owner

@izgzhen Thanks, but it looks like there are still some merge comments after #328. Could you have a look?

I think we are ready to merge this -- if this doesn't work on Windows I'll let you know so we can fix in a separate PR.

Owner

snowleopard commented Jun 25, 2017

@izgzhen Thanks, but it looks like there are still some merge comments after #328. Could you have a look?

I think we are ready to merge this -- if this doesn't work on Windows I'll let you know so we can fix in a separate PR.

@izgzhen

This comment has been minimized.

Show comment
Hide comment
@izgzhen

izgzhen Jun 25, 2017

Collaborator

I think we are ready to merge this -- if this doesn't work on Windows I'll let you know so we can fix in a separate PR.

Let's merge it, thanks!

Collaborator

izgzhen commented Jun 25, 2017

I think we are ready to merge this -- if this doesn't work on Windows I'll let you know so we can fix in a separate PR.

Let's merge it, thanks!

@izgzhen izgzhen referenced this pull request Jun 25, 2017

Closed

Implement installation and binary/source distribution rules #219

3 of 3 tasks complete

@snowleopard snowleopard merged commit 3935e97 into snowleopard:master Jun 25, 2017

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment