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

Error on build of the develop branch: failed to select a version for taskchampion #3739

Open
mdvico opened this issue Dec 30, 2024 · 8 comments

Comments

@mdvico
Copy link

mdvico commented Dec 30, 2024

While trying to build the develop branch I faced a build error. I have taskwarrior installed on the system (M1 MacOs) and that is the output of the task diag you will see pasted below.

  • What command(s) did you run? cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
  • What did you expect to happen? Build taskwarrior
  • What actually happened? Build failed with error:
$ cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
-- Configuring C++17
-- System: Darwin
-- Looking for git submodules
-- Found git submodules
-- Looking for SHA1 references
-- Found SHA1 reference: 3bf020060
-- Looking for libuuid
-- Found libuuid
-- Configuring cmake.h
-- Rust Toolchain: stable-aarch64-apple-darwin
-- Rust Target: aarch64-apple-darwin
-- Using Corrosion as a subdirectory
error: failed to select a version for `taskchampion`.
    ... required by package `taskchampion-lib v0.1.0 (/Users/mvico/Documents/projects/taskwarrior.git/src/taskchampion-cpp)`
versions that meet the requirements `=1.0.2` (locked to 1.0.2) are: 1.0.2

the package `taskchampion-lib` depends on `taskchampion`, with features: `ureq` but `taskchampion` does not have these features.
 It has an optional dependency with that name, but that dependency uses the "dep:" syntax in the features table, so it does not have an
implicit feature with that name.


failed to select a version for `taskchampion` which could resolve this conflict
CMake Error at src/taskchampion-cpp/corrosion/cmake/Corrosion.cmake:1532 (message):
  Crate taskchampion_lib does not depend on cxx.
Call Stack (most recent call first):
  src/taskchampion-cpp/CMakeLists.txt:26 (corrosion_add_cxxbridge)


-- Configuring incomplete, errors occurred!
  • Output of the task diag command:
task 3.3.0
   Platform: Darwin

Compiler
    Version: Apple LLVM 16.0.0 (clang-1600.0.26.4)
       Caps: +stdc +stdc_hosted +LP64 +c8 +i32 +l64 +vp64 +time_t64
 Compliance: C++17

Build Features
      CMake: 3.31.2
    libuuid: libuuid + uuid_unparse_lower
 Build type: Release

Configuration
       File: /Users/mvico/.taskrc (found), 1400 bytes, mode 100644
       Data: /Users/mvico/.task (found), dir, mode 40755
         GC: Enabled
    $EDITOR: nvim
Hooks
     System: Enabled
   Location: /Users/mvico/.task/hooks
             (-none-)

Tests
   Terminal: 210x44
 Broken ref: Scanned 78 tasks for broken references:
             No broken references found
@djmitche
Copy link
Collaborator

Hm, I'm confused! taskchampion-lib does not, in fact, require the ureq feature:

[dependencies]
taskchampion = "=1.0.2"

The server-sync feature does require dep:ureq, but that's internal to Taskchampion.

This setup works fine for me, admittedly on Linux -- but this doesn't seem a Mac-related issue.

It looks like you were able to build 3.3.0 (since you have task diag output from it!) -- did that not encounter this error? There have been very few changes between v3.3.0 and develop right now.

@felixschurk
Copy link
Collaborator

Did you also try with a completely new/clean build directory?
Not that some submodule or something else is on an older version.

@mdvico
Copy link
Author

mdvico commented Dec 30, 2024

Hm, I'm confused! taskchampion-lib does not, in fact, require the ureq feature:

[dependencies]
taskchampion = "=1.0.2"

The server-sync feature does require dep:ureq, but that's internal to Taskchampion.

This setup works fine for me, admittedly on Linux -- but this doesn't seem a Mac-related issue.

It looks like you were able to build 3.3.0 (since you have task diag output from it!) -- did that not encounter this error? There have been very few changes between v3.3.0 and develop right now.

The build for v3.3.0 was not done by me, I installed the taskwarrior v3.3.0 using brew on MacOs (and it installed without issues). I just pasted the output of the task diag to show the related information of my system

I have just checked-out the v3.3.0 tag of the repo and tried re-building and I faced the same issue as before

@mdvico
Copy link
Author

mdvico commented Dec 30, 2024

Did you also try with a completely new/clean build directory? Not that some submodule or something else is on an older version.

This was a new, clean, directory. My steps were:

  1. Create a new directory
  2. Clone the repository
  3. Followed the documentation to try building taskwarrior on the develop branch

@mdvico
Copy link
Author

mdvico commented Dec 31, 2024

Update: The error is still present on tags:

  • v3.3.0
  • v3.2.0
  • v3.1.0

But I can configure it without issues for tag: v3.0.0. The error appears now when trying to build it:

$ cmake --build build
[ 16%] Built target task
[ 28%] Built target libshared
[ 51%] Built target columns
[ 92%] Built target commands
[ 92%] Built target cargo-prebuild_taskchampion-lib
error: package home v0.5.9 cannot be built because it requires rustc 1.70.0 or newer, while the currently active rustc version is 1.68.2
Either upgrade to rustc 1.70.0 or newer, or use
cargo update -p [email protected] --precise ver
where ver is the latest version of home supporting rustc 1.68.2
make[2]: *** [src/tc/CMakeFiles/_cargo-build_taskchampion-lib] Error 101
make[1]: *** [src/tc/CMakeFiles/_cargo-build_taskchampion-lib.dir/all] Error 2
make: *** [all] Error 2

Which is weird because I have a newer version of rustc and it is on the $PATH:

$ which rustc
/opt/homebrew/bin/rustc

@djmitche
Copy link
Collaborator

Huh, I very much expect v3.3.0 wouldn't have built with rust 1.68.2, either -- that's from almost two years ago! That said, you didn't get very far into building v3.3.0 so it's quite possible that this error is just from using an old Rust version. What version is /opt/homebrew/bin/rustc? And, what is the output of rustup show?

@mdvico
Copy link
Author

mdvico commented Jan 1, 2025

Huh, I very much expect v3.3.0 wouldn't have built with rust 1.68.2, either -- that's from almost two years ago! That said, you didn't get very far into building v3.3.0 so it's quite possible that this error is just from using an old Rust version. What version is /opt/homebrew/bin/rustc? And, what is the output of rustup show?

When running /opt/homebrew/bin/rustc I got:

rustc 1.83.0 (90b35a623 2024-11-26) (Homebrew)

The output for rustup show is:

Default host: aarch64-apple-darwin
rustup home:  /Users/mvico/.rustup

stable-aarch64-apple-darwin (default)
rustc 1.68.2 (9eb3afe9e 2023-03-27)

It seems that I had intalled rust by two different methods, I just cleaned up the brew install and re-installed rust by using the rustup method (curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh). This is the new output for the rustup show command:

Default host: aarch64-apple-darwin
rustup home:  /Users/mvico/.rustup

stable-aarch64-apple-darwin (default)
rustc 1.83.0 (90b35a623 2024-11-26)

I switched back to the develop branch and:

  1. The command: cmake -S . -B build -DCMAKE_BUILD_TYPE=Release works without issues
  2. The command: cmake --build build stops with a new error
[  1%] Built target cxxbridge_v1.0.133
[  1%] Built target cargo-prebuild_taskchampion_lib
    Finished `release` profile [optimized] target(s) in 0.38s
Copying byproducts `libtaskchampion_lib.a` to /Users/mvico/Documents/projects/taskwarrior.git/build/src/taskchampion-cpp
[  1%] Built target _cargo-build_taskchampion_lib
[  1%] Built target cargo-build_taskchampion_lib
[  3%] Built target taskchampion-cpp
[ 21%] Built target task
[ 34%] Built target libshared
[ 34%] Building CXX object src/columns/CMakeFiles/columns.dir/ColTypeDate.cpp.o
/Users/mvico/Documents/projects/taskwarrior.git/src/columns/ColTypeDate.cpp:194:15: error: use of undeclared identifier 'EPOCH_MIN_VALUE'
  194 |   if (epoch < EPOCH_MIN_VALUE || epoch >= EPOCH_MAX_VALUE) {
      |               ^
/Users/mvico/Documents/projects/taskwarrior.git/src/columns/ColTypeDate.cpp:194:43: error: use of undeclared identifier 'EPOCH_MAX_VALUE'
  194 |   if (epoch < EPOCH_MIN_VALUE || epoch >= EPOCH_MAX_VALUE) {
      |                                           ^
2 errors generated.
make[2]: *** [src/columns/CMakeFiles/columns.dir/ColTypeDate.cpp.o] Error 1
make[1]: *** [src/columns/CMakeFiles/columns.dir/all] Error 2
make: *** [all] Error 2

@djmitche
Copy link
Collaborator

djmitche commented Jan 1, 2025

That's good progress! I suspect your libshared repo is out of date, and git status would probably confirm this. To fix:

git submodule update --init --recursive

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

No branches or pull requests

3 participants