Bref: Laravel's `bootstrap` directory collides with AWS Lambda's bootstrap file

Created on 3 Jan 2019  Â·  10Comments  Â·  Source: brefphp/bref

Most helpful comment

We are willing to dig in and resolve this if no one else is already working on it. Laravel on Lambda is a particular passion of ours. :-)

All 10 comments

We are willing to dig in and resolve this if no one else is already working on it. Laravel on Lambda is a particular passion of ours. :-)

@bubba-h57 I think you can go ahead, I am focused on #132 and the documentation at the moment.

Wouldn't it be easiest to just create a directory for all application code? Like 'app' or 'build'. Would also make it easier to use Composer in the bootstrap if required, without colliding with the project Composer vendor dir.

That would work but I think that's too bad :/ (ideally we should keep it simple, deploying in a sub-directory could affect stuff we are not thinking about)

I wonder if we can report that to AWS somehow? The fact that the directory collides with the file is more of a bug I think. If it's a directory it should not be picked up by Lambda.

@pmayet do you see this problem:

  • on Lambda?
  • locally in SAM?

or in both?

Maybe it's just a bug in sam local.

What would it affect, you could just change the working dir from the bootstrap? I think it would be easier to change in Bref then convince AWS to change their platform :p

Yes but I guess there will be the same problem in other applications, the fact that the bootstrap directory is attempted to be executed is a bug. But you are right, even if they want to fix it it will take time…

I'm thinking about how all the documentation everywhere mentions that your app runs in /var/task and with Bref it would be a different directory because of this. I think those little complexities might have small impacts in a few places.

In any case what we can do is document this, but since we deploy with SAM (template.yaml + sam deploy) I'm not sure that Bref can help here (at least with how it works now).

@bubba-h57 did you have a solution in mind?

Also how hard is it to rename the bootstrap directory in a fresh Laravel application? Maybe it's worth exploring that too 🤔

That would work but I think that's too bad :/ (ideally we should keep it simple, deploying in a sub-directory could affect stuff we are not thinking about)

I wonder if we can report that to AWS somehow? The fact that the directory collides with the file is more of a bug I think. If it's a directory it should not be picked up by Lambda.

@pmayet do you see this problem:

  • on Lambda?
  • locally in SAM?

or in both?

Maybe it's just a bug in sam local.

locally in SAM.

I check with a root directory as indicated by @barryvdh

Change the name of bootstrap directory isn't possible or tricky, because I think hard coded in the framework.

So, locally, create a directory for the application (src by example), and place the the template.yaml at the root directory.

In the template.yaml, specify the directory in the CodeUri
CodeUri: ./src/

I have make a new test with Lumen, no problem with the boostrap directory with Function and the new runtime.

I think you can close this issue @mnapoli .

Oh okay that's perfect!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

anandvns picture anandvns  Â·  8Comments

mnapoli picture mnapoli  Â·  6Comments

akondas picture akondas  Â·  7Comments

tlfbrito picture tlfbrito  Â·  4Comments

spaceemotion picture spaceemotion  Â·  8Comments