"static_wrapper" imports in the FFI

Hello, I have implemented a small extension to the FFI which allows for "static_wrapper" imports. These are a variation on "wrapper" imports that do not use run-time code generation. This is important in security sensitive contexts because it avoids executable data. While "static_wrapper" imports are less general then "wrapper" imports, they can be used to install Haskell handlers in many C libraries where callbacks have an extra "user-data" parameter (e.g., GTK signal handlers). I have a darcs patch implementing the feature but I could not send it to the list because for some reason the patch is 150K long (!!! my changes are only ~50 lines) and the list has a 40K limit. What is the correct way to submit the patch, should I just commit it to the GHC tree? Here is an example, illustrating how "static_wrapper" imports work: foreign import ccall "static_wrapper" runHandler :: Int -> IO Bool This declaration will generate a C function that can call Haskell functions of the specified type. More concretely, the generated function has the following signature: HsBool runHandler(HsInt argument, HsStablePointer haskell_function); (i.e., given an integer and a pointer to a haskell closure of the correct type, we return a boolean computed by executing the closure). A common use case would be to install "runHandler" as the call-back in the C library, and pass the Haskell closure as the user-specified argument. By default, the closure argument is the last argument in the C function but, if necessary, this can be changed by using a type variable to indicate the position of the closure argument. For example, another way to write the previous example is: foreign import ccall "static_wrapper" runHandler :: Int -> closure -> IO Bool If in some C library the user-specified data is the second argument, then this is how we'd write the declaration: foreign import ccall "static_wrapper" runAnotherHandler :: Char -> closure -> Int -> IO Bool In addition to generating the C function, a "static_wrapper" declaration also imports the C function's address into Haskell, as if the programmer had written an import like this: -- First example foreign import ccall "&runHandler" runHandler :: FunPtr (Int -> StablePtr (Int -> IO Bool) -> IO Bool) -- Second example foreign import ccall "&runAnotherHandler" runAnotherHandler :: FunPtr (Int -> StablePtr (Int -> Char -> IO Bool) -> Char -> IO Bool) This address can be passed to the C library when installing the handler. I hope that you find this features useful! As usual, comments and feedback are most welcome. -Iavor

On March 15, 2010 12:48:02 Iavor Diatchki wrote:
I have implemented a small extension to the FFI which allows for "static_wrapper" imports. These are a variation on "wrapper" imports that do not use run-time code generation. This is important in security sensitive contexts because it avoids executable data. While "static_wrapper" imports are less general then "wrapper" imports, they can be used to install Haskell handlers in many C libraries where callbacks have an extra "user-data" parameter (e.g., GTK signal handlers).
Hi Iavor, Would not the following also do what you want foreign export ccall "haskellCIntCInt" \ cbind :: CInt -> StablePtr (CInt -> IO CInt) -> IO CInt cbind :: a -> StablePtr (a-> IO b) -> IO b cbind x f = deRefStablePtr f >>= (\f_ -> f_ x) On the C side you would then have something like register_callback(haskellCIntInt,<wrapped haskell closure>) where <wrapped haskell closure> would be a stable pointer of type StablePtr (CInt -> IO CInt) generated on the haskell side via newStablePtr <haskell closure> and passed to the C code. Cheers! -Tyson

Hi,
I think that one may view a "static_wrapper" import as a pair of an
export like the one you wrote and an import of the address of the
exported function (this is useful because usually it is convenient to
install the handler on the Haskell side). Perhaps that's a better way
to explain its meaning, rather then the long-winded example that I
wrote. Thanks!
In practice, the foreign export generates slightly less direct code,
because the C code follows 2 indirections: first we enter the closure
for "cbind", and then _that_ code enters the closure for the actual
Haskell function. Perhaps with sufficient optimization on the C side
this can be avoided although I don't think that it happens at the
moment.
In terms of notation, I like the directness of the "static_wrapper"
declaration (although not so much the "static_wrapper" name!) because
it avoids duplication, thus reducing clutter and potential errors.
-Iavor
On Mon, Mar 15, 2010 at 3:56 PM, Tyson Whitehead
On March 15, 2010 12:48:02 Iavor Diatchki wrote:
I have implemented a small extension to the FFI which allows for "static_wrapper" imports. These are a variation on "wrapper" imports that do not use run-time code generation. This is important in security sensitive contexts because it avoids executable data. While "static_wrapper" imports are less general then "wrapper" imports, they can be used to install Haskell handlers in many C libraries where callbacks have an extra "user-data" parameter (e.g., GTK signal handlers).
Hi Iavor,
Would not the following also do what you want
foreign export ccall "haskellCIntCInt" \ cbind :: CInt -> StablePtr (CInt -> IO CInt) -> IO CInt
cbind :: a -> StablePtr (a-> IO b) -> IO b cbind x f = deRefStablePtr f >>= (\f_ -> f_ x)
On the C side you would then have something like
register_callback(haskellCIntInt,<wrapped haskell closure>)
where <wrapped haskell closure> would be a stable pointer of type StablePtr (CInt -> IO CInt) generated on the haskell side via
newStablePtr <haskell closure>
and passed to the C code.
Cheers! -Tyson

On March 15, 2010 19:54:52 Iavor Diatchki wrote:
In terms of notation, I like the directness of the "static_wrapper" declaration (although not so much the "static_wrapper" name!) because it avoids duplication, thus reducing clutter and potential errors.
If it does get accepted, I would propose that adding a new closure form to the existing import and export forms might look a bit nicer. As in foreign closure ccall "cname" haskellname :: type gives you a C function (as you said) of the form result cname(arguments ..., HsStablePointer haskellname); This gets around the non-obviousness of an import also doing an export. If you didn't want to put the closure in the type, you could also support "first cname" and "last cname" (the default) versions to specify where the closure should be passed. Cheers! -Tyson

On 15/03/10 23:54, Iavor Diatchki wrote:
Hi, I think that one may view a "static_wrapper" import as a pair of an export like the one you wrote and an import of the address of the exported function (this is useful because usually it is convenient to install the handler on the Haskell side). Perhaps that's a better way to explain its meaning, rather then the long-winded example that I wrote. Thanks!
In practice, the foreign export generates slightly less direct code, because the C code follows 2 indirections: first we enter the closure for "cbind", and then _that_ code enters the closure for the actual Haskell function. Perhaps with sufficient optimization on the C side this can be avoided although I don't think that it happens at the moment.
In terms of notation, I like the directness of the "static_wrapper" declaration (although not so much the "static_wrapper" name!) because it avoids duplication, thus reducing clutter and potential errors.
It seems hard to justify adding this to GHC, since it's really just syntactic convenience for a particular case. Traditionally syntactic sugar for FFI declarations has been implemented in the preprocessing tools: c2hs and hsc2hs, whereas the FFI extension itself is purposefully minimal. So at the moment we're slightly inclined not to put it in - but feel free to make a compelling case. Note that as an extension in its own right it would need its own flag, documentation etc. Cheers, Simon
-Iavor
On Mon, Mar 15, 2010 at 3:56 PM, Tyson Whitehead
wrote: On March 15, 2010 12:48:02 Iavor Diatchki wrote:
I have implemented a small extension to the FFI which allows for "static_wrapper" imports. These are a variation on "wrapper" imports that do not use run-time code generation. This is important in security sensitive contexts because it avoids executable data. While "static_wrapper" imports are less general then "wrapper" imports, they can be used to install Haskell handlers in many C libraries where callbacks have an extra "user-data" parameter (e.g., GTK signal handlers).
Hi Iavor,
Would not the following also do what you want
foreign export ccall "haskellCIntCInt" \ cbind :: CInt -> StablePtr (CInt -> IO CInt) -> IO CInt
cbind :: a -> StablePtr (a-> IO b) -> IO b cbind x f = deRefStablePtr f>>= (\f_ -> f_ x)
On the C side you would then have something like
register_callback(haskellCIntInt,<wrapped haskell closure>)
where<wrapped haskell closure> would be a stable pointer of type StablePtr (CInt -> IO CInt) generated on the haskell side via
newStablePtr<haskell closure>
and passed to the C code.
Cheers! -Tyson
_______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Hello,
On Tue, Mar 16, 2010 at 3:22 PM, Simon Marlow
It seems hard to justify adding this to GHC, since it's really just syntactic convenience for a particular case. Traditionally syntactic sugar for FFI declarations has been implemented in the preprocessing tools: c2hs and hsc2hs, whereas the FFI extension itself is purposefully minimal.
The fact that, at present, all GHC-compiled programs require an executable data segment is a fairly significant problem. For example, SE Linux policies need to be adjusted for all GHC-compiled programs, even if run-time code generation never actually happens. I decided to implement this as a GHC patch because it seems more primitive then the "wrapper" imports: it is a simpler feature which---if it was available---would have been sufficient in all the situations where I have needed to use a "wrapper" import. Furthermore, the code that is called by the adjustor thunks is essentially the function that we are exposing in a "static_wrapper" import, so it seems plausible that "wrapper" imports can be implemented on top of this, although I have not done this. I thought of implementing the feature as a preprocessor but it did not seem very easy to do because we need to parse Haskell types. Of course, I could have either hacked up a simple parser, or used some kind of a Haskell parsing library but that seemed very heavy-weight. Also, preprocessors tend to complicate the build system, result in confusing error messages, and make it difficult to work with modules in GHCi. As far as I can see, the notation that I used does not conflict with anything, except possibly importing a C function named "static_wrapper" without specifying a header file, which is already a problem with "wrapper" imports. This would not be the case if we used something which is not a valid C identifier (e.g., "static"). This seems like a small enough change to not require a separate flag. If we decided to use Tyson's suggested syntax, then we should probably add a flag. In any case, I think that moving away from executable data is important enough that I'd be happy with an extra flag. Thoughts? -Iavor
So at the moment we're slightly inclined not to put it in - but feel free to make a compelling case. Note that as an extension in its own right it would need its own flag, documentation etc.
Cheers, Simon
-Iavor
On Mon, Mar 15, 2010 at 3:56 PM, Tyson Whitehead
wrote: On March 15, 2010 12:48:02 Iavor Diatchki wrote:
I have implemented a small extension to the FFI which allows for "static_wrapper" imports. These are a variation on "wrapper" imports that do not use run-time code generation. This is important in security sensitive contexts because it avoids executable data. While "static_wrapper" imports are less general then "wrapper" imports, they can be used to install Haskell handlers in many C libraries where callbacks have an extra "user-data" parameter (e.g., GTK signal handlers).
Hi Iavor,
Would not the following also do what you want
foreign export ccall "haskellCIntCInt" \ cbind :: CInt -> StablePtr (CInt -> IO CInt) -> IO CInt
cbind :: a -> StablePtr (a-> IO b) -> IO b cbind x f = deRefStablePtr f>>= (\f_ -> f_ x)
On the C side you would then have something like
register_callback(haskellCIntInt,<wrapped haskell closure>)
where<wrapped haskell closure> would be a stable pointer of type StablePtr (CInt -> IO CInt) generated on the haskell side via
newStablePtr<haskell closure>
and passed to the C code.
Cheers! -Tyson
_______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

On 03/16/10 19:38, Iavor Diatchki wrote:
The fact that, at present, all GHC-compiled programs require an executable data segment is a fairly significant problem.
...
I thought of implementing the feature as a preprocessor but it did not seem very easy to do because we need to parse Haskell types.
Something doesn't add up for me here. If *all* GHC-compiled programs require an executable data segment, then how could a preprocessor possibly remedy this problem? (and likewise, how does the static_wrapper patch do so...) -Isaac

On Mar 16, 2010, at 19:47 , Isaac Dupree wrote:
The fact that, at present, all GHC-compiled programs require an executable data segment is a fairly significant problem. Something doesn't add up for me here. If *all* GHC-compiled
On 03/16/10 19:38, Iavor Diatchki wrote: programs require an executable data segment, then how could a preprocessor possibly remedy this problem? (and likewise, how does the static_wrapper patch do so...)
A goodly chunk of the RTS uses the FFI to access host functions; presumably he also intends rewriting those to use the new import/ export type. -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH

Hi,
Optionally disabling executable heap blocks would be a separate patch.
As far as I know, the only reason that the heap is executable is to
support the adjustor thunks used to implement "wrapper" imports. The
"static_wrapper" patch provides a way to install Haskell callbacks in
many C libraries without the need for adjustor thunks.
-Iavor
On Tue, Mar 16, 2010 at 4:47 PM, Isaac Dupree
On 03/16/10 19:38, Iavor Diatchki wrote:
The fact that, at present, all GHC-compiled programs require an executable data segment is a fairly significant problem.
...
I thought of implementing the feature as a preprocessor but it did not seem very easy to do because we need to parse Haskell types.
Something doesn't add up for me here. If *all* GHC-compiled programs require an executable data segment, then how could a preprocessor possibly remedy this problem? (and likewise, how does the static_wrapper patch do so...)
-Isaac _______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

On March 16, 2010 20:01:32 Iavor Diatchki wrote:
Optionally disabling executable heap blocks would be a separate patch. As far as I know, the only reason that the heap is executable is to support the adjustor thunks used to implement "wrapper" imports. The "static_wrapper" patch provides a way to install Haskell callbacks in many C libraries without the need for adjustor thunks.
I believe this is the code in "rts/Adjustor.c" and "rts/sm/Storage.c". It (or it gets ffi to) write a small bit of assembler that adds a hard coded pointer (to a StablePtr) to the argument list and jump to a hard coded address. It then has to fiddle with the executable bits on the memory page it wrote the code into in order to allow the system the execute it. This leaves me to ask though, could you not also tighten up the security here by just getting the the system to turn off the writable bit when it also turns on the executable one? I realize this implies that you will only get one of these per page, but still that might not be that bad if you don't generate very many and recycle them. As a compromise, you could also just temporarily make pages writable when you add to them, thus greatly minimizing the attack window. If you could get the OS could freeze all other threads while doing this there would be no window. If there generation and usage is/could be localized to OS threads, then modification would always be safe if OS thread works on their own page. I scanned the ghc source (all c, h, cmm, hs, and lhs files), and the only usage of import "wrappers" seems to be in System.Console.Terminfo.Base. Cheers! -Tyson

Hello,
My point was that in many cases we can simply avoid run-time code
generation, rather then trying to work around the system's SE Linux
policy. While I believe that using the foreign "export" gives us the
same functional behavior, the generated code is certainly not the
same. I wrote a small benchmark to compare the two approaches and it
seems that the generated code is ~30% slower when using a foreign
export. As I mentioned in a previous post, I think that this is
because of the extra indirection that we have to follow. I am
attaching my GHC patch and the benchmark if anyone is interested in
playing around with it (Ganesh, thanks for the darcs tip---using
"darcs optimize --reorder" did the trick!)
-Iavor
PS: As a concrete example, Gtk2Hs uses numerous 'import "wrapper"'
declarations, which means that just adding a GUI to a Haskell app
requires you to allow making executable memory at run time. I've had
fairly serious difficulties when trying to explain why this happens to
programmers who are not Haskell implementors.
On Wed, Mar 17, 2010 at 8:21 AM, Tyson Whitehead
On March 16, 2010 20:01:32 Iavor Diatchki wrote:
Optionally disabling executable heap blocks would be a separate patch. As far as I know, the only reason that the heap is executable is to support the adjustor thunks used to implement "wrapper" imports. The "static_wrapper" patch provides a way to install Haskell callbacks in many C libraries without the need for adjustor thunks.
I believe this is the code in "rts/Adjustor.c" and "rts/sm/Storage.c". It (or it gets ffi to) write a small bit of assembler that adds a hard coded pointer (to a StablePtr) to the argument list and jump to a hard coded address. It then has to fiddle with the executable bits on the memory page it wrote the code into in order to allow the system the execute it.
This leaves me to ask though, could you not also tighten up the security here by just getting the the system to turn off the writable bit when it also turns on the executable one? I realize this implies that you will only get one of these per page, but still that might not be that bad if you don't generate very many and recycle them.
As a compromise, you could also just temporarily make pages writable when you add to them, thus greatly minimizing the attack window. If you could get the OS could freeze all other threads while doing this there would be no window. If there generation and usage is/could be localized to OS threads, then modification would always be safe if OS thread works on their own page.
I scanned the ghc source (all c, h, cmm, hs, and lhs files), and the only usage of import "wrappers" seems to be in System.Console.Terminfo.Base.
Cheers! -Tyson

On 17/03/2010 23:13, Iavor Diatchki wrote:
Hello,
My point was that in many cases we can simply avoid run-time code generation, rather then trying to work around the system's SE Linux policy. While I believe that using the foreign "export" gives us the same functional behavior, the generated code is certainly not the same. I wrote a small benchmark to compare the two approaches and it seems that the generated code is ~30% slower when using a foreign export. As I mentioned in a previous post, I think that this is because of the extra indirection that we have to follow. I am attaching my GHC patch and the benchmark if anyone is interested in playing around with it (Ganesh, thanks for the darcs tip---using "darcs optimize --reorder" did the trick!)
Part of the reason is that deRefStablePtr# isn't inlined in Haskell, whereas it is in C, so there's a lot of extra shuffling going on to make an out-of-line call to the deRefStablePtr# primop. If we care about this it can be fixed quite easily. Furthermore, if we really care about callback performance there's probably a factor of 2 to be had just by generating better code in the stub. Currently we make one call to allocate() for each closure, and we make a chain of application nodes. If instead we made one call to allocate(), generated inline code to create the closures, and used a multi-argument application, that would speed things up a lot. So I guess I'm saying the particular optimisation of static_wrapper seems less urgent than some others we could do which would benefit everyone and don't require adding extensions or changing programs.
-Iavor
PS: As a concrete example, Gtk2Hs uses numerous 'import "wrapper"' declarations, which means that just adding a GUI to a Haskell app requires you to allow making executable memory at run time. I've had fairly serious difficulties when trying to explain why this happens to programmers who are not Haskell implementors.
So are you saying you've run into problems where SE Linux is refusing to run GHC-compiled binaries? Is that because the system is using a strict SE Linux configuration of some kind? Do these same people understand why ld.so needs to allocate executable and writable memory? Or Firefox? etc. Don't other languages (e.g. Python) use libffi too? Cheers, Simon
On Wed, Mar 17, 2010 at 8:21 AM, Tyson Whitehead
wrote: On March 16, 2010 20:01:32 Iavor Diatchki wrote:
Optionally disabling executable heap blocks would be a separate patch. As far as I know, the only reason that the heap is executable is to support the adjustor thunks used to implement "wrapper" imports. The "static_wrapper" patch provides a way to install Haskell callbacks in many C libraries without the need for adjustor thunks.
I believe this is the code in "rts/Adjustor.c" and "rts/sm/Storage.c". It (or it gets ffi to) write a small bit of assembler that adds a hard coded pointer (to a StablePtr) to the argument list and jump to a hard coded address. It then has to fiddle with the executable bits on the memory page it wrote the code into in order to allow the system the execute it.
This leaves me to ask though, could you not also tighten up the security here by just getting the the system to turn off the writable bit when it also turns on the executable one? I realize this implies that you will only get one of these per page, but still that might not be that bad if you don't generate very many and recycle them.
As a compromise, you could also just temporarily make pages writable when you add to them, thus greatly minimizing the attack window. If you could get the OS could freeze all other threads while doing this there would be no window. If there generation and usage is/could be localized to OS threads, then modification would always be safe if OS thread works on their own page.
I scanned the ghc source (all c, h, cmm, hs, and lhs files), and the only usage of import "wrappers" seems to be in System.Console.Terminfo.Base.
Cheers! -Tyson
_______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

On 16/03/10 23:38, Iavor Diatchki wrote:
Hello,
On Tue, Mar 16, 2010 at 3:22 PM, Simon Marlow
wrote: It seems hard to justify adding this to GHC, since it's really just syntactic convenience for a particular case. Traditionally syntactic sugar for FFI declarations has been implemented in the preprocessing tools: c2hs and hsc2hs, whereas the FFI extension itself is purposefully minimal.
The fact that, at present, all GHC-compiled programs require an executable data segment is a fairly significant problem. For example, SE Linux policies need to be adjusted for all GHC-compiled programs, even if run-time code generation never actually happens.
GHC-compiled programs don't need an executable data segment. There are two features that require dynamically-allocated executable memory: the GHCi linker, and foreign import "wrapper". However, you don't have to use either! As noted earlier in this thread, you can use foreign export to do the same thing that static_wrapper provides, so we're not getting any new functionality here. Regarding SELinux, we use libffi which works around the SELinux restrictions using a double-mmaping trick. GHC executables do not require an SELinux exception - I've tried this on our Fedora systems with SE Linux enabled. It was fixed in 6.10.1: http://hackage.haskell.org/trac/ghc/ticket/738
I decided to implement this as a GHC patch because it seems more primitive then the "wrapper" imports: it is a simpler feature which---if it was available---would have been sufficient in all the situations where I have needed to use a "wrapper" import.
But as pointed out earlier, you don't need this extenstion to do what you wanted. It's just a syntactic convenience - that's the substance of our objection to adding it.
Furthermore, the code that is called by the adjustor thunks is essentially the function that we are exposing in a "static_wrapper" import, so it seems plausible that "wrapper" imports can be implemented on top of this, although I have not done this.
Probably you could, yes.
I thought of implementing the feature as a preprocessor but it did not seem very easy to do because we need to parse Haskell types. Of course, I could have either hacked up a simple parser, or used some kind of a Haskell parsing library but that seemed very heavy-weight. Also, preprocessors tend to complicate the build system, result in confusing error messages, and make it difficult to work with modules in GHCi.
I don't disagree with the second point - but for better or worse we already have this split between low-level FFI code and preprocessors, and adding syntactic sugar to FFI declarations seems to be going against the grain.
As far as I can see, the notation that I used does not conflict with anything, except possibly importing a C function named "static_wrapper" without specifying a header file, which is already a problem with "wrapper" imports. This would not be the case if we used something which is not a valid C identifier (e.g., "static"). This seems like a small enough change to not require a separate flag. If we decided to use Tyson's suggested syntax, then we should probably add a flag.
Extensions always require a flag, because the extension is by definition not universally supported, so code that uses it has to indicate that. We started being strict about this a while ago, it would be wrong to start introducing exceptions (albeit minor ones).
In any case, I think that moving away from executable data is important enough that I'd be happy with an extra flag. Thoughts?
If that were the case then yes I'd agree, but I don't think it is. Cheers, Simon
-Iavor
So at the moment we're slightly inclined not to put it in - but feel free to make a compelling case. Note that as an extension in its own right it would need its own flag, documentation etc.
Cheers, Simon
-Iavor
On Mon, Mar 15, 2010 at 3:56 PM, Tyson Whitehead
wrote: On March 15, 2010 12:48:02 Iavor Diatchki wrote:
I have implemented a small extension to the FFI which allows for "static_wrapper" imports. These are a variation on "wrapper" imports that do not use run-time code generation. This is important in security sensitive contexts because it avoids executable data. While "static_wrapper" imports are less general then "wrapper" imports, they can be used to install Haskell handlers in many C libraries where callbacks have an extra "user-data" parameter (e.g., GTK signal handlers).
Hi Iavor,
Would not the following also do what you want
foreign export ccall "haskellCIntCInt" \ cbind :: CInt -> StablePtr (CInt -> IO CInt) -> IO CInt
cbind :: a -> StablePtr (a-> IO b) -> IO b cbind x f = deRefStablePtr f>>= (\f_ -> f_ x)
On the C side you would then have something like
register_callback(haskellCIntInt,<wrapped haskell closure>)
where<wrapped haskell closure> would be a stable pointer of type StablePtr (CInt -> IO CInt) generated on the haskell side via
newStablePtr<haskell closure>
and passed to the C code.
Cheers! -Tyson
_______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

On Mon, Mar 15, 2010 at 09:48:02AM -0700, Iavor Diatchki wrote:
I have a darcs patch implementing the feature but I could not send it to the list because for some reason the patch is 150K long (!!! my changes are only ~50 lines) and the list has a 40K limit.
I've just tagged the repo, so if you pull then you should get a much smaller patch file generated. Thanks Ian

Hello,
after I pulled and made the darcs patch again, now it is 116K, which
is still too big to send to the list. If I gzip it, then it becomes
44K, which is almost the right size. For reference, if I use "darcs
diff" to compute the changes, the resulting patch is 2.8K. Let me
know how to proceed.
-Iavor
On Mon, Mar 15, 2010 at 5:57 PM, Ian Lynagh
On Mon, Mar 15, 2010 at 09:48:02AM -0700, Iavor Diatchki wrote:
I have a darcs patch implementing the feature but I could not send it to the list because for some reason the patch is 150K long (!!! my changes are only ~50 lines) and the list has a 40K limit.
I've just tagged the repo, so if you pull then you should get a much smaller patch file generated.
Thanks Ian

Try darcs optimize --reorder in your repo, or pull your patch into a freshly got repo. (Annoying internal detail of darcs - it probably won't use the tag unless it's "clean", which requires that any patches not included in the tag should be after it in the repo order)
-----Original Message-----
From: glasgow-haskell-users-bounces@haskell.org [mailto:glasgow-haskell-users-bounces@haskell.org] On Behalf Of Iavor Diatchki
Sent: 16 March 2010 20:41
To: Iavor Diatchki; GHC Users Mailing List
Subject: Re: "static_wrapper" imports in the FFI
Hello,
after I pulled and made the darcs patch again, now it is 116K, which is still too big to send to the list. If I gzip it, then it becomes 44K, which is almost the right size. For reference, if I use "darcs diff" to compute the changes, the resulting patch is 2.8K. Let me know how to proceed.
-Iavor
On Mon, Mar 15, 2010 at 5:57 PM, Ian Lynagh
On Mon, Mar 15, 2010 at 09:48:02AM -0700, Iavor Diatchki wrote:
I have a darcs patch implementing the feature but I could not send it to the list because for some reason the patch is 150K long (!!! my changes are only ~50 lines) and the list has a 40K limit.
I've just tagged the repo, so if you pull then you should get a much smaller patch file generated.
Thanks Ian
_______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users =============================================================================== Please access the attached hyperlink for an important electronic communications disclaimer: http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html ===============================================================================
participants (7)
-
Brandon S. Allbery KF8NH
-
Ian Lynagh
-
Iavor Diatchki
-
Isaac Dupree
-
Simon Marlow
-
Sittampalam, Ganesh
-
Tyson Whitehead