From qdunkan at gmail.com Thu Apr 5 04:04:04 2018 From: qdunkan at gmail.com (Evan Laforge) Date: Wed, 4 Apr 2018 21:04:04 -0700 Subject: .ghci runs after flag parsing? Message-ID: I just noticed that it appears flag parsing happens before executing .ghci. And sure enough, looking at the source, GHCi.UI.runGHCi executes the dot files, which is definitely after all the dynflags parsing stuff in Main. This means that if your .ghci has a -Wall, you can't turn off warnings from the command line. You have to prepend ":set " to the flags and make a local ./.ghci, or pass -ghci-script. I assume this has how it's already been, and I'm surprised it's taken me this long to notice this! Is there a good reason to do it this way, or is it just the way it's always been and no one complained? It's surprising to me because I think most programs do it the other way. E.g. when you start your shell, settings on the command line will override your .zshrc or whatever. zsh for one doesn't seem to clearly document this, but experimenting seems to indicate that is so. I can put all my flags in a -ghci-script without too much trouble, it's just a surprising default. From jhala at cs.ucsd.edu Wed Apr 18 21:01:08 2018 From: jhala at cs.ucsd.edu (Ranjit Jhala) Date: Wed, 18 Apr 2018 14:01:08 -0700 Subject: Accessing 'Annotations' of modules in external packages Message-ID: Hi all, I'm looking for some help using the GHC API to access the 'Annotations' (created using the 'ANN' mechanism) within modules of *external* packages i.e. non-home modules.Currently I'm using hscEPS :: HscEnv -> IO ExternalPackageState and then using the field eps_PIT :: !PackageIfaceTable and from there, accessing the mi_anns :: [IfaceAnnotation] field of the data ModIface stored in the PackageIfaceTable but this ends in an unfortunate: ``` panic! (the 'impossible' happened) (GHC version 8.2.2 for x86_64-apple-darwin): No mi_anns in PIT Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug ``` Perhaps this is because, as the documentation for `mi_anns` says: Annotations NOT STRICT! we read this field lazily from the interface file but I am not sure how to proceed at this point? Do I need a _different_ HscEnv? Or perhaps I need to set up/initialize the HscEnv separately? Any pointers would be most welcome! Thanks! Ranjit. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben at well-typed.com Fri Apr 20 00:01:22 2018 From: ben at well-typed.com (Ben Gamari) Date: Thu, 19 Apr 2018 20:01:22 -0400 Subject: [ANNOUNCE] GHC 8.4.2 released Message-ID: <87in8md9v9.fsf@smart-cactus.org> Hello everyone, The GHC team is pleased to announce the availability of GHC 8.4.2. The source distribution, binary distributions, and documentation for this release are available at https://downloads.haskell.org/~ghc/8.4.2 This release is a bug-fix release, fixing numerous regressions and bugs present in GHC 8.4.1. These include: * A regression resulting in some uses of `Control.Exception.evaluate` to be inappropriately optimised away (see #13930) * A regression resulting in segmentation faults of programs compiled with profiling (#14705) * A bug causing runtime system panics while running programs with retainer profiling (#14947) * The configure scripts now accepts a `--disable-dtrace` option, again allowing GHC to be bootstrapped on FreeBSD (#15040) * The version number of the `base` package has been bumped to 4.11.1.0 to reflect the addition of the `GHC.IO.FixIOException` type. This interface was added in 8.4.1 but the version bump was missed due to an oversight. * Support for DWARF debug information has been significantly improved (#14894, #14779) A more thorough list of the changes in this release can be found in the release notes, https://downloads.haskell.org/~ghc/8.4.2/docs/html/users_guide/8.4.2-notes.html Thanks to everyone who has contributed to developing, documenting, and testing this release! As always, let us know if you encounter trouble. How to get it ~~~~~~~~~~~~~ The easy way is to go to the web page, which should be self-explanatory: http://www.haskell.org/ghc/ We supply binary builds in the native package format for many platforms, and the source distribution is available from the same place. Packages will appear as they are built - if the package for your system isn't available yet, please try again later. Background ~~~~~~~~~~ Haskell is a standard lazy functional programming language. GHC is a state-of-the-art programming suite for Haskell. Included is an optimising compiler generating efficient code for a variety of platforms, together with an interactive system for convenient, quick development. The distribution includes space and time profiling facilities, a large collection of libraries, and support for various language extensions, including concurrency, exceptions, and foreign language interfaces. GHC is distributed under a BSD-style open source license. A wide variety of Haskell related resources (tutorials, libraries, specifications, documentation, compilers, interpreters, references, contact information, links to research groups) are available from the Haskell home page (see below). On-line GHC-related resources ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Relevant URLs on the World-Wide Web: GHC home page http://www.haskell.org/ghc/ GHC developers' home page http://ghc.haskell.org/trac/ghc/ Haskell home page http://www.haskell.org/ Supported Platforms ~~~~~~~~~~~~~~~~~~~ The list of platforms we support, and the people responsible for them, is here: http://ghc.haskell.org/trac/ghc/wiki/Contributors Ports to other platforms are possible with varying degrees of difficulty. The Building Guide describes how to go about porting to a new platform: http://ghc.haskell.org/trac/ghc/wiki/Building Developers ~~~~~~~~~~ We welcome new contributors. Instructions on accessing our source code repository, and getting started with hacking on GHC, are available from the GHC's developer's site run by Trac: http://ghc.haskell.org/trac/ghc/ Mailing lists ~~~~~~~~~~~~~ We run mailing lists for GHC users and bug reports; to subscribe, use the web interfaces at http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets There are several other haskell and ghc-related mailing lists on www.haskell.org; for the full list, see https://mail.haskell.org/cgi-bin/mailman/listinfo Some GHC developers hang out on #haskell on IRC, too: http://www.haskell.org/haskellwiki/IRC_channel Please report bugs using our bug tracking system. Instructions on reporting bugs can be found here: http://www.haskell.org/ghc/reportabug -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 487 bytes Desc: not available URL: From christiaan.baaij at gmail.com Fri Apr 20 16:28:13 2018 From: christiaan.baaij at gmail.com (Christiaan Baaij) Date: Fri, 20 Apr 2018 18:28:13 +0200 Subject: Accessing 'Annotations' of modules in external packages In-Reply-To: References: Message-ID: ghc-devs is probably a better location for GHC API questions. Anyhow, you might want to look at some code in the Clash compiler: https://github.com/clash-lang/clash-compiler/blob/6ec3ca426bfaaaddcd3692775c25614bc19482fa/clash-ghc/src-ghc/Clash/GHC/LoadInterfaceFiles.hs#L168-L225 We use that to find the following annotations in compiled packages: http://hackage.haskell.org/package/clash-prelude-0.99/docs/Clash-Annotations-Primitive.html Anyhow, the gist of: https://github.com/clash-lang/clash-compiler/blob/6ec3ca426bfaaaddcd3692775c25614bc19482fa/clash-ghc/src-ghc/Clash/GHC/LoadInterfaceFiles.hs#L168-L225 is: * You need a `Module` to start with (you can e.g. get one from a `CoreBndr`) * You need to load the interface file (.hi) for that module. * One you have the contents of the interface file, you can do `TcIface.tcIfaceAnnotations (GHC.mi_anns iface)` to get something of the `Annotation` type. Hope that helps. -- Christiaan On 18 April 2018 at 23:01, Ranjit Jhala wrote: > > Hi all, > > I'm looking for some help using the GHC API to > > access the 'Annotations' (created using the 'ANN' > > mechanism) within modules of *external* packages > > i.e. non-home modules.Currently I'm using > > hscEPS :: HscEnv -> IO ExternalPackageState > > and then using the field > > eps_PIT :: !PackageIfaceTable > > and from there, accessing the > > mi_anns :: [IfaceAnnotation] > > field of the > > data ModIface > > stored in the PackageIfaceTable but this ends in an unfortunate: > > ``` > panic! (the 'impossible' happened) > (GHC version 8.2.2 for x86_64-apple-darwin): > No mi_anns in PIT > > Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug > ``` > > Perhaps this is because, as the documentation for `mi_anns` says: > > Annotations NOT STRICT! we read this field lazily from the interface > file > > but I am not sure how to proceed at this point? Do I need a _different_ > HscEnv? Or perhaps I need to set up/initialize the HscEnv separately? > > Any pointers would be most welcome! > > Thanks! > > Ranjit. > > > > > > > > _______________________________________________ > Glasgow-haskell-users mailing list > Glasgow-haskell-users at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: