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

Sort call faliure #4094

Open
kalocsaibotond opened this issue Oct 3, 2024 · 3 comments
Open

Sort call faliure #4094

kalocsaibotond opened this issue Oct 3, 2024 · 3 comments

Comments

@kalocsaibotond
Copy link

kalocsaibotond commented Oct 3, 2024

Universal Ctags sort call faliure

I ran universal ctags on my python project, on Windows 10, Powershell 7.4.5, and I get the following result

Input file specified two times.

ctags.exe: cannot sort tag file: system ("sort -u -o tags tags") exited with 1

Neverheless, I think I found the issue:

PS> Get-Command sort.exe
CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Application     sort.exe                                           10.0.1904… C:\Windows\system32\sort.exe

I tried sort.exe out separately with sort.exe -u -o tags tags and it yields Input file specified two times.
This is despite the fact I created a scoop shim for the GNU coreutil sort that lies in the Git for Windows mini unix environment.

It would be nice solution to have a way to override the sort command for windows either through environment variable or through a command line option.


The name of the parser:

ctags's default (python) parser.

The command line you used to run ctags:

PS> ctags --options=NONE -R

though the same occurs with

PS> ctags --options=NONE .

.

The content of input file:

Python project files.

The tags output you are not satisfied with:

The generated tags seems fine, I tried them with Neovim client.

The tags output you expect:

I get what I expect, though it is unsorted.

The version of ctags:

PS> ctags --version
Universal Ctags 6.1.0, Copyright (C) 2015-2023 Universal Ctags Team
Universal Ctags is derived from Exuberant Ctags.
Exuberant Ctags 5.8, Copyright (C) 1996-2009 Darren Hiebert
  Compiled: Aug  6 2024, 16:07:53
  URL: https://ctags.io/
  Output version: 0.0
  Optional compiled features: +win32, +wildcards, +regex, +gnulib_regex, +unix-path-separator, +iconv, +option-directory, +xpath, +json, +interactive, +yaml, +case-insensitive-filenames, +packcc, +optscript, +pcre2

How do you get ctags binary:

PS> scoop install extras/universal-ctags
@leleliu008
Copy link
Member

It seems that you built it from source not install via scoop, becasue your Compiled: Aug 6 2024, 16:07:53 2 month ago, scoop just down binary from our release as per https://github.com/ScoopInstaller/Extras/blob/master/bucket/universal-ctags.json , our releases for windows disable the external sort https://github.com/universal-ctags/ctags-win32/blob/master/.github/workflows/build-ctags.yaml#L162

@kalocsaibotond
Copy link
Author

It seems that you built it from source not install via scoop, becasue your Compiled: Aug 6 2024, 16:07:53 2 month ago, scoop just down binary from our release as per https://github.com/ScoopInstaller/Extras/blob/master/bucket/universal-ctags.json , our releases for windows disable the external sort https://github.com/universal-ctags/ctags-win32/blob/master/.github/workflows/build-ctags.yaml#L162

Thank you for your quick response. I think I found the source of interferene:

PS> Get-Command ctags
CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Application     ctags.exe                                          6.1.0.0    C:\Users\botond.kalocsai\scoop\apps\mingw-winlibs\current\bin\ctags.exe

Unfortunately, the mingw-winlibs scoop package also contains a version of universal-ctags that behaves differently, which overrides the proper universal-ctag's shim. Uninstalling mingw-winlibs gives back the access to the proper universal-ctags shim.

@masatake
Copy link
Member

masatake commented Oct 3, 2024

I don't want to add flexibility to the area.
I took much time to work on https://git.almalinux.org/rpms/ctags/commit/3c370ff3576fbbad5e6e5245942a6f306c773d71.patch .

I don't know the package manager(s?) on Windows.
However, if the "sort" command is unavailable, using --disable-external-sort looks like a simple solution.

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

3 participants