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

Fails with /usr/local/bin/build.sh: line 35: //.cargo/env: No such file or directory #84

Open
smirnoal opened this issue Jan 28, 2021 · 6 comments

Comments

@smirnoal
Copy link

it may be a bug in Rust installer, but build.sh fails with error

% docker run --rm \     
    -u $(id -u):$(id -g) \
    -v ${PWD}:/code \
    -v ${HOME}/.cargo/registry:/cargo/registry \
    -v ${HOME}/.cargo/git:/cargo/git \
    softprops/lambda-rust
/usr/local/bin/build.sh: line 35: //.cargo/env: No such file or directory
@ggomagundan
Copy link

I have this issue too

@snydergd
Copy link

snydergd commented Feb 19, 2021

I have this issue as well. If I run the container without a different/non-root uid, it works fine (uses /root/.cargo/env).

Running OSX Big Sur with Docker installed through the homebrew cask.

$HOME appears to come through as / for me (thus, the error on line 53 -- . $HOME/.cargo/env). My uid/gid are 501/20.

find / -iname .cargo in the container as root only turns up that one in /root/.cargo.

That script appears to be the entrypoint, and nothing in it seems to be installing cargo or setting up a .cargo directory (imagine it's probably part of the build). I don't think there's any chance the script could skip line 53, either.

As a workaround, you could probably add an additional volume for /.cargo/ with the necessary env file in it, but that's a lot of work and you'd have to figure out what to put in that file. Or if you trust it, I suppose you could run as root. As mentioned, the ownership/permissions might get a little wonky when you build, but you could change them back with chown.

@alisonjenkins
Copy link

I also just hit this issue but was able to resolve it by building the container from master.

Try cloning the repo and just running make build in the root of the repo. Annoyingly this means that the fix will only apply to your local docker install so won't help if you are using CICD. For that case you will need to push to a container registry and use your repository until a fixed build is pushed to the softprops repo.

@RaviH
Copy link

RaviH commented Apr 19, 2021

Hello, any update on this? While we can build it locally as @alanjjenkins mentioned above, it would be great if we didn't have to do this intermediary step. Thanks!

@encee
Copy link

encee commented Jul 29, 2021

Any update on this? Thanks!

@amritabithi
Copy link

amritabithi commented Aug 13, 2022

To fix this, run the following command to open /home/<your_user>/.bashrc :
gedit ~/.bashrc

And just delete the line that will say something like:
. "$HOME/.cargo/env"

Save the file and open a new terminal and you should no longer see the error.

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

No branches or pull requests

7 participants