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

cygpath: not found in linux #10487

Open
adhami3310 opened this issue Jan 11, 2025 · 6 comments · Fixed by #10497 · May be fixed by #10492
Open

cygpath: not found in linux #10487

adhami3310 opened this issue Jan 11, 2025 · 6 comments · Fixed by #10497 · May be fixed by #10492
Assignees
Labels
bug Something isn't working

Comments

@adhami3310
Copy link

Regression in 0.5.17

I cannot particularly replicate this easily (happens inside of the docker build step). As far as I tested, $OSTYPE is linux-gnu.

/bin/sh: 82: /home/reflexuser/venv/bin/activate: cygpath: not found

The relevant code is:

if { [ "$OSTYPE" = "cygwin" ] || [ "$OSTYPE" = "msys" ]; } && command -v cygpath &> /dev/null ; then
    VIRTUAL_ENV=$(cygpath -u "$VIRTUAL_ENV")
fi

I don't see how it can reach the second file without cygpath not being available.

Docker file:

FROM public.ecr.aws/p3v4g4o2/reflex-cloud-base:v0.0.7-py3.12

ARG USERNAME=reflexuser
USER $USERNAME
ARG APP_DIR=/home/$USERNAME/app
ARG VENV_DIR=/home/$USERNAME/venv

RUN pip install uv
RUN /home/$USERNAME/.local/bin/uv venv --no-cache $VENV_DIR
RUN chmod +x $VENV_DIR/bin/activate


COPY --chown=$USERNAME . $APP_DIR

# FAILS HERE
RUN . $VENV_DIR/bin/activate && /home/$USERNAME/.local/bin/uv pip install --no-color -q -r $APP_DIR/requirements.txt
@charliermarsh
Copy link
Member

\cc @Gankra for when you have time

@charliermarsh charliermarsh added the bug Something isn't working label Jan 11, 2025
@charliermarsh
Copy link
Member

Do you know what the base image for public.ecr.aws/p3v4g4o2/reflex-cloud-base:v0.0.7-py3.12 is?

@zanieb
Copy link
Member

zanieb commented Jan 11, 2025

This line did change in #10397, before:

if ([ "$OSTYPE" = "cygwin" ] || [ "$OSTYPE" = "msys" ]) && $(command -v cygpath &> /dev/null) ; then

after

if { [ "$OSTYPE" = "cygwin" ] || [ "$OSTYPE" = "msys" ]; } && command -v cygpath &> /dev/null ; then

@zanieb
Copy link
Member

zanieb commented Jan 11, 2025

I reproduced with some debug output

 => CACHED [6/9] RUN cp /home/reflexuser/venv/bin/activate /home/reflexuser/venv/bin/activate.bak                                                                                                                                                        0.0s
 => CACHED [7/9] RUN echo 'set -x' > /home/reflexuser/venv/bin/activate                                                                                                                                                                                  0.0s
 => CACHED [8/9] RUN cat "/home/reflexuser/venv/bin/activate.bak" >> /home/reflexuser/venv/bin/activate                                                                                                                                                  0.0s
 => ERROR [9/9] RUN . /home/reflexuser/venv/bin/activate && /home/reflexuser/.local/bin/uv pip install --no-color -q -r /home/reflexuser/app/requirements.txt                                                                                            0.2s
------                                                                                                                                                                                                                                                        
 > [9/9] RUN . /home/reflexuser/venv/bin/activate && /home/reflexuser/.local/bin/uv pip install --no-color -q -r /home/reflexuser/app/requirements.txt:
0.083 + [ -n  ]
0.084 + [ -n  ]
0.084 + [ -n  ]
0.085 + deactivate nondestructive
0.085 + unset -f pydoc
0.085 + [ -n  ]
0.085 + [ -n  ]
0.085 + hash -r
0.086 + [ -n  ]
0.086 + unset VIRTUAL_ENV
0.086 + unset VIRTUAL_ENV_PROMPT
0.086 + [ ! nondestructive = nondestructive ]
0.086 + VIRTUAL_ENV=/home/reflexuser/venv
0.087 + 
0.087 + [  = cygwin ]
0.087 + [  = msys ]
0.087 + cygpath -u /home/reflexuser/venv
0.087 /bin/sh: 83: /home/reflexuser/venv/bin/activate: cygpath: not found
0.088 + VIRTUAL_ENV=
0.088 + export VIRTUAL_ENV
0.088 + _OLD_VIRTUAL_PATH=/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
0.088 + PATH=/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
0.088 + export PATH
0.088 + [ x != x ]
0.089 + basename 
0.099 + VIRTUAL_ENV_PROMPT=() 
0.099 + export VIRTUAL_ENV_PROMPT
0.099 + [ -n  ]
0.099 + [ -z  ]
0.099 + _OLD_VIRTUAL_PS1=$ 
0.099 + PS1=() $ 
0.099 + export PS1
0.099 + alias pydoc
0.100 + true
0.100 + hash -r
0.100 + /home/reflexuser/.local/bin/uv pip install --no-color -q -r /home/reflexuser/app/requirements.txt
0.164 error: File not found: `app/requirements.txt`
------
Dockerfile:19
--------------------
  17 |     RUN echo 'set -x' > $VENV_DIR/bin/activate
  18 |     RUN cat "$VENV_DIR/bin/activate.bak" >> $VENV_DIR/bin/activate
  19 | >>> RUN . $VENV_DIR/bin/activate && /home/$USERNAME/.local/bin/uv pip install --no-color -q -r $APP_DIR/requirements.txt
  20 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c . $VENV_DIR/bin/activate && /home/$USERNAME/.local/bin/uv pip install --no-color -q -r $APP_DIR/requirements.txt" did not complete successfully: exit code: 2

@charliermarsh
Copy link
Member

I reverted this in #10497, but I'll keep this open.

@charliermarsh charliermarsh reopened this Jan 11, 2025
@adhami3310
Copy link
Author

Do you know what the base image for public.ecr.aws/p3v4g4o2/reflex-cloud-base:v0.0.7-py3.12 is?

I believe it's python:3.12-slim

@Gankra Gankra self-assigned this Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
4 participants