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

Panic when using owner #1163

Closed
1 task done
mbhall88 opened this issue Nov 2, 2022 · 4 comments · Fixed by #1164
Closed
1 task done

Panic when using owner #1163

mbhall88 opened this issue Nov 2, 2022 · 4 comments · Fixed by #1164
Labels

Comments

@mbhall88
Copy link

mbhall88 commented Nov 2, 2022

Checks

  • I have read the troubleshooting section and still think this is a bug.

Describe the bug you encountered:

$ fd -d 2 -o $USER -t d . /hps/scratch/lsf_tmpdir
thread 'main' panicked at 'Mismatch between definition and access of `owner`. Could not downcast to TypeId { t: 14109425959541630025 }, need to downcast to TypeId { t: 563790022623738129 }
', /nfs/research/zi/mbhall//Software/.cargo/registry/src/github.com-1ecc6299db9ec823/clap-4.0.18/src/parser/error.rs:30:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

I guess this is akin to #1160? But as it is not a u32 I wasn't sure how to put in a fix (I was planning to copy the fix for that issue)

Describe what you expected to happen:

Before upgrading to this version, the command ran fine. I expect it to list all directories owned by me ($USER)

What version of fd are you using?

0.5.1

Which operating system / distribution are you on?

Linux 4.18.0-240.22.1.el8_3.x86_64 x86_64


LSB Version:    :core-4.1-amd64:core-4.1-noarch
Distributor ID: CentOS
Description:    CentOS Linux release 8.3.2011
Release:        8.3.2011
Codename:       n/a
@mbhall88 mbhall88 added the bug label Nov 2, 2022
@tmccombs
Copy link
Collaborator

tmccombs commented Nov 2, 2022

hmm, I wonder if these are caused by a bug in clap

@tmccombs
Copy link
Collaborator

tmccombs commented Nov 2, 2022

I'll look into this later tonight.

tmccombs added a commit to tmccombs/fd that referenced this issue Nov 3, 2022
Unfortunately, clap_derive can't combine a value_parser of Option<T>
with an optional argument to get a merged Option<T> so we need to do the
check for the nop outside of the value parser.

Also adds some tests for --owner

Fixes: sharkdp#1163
tmccombs added a commit to tmccombs/fd that referenced this issue Nov 3, 2022
Unfortunately, clap_derive can't combine a value_parser of Option<T>
with an optional argument to get a merged Option<T> so we need to do the
check for the nop outside of the value parser.

Also adds some tests for --owner

Fixes: sharkdp#1163
tmccombs added a commit to tmccombs/fd that referenced this issue Nov 3, 2022
Unfortunately, clap_derive can't combine a value_parser of Option<T>
with an optional argument to get a merged Option<T> so we need to do the
check for the nop outside of the value parser.

Also adds some tests for --owner

Fixes: sharkdp#1163
@sharkdp
Copy link
Owner

sharkdp commented Nov 3, 2022

@tmccombs
Copy link
Collaborator

tmccombs commented Nov 3, 2022

Thanks @sharkdp

tmccombs added a commit to tmccombs/fd that referenced this issue Nov 11, 2022
Unfortunately, clap_derive can't combine a value_parser of Option<T>
with an optional argument to get a merged Option<T> so we need to do the
check for the nop outside of the value parser.

Also adds some tests for --owner

Fixes: sharkdp#1163
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants