Re: [Chicken-users] Openssl with csc -deploy

2015-05-10 Thread Nick Van Horn
 Peter Bex pe...@more-magic.net writes:
 At least in http-client there is no easy hook.  But perhaps you could
 tweak the sources of http-client to make openssl a hard dependency.
 Simply add (use openssl) and remove the definition of ssl-connect.

It seems like tweaking the source should work, but...

 Evan Hanson ev...@foldling.org writes:
 ...so for now can you just try adding
 `chicken-install -i foo` to your build process and see if this works?

This indeed solves the problem for now, without having to tweak any
other packages. Thanks for the tip Evan!

In summary to those who may come later, I am able to successfully deploy
my application by:

$ csc -deploy foo
$ chicken-install -i foo
$ chicken-install -deploy -p foo http-client openssl

Thanks again for the help Peter and Evan!

Cheers,
Nick

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Openssl with csc -deploy

2015-05-08 Thread Peter Bex
On Thu, May 07, 2015 at 11:40:40PM -0400, Nick Van Horn wrote:
 Thanks for the reply Peter.
 
  This won't help because Spiffy has a run-time dependency on openssl,
  which it tries to load via something like this:
 
  (define ssl-port?
(handle-exceptions _ #f (eval `(let () (use ssl) ssl-port?
 
  The idea is that on Windows openssl is too painful to install, so making
  it a hard dependency is considered obnoxious.
 
 Perhaps I should have listed the extensions that I'm using, as I'm not
 in fact using Spiffy. I'm using rest-bind, http-client, oauth, and their
 dependencies for retrieving web data over a secure connection. 

Oh, sorry.  I misunderstood.  http-client _also_ has this openssl hack,
but I forgot about that so I somehow assumed you were using Spiffy.

 Trying to run the eval you supplied in my deployed application (csc
 -deploy foo.scm) leads to the error:
 
 Error: during expansion of (import ...) - module not found: openssl

Then this is probably a bug: it seems that in deploy mode, evaled code
does not use the deployment search path.  I've created a ticket to track
this bug: https://bugs.call-cc.org/ticket/1191

 What is curious is that my attempts to load the openssl module with
 `use`, `require-extension`, and the like prior to this test does *not*
 lead to this error when I run my unmodified application.

Yeah, but those use statements are evaluated at compile-time.

 In fact, the missing openssl module is only noticed downstream, when
 my original error is thrown by http-client.

I don't understand what you mean by that.

Cheers,
Peter


signature.asc
Description: Digital signature
___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Openssl with csc -deploy

2015-05-08 Thread Nick Van Horn
 Then this is probably a bug: it seems that in deploy mode, evaled code
 does not use the deployment search path.  I've created a ticket to track
 this bug: https://bugs.call-cc.org/ticket/1191

Great---thanks for doing this. This bug has derailed my plans to deploy
this application on other machines. Hopefully the solution is simple
enough to see this fixed someday soon.

Is there any possible quick-fix to use in the meantime, so that I can
begin testing things in my deployed environment?

 Yeah, but those use statements are evaluated at compile-time.

Ah, that makes sense.

 In fact, the missing openssl module is only noticed downstream, when
 my original error is thrown by http-client.

 I don't understand what you mean by that.

I only mean that I hadn't noticed this bug until I tried a secure
connection with http-client. The other aspects of my application had
been working fine in interpreted and deployed versions of the code. This
was surprising to me until you clarified the compile-time evaluation.

Thanks again!
Nick

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Openssl with csc -deploy

2015-05-08 Thread Peter Bex
On Fri, May 08, 2015 at 11:52:06AM -0400, Nick Van Horn wrote:
  Then this is probably a bug: it seems that in deploy mode, evaled code
  does not use the deployment search path.  I've created a ticket to track
  this bug: https://bugs.call-cc.org/ticket/1191
 
 Great---thanks for doing this. This bug has derailed my plans to deploy
 this application on other machines. Hopefully the solution is simple
 enough to see this fixed someday soon.
 
 Is there any possible quick-fix to use in the meantime, so that I can
 begin testing things in my deployed environment?

Sorry, I don't think there's any hook that allows for overriding any
of this.  I don't understand this module loading code very well yet,
so perhaps one of the other core maintainers can weigh in on this.

At least in http-client there is no easy hook.  But perhaps you could
tweak the sources of http-client to make openssl a hard dependency.
Simply add (use openssl) and remove the definition of ssl-connect.

Cheers,
Peter


signature.asc
Description: Digital signature
___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Openssl with csc -deploy

2015-05-08 Thread Evan Hanson
Hi Nick,

I've used the following commands for this. The only difference is the
third command, which copies CHICKEN's core libraries into the deployment
directory. I have a hunch as to why this makes the difference, but it's
orthogonal to your problem, so for now can you just try adding
`chicken-install -i foo` to your build process and see if this works?

$ cat foo.scm
(use http-client)
(print (call-with-input-request https://call-cc.org; #f (cut read-string 
#f )))
$ csc -deploy foo
$ chicken-install -i foo
$ chicken-install -p foo -deploy http-client openssl
$ ./foo/foo
[... response ...]

Cheers,

Evan


signature.asc
Description: Digital signature
___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Openssl with csc -deploy

2015-05-07 Thread Peter Bex
On Thu, May 07, 2015 at 01:19:34AM -0400, Nick Van Horn wrote:
 The problem arises when I try to deploy with:
 
 csc -deploy foo.scm
 chicken-install -deploy -p ./foo openssl [... +other extensions]
 
 Both commands run without error. All extensions install in the
 deployment repository without (any obvious) error. However, running the
 newly created executable generates the error:
 
 Error: (ssl-connect) Unable to connect over HTTPS. To fix this, install
 the openssl egg and try again:

[...]

 My application uses a custom egg that implicitly imports openssl. I've
 added an explicit (use openssl) in each file of the program, but this
 hasn't helped.

Hello Nick,

This won't help because Spiffy has a run-time dependency on openssl,
which it tries to load via something like this:

(define ssl-port?
  (handle-exceptions _ #f (eval `(let () (use ssl) ssl-port?

The idea is that on Windows openssl is too painful to install, so making
it a hard dependency is considered obnoxious.

 Can anyone suggest what might be causing this problem? For what it's
 worth, including (use chicken-syntax) did not solve this problem...

Can you try what it prints when you run the eval above from your deployed
application and then display the value of ssl-port??  It may be that
deployment mode has trouble loading libraries in eval, or perhaps the
dynamic dependency in Spiffy is broken somehow.

Cheers,
Peter


signature.asc
Description: Digital signature
___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] Openssl with csc -deploy

2015-05-06 Thread Nick Van Horn
Hello all,

I have a problem similar to a recent post
(http://lists.nongnu.org/archive/html/chicken-users/2014-10/msg00030.html)
involving compiling an application that uses the openssl egg.

The application runs interpreted via csi -s with no problems. I can also
compile the program with 'csc foo.scm -o foo' and run the executable foo
with no problems.

The problem arises when I try to deploy with:

csc -deploy foo.scm
chicken-install -deploy -p ./foo openssl [... +other extensions]

Both commands run without error. All extensions install in the
deployment repository without (any obvious) error. However, running the
newly created executable generates the error:

Error: (ssl-connect) Unable to connect over HTTPS. To fix this, install
the openssl egg and try again:

Call history:

http-client.scm:507: g886 
http-client.scm:616: intarweb#request-uri 
http-client.scm:616: close-connection!
http-client.scm:161: ensure-local-connections 
http-client.scm:129: connections-owner
http-client.scm:164: connections  
http-client.scm:164: hash-table-ref/default   
http-client.scm:122: open-output-string   
http-client.scm:122: ##sys#check-output-port  
http-client.scm:122: uri-common#uri-host  
http-client.scm:122: ##sys#print  
http-client.scm:122: ##sys#write-char-0   
http-client.scm:122: uri-common#uri-port  
http-client.scm:122: ##sys#print  
http-client.scm:122: get-output-string
http-client.scm:617: raise

My application uses a custom egg that implicitly imports openssl. I've
added an explicit (use openssl) in each file of the program, but this
hasn't helped.

Can anyone suggest what might be causing this problem? For what it's
worth, including (use chicken-syntax) did not solve this problem...

I'm using Chicken:

Version 4.9.0.1 (stability/4.9.0) (rev 8b3189b)
linux-unix-gnu-x86-64 [ 64bit manyargs dload ptables ]
bootstrapped 2014-06-07

Thanks,
Nick

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users