Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: editable dependencies in Python breaks build command #818

Open
sthulb opened this issue Nov 30, 2018 · 8 comments
Open

build: editable dependencies in Python breaks build command #818

sthulb opened this issue Nov 30, 2018 · 8 comments

Comments

@sthulb
Copy link
Contributor

sthulb commented Nov 30, 2018

Currently, sam build uses a requirements.txt file to install dependancies, if a dep is marked as editable (-e in the file), it causes the build command to break with:
OSError: [Errno 30] Read-only file system: '/tmp/samcli/source/src'

This could potentially causes issues in a number of situations, most notably, people who use the same requirements.txt file for development and for build.

Ideally, sam build would strip/sanitise the requirements.txt to remove any flags for the build command.


SAM CLI Version: 0.8.0

@jfuss jfuss added the area/build sam build command label Nov 30, 2018
@brysontyrrell
Copy link
Contributor

I ran into this today too.

@jfuss jfuss added this to the SAM Build Backlog milestone Dec 27, 2018
@dhruvsood dhruvsood removed this from the SAM Build Backlog milestone Jan 18, 2019
@kornicameister
Copy link

kornicameister commented Jul 31, 2020

Ditto. I ran into this when building from a privately hosted repository.

-e "git+https://kornicameister:uberpassword@ubergit.repo.com/uberrepo.git@master#eqq=uberlib&subdirectory=pkgs/uberlib`

so uber-sad :(


sam --version: SAM CLI, version 1.0.0

@cdaniluk
Copy link

cdaniluk commented Aug 1, 2020

This has been sitting open for close to 2 years..

@kornicameister
Copy link

Yeah...time to invest some time and fix? :D

@irineul
Copy link

irineul commented Nov 25, 2020

That's critical! How to work around it?

@kornicameister
Copy link

kornicameister commented Nov 26, 2020

I'd say that one approach to deal with that could be putting something you -e in requirements into separate layer. End result, in lambda runtime, is actually indistinguishable from a requirements file that says -e.

PS. IMHO because I haven't tested that. It just seems reasonable to assume that.
PS2. -e can still be used in another requirements file like test-requirements.txt or dev-requirements.txt used solely in development but not when sam build rolls over the project.

@obi-t4
Copy link

obi-t4 commented Jan 6, 2021

This might be the workaround:
https://stackoverflow.com/a/63668855

@yucer
Copy link

yucer commented Jun 21, 2021

PS2. -e can still be used in another requirements file like test-requirements.txt or dev-requirements.txt used solely in development but not when sam build rolls over the project.

I would like to point out another possible scenario that could result into non-production dependencies being used into requirements.txt with one editable version. And it is related to the time gap into the project release and those of its dependencies and how they influences "emergency deployments".

For example:

The project upgraded the whole set of dependencies, but one of them comes with a recently discovered error in the context of your system. At this point it might be that you can not downgrade a version because your database or other set of dependencies was already upgraded. Given that is already being used in prod, you need to take more actions after reporting the issue because your system needs to keep going. If the dependency project is slow to fix regressions:

  • make one emergency fork of the deployed version perform there the necessary fixes
  • deploy the patched dependency from your forked repository.
  • Once the upstream project fixed issue, you deploy upstream version from the original repository again.

It is advisable to do that, just in case that you have knowledge of over the dependency project (for example, you belong to its development community).

Interesting from this case... is that the repository might even public, so it doesn't need credentials... but you would still get the error:

`OSError: [Errno 30] Read-only file system: '/tmp/samcli/source/src'

The error is related more to the editable nature of the dependency deployment than to the private nature of the repository. What I mean is that somehow this discussion has been deviated from the former to the later.

The original problem was not related to specify the credentials of the private repository, it was related to the read-only nature of the path were the editable dependency is going to be installed to. It can also happen in public code that doesn't need authentication.

Am I missing something ? Or still more work is needed here ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants