cheeselemon / ophiuchi-desktop

A local https proxy server using docker as backend
MIT License
1.25k stars 47 forks source link

[BUG] unable to run or build due to time library #22

Open dave-palt opened 3 months ago

dave-palt commented 3 months ago

Describe the bug The build with tauri fails for an indirect rust dependency.

To Reproduce Steps to reproduce the behavior: 1 - execute npm run tauri build -- --debug

npm run tauri build -- --debug

> ophiuchi@0.5.0 tauri
> tauri build --debug

     Running beforeBuildCommand `npm run build`

> ophiuchi@0.5.0 build
> next build

- info Creating an optimized production build
- info Compiled successfully
- info Linting and checking validity of types
- info Collecting page data
- info Generating static pages (5/5)
- info Finalizing page optimization

Route (app)                                Size     First Load JS
┌ ○ /                                      8.64 kB        99.2 kB
├ ○ /endpoint-list                         136 kB          227 kB
└ ○ /favicon.ico                           0 B                0 B
+ First Load JS shared by all              78.6 kB
  ├ chunks/1-33d54f508cf16c72.js           26 kB
  ├ chunks/6b6add3f-b7bc95e4e78e3454.js    50.6 kB
  ├ chunks/main-app-0b5394ef40b6aec5.js    220 B
  └ chunks/webpack-773222ee38fc6ca0.js     1.78 kB

Route (pages)                              Size     First Load JS
─ ○ /404                                   180 B          75.8 kB
+ First Load JS shared by all              75.6 kB
  ├ chunks/framework-b5f16bf8d1f4a453.js   45.1 kB
  ├ chunks/main-fd792b4cfadb033a.js        28.6 kB
  ├ chunks/pages/_app-8ed5c22f8328e915.js  194 B
  └ chunks/webpack-773222ee38fc6ca0.js     1.78 kB

○  (Static)  automatically rendered as static HTML (uses no initial props)

   Compiling serde v1.0.183
   Compiling thiserror v1.0.46
   Compiling phf v0.8.0
   Compiling html5ever v0.25.2
   Compiling cssparser v0.27.2
   Compiling cssparser-macros v0.6.1
   Compiling derive_more v0.99.17
   Compiling darling_macro v0.20.3
   Compiling time v0.3.25
   Compiling darling v0.20.3
   Compiling rand v0.8.5
error[E0282]: type annotations needed for `Box<_>`
  --> /Users/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/time-0.3.25/src/format_description/parse/mod.rs:83:9
   |
83 |     let items = format_items
   |         ^^^^^
...
86 |     Ok(items.into())
   |              ---- type must be known at this point
   |
help: consider giving `items` an explicit type, where the placeholders `_` are specified
   |
83 |     let items: Box<_> = format_items
   |              ++++++++

   Compiling brotli-decompressor v2.3.4
   Compiling phf_macros v0.10.0
   Compiling aho-corasick v1.0.4
For more information about this error, try `rustc --explain E0282`.
error: could not compile `time` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
       Error failed to build app: failed to build app

Expected behavior Something like this:

npm run tauri build

> ophiuchi@0.5.0 tauri
> tauri build

     Running beforeBuildCommand `npm run build`

> ophiuchi@0.5.0 build
> next build

- info Creating an optimized production build
- info Compiled successfully
- info Linting and checking validity of types
- info Collecting page data
- info Generating static pages (5/5)
- info Finalizing page optimization

Route (app)                                Size     First Load JS
┌ ○ /                                      8.64 kB        99.2 kB
├ ○ /endpoint-list                         136 kB          227 kB
└ ○ /favicon.ico                           0 B                0 B
+ First Load JS shared by all              78.6 kB
  ├ chunks/1-33d54f508cf16c72.js           26 kB
  ├ chunks/6b6add3f-b7bc95e4e78e3454.js    50.6 kB
  ├ chunks/main-app-0b5394ef40b6aec5.js    220 B
  └ chunks/webpack-773222ee38fc6ca0.js     1.78 kB

Route (pages)                              Size     First Load JS
─ ○ /404                                   180 B          75.8 kB
+ First Load JS shared by all              75.6 kB
  ├ chunks/framework-b5f16bf8d1f4a453.js   45.1 kB
  ├ chunks/main-fd792b4cfadb033a.js        28.6 kB
  ├ chunks/pages/_app-8ed5c22f8328e915.js  194 B
  └ chunks/webpack-773222ee38fc6ca0.js     1.78 kB

○  (Static)  automatically rendered as static HTML (uses no initial props)

    Updating crates.io index
     Locking 8 packages to latest compatible versions
    Updating deranged v0.3.7 -> v0.3.11
      Adding num-conv v0.1.0
      Adding powerfmt v0.2.0
    Updating serde v1.0.183 -> v1.0.193 (latest: v1.0.208)
    Updating serde_derive v1.0.183 -> v1.0.193 (latest: v1.0.208)
    Updating time v0.3.25 -> v0.3.36
    Updating time-core v0.1.1 -> v0.1.2
    Updating time-macros v0.2.11 -> v0.2.18
  Downloaded serde_derive v1.0.193
  Downloaded serde v1.0.193
  Downloaded 2 crates (132.6 KB) in 0.35s
   Compiling serde v1.0.193
   Compiling serde_derive v1.0.193
   Compiling powerfmt v0.2.0
   Compiling time-core v0.1.2
   Compiling num-conv v0.1.0
   Compiling security-framework v2.11.0
   Compiling generic-array v0.14.7
   Compiling brotli v3.3.4
   Compiling infer v0.12.0
   Compiling num-traits v0.2.16
   Compiling deranged v0.3.11
   Compiling regex v1.9.3
   Compiling phf v0.10.1
   Compiling time v0.3.36
   Compiling crc32fast v1.3.2
   Compiling core-graphics-types v0.1.2
   Compiling cssparser v0.27.2
   Compiling markup5ever v0.10.1
   Compiling scroll_derive v0.11.1
   Compiling crossbeam-utils v0.8.16
   Compiling glob v0.3.1
   Compiling winnow v0.5.11
   Compiling adler v1.0.2
   Compiling itoa v0.4.8
   Compiling system-configuration-sys v0.5.0
   Compiling matches v0.1.10
   Compiling stable_deref_trait v1.2.0
   Compiling nodrop v0.1.14
   Compiling dunce v1.0.4
   Compiling try-lock v0.2.4
   Compiling alloc-no-stdlib v2.0.4
   Compiling heck v0.4.1
   Compiling want v0.3.1
   Compiling alloc-stdlib v0.2.2
   Compiling servo_arc v0.1.1
   Compiling miniz_oxide v0.7.1
   Compiling scroll v0.11.0
   Compiling native-tls v0.2.11
   Compiling futures-channel v0.3.28
   Compiling httparse v1.8.0
   Compiling fxhash v0.2.1
   Compiling html5ever v0.25.2
   Compiling selectors v0.22.0
   Compiling backtrace v0.3.68
   Compiling mach2 v0.4.1
   Compiling socket2 v0.4.9
   Compiling indexmap v1.9.3
   Compiling memoffset v0.9.0
   Compiling gimli v0.27.3
   Compiling raw-window-handle v0.5.2
   Compiling same-file v1.0.6
   Compiling tower-service v0.3.2
   Compiling semver v1.0.18
   Compiling thin-slice v0.1.1
   Compiling httpdate v1.0.3
   Compiling walkdir v2.3.3
   Compiling crash-context v0.6.1
   Compiling string_cache v0.8.7
   Compiling serde_json v1.0.105
   Compiling url v2.4.0
   Compiling serde_with v3.2.0
   Compiling uuid v1.4.1
   Compiling bytes v1.4.0
   Compiling debugid v0.8.0
   Compiling http v0.2.9
   Compiling tokio v1.31.0
   Compiling treediff v4.0.2
   Compiling json-patch v1.0.0
   Compiling sentry-types v0.31.7
   Compiling toml_datetime v0.6.3
   Compiling serde_spanned v0.6.3
   Compiling toml_edit v0.19.14
   Compiling kuchiki v0.8.1
   Compiling tauri-utils v1.4.0
   Compiling http-body v0.4.5
   Compiling addr2line v0.20.0
   Compiling cfb v0.7.3
   Compiling sentry-core v0.31.7
   Compiling toml v0.7.6
   Compiling tokio-util v0.7.10
   Compiling tokio-native-tls v0.3.1
   Compiling h2 v0.3.21
   Compiling flate2 v1.0.27
   Compiling brotli-decompressor v2.3.4
   Compiling core-graphics v0.22.3
   Compiling cocoa-foundation v0.1.1
   Compiling range-map v0.2.0
   Compiling block-buffer v0.10.4
   Compiling crypto-common v0.1.6
   Compiling hyper v0.14.27
   Compiling fdeflate v0.3.0
   Compiling objc_id v0.1.1
   Compiling aho-corasick v1.0.4
   Compiling object v0.31.1
   Compiling num-derive v0.4.1
   Compiling smart-default v0.7.1
   Compiling findshlibs v0.10.2
   Compiling tao v0.16.2
   Compiling polling v2.8.0
   Compiling rustc-demangle v0.1.23
   Compiling dispatch v0.2.0
   Compiling hashbrown v0.12.3
   Compiling minidump-writer v0.8.2
   Compiling regex-syntax v0.7.4
   Compiling safemem v0.3.3
   Compiling plain v0.2.3
   Compiling goblin v0.7.1
   Compiling line-wrap v0.1.1
   Compiling minidump-common v0.18.0
   Compiling regex-automata v0.3.6
   Compiling hyper-tls v0.5.0
   Compiling png v0.17.9
   Compiling digest v0.10.7
   Compiling cocoa v0.24.1
   Compiling crossbeam-channel v0.5.8
   Compiling system-configuration v0.5.1
   Compiling serde_urlencoded v0.7.1
   Compiling sentry-contexts v0.31.7
   Compiling quick-xml v0.29.0
   Compiling cpufeatures v0.2.9
   Compiling memmap2 v0.5.10
   Compiling instant v0.1.12
   Compiling encoding_rs v0.8.32
   Compiling base64 v0.21.2
   Compiling tauri-runtime v0.14.0
   Compiling wry v0.24.3
   Compiling ipnet v2.9.0
   Compiling match_cfg v0.1.0
   Compiling mime v0.3.17
   Compiling hostname v0.3.1
   Compiling plist v1.5.0
   Compiling reqwest v0.11.22
   Compiling sha2 v0.10.7
   Compiling ico v0.3.0
   Compiling sentry-backtrace v0.31.7
   Compiling embed-resource v2.2.0
   Compiling anyhow v1.0.74
   Compiling bstr v1.6.0
   Compiling uname v0.1.1
   Compiling http-range v0.1.5
   Compiling rfd v0.10.0
   Compiling tauri-runtime-wry v0.14.0
   Compiling globset v0.4.13
   Compiling tauri-winres v0.1.1
   Compiling sentry-panic v0.31.7
   Compiling minidumper v0.8.0
   Compiling sentry-debug-images v0.31.7
   Compiling tauri-codegen v1.4.0
   Compiling objc-foundation v0.1.1
   Compiling cargo_toml v0.15.3
   Compiling crash-handler v0.6.0
   Compiling tauri v1.4.1
   Compiling thread_local v1.1.7
   Compiling serialize-to-javascript-impl v0.1.1
   Compiling dirs-sys-next v0.1.2
   Compiling xattr v1.0.1
   Compiling filetime v0.2.22
   Compiling vte_generate_state_changes v0.1.1
   Compiling pathdiff v0.2.1
   Compiling utf8parse v0.2.1
   Compiling open v3.2.0
   Compiling serialize-to-javascript v0.1.1
   Compiling tar v0.4.40
   Compiling tauri-build v1.4.0
   Compiling vte v0.11.1
   Compiling dirs-next v2.0.0
   Compiling ignore v0.4.20
   Compiling tauri-macros v1.4.0
   Compiling minidumper-child v0.2.1
   Compiling sentry v0.31.7
   Compiling zip v0.6.6
   Compiling serde_repr v0.1.16
   Compiling shared_child v1.0.0
   Compiling os_pipe v1.1.4
   Compiling state v0.5.3
   Compiling embed_plist v1.2.2
   Compiling minisign-verify v0.2.1
   Compiling app v0.5.0 (/Users/user/Documents/projects/ophiuchi-desktop/src-tauri)
   Compiling sentry-rust-minidump v0.6.4
   Compiling strip-ansi-escapes v0.2.0
   Compiling iana-time-zone v0.1.57
   Compiling chrono v0.4.38
   Compiling fix-path-env v0.0.0 (https://github.com/tauri-apps/fix-path-env-rs#016512bc)
   Compiling sentry-tauri v0.2.0
warning: constant `PREFIX` is never used
  --> src/keychainmgr/keychain_passwords.rs:18:7
   |
18 | const PREFIX: &str = "dev.ophiuchi.app: ";
   |       ^^^^^^
   |
   = note: `#[warn(dead_code)]` on by default

warning: `app` (bin "app") generated 1 warning
    Finished `release` profile [optimized] target(s) in 55.76s
        Warn Signing, by default, is only supported on Windows hosts, but you can specify a custom signing command in `bundler > windows > sign_command`, for now, skipping signing the installer...
    Bundling Ophiuchi.app (/Users/user/Documents/projects/ophiuchi-desktop/src-tauri/target/release/bundle/macos/Ophiuchi.app)
    Bundling Ophiuchi_0.5.0_aarch64.dmg (/Users/user/Documents/projects/ophiuchi-desktop/src-tauri/target/release/bundle/dmg/Ophiuchi_0.5.0_aarch64.dmg)
     Running bundle_dmg.sh
    Bundling /Users/user/Documents/projects/ophiuchi-desktop/src-tauri/target/release/bundle/macos/Ophiuchi.app.tar.gz (/Users/user/Documents/projects/ophiuchi-desktop/src-tauri/target/release/bundle/macos/Ophiuchi.app.tar.gz)
    Finished 2 bundles at:
        /Users/user/Documents/projects/ophiuchi-desktop/src-tauri/target/release/bundle/macos/Ophiuchi.app
        /Users/user/Documents/projects/ophiuchi-desktop/src-tauri/target/release/bundle/dmg/Ophiuchi_0.5.0_aarch64.dmg
        /Users/user/Documents/projects/ophiuchi-desktop/src-tauri/target/release/bundle/macos/Ophiuchi.app.tar.gz (updater)

Screenshots N/A

Desktop (please complete the following information):

Additional context I found out that this works https://github.com/time-rs/time/issues/681#issuecomment-2128002434

Adding the following (line 24) works

image

There is probably another dependency that should be updated instead.

cheeselemon commented 1 month ago

thanks!