Description of problem: Specified invalid cargo name as used for golang usually. Version-Release number of selected component: rust2rpm-25.0.1-1.fc37 Additional info: reporter: libreport-2.17.11 comment: Specified invalid cargo name as used for golang usually. reason: crate.py:62:local_toml_file:AssertionError cgroup: 0::/user.slice/user-100616.slice/user/app.slice/app-org.gnome.Terminal.slice/vte-spawn-7cf0ea2d-e714-4d62-8a5a-31a0e98a7c02.scope executable: /usr/bin/rust2rpm kernel: 6.5.5-100.fc37.x86_64 crash_function: local_toml_file cmdline: /usr/bin/python3 -sP /usr/bin/rust2rpm https://github.com/NLnetLabs/octseq interpreter: python3-3.11.6-1.fc37.x86_64 package: rust2rpm-25.0.1-1.fc37 type: Python3 uid: 100616 exception_type: AssertionError runlevel: N 5 Truncated backtrace: crate.py:62:local_toml_file:AssertionError Traceback (most recent call last): File "/usr/bin/rust2rpm", line 8, in <module> sys.exit(main()) ^^^^^^ File "/usr/lib64/python3.11/contextlib.py", line 81, in inner return func(*args, **kwds) ^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/rust2rpm/__main__.py", line 50, in main project, version, diffs, metadata, doc_files, license_files, is_local, vendor_tarball = process_project( ^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/rust2rpm/crate.py", line 268, in process_project name, version, diffs, metadata, doc_files, license_files, vendor_tarball = process_project_local( ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/rust2rpm/crate.py", line 181, in process_project_local toml_path, doc_files, license_files = local_toml_file(project) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/rust2rpm/crate.py", line 62, in local_toml_file assert os.path.isfile(toml_path) AssertionError Local variables in innermost frame: toml_path: 'https://github.com/NLnetLabs/octseq'
Created attachment 1999904 [details] File: namespaces
Created attachment 1999905 [details] File: cpuinfo
Created attachment 1999906 [details] File: open_fds
Created attachment 1999907 [details] File: environ
Created attachment 1999908 [details] File: os_info
Created attachment 1999909 [details] File: mountinfo
Created attachment 1999910 [details] File: backtrace
I would expect nicer error message instead of just assertion error. It makes it unclear that I used it wrong way.
Hm, yeah. Passing something that's neither a crate name, nor a directory, nor a file path is unexpected. Do you think it would make sense to convert the "else" case here to a check for "elif os.path.isfile" instead, and make the "else" case an error instead? https://pagure.io/fedora-rust/rust2rpm/blob/main/f/rust2rpm/crate.py#_177-182 PS: If you're working on updating an existing package, then you don't need to pass any argument at all. If missing, the crate name is autodetected from any "rust-*.spec" files in the current working directory (or the name of the current working directory, if no "rust-*.spec" file exists yet).
> Specified invalid cargo name as used for golang usually. I also don't really understand why you expect rust2rpm to behave exactly like go2rpm - these are ecosystems that work in diametrically opposed ways. Golang has no registry whatsoever and everything is a URL only, whereas Rust has a central registry where everything is identified by name, and it is impossible for any package uploaded there to reference projects via git URL.
This message is a reminder that Fedora Linux 37 is nearing its end of life. Fedora will stop maintaining and issuing updates for Fedora Linux 37 on 2023-12-05. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a 'version' of '37'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, change the 'version' to a later Fedora Linux version. Note that the version field may be hidden. Click the "Show advanced fields" button if you do not see it. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora Linux 37 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora Linux, you are encouraged to change the 'version' to a later version prior to this bug being closed.
I have refactored the code in question to do better error handling: https://pagure.io/fedora-rust/rust2rpm/c/323dbea4b6dbfe60f650ab654dfc7f16f3aad9e4?branch=main This will be part of the next rust2rpm release.
FEDORA-2023-3565972927 has been submitted as an update to Fedora 40. https://bodhi.fedoraproject.org/updates/FEDORA-2023-3565972927
FEDORA-2023-3565972927 has been pushed to the Fedora 40 stable repository. If problem still persists, please make note of it in this bug report.