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

BUG: compilation failed with "cannot assign twice to immutable variable record_count" error #2324

Closed
vitali2y opened this issue Dec 3, 2024 · 2 comments

Comments

@vitali2y
Copy link

vitali2y commented Dec 3, 2024

Describe the bug
Compilation from source with feature_capable,apply,luau,foreach,to,self_update,polars,lite,datapusher_plus optional features produces cannot assign twice to immutable variable `record_count` error @ src/cmd/sortcheck.rs:126.

To Reproduce
Steps to reproduce the behavior:

➜  git clone https://github.com/dathere/qsv.git && cd qsv
~...~
➜  cargo build --release --locked --bin qsv --features feature_capable,apply,luau,foreach,to,self_update,polars,lite,datapusher_plus
    Updating git repository `https://github.com/pola-rs/polars`
  Downloaded time-macros v0.2.19
  Downloaded time v0.3.37
~...~
   Compiling polars-mem-engine v0.44.2 (https://github.com/pola-rs/polars?rev=d86e44b#d86e44b9)
   Compiling polars-sql v0.44.2 (https://github.com/pola-rs/polars?rev=d86e44b#d86e44b9)
~...~
error[E0384]: cannot assign twice to immutable variable `record_count`
   --> src/cmd/sortcheck.rs:126:9
    |
115 | /         record_count = if show_progress {
116 | |             let count = util::count_rows(&rconfig)?;
117 | |             util::prep_progress(&progress, count);
118 | |             count
...   |
121 | |             0
122 | |         };
    | |_________- first assignment to `record_count`
...
126 |           record_count = 0;
    |           ^^^^^^^^^^^^^^^^ cannot assign twice to immutable variable
    |
help: consider making this binding mutable
    |
105 |     let mut record_count;
    |         +++

For more information about this error, try `rustc --explain E0384`.
warning: `qsv` (bin "qsv") generated 3 warnings
error: could not compile `qsv` (bin "qsv") due to 1 previous error; 3 warnings emitted
➜

Expected behavior
Compilation should be finished successfully.

Desktop:

  • OS: Linux Mint 21.2
  • qsv Version 1.0.0 (master branch)
  • Rust: rustc 1.83.0 (90b35a623 2024-11-26)
vitali2y added a commit to vitali2y/qsv that referenced this issue Dec 3, 2024
@vitali2y vitali2y mentioned this issue Dec 3, 2024
@jqnatividad
Copy link
Collaborator

jqnatividad commented Dec 3, 2024

Hi @vitali2y ,
Thanks for the report.

However, this is by design.

The datapusher_plus feature triggers the qsvdp binary variant to be built.

It is MUTUALLY EXCLUSIVE with the feature_capable and lite features - which triggers the qsv and qsvlite binary variants to be built respectively.

I'll update the documentation to make this clearer.

So for what you're trying to do, your build command should be as follows:

cargo build --release --locked -F feature_capable,apply,luau,foreach,to,self_update,polars

@jqnatividad
Copy link
Collaborator

FYI @vitali2y
Amended the docs as explained above
83cd732

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants