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

devenv shell not working with paths with spaces #744

Closed
zarelit opened this issue Jul 21, 2023 · 9 comments · Fixed by #1005
Closed

devenv shell not working with paths with spaces #744

zarelit opened this issue Jul 21, 2023 · 9 comments · Fixed by #1005
Labels
bug Something isn't working

Comments

@zarelit
Copy link

zarelit commented Jul 21, 2023

Describe the bug

devenv init and devenv shell don't play nice with paths with spaces

To reproduce

mkdir -p '/tmp/proof of concept'
cd '/tmp/proof of concept'
git init
devenv init

last command output is:

[zarel@tantra:/tmp/proof of concept]$ devenv init
Creating .envrc
Creating devenv.nix
Creating devenv.yaml
Appending defaults to .gitignore
Done.
direnv is installed. Running direnv allow.
direnv: loading /tmp/proof of concept/.envrc
direnv: loading https://raw.githubusercontent.com/cachix/devenv/d1f7b48e35e6dee421cfd0f51481d17f77586997/direnvrc (sha256-YBzqskFZxmNb3kYVoKD9ZixoPXJh1C9ZvTLGFRkauZ0=)
direnv: using devenv
direnv: .envrc changed, reloading
Building shell ...
error:
       error: 'file:///tmp/proof of concept' is not a valid URL
direnv: loading the environment failed
direnv: error exit status 1

Version

devenv: 0.6.3

@zarelit zarelit added the bug Something isn't working label Jul 21, 2023
@domenkozar
Copy link
Member

I'm just about to publish a rewrite of CLI in Python, which should fix this.

@domenkozar
Copy link
Member

Could you try #745 by installing python-rewrite branch?

@zarelit
Copy link
Author

zarelit commented Jul 22, 2023

The python rewrite right now is not working with this case but that's okay it's just a small nuisance for me:

[zarel@tantra:/tmp/proof of concept]$ devenv init
Creating devenv.nix
Creating devenv.yaml
Creating .envrc
Appending defaults to .gitignore
Done.
direnv is installed. Running $ direnv allow .
direnv: loading /tmp/proof of concept/.envrc
direnv: loading https://raw.githubusercontent.com/cachix/devenv/d1f7b48e35e6dee421cfd0f51481d17f77586997/direnvrc (sha256-YBzqskFZxmNb3kYVoKD9ZixoPXJh1C9ZvTLGFRkauZ0=)
direnv: using devenv
direnv: .envrc changed, reloading
Traceback (most recent call last):
  File "/nix/store/8fpiimbs1c22vdpv21bi1lzaqwnin7zs-python3.10-devenv-1.0/bin/.devenv-wrapped", line 9, in <module>
    sys.exit(cli())
  File "/nix/store/vzfvszdsa9mdz4rpy03n6c7qh37g91dc-python3.10-click-8.1.6/lib/python3.10/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/nix/store/vzfvszdsa9mdz4rpy03n6c7qh37g91dc-python3.10-click-8.1.6/lib/python3.10/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/nix/store/vzfvszdsa9mdz4rpy03n6c7qh37g91dc-python3.10-click-8.1.6/lib/python3.10/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/nix/store/vzfvszdsa9mdz4rpy03n6c7qh37g91dc-python3.10-click-8.1.6/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/nix/store/vzfvszdsa9mdz4rpy03n6c7qh37g91dc-python3.10-click-8.1.6/lib/python3.10/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/nix/store/8fpiimbs1c22vdpv21bi1lzaqwnin7zs-python3.10-devenv-1.0/lib/python3.10/site-packages/devenv/cli.py", line 418, in print_dev_env
    env = shell()
  File "/nix/store/vzfvszdsa9mdz4rpy03n6c7qh37g91dc-python3.10-click-8.1.6/lib/python3.10/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/nix/store/vzfvszdsa9mdz4rpy03n6c7qh37g91dc-python3.10-click-8.1.6/lib/python3.10/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/nix/store/vzfvszdsa9mdz4rpy03n6c7qh37g91dc-python3.10-click-8.1.6/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/nix/store/vzfvszdsa9mdz4rpy03n6c7qh37g91dc-python3.10-click-8.1.6/lib/python3.10/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/nix/store/8fpiimbs1c22vdpv21bi1lzaqwnin7zs-python3.10-devenv-1.0/lib/python3.10/site-packages/devenv/cli.py", line 201, in shell
    run_assemble()
  File "/nix/store/8fpiimbs1c22vdpv21bi1lzaqwnin7zs-python3.10-devenv-1.0/lib/python3.10/site-packages/devenv/cli.py", line 132, in run_assemble
    system = click.get_current_context().obj['system']
TypeError: 'NoneType' object is not subscriptable
direnv: loading the environment failed
direnv: error exit status 1

@domenkozar
Copy link
Member

@zarelit thanks for reporting that, I've fixed it in the latest branch, can you try again?

@zarelit
Copy link
Author

zarelit commented Jul 23, 2023

Hi @domenkozar thank you again for your support, unfortunately I have to report this outcome:

[zarel@tantra:/tmp/proof of concept]$ devenv init
Creating devenv.nix
Creating devenv.yaml
Creating .envrc
Appending defaults to .gitignore
Done.
direnv is installed. Running $ direnv allow .
direnv: loading /tmp/proof of concept/.envrc
direnv: loading https://raw.githubusercontent.com/cachix/devenv/d1f7b48e35e6dee421cfd0f51481d17f77586997/direnvrc (sha256-YBzqskFZxmNb3kYVoKD9ZixoPXJh1C9ZvTLGFRkauZ0=)
direnv: using devenv
direnv: .envrc changed, reloading
error:
       error: unexpected argument 'concept/.devenv/gc/shell'
Try '/nix/store/y7jg84kb2kr0rln9a33jdlk6vkzkh9ii-nix-2.12.0pre20230216_7c91803/bin/nix --help' for more information.
Error: Following command exited with code 1:

  /nix/store/y7jg84kb2kr0rln9a33jdlk6vkzkh9ii-nix-2.12.0pre20230216_7c91803/bin/nix --show-trace --extra-experimental-features "nix-command flakes" --option warn-dirty false --system x86_64-linux print-dev-env --impure --profile /tmp/proof of concept/.devenv/gc/shell 
direnv: loading the environment failed
direnv: error exit status 1

and devenv info

[zarel@tantra:/tmp/proof of concept]$ devenv info
error:
       error: 'file:///tmp/proof of concept' is not a valid URL
Error: Following command exited with code 1:

  /nix/store/y7jg84kb2kr0rln9a33jdlk6vkzkh9ii-nix-2.12.0pre20230216_7c91803/bin/nix --show-trace --extra-experimental-features "nix-command flakes" --option warn-dirty false --system x86_64-linux flake metadata 

@domenkozar
Copy link
Member

To reproduce:

/nix/store/hxrvmv3vvcw2g9z8kfxmnyd17s1dgxf3-python3.11-devenv-1.0/bin/devenv print-dev-env
path '/home/domen/dev/foo bar/bar/.devenv/gc/shell' does not contain a '.devenv.flake.nix', searching up
error:
       error: getting status of '/home/domen/dev/foo bar/bar/.devenv/gc/shell': No such file or directory
Error: Following command exited with code 1:

  /nix/store/y7jg84kb2kr0rln9a33jdlk6vkzkh9ii-nix-2.12.0pre20230216_7c91803/bin/nix --show-trace --extra-experimental-features "nix-command flakes" --option warn-dirty false --system x86_64-linux print-dev-env --impure --profile /home/domen/dev/foo bar/.devenv/gc/shell 

@domenkozar
Copy link
Member

This should be fixed in the latest branch. Thanks!

@domenkozar domenkozar mentioned this issue Oct 9, 2023
7 tasks
@domenkozar domenkozar mentioned this issue Mar 11, 2024
2 tasks
@zarelit
Copy link
Author

zarelit commented Apr 8, 2024

I can also confirm it's working since 1.0.0 :-) thank you @domenkozar and the rest of the devenv team

@zarelit
Copy link
Author

zarelit commented Apr 8, 2024

Actually before 1.0.0.0 it was not able to "devenv init" but actually using it keeps giving errors. Keeping this issue closed in favor of #1107

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
Development

Successfully merging a pull request may close this issue.

2 participants