Commit graph

144 commits

Author SHA1 Message Date
Dustin J. Mitchell
4ff63a7960
Use TaskChampion 0.7.0, now via cxx instead of hand-rolled FFI (#3588)
TC 0.7.0 introduces a new `TaskData` type that maps to Taskwarrior's
`Task` type more cleanly. It also introduces the idea of gathering lists
of operations and "committing" them to a replica.

A consequence of this change is that TaskChampion no longer
automatically maintains dependency information, so Taskwarrior must do
so, with its `TDB2::dependency_sync` method. This method does a very
similar thing to what TaskChampion had been doing, so this is a shift of
responsibility but not a major performance difference.

Cxx is .. not great. It is missing a lot of useful things that make a
general-purpose bridge impractical:

 - no support for trait objects
 - no support for `Option<T>` (https://github.com/dtolnay/cxx/issues/87)
 - no support for `Vec<Box<..>>`

As a result, some creativity is required in writing the bridge, for
example returning a `Vec<OptionTaskData>` from `all_task_data` to allow
individual `TaskData` values to be "taken" from the vector.

That said, Cxx is the current state-of-the-art, and does a good job of
ensuring memory safety, at the cost of some slightly awkward APIs.

Subsequent work can remove the "TDB2" layer and allow commands and other
parts of Taskwarrior to interface directly with the `Replica`.
2024-08-11 02:06:00 +00:00
Dustin J. Mitchell
94b3e301d1
Remove taskchampion source from this repo (#3427)
* move taskchampion-lib to src/tc/lib, remove the rest
* update references to taskchampion
* Use a top-level Cargo.toml so everything is consistent
* apply comments from ryneeverett
2024-05-02 02:45:11 +00:00
Dustin J. Mitchell
4d9bb20bdd
Update task news to support 3.0.0 (#3342)
* Introduce Version, use it to check current version in custom reports
* Support multiple versions in 'task news'
2024-04-15 22:04:16 -04:00
Dustin J. Mitchell
18a8bd2997
Use corrosion instead of CMakeRust (#3273)
* Use corrosion instead of CMakeRust
* use OpenSUSE tumbleweed (latest) to get newer CMake
2024-03-02 16:21:34 -05:00
Dustin J. Mitchell
9566c929e2
Add support for cloud sync, specifically GCP (#3223)
* Add support for cloud sync, specifically GCP

This adds generic support for sync to cloud services, with specific
spuport for GCP. Adding others -- so long as they support a
compare-and-set operation -- should be comparatively straightforward.

The cloud support includes cleanup of unnecessary data, and should keep
total space usage roughly proportional to the number of tasks.

Co-authored-by: ryneeverett <ryneeverett@gmail.com>
2024-01-21 12:36:37 -05:00
Dathan Bennett
a7bb0c9ba0
Link executables using system frameworks on Darwin (#3075)
* Link test executables using system frameworks on Darwin

On an M1 MBP, running `cmake . && make test` yields the error

```
[ 69%] Linking CXX executable tc.t
Undefined symbols for architecture arm64:
  "_CFRelease", referenced from:
      _$LT$iana_time_zone..platform..system_time_zone..SystemTimeZone$u20$as$u20$core..ops..drop..Drop$GT$::drop::hcd3964de9573de30 in libtc_rust.a(iana_time_zone-0e2714c6ff24f5bb.iana_time_zone.4cacef0c-cgu.15.rcgu.o)
  "_CFStringGetBytes", referenced from:
      iana_time_zone::platform::string_ref::StringRef$LT$T$GT$::to_utf8::h39971b546d587152 in libtc_rust.a(iana_time_zone-0e2714c6ff24f5bb.iana_time_zone.4cacef0c-cgu.13.rcgu.o)
  "_CFStringGetCStringPtr", referenced from:
      iana_time_zone::platform::string_ref::StringRef$LT$T$GT$::as_utf8::h8bb5c2c0d091ded1 in libtc_rust.a(iana_time_zone-0e2714c6ff24f5bb.iana_time_zone.4cacef0c-cgu.13.rcgu.o)
  "_CFStringGetLength", referenced from:
      iana_time_zone::platform::string_ref::StringRef$LT$T$GT$::to_utf8::h39971b546d587152 in libtc_rust.a(iana_time_zone-0e2714c6ff24f5bb.iana_time_zone.4cacef0c-cgu.13.rcgu.o)
  "_CFTimeZoneCopySystem", referenced from:
      iana_time_zone::platform::system_time_zone::SystemTimeZone:🆕:hc42d30609914d79d in libtc_rust.a(iana_time_zone-0e2714c6ff24f5bb.iana_time_zone.4cacef0c-cgu.15.rcgu.o)
  "_CFTimeZoneGetName", referenced from:
      iana_time_zone::platform::system_time_zone::SystemTimeZone::name::h44947ee6deb3339a in libtc_rust.a(iana_time_zone-0e2714c6ff24f5bb.iana_time_zone.4cacef0c-cgu.15.rcgu.o)
  "_SecRandomCopyBytes", referenced from:
      ring::rand::darwin::fill::h0ad94d66d4e1a222 in libtc_rust.a(ring-e5f87a2e334d4c6a.ring.a21bac31-cgu.4.rcgu.o)
  "_kSecRandomDefault", referenced from:
      ring::rand::darwin::fill::h0ad94d66d4e1a222 in libtc_rust.a(ring-e5f87a2e334d4c6a.ring.a21bac31-cgu.4.rcgu.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [test/tc.t] Error 1
make[2]: *** [test/CMakeFiles/tc.t.dir/all] Error 2
make[1]: *** [test/CMakeFiles/test.dir/rule] Error 2
```

This change resolves the error by updating the targets in
test/CMakeLists.txt to link against the CoreFoundation and Security
frameworks when building under Mac OS.

* Link executables against CoreFoundation and Security frameworks on Mac OS

* Rename test_osx.sh to test_macos.sh

---------

Co-authored-by: Dathan Bennett <dathanb@netflix.com>
2023-07-20 17:23:12 -04:00
Dustin J. Mitchell
31105c2ba3
Sync against taskchampion-sync-server (#3118)
This removes use of gnutls and the TLS implementation, which is no
longer needed (task synchronization is handled via Taskchampion, which
uses `reqwest`, which handles TLS via other Rust dependencies). This
incidentally removes the following config options:
 * `debug.tls`
 * `taskd.ca`
 * `taskd.certificate`
 * `taskd.ciphers`
 * `taskd.credentials`
 * `taskd.key`
 * `taskd.server`
 * `taskd.trust`
2023-07-08 10:27:33 -04:00
Dustin J. Mitchell
12ecfa2b1e rename rust/ to taskchampion/ 2022-07-29 21:41:41 -04:00
Dustin J. Mitchell
8c30400af3 Add a C++ wrapper around TC FFI
This uses CMake to build a simple Rust library (in `src/tc/rust`) that
just re-exports everything from the `taskchampion-lib` crate.

The C++ wrappers then wrap this into C++ objects with proper lifecycle
maintenance, in the `tc` namespace.

The C++ wrappers are incomplete, and missing methods are tagged with
"TODO".  These will be added as needed.
2022-07-29 21:41:41 -04:00
Tomas Babej
c98fe5f34b
cmake: Remove recur2.cpp from CMakeLists 2021-06-12 10:40:47 -04:00
Jan Palus
9548bfdaba build: make sure internal libs are built as static
these libararies are not installed so don't leave the decision up to
enviroment which might build shared libraries resulting in binary
with missing deps after installation

Fixes #2403
2021-01-29 23:05:02 -05:00
Tomas Babej
e6edac7edd
build: Update libshared to version supporting Unicode 11
Closes #2333.
2020-12-20 15:27:28 -05:00
Paul Beckingham
4a929197ae Build: C++14 support added 2018-02-16 22:04:29 -05:00
Paul Beckingham
016bb94d3f l10n: Eliminated i18n.h 2018-01-21 23:29:59 -05:00
Paul Beckingham
b40cc89235 Recurrence: Added stub for handleRecurrence2 2017-03-31 08:38:35 -04:00
Paul Beckingham
f6f79d28ee Recurrence: Relocate nag function out of the way 2017-03-31 08:34:25 -04:00
Paul Beckingham
18aeeca103 CMake: Eliminated Dates.cpp 2017-03-05 09:46:44 -05:00
Paul Beckingham
d0ec6b27aa Nibbler: Elimnated, migrated to Pig 2017-03-04 22:21:49 -05:00
Paul Beckingham
68adade5b0 ISO8601: Migrated all to Datetime/Duration 2017-03-04 22:18:04 -05:00
Paul Beckingham
dd4fef6794 Config: Migrated to libshared Configuration 2017-02-26 10:46:51 -05:00
Tomas Babej
b59f36a614 build: Fix linking problem on non-OS-X platforms 2017-02-14 15:18:44 +01:00
Paul Beckingham
39f8e7528e TLS: Now uses SNI 2017-02-11 13:51:02 -05:00
Paul Beckingham
7e09dd9457 Color: Now uses libshared 2017-01-25 22:26:33 -05:00
Paul Beckingham
392e74cd70 ViewText: Eliminated 2016-12-17 20:23:36 -05:00
Paul Beckingham
f6ae39cb82 Msg: Migrated to use libshared 2016-12-11 20:33:13 -05:00
Paul Beckingham
b2ad9e96bd text: Eliminated module 2016-12-11 17:51:44 -05:00
Paul Beckingham
355620c640 libhsared: migrating from local to libshared 2016-12-06 07:20:45 -05:00
Paul Beckingham
4f072d47cd Timer: Migrated to libshared 2016-10-17 21:52:39 -04:00
Paul Beckingham
d648e0ae44 libshared: Integrated FS 2016-06-26 09:15:08 -04:00
Paul Beckingham
143e149de5 libshared: Added Table 2016-06-25 18:09:36 -04:00
Paul Beckingham
43de419cdd libshared: Integrated utf8, wcwidth 2016-06-25 17:52:20 -04:00
Paul Beckingham
8291e97e87 libshared: Integrated JSON 2016-06-25 17:27:57 -04:00
Paul Beckingham
2e8763364b libshared: Integrated the submodule
- Integrated RX.
2016-06-25 17:22:27 -04:00
Paul Beckingham
bfefd247c4 Context: Combined interactive.cpp and Context.cpp 2016-02-24 23:26:39 -05:00
Paul Beckingham
b1678a55df Date: Removed 2015-10-07 07:28:42 -04:00
Paul Beckingham
565232eccd Duration: Obsolete, removed 2015-08-12 11:41:15 -04:00
Paul Beckingham
737cb23546 CLI2: Eliminated CLI
- This is a large commit, as all the changes are centered around the elimination
  of CLI.
- CLI is no longer compiled.
- Context no longer maintains CLI + CLI2.
- Filter now walks the parse tree and sends to Eval a
  std::vector <std::pair <std::string, Lexer::Type>> containing only args tagged
  with FILTER.
- Filter more efficiently sets/unsets Eval::debug, by doing it less often.
- The filterExpr.length() check is no longer meaningful, and instead the size of
  the std::vector above is used.
- Filter::pendingOnly performs better analysis.
- Filter::safety makes use of the std::vector size also.
- Task::modify makes use of 'canonical' rather than 'name', which is a policy
  change, not a fix.
2015-06-24 13:23:56 -04:00
Paul Beckingham
708ddd3804 CLI2: Refactoring CLI to rely completely on the Lexer 2015-06-13 13:35:34 -04:00
Paul Beckingham
3e043291f0 Cleanup: Combined File, Path and Directory into FS
- The three objects are related and always travel together, so they are now
  combined.
2015-05-25 10:11:41 -04:00
Paul Beckingham
745aad0d27 Lexer
- Renamed Lexer2 to Lexer, it looks good enough to assume control.
2015-02-22 18:23:03 -05:00
Paul Beckingham
0cf18f3b16 Lexer2
- Integrated Lexer2 in place of Lexer. Tests fail.
2015-02-22 13:52:14 -05:00
Paul Beckingham
ae6024ef8b Lex
- Added a 'lex' binary to test Lexer2.
2015-02-21 10:03:17 -08:00
Paul Beckingham
d10ad5c7af Lexer2
- Copied in the Lexer2 object.
2015-02-19 08:54:20 -08:00
Paul Beckingham
6d75045658 Tree
- Eliminated Tree object from the repository.
2014-11-02 22:30:21 -05:00
Paul Beckingham
f7ba181db2 CMake
- Removed Parser.{h,cpp} from the build.
2014-11-02 22:20:37 -05:00
Paul Beckingham
3b0606922f CMake
- Added new CLI class.
2014-10-13 23:17:20 -04:00
Paul Beckingham
6fb1cbdc7f CMake
- Removed 'args' binary, which is no longer needed.
2014-07-06 09:24:14 -04:00
Paul Beckingham
5b9413b02c Alias
- Removal of alias load/resolve code, which (1) needs a rewrite, and (2) belongs
  in the Parser.
2014-07-03 19:04:48 -04:00
Paul Beckingham
f585f31d69 OldDuration
- Removed obsolete OldDuration object, replaced by Duration.
2014-05-28 23:59:16 -04:00
Paul Beckingham
e2aacb87f9 Arg
- Removed obsolete Arg.
2014-05-25 22:08:04 -04:00