Skip to content
New issue

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

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

Already on GitHub? # to your account

"briefcase create" stops with error "unknown flag: --progress" #1095

Closed
juengling opened this issue Feb 12, 2023 · 2 comments
Closed

"briefcase create" stops with error "unknown flag: --progress" #1095

juengling opened this issue Feb 12, 2023 · 2 comments
Labels
bug A crash or error in behavior. linux The issue relates Linux support.

Comments

@juengling
Copy link

Describe the bug

Trying to follow the tutorial in the Linux part, in step 3 the briefcase create command stops with the error "unknown flag: --progress". Then it says "Error building Docker container image for helloworld."

Removing "--progress" from docker.py it complains "docker build" requires exactly 1 argument..

Steps to reproduce

Follow the steps of the tutorial for Linux. Last command before the error: briefcase create

Expected behavior

Result of step 3 of the tutorial: Packaging for distribution.

Screenshots

No response

Environment

  • Operating System: Ubuntu 20.04.5 LTS
  • Python version: 3.8.10
  • Software versions:
    • Briefcase: 0.3.12

Logs

briefcase.2023_02_12-10_06_56.create.log

Additional context

No response

@juengling juengling added the bug A crash or error in behavior. label Feb 12, 2023
@rmartin16 rmartin16 added the linux The issue relates Linux support. label Feb 12, 2023
@rmartin16
Copy link
Member

Your log suggests you're using rootless Docker. When I installed rootless docker (via the curl -> sh method), I encountered the same error; rootless Docker doesn't appear to be shipping with buildkit...or buildx for that matter.

I was able to work around issue by installing buildx for this rootless docker install:

mkdir -p ~/.docker/cli-plugins && \
wget https://github.com/docker/buildx/releases/download/v0.10.2/buildx-v0.10.2.linux-amd64 -O ~/.docker/cli-plugins/docker-buildx && \
chmod +x ~/.docker/cli-plugins/docker-buildx 

Then, though, I encountered a PermissionError once Briefcase built the image and tried to interact with parts of the filesystem that were created from within the Docker container.

Installing collected packages: zipp, travertino, pycairo, pygobject, importlib-metadata, toga-core, gbulb, toga-gtk
Successfully installed gbulb-0.6.4 importlib-metadata-6.0.0 pycairo-1.23.0 pygobject-3.42.2 toga-core-0.3.0 toga-gtk-0.3.0 travertino-0.1.3 zipp-3.13.0
ERROR: Exception:
Traceback (most recent call last):
  File "/usr/lib/python3.8/shutil.py", line 791, in move
    os.rename(src, real_dst)
OSError: [Errno 18] Invalid cross-device link: '/tmp/pip-target-3whz6qoj/lib/python/zipp' -> '/app/appimage/Hello World/Hello World.AppDir/usr/app_packages/zipp'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/brutus/.local/lib/python3.8/site-packages/pip/_internal/cli/base_command.py", line 167, in exc_logging_wrapper
    status = run_func(*args)
  File "/home/brutus/.local/lib/python3.8/site-packages/pip/_internal/cli/req_command.py", line 205, in wrapper
    return func(self, options, args)
  File "/home/brutus/.local/lib/python3.8/site-packages/pip/_internal/commands/install.py", line 464, in run
    self._handle_target_dir(
  File "/home/brutus/.local/lib/python3.8/site-packages/pip/_internal/commands/install.py", line 523, in _handle_target_dir
    shutil.move(os.path.join(lib_dir, item), target_item_dir)
  File "/usr/lib/python3.8/shutil.py", line 807, in move
    copytree(src, real_dst, copy_function=copy_function,
  File "/usr/lib/python3.8/shutil.py", line 557, in copytree
    return _copytree(entries=entries, src=src, dst=dst, symlinks=symlinks,
  File "/usr/lib/python3.8/shutil.py", line 458, in _copytree
    os.makedirs(dst, exist_ok=dirs_exist_ok)
  File "/usr/lib/python3.8/os.py", line 223, in makedirs
    mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/app/appimage/Hello World/Hello World.AppDir/usr/app_packages/zipp'
WARNING: You are using pip version 22.0.4; however, version 23.0 is available.
You should consider upgrading via the '/usr/bin/python3.8 -m pip install --upgrade pip' command.
>>> Return code: 2
Installing app requirements...

This is quite similar to #1083. However, here, Docker isn't running in a VM....instead rootless Docker is using Linux's user namespaces to isolate the container.

I'm still trying to wrap my head around all this uid/gid mapping...but it seems the approach with rootless Docker is for the root user within the container to map to the user that started the container. So, our approach of creating the brutus user within the container to do everything probably breaks this mapping and ultimately leads to permission errors.

@juengling, As for your specific situation, I would recommend using "rootful" Docker if you can. This is the only currently supported Docker on Linux. Alternatively, using --no-docker will avoid Docker altogether.

@rmartin16
Copy link
Member

Got a PoC fix working for both rootless Docker as well as Docker Desktop. I'm closing this issue in favor of #1083 since the ultimate solution will likely work for both. I'll add details there.

@rmartin16 rmartin16 closed this as not planned Won't fix, can't repro, duplicate, stale Feb 12, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug A crash or error in behavior. linux The issue relates Linux support.
Projects
None yet
Development

No branches or pull requests

2 participants