| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Most of the other users of the fptools build system have migrated to
Cabal, and with the move to darcs we can now flatten the source tree
without losing history, so here goes.
The main change is that the ghc/ subdir is gone, and most of what it
contained is now at the top level. The build system now makes no
pretense at being multi-project, it is just the GHC build system.
No doubt this will break many things, and there will be a period of
instability while we fix the dependencies. A straightforward build
should work, but I haven't yet fixed binary/source distributions.
Changes to the Building Guide will follow, too.
|
| |
|
|
|
|
|
| |
Eliminate things like "warning: call-clobbered register used as global
register variable", which is an non-suppressible warning from gcc.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Two changes from Krasimir Angelov, which were required for Visual
Haskell:
- messaging cleanup throughout the compiler. DynFlags has a new
field:
log_action :: Severity -> SrcSpan -> PprStyle -> Message -> IO ()
this action is invoked for every message generated by the
compiler. This means a client of the GHC API can direct messages to
any destination, or collect them up in an IORef for later
perusal.
This replaces previous hacks to redirect messages in the GHC API
(hence some changes to function types in GHC.hs).
- The JustTypecheck mode of GHC now does what it says. It doesn't
run any of the compiler passes beyond the typechecker for each module,
but does generate the ModIface in order that further modules can be
typechecked.
And one change from me:
- implement the LANGUAGE pragma, finally
|
|
|
|
|
|
| |
Rationalise the filename handling in a few places, taking some bits
from the defunct System.FilePath library. Also fixes a bug I recently
introduced in replaceFilenameDirectory.
|
|
|
|
|
|
|
|
|
|
|
|
| |
newTempName: instead of bumping the processId until we find a name
that isn't used, add an integer suffix to the processId. This should
prevent temp-file conflicts that appear to have been affecting our
nightly builds and occasionally make -j.
The right way to allocate a temporary file is to create it straight
away, but I'm not sure of the implications of passing existing
temporary files to the various sub-processes that GHC executes, hence
this fix instead.
|
|
|
|
|
|
|
| |
runSomething: 'rawSystem' might raise an exception to indicate that
'pgm' couldn't be executed, so catch this here & report.
Merge to STABLE.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In many places there was a common pattern
when (verbose >= n) $ putMsg "..."
It is now replaced with
debutTraceMsg dflags n "..."
In few places hPutStrLn stderr or putStrLn was used instead of putMsg in
the above pattern. They are replaced too. Now putMsg is used only in places
where the verbosity flag was not checked.
|
|
|
|
|
|
|
| |
DriverPipeline.compile: we should be grabbing the OPTIONS from the
StringBuffer, not reading the file again (duh!)
SysTools: some message cleanups
|
|
|
|
|
|
|
| |
Tweaks to get the GHC sources through Haddock. Doesn't quite work
yet, because Haddock complains about the recursive modules. Haddock
needs to understand SOURCE imports (it can probably just ignore them
as a first attempt).
|
|
|
|
|
|
|
|
|
|
|
|
| |
Complete the transition of -split-objs into a dynamic flag (looks like I
half-finished it in the last commit).
Also: complete the transition of -tmpdir into a dynamic flag, which
involves some rearrangement of code from SysTools into DynFlags.
Someday, initSysTools should move wholesale into initDynFlags, because
most of the state that it initialises is now part of the DynFlags
structure, and the rest could be moved in easily.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Flags cleanup.
Basically the purpose of this commit is to move more of the compiler's
global state into DynFlags, which is moving in the direction we need
to go for the GHC API which can have multiple active sessions
supported by a single GHC instance.
Before:
$ grep 'global_var' */*hs | wc -l
78
After:
$ grep 'global_var' */*hs | wc -l
27
Well, it's an improvement. Most of what's left won't really affect
our ability to host multiple sessions.
Lots of static flags have become dynamic flags (yay!). Notably lots
of flags that we used to think of as "driver" flags, like -I and -L,
are now dynamic. The most notable static flags left behind are the
"way" flags, eg. -prof. It would be nice to fix this, but it isn't
urgent.
On the way, lots of cleanup has happened. Everything related to
static and dynamic flags lives in StaticFlags and DynFlags
respectively, and they share a common command-line parser library in
CmdLineParser. The flags related to modes (--makde, --interactive
etc.) are now private to the front end: in fact private to Main
itself, for now.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Rationalise the BUILD,HOST,TARGET defines.
Recall that:
- build is the platform we're building on
- host is the platform we're running on
- target is the platform we're generating code for
The change is that now we take these definitions as applying from the
point of view of the particular source code being built, rather than
the point of view of the whole build tree.
For example, in RTS and library code, we were previously testing the
TARGET platform. But under the new rule, the platform on which this
code is going to run is the HOST platform. TARGET only makes sense in
the compiler sources.
In practical terms, this means that the values of BUILD, HOST & TARGET
may vary depending on which part of the build tree we are in.
Actual changes:
- new file: includes/ghcplatform.h contains platform defines for
the RTS and library code.
- new file: includes/ghcautoconf.h contains the autoconf settings
only (HAVE_BLAH). This is so that we can get hold of these
settings independently of the platform defines when necessary
(eg. in GHC).
- ghcconfig.h now #includes both ghcplatform.h and ghcautoconf.h.
- MachRegs.h, which is included into both the compiler and the RTS,
now has to cope with the fact that it might need to test either
_TARGET_ or _HOST_ depending on the context.
- the compiler's Makefile now generates
stage{1,2,3}/ghc_boot_platform.h
which contains platform defines for the compiler. These differ
depending on the stage, of course: in stage2, the HOST is the
TARGET of stage1. This was wrong before.
- The compiler doesn't get platform info from Config.hs any more.
Previously it did (sometimes), but unless we want to generate
a new Config.hs for each stage we can't do this.
- GHC now helpfully defines *_{BUILD,HOST}_{OS,ARCH} automatically
in CPP'd Haskell source.
- ghcplatform.h defines *_TARGET_* for backwards compatibility
(ghcplatform.h is included by ghcconfig.h, which is included by
config.h, so code which still #includes config.h will get the TARGET
settings as before).
- The Users's Guide is updated to mention *_HOST_* rather than
*_TARGET_*.
- coding-style.html in the commentary now contains a section on
platform defines. There are further doc updates to come.
Thanks to Wolfgang Thaller for pointing me in the right direction.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fill in the haddock-interfaces and haddock-html fields in the
package.conf files.
To do this I had to make some changes:
- haddock-interfaces requires the value of $(datadir). We can't
just plug this in, because $(datadir) might change at install-time
(eg. a Windows installer can be placed anywhere, as can a Unix
binary .tar.gz distribution). The current trick is for the
compiler to splice in the value of $libdir in package.conf at
runtime. So we could extend this mechanism and tell the compiler
the value of $datadir via a command-line option, but that seems
ugly.
On Windows, $datadir==$libdir, so we don't need any changes:
package.conf still uses $libdir, and a Windows installation is
independent of its absolute location. Even 'make install' on
Windows should have this property.
On Unix:
- for 'make install' and in-place execution, we just use
absolute paths in package.conf
- for a binary dist, we generate a package.conf that refers
to $libdir and $datadir, and splice in the values at
install-time (distrib/Makefile-bin.in).
- Also, I renamed $libdir to $topdir to more closely reflect its
actual meaning. This is somewhat malicious in that it will flush
out all those clients using $libdir when they really shouldn't
be :-)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Further integration with the new package story. GHC now supports
pretty much everything in the package proposal.
- GHC now works in terms of PackageIds (<pkg>-<version>) rather than
just package names. You can still specify package names without
versions on the command line, as long as the name is unambiguous.
- GHC understands hidden/exposed modules in a package, and will refuse
to import a hidden module. Also, the hidden/eposed status of packages
is taken into account.
- I had to remove the old package syntax from ghc-pkg, backwards
compatibility isn't really practical.
- All the package.conf.in files have been rewritten in the new syntax,
and contain a complete list of modules in the package. I've set all
the versions to 1.0 for now - please check your package(s) and fix the
version number & other info appropriately.
- New options:
-hide-package P sets the expose flag on package P to False
-ignore-package P unregisters P for this compilation
For comparison, -package P sets the expose flag on package P
to True, and also causes P to be linked in eagerly.
-package-name is no longer officially supported. Unofficially, it's
a synonym for -ignore-package, which has more or less the same effect
as -package-name used to.
Note that a package may be hidden and yet still be linked into
the program, by virtue of being a dependency of some other package.
To completely remove a package from the compiler's internal database,
use -ignore-package.
The compiler will complain if any two packages in the
transitive closure of exposed packages contain the same
module.
You *must* use -ignore-package P when compiling modules for
package P, if package P (or an older version of P) is already
registered. The compiler will helpfully complain if you don't.
The fptools build system does this.
- Note: the Cabal library won't work yet. It still thinks GHC uses
the old package config syntax.
Internal changes/cleanups:
- The ModuleName type has gone away. Modules are now just (a
newtype of) FastStrings, and don't contain any package information.
All the package-related knowledge is in DynFlags, which is passed
down to where it is needed.
- DynFlags manipulation has been cleaned up somewhat: there are no
global variables holding DynFlags any more, instead the DynFlags
are passed around properly.
- There are a few less global variables in GHC. Lots more are
scheduled for removal.
- -i is now a dynamic flag, as are all the package-related flags (but
using them in {-# OPTIONS #-} is Officially Not Recommended).
- make -j now appears to work under fptools/libraries/. Probably
wouldn't take much to get it working for a whole build.
|
|
|
|
| |
Get rawSystem from Compat.RawSystem in libghccompat.
|
|
|
|
|
|
|
| |
Catch exit(127) result from raw system, and report that we couldn't
execute the program. This is a semi-hack; all exec() errors get
reported as exit(127) by rawSystem, but if we treat it just like a
program that does exit(127) then the user sees no output.
|
|
|
|
| |
wibble
|
|
|
|
| |
Merge backend-hacking-branch onto HEAD. Yay!
|
|
|
|
|
|
|
| |
Move the definition of rawSystem into a separate file which we
#include in the places it is needed. This is slightly better than
copying the code, since we now need it in three places
(ghc/utils/runghc is the 3rd).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Remove all known hacks in rawSystem:
- no splitting of the program name using toArgs
- no avoiding translate when the string already appears to be quoted
- no avoiding translate for the command name
We now keep separate program name & args for various SysTools
programs: gcc, as, ld, mkdll.
MERGE TO STABLE
|
|
|
|
|
|
| |
New version of translate for mingw32, which correctly (allegedly)
reverses the command-line translation done by the standard C runtime
on Windows.
|
|
|
|
| |
Make trace message more accurate
|
|
|
|
| |
Fix build
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
---------------------------------------
Fix the WinME/98/95 double-backslash bug
---------------------------------------
Merge to stable branch, at least
once we are sure it's right
Backslashes should not be escaped in command-line arguments for rawSystem,
on Win32. This only actually causes failures on WinME/98/95, and we can't
test that since we don't have it. But this fix seems right regardless.
There are extensive new comments in libraries/base/System/Cmd.hs which
describe the issues.
|
|
|
|
| |
Comments only
|
|
|
|
| |
Add (missing?) -pgmdll option. Remove duplicate -pgmP option.
|
|
|
|
| |
merge rev. 1.106.2.3
|
|
|
|
| |
GC export list.
|
|
|
|
| |
Add a separate --help message for GHCi.
|
|
|
|
|
|
|
|
|
|
| |
- In GHCi & Template Haskell, give a warning for things mentioned
on the command line that we don't recognise, and then ignore them.
In batch mode, these are still passed to the linker as before.
- Clean up & rename the filename-suffix recognising functions in
DriverPhases. There's probably a better place for these, but I've left
them where they are for now.
|
|
|
|
| |
After removing temp files, reset the list of temporary files to empty.
|
|
|
|
| |
oops, remove excess baggage in previous commit
|
|
|
|
|
|
|
|
|
| |
Fix a blatant bug in cleanTempFilesExcept, which was causing
legitimate source files to be deleted. The previous fixes for this
bug missed the real cause of the problem.
I take full blame for this bug, which has been here since the dawn of
GHCi (at least I traced it back to 5.00).
|
|
|
|
| |
Update comments to match reality.
|
|
|
|
|
|
|
|
|
|
| |
SysTools.removeTmpFiles:
- never delete source files with a DriverPhases.haskellish_user_src_file
file extension & loudly complain should the compiler attempt to do so.
This is a protective measure against bugs elsewhere in the driver pipeline
(cf., 'ghc-6.0 --make' deleting input files if specified using backward
instead of forward slashes under win32.)
|
|
|
|
| |
comments only
|
|
|
|
|
|
|
|
| |
setTmpDir: canonicalise temp file paths under mingw:
- convert backslashes into forward ones
- drop trailing slash
- translate /cygdrive/drive/path to drive:/path, coping with
cygwin-centric settings for TMP or TEMP.
|
|
|
|
|
| |
Attempt to fix the nightly builds (untested):
Use our forefathers' syntax to import rawSystem
|
|
|
|
| |
Add the commit message as a comment
|
|
|
|
|
|
| |
Urk, don't quote/escape the command name on Windows, because the
compiler is exceedingly naughty and sometimes uses 'perl "..."' as the
command name.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Change the type of System.Cmd.rawSystem:
rawSystem :: FilePath -> [String] -> IO ExitCode
and implement it properly on both Windows & Unix. The intended
meaning is that the program is executed with *exactly* these
arguments.
We now re-use this rawSystem in the compiler itself (using it directly
from the library if __GLASGOW_HASKELL__ >= 601).
The previous implementation of SysTools.runSomething was broken on
4.08, because Posix.executeFile was broken. However, implementing the
new rawSystem on 4.08 is tricky, because it uses the FFI marshalling
libraries which weren't present on 4.08. Hence, bootstrapping from
4.08 is now not possible (it was already not possible on Windows). It
could be made possible by importing enough FFI marshalling support,
but I won't bother doing that unless/until it is needed.
|
|
|
|
| |
Comments
|
|
|
|
|
|
|
| |
- renamed unDosifyPath as normalisePath
- renamed dosifyPath as platformPath
- dropped dosifyPaths; unused.
- platformPath (ne dosifyPath): drop slicing off of /cygdrive prefixes
|
|
|
|
|
|
|
| |
Quick fix: Escape double quotes when quoting; affects only WinDoze
builds. While I'm there: Move quoting hell into #ifdef, so its scope
is obvious and changed an #ifndef into an #ifdef (negated conditions
are evil, at least for my small brain).
|
|
|
|
| |
Drop unused import of System.system.
|
|
|
|
| |
Work around broken getProcessStatus in 5.04.x
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Attention: Tentative fix only! But at least this works much better
than before.
From the Linux man page for waitpid:
[...]
ERRORS
ECHILD if the process specified in pid does not exist or
is not a child of the calling process. (This can
happen for one's own child if the action for
SIGCHLD is set to SIG_IGN. See also the LINUX NOTES
section about threads.)
[...]
Consequently, we don't ignore SIGCHLD anymore. Further changes:
* SIGCONT is not ignored anymore, either. What was this for?
* Don't use WUNTRACED in waitpid. Again, what was this for?
|
|
|
|
|
| |
System.Cmd.system-less invocation of sub-tasks
(Sven approved reverting the OpenGL-Makefile change)
|