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

change ghc-config to use the path ghc instead of TEST_HC #3

Open
wants to merge 1 commit into
base: ghc-8.10-ghcjs
Choose a base branch
from

Conversation

JoshMeredith
Copy link

This change uses the hard-coded system $PATH ghc to build ghc-config instead of the make variable TEST_HC, which brings the make behaviour in line Hadrian. Ideally we would use GHC_STAGE0 from config.mk, but I have been unable to get that to work via imports. Running the testsuite via make test before and after the changes (without a cross-compiler target) results in the same outputs, so it seems like this isn't causing any side-effect changes.

Alternately, I also considered matching the locators for other tools located in this same boilerplate.mk file, as follows, but this resulted in the same error for whatever reason.

ifeq "$(GHC_PKG)" ""
GHC_PKG := $(call find_tool,ghc-pkg)
endif

And these all result in an error message matching this:

make -C testsuite/tests SUMMARY_FILE=../../testsuite_summary.txt
make[1]: Entering directory '/home/josh/projects/ghc/config-test/ghc/testsuite/tests'
"" --make -o ../mk/ghc-config ../mk/ghc-config.hs
/bin/sh: 1: : Permission denied
PYTHON="python3" "python3" ../driver/runtests.py -e "ghc_compiler_always_flags='-dcore-lint -dstg-lint -dcmm-lint -no-user- -rtsopts  -Werror=compat -dno-debug-output'" -e "config.compiler_debugged=False" -e ghc_with_native_codegen=False -e "config.leading_underscore=False" -e config.have_vanilla=True -e config.have_dynamic=True -e config.have_profiling=False -e ghc_with_threaded_rts=False -e ghc_with_dynamic_rts=False -e config.have_interp=True -e config.unregisterised=False -e config.have_gdb=False -e config.have_readelf=True -e config.have_fast_bignum=False -e config.ghc_dynamic=False -e ghc_with_smp=False -e windows=False -e darwin=False -e config.in_tree_compiler=True -e config.cleanup=True -e config.local=True --rootdir=. --config-file=../config/ghc --top="/home/josh/projects/ghc/config-test/ghc/testsuite" -e 'config.platform=""' -e 'config.os=""' -e 'config.arch=""' -e 'config.wordsize=""' -e 'config.timeout=int() or config.timeout' -e 'config.exeext=""' --config 'compiler="/home/josh/projects/ghc/config-test/ghc/inplace/bin/ghc-stage2"' --config 'ghc_pkg="/home/josh/projects/ghc/config-test/ghc/inplace/bin/ghc-pkg"' --config 'haddock=' --config 'hp2ps="/home/josh/projects/ghc/config-test/ghc/inplace/bin/hp2ps"' --config 'hpc="/home/josh/projects/ghc/config-test/ghc/inplace/bin/hpc"' --config 'gs="gs"' --config 'timeout_prog="../timeout/install-inplace/bin/timeout"' --config 'stats_files_dir=../tests/perf/haddock' -e "config.stage=" --summary-file "../../testsuite_summary.txt"   --rootdir=../../libraries/array/tests  --rootdir=../../libraries/base/tests  --rootdir=../../libraries/binary/tests  --rootdir=../../libraries/bytestring/tests  --rootdir=../../libraries/deepseq/tests  --rootdir=../../libraries/directory/tests  --rootdir=../../libraries/exceptions/tests  --rootdir=../../libraries/filepath/tests  --rootdir=../../libraries/ghc-compact/tests  --rootdir=../../libraries/ghc-heap/tests  --rootdir=../../libraries/ghc-prim/tests  --rootdir=../../libraries/haskeline/tests  --rootdir=../../libraries/hpc/tests  --rootdir=../../libraries/pretty/tests  --rootdir=../../libraries/process/tests  --rootdir=../../libraries/stm/tests  --rootdir=../../libraries/template-haskell/tests  --rootdir=../../libraries/text/tests  --rootdir=../../libraries/unix/tests \
	 \
	 \
	 \
	 \
	 \
	 \
	
Traceback (most recent call last):
  File "../driver/runtests.py", line 90, in <module>
    exec(e)
  File "<string>", line 1
    config.stage=
                ^
SyntaxError: invalid syntax
make[1]: *** [../mk/test.mk:356: test] Error 1
make[1]: Leaving directory '/home/josh/projects/ghc/config-test/ghc/testsuite/tests'
make: *** [Makefile:224: test] Error 2

with this excerpt indicating that the variable isn't defined properly

"" --make -o ../mk/ghc-config ../mk/ghc-config.hs
/bin/sh: 1: : Permission denied

Given that the make builds aren't sticking around for very long, I don't think it's worth it to spend further time debugging when the system ghc bandaid appears to work.

@@ -236,7 +236,7 @@ endif
# This way we cache the results for different values of $(TEST_HC)

$(TOP)/mk/ghc-config : $(TOP)/mk/ghc-config.hs
"$(TEST_HC)" --make -o $@ $<
ghc --make -o $@ $<
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is okay as a temporary fix, but should be changed to use the stage0 ghc before we try to merge upstream. Better add a comment that we really want the STAGE0 GHC here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants