Happstack 0.4 stable coming soon!

3 views
Skip to first unread message

stepcut

unread,
Nov 9, 2009, 1:24:20 PM11/9/09
to HAppS
Hello,

We are looking to make a new stable 0.4 release. Since 0.3 we have
added sendfile support to the file serving code, rewritten
Happstack.Server.HTTP.FileServe to be more modular and composable,
other things I don't even remember, and fixed many bugs.

The remaining buglist for 0.4 is currently:

http://code.google.com/p/happstack/issues/list?can=2&q=milestone=0.4&colspec=ID%20Type%20Status%20Priority%20Milestone%20Owner%20Summary

Here is what you can do:
1. report any other issues you think are critical for 0.4 to the bug
tracker and set the milestone
2. test your code against darcs head
3. if you use MacOS, Windows, FreeBSD, or any other non-Linux
platform where Happstack might run, you can really help us out by
letting is know if it works or not. Most of the developers are using
Linux, so the other platforms do not get tested much. But working
MacOS, Windows, and Linux support is a requirement for each release!

Thanks!
- jeremy

John MacFarlane

unread,
Nov 10, 2009, 2:45:24 PM11/10/09
to ha...@googlegroups.com
> 2. test your code against darcs head
> 3. if you use MacOS, Windows, FreeBSD, or any other non-Linux
> platform where Happstack might run, you can really help us out by
> letting is know if it works or not. Most of the developers are using
> Linux, so the other platforms do not get tested much. But working
> MacOS, Windows, and Linux support is a requirement for each release!

I successfully compiled happstack-server from darcs head on MacOS
10.5.8, and I was also able to compile gitit against it.

I noticed a bunch of compiler warnings when compiling happstack.
A lot of them seem really easy to fix -- e.g. things that are
imported and not used, or
"-XPatternSignatures is deprecated: use -XScopedTypeVariables".
Is there any reason not to fix them?

I also noticed that the link to the API documentation on the happstack
website goes to the docs for version 0.2.

John

stepcut

unread,
Nov 10, 2009, 3:11:59 PM11/10/09
to HAppS
Hello,

- We have not fixed the "-XPatternSignatures is deprecated: use -
XScopedTypeVariables" warning because ScopedTypeVariables is not
supported in 6.8.x, and we have not decided to drop support for 6.8.x
yet. All (or most) of the other warnings should be fixed if someone
has the time and interest. I personally don't mind the warnings about
shadowed names (so we can just turn those off), and orphan instances
are necessary, so we can disable that warning as well.

- Did you successfully run gitit? Or just compile it? I believe the
error we are seeing on OS X happens at run time when it tries to bind
to the server port.

- yeah, I noticed that doc link was out of date as well. I plan to
fix it after 0.4 is out. (The docs for 0.3 are not installed on the
server, so it is more work than just updating the link)

John MacFarlane

unread,
Nov 10, 2009, 4:43:36 PM11/10/09
to ha...@googlegroups.com
+++ stepcut [Nov 10 09 12:11 ]:

> - Did you successfully run gitit? Or just compile it? I believe the
> error we are seeing on OS X happens at run time when it tries to bind
> to the server port.

Yes, it runs just fine for me.
I'm using network-2.2.1.4, by the way.

John MacFarlane

unread,
Nov 10, 2009, 5:30:10 PM11/10/09
to ha...@googlegroups.com
+++ John MacFarlane [Nov 10 09 13:43 ]:

> > On Nov 10, 1:45 pm, John MacFarlane <fiddlosop...@gmail.com> wrote:
> > > >   2. test your code against darcs head
> > > >   3. if you use MacOS, Windows, FreeBSD, or any other non-Linux
> > > > platform where Happstack might run, you can really help us out by
> > > > letting is know if it works or not. Most of the developers are using
> > > > Linux, so the other platforms do not get tested much. But working
> > > > MacOS, Windows, and Linux support is a requirement for each release!

On FreeBSD 7.2, I ran into trouble compiling sendfile (now a dependency
of happstack-server). I haven't had time to investigate further, but
here's the log:

Configuring sendfile-0.5...
Preprocessing library sendfile-0.5...
Building sendfile-0.5...
[1 of 3] Compiling Network.Socket.SendFile.FreeBSD (
src/Network/Socket/SendFile/FreeBSD.hs,
dist/build/Network/Socket/SendFile/FreeBSD.o )
[2 of 3] Compiling Network.Socket.SendFile.Internal (
src/Network/Socket/SendFile/Internal.hs,
dist/build/Network/Socket/SendFile/Internal.o )

src/Network/Socket/SendFile/Internal.hs:76:18:
Couldn't match expected type `Integer -> IO ()'
against inferred type `IO Integer'
In the first argument of `wrapSendFile'', namely `_sendFile'
In the expression: wrapSendFile' _sendFile out_fd in_fd off count
In the expression:
do let out_fd = Fd (fdSocket outs)
let in_fd = Fd (haFD inp')
wrapSendFile' _sendFile out_fd in_fd off count

src/Network/Socket/SendFile/Internal.hs:85:18:
Couldn't match expected type `Integer -> IO ()'
against inferred type `IO Integer'
In the first argument of `wrapSendFile'', namely `_sendFile'
In the expression: wrapSendFile' _sendFile out_fd in_fd off count
In the expression:
do let out_fd = Fd (haFD outp')
let in_fd = Fd (haFD inp')
wrapSendFile' _sendFile out_fd in_fd off count
cabal: Error: some packages failed to install:
happstack-server-0.4 depends on sendfile-0.5 which failed to install.
sendfile-0.5 failed during the building phase. The exception was:
exit: ExitFailure 1

John MacFarlane

unread,
Nov 10, 2009, 5:46:59 PM11/10/09
to ha...@googlegroups.com
+++ John MacFarlane [Nov 10 09 14:30 ]:

>
> On FreeBSD 7.2, I ran into trouble compiling sendfile (now a dependency
> of happstack-server). I haven't had time to investigate further, but
> here's the log:

Looks like _sendFile has a different type (even a different
number of arguments) in Network.Socket.SendFile.Linux and
in Network.Socket.SendFile.FreeBSD, but the calling module
Network.Socket.SendFile.Internal is not sensitive to this difference.

If someone sends a patch today, I can apply it and test on
my FreeBSD machine. (But I'll be away the rest of the week.)

John

Douglas Burke

unread,
Nov 10, 2009, 5:47:44 PM11/10/09
to ha...@googlegroups.com

I'm pretty sure that native sendfile is not working on *BSD systems in
0.5. You could try looking at the changes in the repository post the 0.5
release

http://patch-tag.com/r/mae/sendfile

to see if the OS-X support I added can be used as a template for fixing
up the FreeBSD version.

Or, try and install sendfile with the portable flag set, which uses the
Haskell version of the sendfile code, which should work, as it is the C
binding that needs some work.

HTH
Doug


Matthew Elder

unread,
Nov 10, 2009, 6:21:29 PM11/10/09
to ha...@googlegroups.com
Precisely :) I did not have enough bsd dev power to work out those issues.

-portable will work on any haskell platform, in theory (with less perf)
--
Sent from my mobile device

Need somewhere to put your code? http://patch-tag.com
Want to build a webapp? http://happstack.com

John MacFarlane

unread,
Nov 10, 2009, 7:15:22 PM11/10/09
to ha...@googlegroups.com
+++ Matthew Elder [Nov 10 09 15:21 ]:

>
> Precisely :) I did not have enough bsd dev power to work out those issues.
>
> -portable will work on any haskell platform, in theory (with less perf)

I was able to compile sendfile with -fportable, and then
happstack-server 0.4 and gitit on top of that. Everything
seems to work just fine on FreeBSD. It woud be nice to get the
native sendfile working, but I don't know enough about it
to do it myself.

John

Matthew Elder

unread,
Nov 10, 2009, 7:35:58 PM11/10/09
to ha...@googlegroups.com
yeah... i could work it out when i have more time but need a test box.
--

Matthew Elder

unread,
Nov 10, 2009, 7:38:16 PM11/10/09
to ha...@googlegroups.com
speaking of which, does anyone have problems building sendfile on ghc
6.12? I received a patch that makes it work but it breaks 6.10 and in
theory 6.8 (they changed the way they handle low level descriptors in
ghc).. so i didn't accept it.

need to do some conditional compilation so both work

which brings me to my next question. does anyone have a decent guide
on compiling multiple ghc's in different prefixes on the same box? I
have an idea about how to do this but I haven't the time to go on that
journey myself.

Paulo Tanimoto

unread,
Nov 10, 2009, 7:40:19 PM11/10/09
to ha...@googlegroups.com
On Tue, Nov 10, 2009 at 6:35 PM, Matthew Elder <ma...@mattelder.org> wrote:
>
> yeah... i could work it out when i have more time but need a test box.
>

Would FreeBSD in a virtual machine be enough? I don't have FreeBSD,
but I could install it in a VM and give you root access. The problem
is that you need GHC installed, right? I don't know how easy that is.

Paulo

Matthew Elder

unread,
Nov 10, 2009, 7:58:15 PM11/10/09
to ha...@googlegroups.com
I can build it from source. this is preferable. and yeah that would
definitely work :)

I love that a community can come together and pool resources like this.

John MacFarlane

unread,
Nov 10, 2009, 8:04:04 PM11/10/09
to ha...@googlegroups.com
+++ Paulo Tanimoto [Nov 10 09 18:40 ]:

Easy. There's a binary package you can install using pkg_add.

Paulo Tanimoto

unread,
Nov 10, 2009, 8:13:58 PM11/10/09
to ha...@googlegroups.com
On Tue, Nov 10, 2009 at 7:04 PM, John MacFarlane <fiddlo...@gmail.com> wrote:
>
> Easy.  There's a binary package you can install using pkg_add.
>
>

Thanks, John, I'll try that. Matthew, I'll email you soon.

Paulo

stepcut

unread,
Nov 10, 2009, 9:03:33 PM11/10/09
to HAppS
On Nov 10, 6:38 pm, Matthew Elder <m...@mattelder.org> wrote:

> which brings me to my next question. does anyone have a decent guide
> on compiling multiple ghc's in different prefixes on the same box? I
> have an idea about how to do this but I haven't the time to go on that
> journey myself.

Personally, I would use build-env to create a separate chroot for each
version of ghc. Then you just chroot into the right one and use it.
This seems easier than trying to get multiple versions to live
together in the same environment.

In theory, though, you could also just do, ./configure --prefix=/opt/
ghc612

- jeremy

John MacFarlane

unread,
Nov 11, 2009, 11:38:23 AM11/11/09
to ha...@googlegroups.com
Suggestion: Why not change the cabal file for sendfile so that
it uses the 'portable' method on FreeBSD? This can be reverted
when the FreeBSD module is fixed. This way FreeBSD users will
be able to 'cabal install happstack' without having to know that
they need the '-fportable' flag for sendfile...

Here's a diff:

@@ -41,13 +41,14 @@
cpp-options: -DLINUX_SENDFILE
other-modules: Network.Socket.SendFile.Linux
else
- if os(freebsd) && !flag(portable)
- cpp-options: -DFREEBSD_SENDFILE
- other-modules: Network.Socket.SendFile.FreeBSD
- else
- cpp-options: -DPORTABLE_SENDFILE
- build-depends: bytestring >= 0.9.1.4 && < 0.10,
- network-bytestring >= 0.1.1.3 && < 0.2
+-- commented out until freebsd module is fixed
+-- if os(freebsd) && !flag(portable)
+-- cpp-options: -DFREEBSD_SENDFILE
+-- other-modules: Network.Socket.SendFile.FreeBSD
+-- else
+ cpp-options: -DPORTABLE_SENDFILE
+ build-depends: bytestring >= 0.9.1.4 && < 0.10,
+ network-bytestring >= 0.1.1.3 && < 0.2



+++ John MacFarlane [Nov 10 09 16:15 ]:

Matthew Elder

unread,
Nov 11, 2009, 12:58:17 PM11/11/09
to ha...@googlegroups.com
i thought about this yes, but I kind of wanted people to test it :) I
can default it to portable and create a flag for freebsd i suppose.

i will address this when i get that test box.
--
Reply all
Reply to author
Forward
0 new messages