erlyaws / yaws

Yaws webserver
https://erlyaws.github.io
BSD 3-Clause "New" or "Revised" License
1.28k stars 267 forks source link

Unable to use with rebar3 + LFE on OS X #249

Closed yurrriq closed 8 years ago

yurrriq commented 8 years ago

Sorry for the lack of description on this and the previous issue, but I'm too tired at the moment.. I'll be happy to answer any clarifying questions and try out potential solutions tomorrow and beyond.

Cheers!

=INFO REPORT==== 8-Dec-2015::02:23:35 ===
Yaws: Listening to 0.0.0.0:5099 for <1> virtual servers:
 - http://localhost:5099 under ~/src/example/www

=INFO REPORT==== 8-Dec-2015::02:23:35 ===
stop_ready([], <0.48.0>)

=INFO REPORT==== 8-Dec-2015::02:23:35 ===
    application: yaws
    exited: {{shutdown,
                 {failed_to_start_child,yaws_sup_restarts,
                     {shutdown,
                         {failed_to_start_child,yaws_sendfile,
                             {error,
                                 "could not load driver yaws_sendfile_drv"}}}}},
             {yaws_app,start,[normal,[]]}}
    type: permanent
{"Kernel pid terminated",application_controller,"{application_start_failure,yaws,{{shutdown,{failed_to_start_child,yaws_sup_restarts,{shutdown,{failed_to_start_child,yaws_sendfile,{error,\"could not load driver yaws_sendfile_drv\"}}}}},{yaws_app,start,[normal,[]]}}}"}

Crash dump is being written to: erl_crash.dump...done
Kernel pid terminated (application_controller) ({application_start_failure,yaws,{{shutdown,{failed_to_start_child,yaws_sup_restarts,{shutdown,{failed_to_start_child,yaws_sendfile,{error,"could not l
capflam commented 8 years ago

About the issue #248, the problem is about a bug in Yaws-2.0. It was fixed in Yaws-2.0.2. For this one, yaw_sendfile_drv cannot be loaded for any reason. If you compiled Yaws on the same machine, it is probably a problem with rebar or the way Yaws is "installed". By looking closer, yaws_sendfile_drv binary should by placed in the directory priv/lib, relatively to the yaws application directory.

Can you check the location of yaws_sendfile_drv binary ?

oubiwann commented 8 years ago

I can confirm that this is working with LFE and YAWS 2.0.2.

The problem that some users may encounter is that rebar3 (which the LFE community is in the process of migrating to) does not compile this driver.

If all the deps are present on a Linux system, the following target should work in an LFE+YAWS project's Makefile:

compile:
    rebar3 compile
    cd $(YAWS_DIR) && \
    autoreconf -fi && \
    ./configure && \
    make

Without this (or an analogous step) the YAWS error reported by @yurrriq above will be seen.

vinoski commented 8 years ago

For rebar we had to use capabilities such as rebar.config.script and .app.src.script to be able to build Yaws successfully. (Interestingly, Yaws won't build with any rebar newer than early Dec 2015 because they introduced a .app.src.script bug into rebar around then.)

But rebar3 is a different story, as it's quite different than rebar. To the best of my knowledge nobody has yet done any of the real work needed to make Yaws work with it.

yurrriq commented 8 years ago

There may be a solution involving pre_hooks and the pc rebar3 plugin. I've had similar success with eleveldb and similar.

vinoski commented 8 years ago

Oh, there's definitely a solution with rebar3, that doesn't worry me at all. It's simply a matter of someone finding the time to implement it.

yurrriq commented 8 years ago

I don't use yaws, but I can take a look. I've been solving similar problems somewhat often lately.

yurrriq commented 8 years ago

Closing this as a duplicate of of #254 and since Duncan has a solid fix.

oubiwann commented 8 years ago

For rebar we had to use capabilities such as rebar.config.script and .app.src.script to be able to build Yaws successfully. (Interestingly, Yaws won't build with any rebar newer than early Dec 2015 because they introduced a .app.src.script bug into rebar around then.)

But rebar3 is a different story, as it's quite different than rebar. To the best of my knowledge nobody has yet done any of the real work needed to make Yaws work with it.

Steve, given that newer rebar doesn't work with YAWS, would you be willing to ditch it in favor of rebar3?

I ask because the config files between the two versions aren't 100% compatible and it would make things easier if we only had to support one :-)

I use YAWS a great deal, so this is something that would make my life easier and that I can actually start tackling today.

oubiwann commented 8 years ago

I've created a "proposal" ticket for the work with #262.

vinoski commented 8 years ago

@oubiwann: I think dropping rebar and going with rebar3 is fine. I knew trying to support both would be a pain, and it's not really worth it especially in the long run. The future is clearly rebar3.

bartima3us commented 7 years ago

As I understand, this bug still not fixed? Because I get the same error with latest Yaws like @yurrriq in 2015.

vinoski commented 7 years ago

Correct. There's a feature rebar provides that Yaws uses — in fact it may have even been added to rebar originally for Yaws — but it's not available in rebar3. I spoke to the rebar3 folks recently about it and they don't want to support it because only one or two apps use it. So, devising some other approach is necessary.