alanvardy / tod

An unofficial Todoist command line client written in Rust
MIT License
104 stars 9 forks source link

Is source currently buildable? #756

Closed stacksjb closed 6 months ago

stacksjb commented 6 months ago

Forked and pulled down to start banging my head against the wall, and its' not compiling due to 6 errors:

error: expected `;`, found `delete_config`
   --> src/main.rs:483:32
    |
483 |     Ok(format!("{:?}", config))
    |                                ^ help: add `;` here
484 |     delete_config(&config.unwrap().path);
    |     ------------- unexpected token

error[E0425]: cannot find function `config_list` in this scope
  --> src/main.rs:92:32
   |
92 |         Some(("config", m)) => config_list(m),
   |                                ^^^^^^^^^^^ not found in this scope

error[E0277]: the size for values of type `str` cannot be known at compilation time
   --> src/main.rs:107:13
    |
107 |         Err(e) => {
    |             ^ doesn't have a size known at compile-time
    |
    = help: the trait `Sized` is not implemented for `str`
    = note: all local variables must have a statically known size
    = help: unsized locals are gated as an unstable feature

error[E0277]: the size for values of type `str` cannot be known at compilation time
   --> src/main.rs:107:9
    |
107 |         Err(e) => {
    |         ^^^^^^ doesn't have a size known at compile-time
    |
    = help: the trait `Sized` is not implemented for `str`
note: required by a bound in `Err`
   --> /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/result.rs:511:5

error[E0599]: no method named `unwrap` found for struct `Config` in the current scope
   --> src/main.rs:484:27
    |
484 |     delete_config(&config.unwrap().path);
    |                           ^^^^^^ method not found in `Config`
    |
   ::: src/config.rs:13:1
    |
13  | pub struct Config {
    | ----------------- method `unwrap` not found for this struct
    |
help: some of the expressions' fields have a method of the same name
    |
484 |     delete_config(&config.last_version_check.unwrap().path);
    |                           +++++++++++++++++++
484 |     delete_config(&config.mock_select.unwrap().path);
    |                           ++++++++++++
484 |     delete_config(&config.mock_string.unwrap().path);
    |                           ++++++++++++
484 |     delete_config(&config.mock_url.unwrap().path);
    |                           +++++++++
      and 8 other candidates

error[E0425]: cannot find function `delete_config` in this scope
   --> src/main.rs:484:5
    |
484 |     delete_config(&config.unwrap().path);
    |     ^^^^^^^^^^^^^ not found in this scope

Some errors have detailed explanations: E0277, E0425, E0599.
For more information about an error, try `rustc --explain E0277`.
error: could not compile `tod` (bin "tod") due to 6 previous errors

If it's not in a currently buildable state (only the release is), let me know and I'll sit tight :)

alanvardy commented 6 months ago

I can build on main in dev

image

Release is fine

image

test suite fine

 ~/d/tod   main   cargo test
    Finished `test` profile [unoptimized + debuginfo] target(s) in 0.13s
     Running unittests src/main.rs (target/debug/deps/tod-dfbf87b0dd0be684)

running 56 tests
test error::tests::can_format ... ok
test config::tests::test_maybe_expand_home_dir ... ok
test input::tests::can_select ... ok
test config::tests::add_project_should_work ... ok
test config::tests::set_and_clear_next_id_should_work ... ok
test config::tests::remove_project_should_work ... ok
test config::tests::new_should_generate_config ... ok
test config::tests::reload_config_should_work ... ok
test projects::tests::should_add_and_remove_projects ... ok
test config::tests::config_tests ... ok
test projects::tests::test_move_task_to_project ... ok
test projects::tests::test_remove_all ... ok
test projects::tests::test_prioritize_tasks_with_no_tasks ... ok
test filters::tests::test_all_tasks ... ok
test projects::tests::test_all_tasks ... ok
test sections::tests::should_convert_json_to_sections ... ok
test cargo::tests::test_get_latest_version ... ok
test tasks::tests::can_format_task_with_today ... ok
test tasks::tests::date_value_can_handle_date ... ok
test tasks::tests::can_format_task_with_a_date ... ok
test projects::tests::test_get_next_task ... ok
test tasks::tests::date_value_can_handle_datetime ... ok
test projects::tests::test_import ... ok
test filters::tests::test_rename_task ... ok
test tasks::tests::datetime_works_with_date ... ok
test tasks::tests::has_no_date_works ... ok
test tasks::tests::is_today_works ... ok
test tasks::tests::is_overdue_works ... ok
test tasks::tests::test_to_integer ... ok
test tasks::tests::sort_by_value_works ... ok
test tasks::tests::sort_by_datetime_works ... ok
test filters::tests::test_get_next_task ... ok
test time::tests::test_timezone_from_string ... ok
test tasks::tests::value_can_get_the_value_of_an_task ... ok
test projects::tests::test_remove_auto ... ok
test filters::tests::test_label ... ok
test projects::tests::test_list ... ok
test projects::tests::test_rename_task ... ok
test projects::tests::test_process_tasks ... ok
test filters::tests::test_prioritize_tasks ... ok
test filters::tests::test_process_tasks ... ok
test tasks::tests::test_process_task ... ok
test todoist::tests::should_get_tasks_for_project ... ok
test todoist::tests::should_complete_a_task ... ok
test verify_cmd ... ok
test tasks::tests::test_set_priority ... ok
test todoist::tests::should_move_a_task ... ok
test time::tests::test_is_date ... ok
test projects::tests::test_empty ... ok
test time::tests::test_is_datetime ... ok
test todoist::tests::should_update_date_on_a_task ... ok
test todoist::tests::should_prioritize_a_task ... ok
test todoist::tests::test_quick_add_task ... ok
test todoist::tests::test_add_task ... ok
test filters::tests::test_schedule ... ok
test projects::tests::test_schedule ... ok

test result: ok. 56 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.16s
alanvardy commented 6 months ago

I'm running on the latest stable rust, and I use branch main as my trunk branch, not master in case you have been using that

alanvardy commented 6 months ago

Actually, based on this line in your error I am pretty sure that you are on a branch other than main

error[E0425]: cannot find function `config_list` in this scope
  --> src/main.rs:92:32
   |
92 |         Some(("config", m)) => config_list(m),
   |                                ^^^^^^^^^^^ not found in this scope

I have some very different code in that location (a struct definition)

stacksjb commented 6 months ago

Something weird with my github fork, it said it was all up to date but was clearly not the same code, even though it said it was identical to tod/main. I deleted and re-pulled and it is working now.