1. 14 Jun, 2001 1 commit
    • simonpj's avatar
      [project @ 2001-06-14 12:50:05 by simonpj] · 16d5d1c7
      simonpj authored
      ----------------------
      	Installation packaging
      	----------------------
      
      GHC runs various system programs like
      	cp, touch
      	gcc, as, ld etc
      
      On Windows we plan to deliver these programs along with GHC,
      so we have to be careful about where to find them.
      
      This commit isolates all these dependencies in a single module
      
      	main/SysTools.lhs
      
      Most of the #ifdefery for mingw has moved into this module.
      There's some documentation in SysTools.lhs
      
      Along the way I did lots of other cleanups.  In particular
      
        * There is no more 'globbing' needed when calling runSomething
        * All file removal goes via the standard Directory.removeFile
        * TmpFiles.hs has gone; absorbed into SysTools
        * Some DynFlag stuff has moved from DriverFlags to CmdLineOpts
      
      
      Still to do:
      
        **	I'm a bit concerned that calling removeFile one at a time
      	when deleting masses of split-object files is going to be
      	rather slow
      
        **	GHC now expects to find split,mangle,unlit in
      		libdir/extra-bin
      	instead of just
      		libdir
      
      	So something needs to change in the Unix installation scripts
      
        **    The "ineffective C preprocessor" is a perversion and should die
      16d5d1c7
  2. 07 Jun, 2001 2 commits
    • simonmar's avatar
      [project @ 2001-06-07 14:15:22 by simonmar] · dea3256b
      simonmar authored
      Don't force a module's {-# SOURCE #-} imports to have object linkables
      in order for the current module's object linkable to be considered
      valid (fixes some unnecessary recompilation with recursive modules).
      dea3256b
    • simonmar's avatar
      [project @ 2001-06-07 11:03:07 by simonmar] · c95b8662
      simonmar authored
      First part of support for hierarchical module names:
      
         - the Finder now searches all possible paths when looking for
           a source file or .hi file.  I've removed the caching because
           now we have to search in subdirectories of each path option,
           and it was dubious whether the cache was actually helping.
      
         - the compilation manager now outputs a warning if it can't find
           the source for a given module, only the .hi file.  Previously
           this caused a cryptic error message when we attempted to call
           getModificationTime on the non-existent source file.
      c95b8662
  3. 05 Jun, 2001 1 commit
  4. 08 May, 2001 1 commit
    • simonmar's avatar
      [project @ 2001-05-08 10:58:48 by simonmar] · b8b47abe
      simonmar authored
      Add
      
      	DriverPhases.haskellish_src_suffix :: String -> Bool
      	DriverPhases.haskellish_src_file   :: String -> Bool
      
      which return True for suffixes of Haskell source files only.  The
      existing haskellish_suffix and haskellish_file return True also for
      .raw_s and .hc files.
      
      We use these instead of haskellish_file in Main.main when deciding
      whether to preprocess a file.
      
      Fixes: compilation of .raw_s files, and potential bugs with
      compilation of .hc files.
      b8b47abe
  5. 04 May, 2001 1 commit
    • simonmar's avatar
      [project @ 2001-05-04 14:56:53 by simonmar] · dfbbfedc
      simonmar authored
      - only read ~/.ghci if it is owned by the current user and isn't
        writable by anyone else.
      
      - Only read ./.ghci if both . and ./.ghci are owned by the current
        user and aren't writable by anyone else.  I think this is
        sufficient: we don't need to check .. and ../.. etc. because "."
        always refers to the same directory while a process is running.
      
      - Don't load .so libraries in a package if that package is already
        linked with GHCi.  This stops us re-linking libm, libreadline etc.
      
      - Allow packages to be loaded from within GHCi using
      	:set -package <name>
        NOTE: this will unload all modules currently loaded into the
        interpreter.  I did this to be on the safe side - I think perhaps
        it isn't necessary, but I haven't thought it through fully yet.
      
      - fix CompManager.cmUnload in the process.  It was wrong in several
        ways.
      
      MERGE WITH 5.00
      dfbbfedc
  6. 01 May, 2001 1 commit
  7. 27 Apr, 2001 1 commit
  8. 28 Mar, 2001 2 commits
    • simonmar's avatar
      [project @ 2001-03-28 16:51:02 by simonmar] · da25d580
      simonmar authored
      Cleaning up error reporting, 2nd attempt.
      
        - The UserError name is already bagged by Exception (for
          userErrors).  So we use ProgramError instead, which is
          more appropriate.
      
        - some previously UserErrors are now CmdLineErrors.  GHCi
          catches CmdLineErrors and prints them without the "ghc: "
          prefix.
      da25d580
    • simonmar's avatar
      [project @ 2001-03-28 11:01:19 by simonmar] · f4eba96b
      simonmar authored
      Clean up GHC's error reporting.
      
        - the GhcException type has some more constructors: CmdLineError,
          UserError, and InstallationError.  OtherError has gone.
      
        - most error messages should begin with "<location>:".  When the
          error is on the command-line or in GHC itself, <location> is
          "ghc", for consistency with std Unix semantics.
      
        - GHCi no longer prints a superfluous "ghc: " before certain error
          messages.
      f4eba96b
  9. 21 Mar, 2001 1 commit
  10. 19 Mar, 2001 1 commit
    • simonmar's avatar
      [project @ 2001-03-19 16:22:00 by simonmar] · dd4bc7ed
      simonmar authored
      Fix a problem with the 'it' variable in GHCi.  New bindings for 'it'
      were getting confused with old bindings, because we always used the
      same 'it' name.
      
      Now, we generate a new unique for 'it' each time around.
      
      Also, make sure that any existing variables shadowed by new
      command-line bindings are correctly removed from the environments to
      avoid space leaks.
      dd4bc7ed
  11. 15 Mar, 2001 1 commit
    • simonmar's avatar
      [project @ 2001-03-15 11:26:27 by simonmar] · cf2aab8a
      simonmar authored
      Do a better job of telling the user whether we're interpreting a
      module or using an existing object file.
      
      eg.
      
         Main> :load A
         Skipping  D                ( D.hs, D.o )
         Compiling C                ( C.hs, interpreted )
         Skipping  B                ( B.hs, B.o )
         Compiling Main             ( A.hs, interpreted )
         Main>
      cf2aab8a
  12. 08 Mar, 2001 1 commit
    • simonpj's avatar
      [project @ 2001-03-08 12:07:38 by simonpj] · 51a571c0
      simonpj authored
      --------------------
      	A major hygiene pass
      	--------------------
      
      1. The main change here is to
      
      	Move what was the "IdFlavour" out of IdInfo,
      	and into the varDetails field of a Var
      
         It was a mess before, because the flavour was a permanent attribute
         of an Id, whereas the rest of the IdInfo was ephemeral.  It's
         all much tidier now.
      
         Main places to look:
      
      	   Var.lhs	Defn of VarDetails
      	   IdInfo.lhs	Defn of GlobalIdDetails
      
         The main remaining infelicity is that SpecPragmaIds are right down
         in Var.lhs, which seems unduly built-in for such an ephemeral thing.
         But that is no worse than before.
      
      
      2. Tidy up the HscMain story a little.  Move mkModDetails from MkIface
         into CoreTidy (where it belongs more nicely)
      
         This was partly forced by (1) above, because I didn't want to make
         DictFun Ids into a separate kind of Id (which is how it was before).
         Not having them separate means we have to keep a list of them right
         through, rather than pull them out of the bindings at the end.
      
      3. Add NameEnv as a separate module (to join NameSet).
      
      4. Remove unnecessary {-# SOURCE #-} imports from FieldLabel.
      51a571c0
  13. 02 Mar, 2001 1 commit
  14. 01 Mar, 2001 2 commits
    • qrczak's avatar
      [project @ 2001-03-01 21:39:36 by qrczak] · 0c5e53f0
      qrczak authored
      Let ':t \x->x' work by putting a space before the expression.
      0c5e53f0
    • simonmar's avatar
      [project @ 2001-03-01 14:26:00 by simonmar] · 18b24e64
      simonmar authored
      GHCi fixes:
      
        - expressions are now compiled in a pseudo-module "$Interactive",
          which avoids some problems with storage of demand-loaded declarations.
      
        - compilation manager now detects when it needs to read the interace
          for a module, even if it is already compiled.  GHCi never demand-loads
          interfaces now.
      
        - (from Simon PJ) fix a problem with the recompilation checker, which
          meant that modules were sometimes not recompiled when they should
          have been.
      
        - ByteCodeGen/Link: move linker related stuff into ByteCodeLink.
      18b24e64
  15. 28 Feb, 2001 2 commits
    • simonmar's avatar
      [project @ 2001-02-28 17:57:52 by simonmar] · 85c61e76
      simonmar authored
      Compiling a module outside of a running GHCi and expecting GHCi to
      pick it up when you do ':r' ain't gonna work.
      
      We thought it would, but there's a problem with module versions and
      the recompilation machinery, namely that the outside compiler doesn't
      know about the versions being used internally in the running GHCi.
      
      The "right" solution is to implement a ':compile' command in GHCi, but
      we aren't going to do that before the release.
      
      This commit disables the picking up of newly compiled modules, until
      you do a full load (i.e. :load).
      85c61e76
    • simonmar's avatar
      [project @ 2001-02-28 12:12:43 by simonmar] · 85222f5c
      simonmar authored
      oops, don't export cmTypeOfName when !GHCI.
      85222f5c
  16. 27 Feb, 2001 1 commit
  17. 26 Feb, 2001 3 commits
    • simonmar's avatar
      [project @ 2001-02-26 16:43:31 by simonmar] · 252fd0cd
      simonmar authored
      Update the interactive context in cmRunStmt rather than hscMain.
      252fd0cd
    • simonmar's avatar
      [project @ 2001-02-26 15:50:21 by simonmar] · 436d7d67
      simonmar authored
      - message wibbles
      
      - in one-shot mode, make sure the interface file follows the module rather
        than the filename of the source.
      436d7d67
    • simonmar's avatar
      [project @ 2001-02-26 15:06:57 by simonmar] · 1c62b517
      simonmar authored
      Implement do-style bindings on the GHCi command line.
      
      The syntax for a command-line is exactly that of a do statement, with
      the following meanings:
      
        - `pat <- expr'
          performs expr, and binds each of the variables in pat.
      
        - `let pat = expr; ...'
          binds each of the variables in pat, doesn't do any evaluation
      
        - `expr'
          behaves as `it <- expr' if expr is IO-typed, or `let it = expr'
          followed by `print it' otherwise.
      1c62b517
  18. 12 Feb, 2001 1 commit
  19. 07 Feb, 2001 6 commits
  20. 06 Feb, 2001 1 commit
    • simonmar's avatar
      [project @ 2001-02-06 12:03:10 by simonmar] · 0ed9d260
      simonmar authored
      Try to get the stable modules story right.  Things now work much
      better: objects aren't unloaded and reloaded unnecessarily, and
      compiling modules from with GHCi works:
      
      	> :! ghc -c A.hs
      	> :r
      	Compiling A ... compilation IS NOT required (using ./A.o)
      	Compiling B ... compilation IS NOT required
      	Compiling C ... compilation IS NOT required
      	Compiling Main ... compilation IS NOT required
      
      Compiled module must not depend on interpreted modules, but we
      currently don't enforce this restriction properly.
      0ed9d260
  21. 05 Feb, 2001 1 commit
  22. 31 Jan, 2001 1 commit
  23. 26 Jan, 2001 3 commits
    • simonmar's avatar
      [project @ 2001-01-26 17:37:27 by simonmar] · f092f609
      simonmar authored
      merge PersistentCmState and CmState
      f092f609
    • simonmar's avatar
      [project @ 2001-01-26 17:29:34 by simonmar] · 1d879dec
      simonmar authored
      Ok, don't throw away interfaces and symbol tables as part of the
      pre-upsweep.  This seems to fix the recompilation problems (well, some
      of them anyway...).
      1d879dec
    • simonmar's avatar
      [project @ 2001-01-26 17:21:51 by simonmar] · e5fd6ca8
      simonmar authored
      Greatly simplify the story about linkables, source_unchanged, and the
      pre-upsweep.
      
      Now we pre-generate the list of valid linkables; that is, for each
      module if a linkable exists and is newer than the source, we keep it.
      If a module has a valid linkable, then it is "source unchanged", and
      it is also possibly "stable" as far as the pre-upsweep is concerned
      (as long as its imports are also stable).
      
      The pre-upsweep is no longer dependent on the mode
      (interactive/batch).
      
      There's still a bug here, though: the pre-upsweep removes old
      interfaces from the HIT, so we don't get an opportunity to avoid
      compilation for non-stable modules.  That's the next job.
      e5fd6ca8
  24. 25 Jan, 2001 1 commit
    • simonpj's avatar
      [project @ 2001-01-25 17:47:12 by simonpj] · ab7fb945
      simonpj authored
      A big improvement to the way command-line expressions are typechecked.
      Now we don't wrap in "print" and hope for the best (the wrong "print"
      might be in scope).  Instead we work on the renamed epxression and
      do the Right Thing by using the correct "print".
      
      Also do generalisation, so that we get the right type back from
      the :t command.
      
      WARNING: it's possible that these files overlap with my fortcoming
      Big Commit of typechecker stuff, so you may need to hang on for
      a few mins.
      ab7fb945
  25. 18 Jan, 2001 1 commit
    • simonmar's avatar
      [project @ 2001-01-18 16:30:00 by simonmar] · 183bd266
      simonmar authored
      Problem 1
      =========
      
      The typechecker, when deciding whether to extend the Package
      environment with any new typechecked declarations in its hand, was
      inserting new declarations into the environment only if the
      declaration's module differed from the "current" module.  This doesn't
      work if the "current" module is a package module, as it could be at
      the GHCi command line, for example.
      
      The solution is to filter the declarations only if the current module
      is not a package module.
      
      
      Problem 2
      =========
      
      The "current" module, as obtained from the compilation manager, was
      always bogusly a Home module (it used mkHomeModule).  To properly fix
      this, the GHCi state has to carry around Modules instead of
      ModuleNames, and CompMan.cmLoadModule needs to return a list of
      Modules.
      183bd266
  26. 16 Jan, 2001 1 commit
  27. 18 Dec, 2000 1 commit