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

setup.sh unable to write to openroad_deps_prefixes #2505

Open
jeffng-or opened this issue Oct 24, 2024 · 1 comment
Open

setup.sh unable to write to openroad_deps_prefixes #2505

jeffng-or opened this issue Oct 24, 2024 · 1 comment

Comments

@jeffng-or
Copy link
Contributor

Subject

[Flow] for any util, flow Makefile, or flow script issues.

Describe the bug

When running within a docker container (or presumably a new machine), the logging of the openroad_deps_prefixes.txt file within setup.sh fails with a permission issue.

My best guess that lines 32 & 33 call the ORFS and OR DependencyInstaller.sh scripts as the SUDO_USER (e.g. normal user who called setup.sh with sudo). But, the same DependencyInstaller.sh scripts were called as root on lines 29 & 30 and the file was written by one of those calls.

So, the end result is that the calls as root created the file and then we try to write to the file as the SUDO_USER, who doesn't have permission.

Expected Behavior

setup.sh doesn't fail on a new machine or new docker container

Environment

Running with the current head of ORFS, which would be commit 7e8d10b5a595cd772f01fe0b4b7ebd7669315a22

To Reproduce

Use the following Dockerfile:

# syntax=docker/dockerfile:1

FROM ubuntu:22.04
RUN apt update && apt upgrade -y
RUN apt install python3
RUN apt install python3-pip -y
RUN apt install git -y
RUN apt install sudo -y

RUN adduser --disabled-password --gecos '' --home /home/localuser --shell /bin/bash localuser
RUN adduser localuser sudo
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers

USER localuser
WORKDIR /home/localuser

RUN git clone --recursive https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts.git
WORKDIR OpenROAD-flow-scripts
  1. docker build -t Dockerfile -t test:1.0 .
  2. docker run -it test:1.0 bash
  3. sudo ./setup.sh

Relevant log output

./tools/OpenROAD/etc/DependencyInstaller.sh: line 981: /home/jeffng/OpenROAD-flow-scripts/tools/OpenROAD/etc/openroad_deps_prefixes.txt: Permission denied

Screenshots

No response

Additional Context

No response

@jeffng-or
Copy link
Contributor Author

Working around by:

sudo install -m 666 /dev/null OpenROAD-flow-scripts/tools/OpenROAD/etc/openroad_deps_prefixes.txt

to create the file owned by root, but open to all for writing before calling setup.sh

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

1 participant