Closed tamasgal closed 1 year ago
aaah :facepalm: yes, the install script, I'm guessing the permission denied error is coming from trying to copy a file into a directory that hasn't been created yet
I don't know why I didn't mkdir -p
for the ${man_dest_path}
but this should (lol) be an easy fix.
Yeah ;) That's what I also tried (see above), but then hit the next thing with ERROR: Copying to .denv/bin failed.
, probably related to the illegal option
which I mentioned in Zoom, since some commands on macOS are not GNU.
Alright, I fixed up the copying/mkdir, can you try the following?
curl -s https://raw.githubusercontent.com/tomeichlersmith/denv/39-install-macos/install | sh -s -- --prefix install
I'm assuming the illegal option
is from using the install
command. Could you post the man page or help printout for install
for me? I can also just google around while I'm waiting for jobs to run.
https://ss64.com/osx/cp.html this says there is no -t
flag for cp
which could be the issue and https://ss64.com/osx/install.html is the same for install
.
Going to update the install
script to avoid the -t
flags...
Alright, I got the install operational (I think) and added docker on MacOS to the testing suite. It is currently failing with a confusing error:
INFO: Testing denv with docker
PASS: 'denv' failed when it should have failed
PASS: 'denv init ubuntu:22.04' ran successfully
PASS: 'denv init ubuntu:18.04' failed when it should have failed
PASS: 'denv config print' ran successfully
PASS: 'denv false' failed when it should have failed
docker: Error response from daemon: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: "/usr/local/bin/_denv_entrypoint": is a directory: unknown: permission denied.
time="2023-09-05T17:59:59Z" level=error msg="error waiting for container: "
FAIL: != tmp.YwMDO4sv when comparing 'denv printenv DENV_NAME' and 'basename /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/tmp.YwMDO4sv'
Error: Process completed with exit code 1.
It's odd because this is failing on the second command that launched a container. denv false
runs false
within the container and that seems to run fine while the following run fails. I suspect this is due to the configuration of docker on MacOS and I am unsure if it is an issue with the runner or with docker on MacOS in general.
Hmm, I tried but something strange is happening. I installed denv
in ~/.denv
and ~/.denv/bin
was populated but then after doing denv init
(and realising that Docker was not running), the ~/.denv/bin
folder vanished. It's a bit scary that things are deleted without any good reason ;)
Here is the history:
░ tamasgal@silentbox:~
░ 13:31:41 > curl -s https://raw.githubusercontent.com/tomeichlersmith/denv/39-i
nstall-macos/install | sh -s -- --prefix .denv
INFO: Checking dependencies...
INFO: Downloading...
INFO: Unpacking...
INFO: Successfully installed denv to /Users/tamasgal/.denv/bin
INFO: Found /Users/tamasgal/.denv/bin in PATH, you're all set!
░ tamasgal@silentbox:~
░ 13:31:44 > denv
/Users/tamasgal/.denv/bin/denv: line 314: /Users/tamasgal/.denv/config: No such file or directory
░ tamasgal@silentbox:~
░ 13:31:47 1 > denv init
denv init [help|-h|--help] IMAGE [WORKSPACE] [--no-gitignore]
[--force] [--name NAME]
ARGUMENT
help : print this help and exit
IMAGE : the container image to use for running the denv
WORKSPACE : the directory to create the denv for
optional, defaults to present working directory
OPTIONS
-h, --help : print this help and exit
--no-gitignore : don't generate a gitignore for the .denv directory
--force : overwrite an existing denv if it exists
--name : set a name for this denv
ERROR: Provide at least an image to use for running
░ tamasgal@silentbox:~
░ 13:31:51 1 > denv init python:2.7
This workspace already has a denv. Would you like to overwrite it? [Y/n] y
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
(here I started Docker.app)
░ tamasgal@silentbox:~ took 5s
░ 13:32:04 1 > denv
zsh: command not found: denv
░ tamasgal@silentbox:~
░ 13:32:58 130 > ls .denv
config
░ tamasgal@silentbox:~
░ 13:33:00 > which denv
denv not found
Ah yes, this is because the directory .denv
in the current working directory is what is used by denv
to store the configuration.
Right now, "overwriting" means deleting .denv
and starting from an empty directory; however, I could undo that and simply ignore the fact that other files may be in .denv
.
This is where the offending lines are
https://github.com/tomeichlersmith/denv/blob/f754454ace8ba42ace3ac9f76ad1a84b6c5c1296/denv#L587-L608
Instead of rm -r .denv
, you could replace that with just rm -f .denv/config
to make sure the new config is "clean" in some sense. That would allow you to install denv
into .denv
.
Edit: I've updated the development branch to avoid fully removing the .denv
directory. You should be good to re-try. :crossed_fingers:
OK works now, thanks! :) We can close this. I'll do some further tests :)
Describe the bug The installation script on macOS (13.3.1) fails with a permission error.
To Reproduce Steps to reproduce the behavior:
denv
with...Expected behavior
denv
should install without errorsScreenshots Here is the output of a session where I try to install
denv
: