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

r2env add [email protected] fails if ~/.r2env/src/radare2 is older than the 5.9.0 release #36

Open
eliminmax opened this issue May 5, 2024 · 1 comment

Comments

@eliminmax
Copy link
Contributor

As the title states, r2env add [email protected] fails if the source repo directory already exists, but was cloned before the 5.9.0 release tag existed. Manually fetching the latest tags fixes it.

I assume that the same failure would occur for any new tag.

Now that I have an up-to-date version of the repo, I can't reproduce the issue. I didn't keep track of the exact error messages I saw or steps I took to fix it on my machine. I plan on restoring ~/.r2env/src/radare2/ from a backup and trying to reproduce it, keeping better notes of my progress. I might also open a pull request to fix the issue - I might have some idea about how to fix it, but I need to test it before going through with it.

@eliminmax
Copy link
Contributor Author

The exact Traceback is as follows:

[*] Installing [email protected] package from source
[-] Cloning 5.9.0 version
Traceback (most recent call last):
  File "/home/eliminmax/.local/pipx/bin/r2env", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/eliminmax/.local/pipx/venvs/r2env/lib/python3.11/site-packages/r2env/repl.py", line 116, in main
    REPL().run_action(action_args)
  File "/home/eliminmax/.local/pipx/venvs/r2env/lib/python3.11/site-packages/r2env/repl.py", line 96, in run_action
    self.actions[action](args[0], use_meson=action_args.meson, use_dist=action_args.package)
  File "/home/eliminmax/.local/pipx/venvs/r2env/lib/python3.11/site-packages/r2env/core.py", line 79, in install
    self._package_manager.install_package(profile, version, use_meson=use_meson, use_dist=use_dist)
  File "/home/eliminmax/.local/pipx/venvs/r2env/lib/python3.11/site-packages/r2env/package_manager.py", line 162, in install_package
    if self._build_from_source(profile, version, source_path, dst_dir, logfile, use_meson=use_meson):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/eliminmax/.local/pipx/venvs/r2env/lib/python3.11/site-packages/r2env/package_manager.py", line 278, in _build_from_source
    git_fetch(self._packages[profile]["source"], version, source_path)
  File "/home/eliminmax/.local/pipx/venvs/r2env/lib/python3.11/site-packages/r2env/tools.py", line 84, in git_fetch
    repo.git.checkout(version)
  File "/home/eliminmax/.local/pipx/venvs/r2env/lib/python3.11/site-packages/git/cmd.py", line 741, in <lambda>
    return lambda *args, **kwargs: self._call_process(name, *args, **kwargs)
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/eliminmax/.local/pipx/venvs/r2env/lib/python3.11/site-packages/git/cmd.py", line 1315, in _call_process
    return self.execute(call, **exec_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/eliminmax/.local/pipx/venvs/r2env/lib/python3.11/site-packages/git/cmd.py", line 1109, in execute
    raise GitCommandError(redacted_command, status, stderr_value, stdout_value)
git.exc.GitCommandError: Cmd('git') failed due to: exit code(1)
  cmdline: git checkout 5.9.0
  stderr: 'error: pathspec '5.9.0' did not match any file(s) known to git'

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