Package Details: softu2f 0.4.2.r22.gda1c12d-1

Git Clone URL: https://aur.archlinux.org/softu2f.git (read-only, click to copy)
Package Base: softu2f
Description: Software U2F HID token daemon (rust-u2f)
Upstream URL: https://github.com/danstiner/rust-u2f
Submitter: grawity
Maintainer: None
Last Packager: grawity
Votes: 1
Popularity: 0.001345
First Submitted: 2019-11-04 09:03 (UTC)
Last Updated: 2023-09-17 17:30 (UTC)

Latest Comments

1 2 Next › Last »

ravenstar commented on 2024-02-26 19:24 (UTC)

Built only with options=('!lto') in the PKGBUILD.

Details can be found here: https://gitlab.archlinux.org/archlinux/rfcs/-/blob/master/rfcs/0004-lto-by-default.rst

kousu commented on 2023-08-30 12:43 (UTC)

This is still failing for me, but with a different error now:

$ rustc --version
rustc 1.72.0 (5680fa18f 2023-08-23) (Arch Linux rust 1:1.72.0-1)
$ makepkg -s
==> Making package: softu2f 0.4.2.r12.gb65fb15-1 (Wed 30 Aug 2023 08:36:55 AM)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Cloning rust-u2f git repo...
Cloning into bare repository '/home/kousu/Downloads/softu2f/rust-u2f'...
remote: Enumerating objects: 5031, done.
remote: Counting objects: 100% (1645/1645), done.
remote: Compressing objects: 100% (689/689), done.
remote: Total 5031 (delta 1126), reused 1353 (delta 944), pack-reused 3386
Receiving objects: 100% (5031/5031), 1.11 MiB | 4.02 MiB/s, done.
Resolving deltas: 100% (3277/3277), done.
  -> Found softu2f_system.preset
==> Validating source files with sha256sums...
    rust-u2f ... Skipped
    softu2f_system.preset ... Passed
==> Extracting sources...
  -> Creating working copy of rust-u2f git repo...
Cloning into 'rust-u2f'...
done.
Switched to a new branch 'makepkg'
==> Starting pkgver()...
==> Starting build()...
warning: some crates are on edition 2021 which defaults to `resolver = "2"`, but virtual workspaces default to `resolver = "1"`
note: to keep the current resolver, specify `workspace.resolver = "1"` in the workspace root's manifest
note: to use the edition 2021 resolver, specify `workspace.resolver = "2"` in the workspace root's manifest
   Compiling libc v0.2.123
   Compiling proc-macro2 v1.0.47
   Compiling autocfg v1.1.0
   Compiling unicode-ident v1.0.5
   Compiling syn v1.0.103
   Compiling cfg-if v1.0.0
   Compiling memchr v2.4.1
   Compiling log v0.4.16
   Compiling serde_derive v1.0.136
   Compiling quote v1.0.18
   Compiling serde v1.0.136
   Compiling futures-core v0.3.21
   Compiling pin-project-lite v0.2.8
   Compiling lazy_static v1.4.0
   Compiling typenum v1.15.0
   Compiling version_check v0.9.4
   Compiling once_cell v1.10.0
   Compiling num-traits v0.2.14
   Compiling generic-array v0.14.5
   Compiling futures-io v0.3.21
   Compiling futures-sink v0.3.21
   Compiling slab v0.4.6
   Compiling futures-task v0.3.21
   Compiling futures-channel v0.3.21
   Compiling bitflags v1.3.2
   Compiling socket2 v0.4.4
   Compiling futures-util v0.3.21
   Compiling num-integer v0.1.44
   Compiling pkg-config v0.3.25
   Compiling scopeguard v1.1.0
   Compiling pin-utils v0.1.0
   Compiling smallvec v1.8.0
   Compiling ppv-lite86 v0.2.16
   Compiling tracing-core v0.1.25
   Compiling memoffset v0.6.5
   Compiling lock_api v0.4.7
   Compiling parking_lot_core v0.9.2
   Compiling subtle v2.4.1
   Compiling aho-corasick v0.7.18
   Compiling regex-syntax v0.6.25
   Compiling cc v1.0.73
   Compiling glob v0.3.0
   Compiling clang-sys v1.3.1
   Compiling regex v1.5.5
   Compiling num_cpus v1.13.1
   Compiling getrandom v0.2.6
   Compiling crossbeam-utils v0.8.8
   Compiling byteorder v1.4.3
   Compiling bytes v1.1.0
   Compiling rand_core v0.6.3
   Compiling parking_lot v0.12.0
   Compiling thiserror-impl v1.0.30
   Compiling futures-macro v0.3.21
   Compiling tracing-attributes v0.1.20
   Compiling thiserror v1.0.30
   Compiling tokio-macros v1.7.0
   Compiling tracing v0.1.33
   Compiling mio v0.8.2
   Compiling signal-hook-registry v1.4.0
   Compiling minimal-lexical v0.2.1
   Compiling tokio v1.17.0
   Compiling nom v7.1.1
   Compiling futures-executor v0.3.21
   Compiling rand_chacha v0.3.1
   Compiling libloading v0.7.3
   Compiling either v1.6.1
   Compiling bindgen v0.61.0
   Compiling toml v0.5.8
   Compiling which v4.2.5
   Compiling proc-macro-crate v1.1.3
   Compiling rand v0.8.5
   Compiling cexpr v0.6.0
   Compiling futures v0.3.21
   Compiling pin-project-internal v1.0.10
   Compiling openssl-sys v0.9.72
   Compiling crossbeam-epoch v0.9.8
   Compiling async-trait v0.1.53
   Compiling peeking_take_while v0.1.2
   Compiling shlex v1.1.0
   Compiling rustc-hash v1.1.0
   Compiling lazycell v1.3.0
   Compiling proc-macro-hack v0.5.19
   Compiling cache-padded v1.2.0
   Compiling concurrent-queue v1.2.2
   Compiling pin-project v1.0.10
   Compiling block-buffer v0.10.2
   Compiling crypto-common v0.1.3
   Compiling num-bigint v0.4.3
   Compiling static_assertions v1.1.0
   Compiling fastrand v1.7.0
   Compiling cpufeatures v0.2.2
   Compiling parking v2.0.0
   Compiling crossbeam-queue v0.3.5
   Compiling waker-fn v1.1.0
   Compiling futures-lite v1.12.0
   Compiling digest v0.10.3
   Compiling ring v0.16.20
   Compiling openssl v0.10.38
   Compiling getrandom v0.1.16
   Compiling tower-layer v0.3.1
   Compiling tower-service v0.3.1
   Compiling foreign-types-shared v0.1.1
   Compiling hex v0.4.3
   Compiling foreign-types v0.3.2
   Compiling tower v0.4.12
   Compiling pkg-version-impl v0.1.1
   Compiling crossbeam-deque v0.8.1
   Compiling uhid-sys v1.0.0 (/home/kousu/Downloads/softu2f/src/rust-u2f/linux/uhid-sys)
   Compiling regex-automata v0.1.10
   Compiling crossbeam-channel v0.5.4
   Compiling enumflags2_derive v0.7.4
   Compiling nix v0.23.1
   Compiling polling v2.2.0
error: failed to run custom build command for `uhid-sys v1.0.0 (/home/kousu/Downloads/softu2f/src/rust-u2f/linux/uhid-sys)`

Caused by:
  process didn't exit successfully: `/home/kousu/Downloads/softu2f/src/rust-u2f/target/release/build/uhid-sys-9282f60d1c53cfe9/build-script-build` (exit status: 101)
  --- stderr
  thread 'main' panicked at '"__atomic_wide_counter_struct_(unnamed_at_/usr/include/bits/atomic_wide_counter_h_28_3)" is not a valid Ident', /home/kousu/.cargo/registry/src/index.crates.io-6f17d22bba15001f/proc-macro2-1.0.47/src/fallback.rs:756:9
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
==> ERROR: A failure occurred in build().
    Aborting...

kousu commented on 2022-10-25 21:56 (UTC) (edited on 2022-10-25 21:57 (UTC) by kousu)

Attempt 1

Trying to build out of the current snapshot, the one tagged

pkgname=softu2f
pkgver=0.4.0.r25.g45a073f
pkgrel=1

on a fresh Arch install currently gives me

    Compiling tokio-linux-uhid v0.4.0 (/home/build2/softu2f/src/rust-u2f/linux/uhid-tokio)
error: reference to packed field is unaligned
   --> uhid-tokio/src/codec.rs:242:31
    |
242 |                 let payload = &event.u.start;
    |                               ^^^^^^^^^^^^^^
makepkg -s
[build2@cb90fada0e7d softu2f]$ makepkg -s
==> Making package: softu2f 0.4.0.r25.g45a073f-1 (Tue Oct 25 21:49:46 2022)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Updating rust-u2f git repo...
  -> Found softu2f_system.preset
==> Validating source files with sha256sums...
    rust-u2f ... Skipped
    softu2f_system.preset ... Passed
==> Extracting sources...
  -> Creating working copy of rust-u2f git repo...
Reset branch 'makepkg'
==> Starting pkgver()...
==> Removing existing $pkgdir/ directory...
==> Starting build()...
warning: constant `VENDOR_FIRST_COMMAND_CODE` is never used
 --> /home/build2/softu2f/src/rust-u2f/u2f-core/src/constants.rs:4:18
  |
4 | pub(crate) const VENDOR_FIRST_COMMAND_CODE: u8 = 0x40;
  |                  ^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(dead_code)]` on by default

warning: constant `VENDOR_LAST_COMMAND_CODE` is never used
 --> /home/build2/softu2f/src/rust-u2f/u2f-core/src/constants.rs:5:18
  |
5 | pub(crate) const VENDOR_LAST_COMMAND_CODE: u8 = 0xbf;
  |                  ^^^^^^^^^^^^^^^^^^^^^^^^

warning: constant `SW_COMMAND_NOT_ALLOWED` is never used
  --> /home/build2/softu2f/src/rust-u2f/u2f-core/src/constants.rs:10:18
   |
10 | pub(crate) const SW_COMMAND_NOT_ALLOWED: u16 = 0x6986;
   |                  ^^^^^^^^^^^^^^^^^^^^^^

warning: constant `EC_POINT_FORMAT_UNCOMPRESSED` is never used
  --> /home/build2/softu2f/src/rust-u2f/u2f-core/src/constants.rs:23:18
   |
23 | pub(crate) const EC_POINT_FORMAT_UNCOMPRESSED: u8 = 0x04;
   |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: associated function `from_bytes` is never used
  --> /home/build2/softu2f/src/rust-u2f/u2f-core/src/public_key.rs:21:19
   |
21 |     pub(crate) fn from_bytes(bytes: &[u8]) -> Result<PublicKey, String> {
   |                   ^^^^^^^^^^

warning: associated function `as_ec_key` is never used
  --> /home/build2/softu2f/src/rust-u2f/u2f-core/src/public_key.rs:34:19
   |
34 |     pub(crate) fn as_ec_key(&self) -> &EcKey<Public> {
   |                   ^^^^^^^^^

warning: `u2f-core` (lib) generated 6 warnings
warning: variants `None`, `InvalidParameter`, `InvalidMessageLength`, `MessageTimedOut`, `CommandRequiresChannelLock` and `SyncCommandFailed` are never constructed
  --> /home/build2/softu2f/src/rust-u2f/u2fhid-protocol/src/definitions.rs:80:5
   |
79 | pub enum ErrorCode {
   |          --------- variants in this enum
80 |     None,
   |     ^^^^
...
83 |     InvalidParameter,
   |     ^^^^^^^^^^^^^^^^
84 |     InvalidMessageLength,
   |     ^^^^^^^^^^^^^^^^^^^^
85 |     InvalidMessageSequencing,
86 |     MessageTimedOut,
   |     ^^^^^^^^^^^^^^^
87 |     ChannelBusy,
88 |     CommandRequiresChannelLock,
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^
89 |     SyncCommandFailed,
   |     ^^^^^^^^^^^^^^^^^
   |
   = note: `#[warn(dead_code)]` on by default
   = note: `ErrorCode` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis

warning: variant `Wink` is never constructed
   --> /home/build2/softu2f/src/rust-u2f/u2fhid-protocol/src/definitions.rs:429:5
    |
410 | pub enum ResponseMessage {
    |          --------------- variant in this enum
...
429 |     Wink,
    |     ^^^^
    |
    = note: `ResponseMessage` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis

warning: field `timeout` is never read
  --> /home/build2/softu2f/src/rust-u2f/u2fhid-protocol/src/protocol_state_machine.rs:34:5
   |
31 | struct DispatchState {
   |        ------------- field in this struct
...
34 |     timeout: Timeout,
   |     ^^^^^^^

warning: associated function `get_ref` is never used
  --> /home/build2/softu2f/src/rust-u2f/u2fhid-protocol/src/segmenting_sink.rs:38:12
   |
38 |     pub fn get_ref(&self) -> &S {
   |            ^^^^^^^

warning: associated function `get_mut` is never used
  --> /home/build2/softu2f/src/rust-u2f/u2fhid-protocol/src/segmenting_sink.rs:43:12
   |
43 |     pub fn get_mut(&mut self) -> &mut S {
   |            ^^^^^^^

warning: associated function `poll_ready` is never used
  --> /home/build2/softu2f/src/rust-u2f/u2fhid-protocol/src/segmenting_sink.rs:47:12
   |
47 |     pub fn poll_ready(&mut self) -> Async<()> {
   |            ^^^^^^^^^^

warning: `u2fhid-protocol` (lib) generated 6 warnings
   Compiling tokio-linux-uhid v0.4.0 (/home/build2/softu2f/src/rust-u2f/linux/uhid-tokio)
error: reference to packed field is unaligned
   --> uhid-tokio/src/codec.rs:242:31
    |
242 |                 let payload = &event.u.start;
    |                               ^^^^^^^^^^^^^^
    |
    = note: `#[deny(unaligned_references)]` on by default
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
    = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
    = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
    = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)

error: could not compile `tokio-linux-uhid` due to 2 previous errors
==> ERROR: A failure occurred in build().
    Aborting...
Attempt 2

I tried using @grdgkjrpdihe's PKGBUILD below, the one tagged

pkgname=softu2f-git
pkgver=0.4.2.r33.ged469b7
pkgrel=1

and got the same error, though in a slightly different order:

makepkg -s
[build2@cb90fada0e7d softu2f-newer]$ makepkg -s
==> Making package: softu2f-git 0.4.2.r33.ged469b7-1 (Tue Oct 25 21:51:58 2022)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Updating rust-u2f git repo...
==> Validating source files with sha256sums...
    rust-u2f ... Skipped
==> Extracting sources...
  -> Creating working copy of rust-u2f git repo...
Reset branch 'makepkg'
==> Starting prepare()...
==> Starting pkgver()...
==> Removing existing $pkgdir/ directory...
==> Starting build()...
warning: unused imports: `Deserialize`, `Serialize`
 --> fido2-authenticator-api/src/webauthn.rs:1:13
  |
1 | use serde::{Deserialize, Serialize};
  |             ^^^^^^^^^^^  ^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

warning: unused import: `std::io`
 --> fido2-authenticator-api/src/lib.rs:5:5
  |
5 | use std::io;
  |     ^^^^^^^

warning: unused import: `std::pin::Pin`
 --> fido2-authenticator-api/src/lib.rs:6:5
  |
6 | use std::pin::Pin;
  |     ^^^^^^^^^^^^^

warning: unused import: `std::rc::Rc`
 --> fido2-authenticator-api/src/lib.rs:7:5
  |
7 | use std::rc::Rc;
  |     ^^^^^^^^^^^

warning: unused import: `std::result::Result`
 --> fido2-authenticator-api/src/lib.rs:8:5
  |
8 | use std::result::Result;
  |     ^^^^^^^^^^^^^^^^^^^

warning: unused import: `std::task::Context`
 --> fido2-authenticator-api/src/lib.rs:9:5
  |
9 | use std::task::Context;
  |     ^^^^^^^^^^^^^^^^^^

warning: unused import: `std::task::Poll`
  --> fido2-authenticator-api/src/lib.rs:10:5
   |
10 | use std::task::Poll;
   |     ^^^^^^^^^^^^^^^

warning: unused import: `async_trait::async_trait`
  --> fido2-authenticator-api/src/lib.rs:12:5
   |
12 | use async_trait::async_trait;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^

warning: unused imports: `BigEndian`, `WriteBytesExt`
  --> fido2-authenticator-api/src/lib.rs:13:17
   |
13 | use byteorder::{BigEndian, WriteBytesExt};
   |                 ^^^^^^^^^  ^^^^^^^^^^^^^

warning: unused import: `futures::Future`
  --> fido2-authenticator-api/src/lib.rs:14:5
   |
14 | use futures::Future;
   |     ^^^^^^^^^^^^^^^

warning: unused import: `serde::Deserialize`
  --> fido2-authenticator-api/src/lib.rs:15:5
   |
15 | use serde::Deserialize;
   |     ^^^^^^^^^^^^^^^^^^

warning: unused import: `serde::Serialize`
  --> fido2-authenticator-api/src/lib.rs:16:5
   |
16 | use serde::Serialize;
   |     ^^^^^^^^^^^^^^^^

warning: unused import: `thiserror::Error`
  --> fido2-authenticator-api/src/lib.rs:17:5
   |
17 | use thiserror::Error;
   |     ^^^^^^^^^^^^^^^^

warning: unused imports: `debug`, `error`, `info`, `trace`
  --> fido2-authenticator-api/src/lib.rs:18:15
   |
18 | use tracing::{debug, error, info, trace};
   |               ^^^^^  ^^^^^  ^^^^  ^^^^^

warning: enum `COSEAlgorithmIdentifier` is never used
 --> fido2-authenticator-api/src/webauthn.rs:3:6
  |
3 | enum COSEAlgorithmIdentifier {
  |      ^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(dead_code)]` on by default

warning: fields `alg` and `type_` are never read
  --> fido2-authenticator-api/src/webauthn.rs:12:5
   |
11 | pub struct PublicKeyCredentialParameters {
   |            ----------------------------- fields in this struct
12 |     alg: u64, // todo use COSEAlgorithmIdentifier
   |     ^^^
13 |     type_: String,
   |     ^^^^^
   |
   = note: `PublicKeyCredentialParameters` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis

warning: unreachable pattern
   --> u2f-core/src/request.rs:121:13
    |
106 |             REGISTER_COMMAND_CODE => {
    |             --------------------- matches any value
...
121 |             AUTHENTICATE_COMMAND_CODE => {
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^ unreachable pattern
    |
    = note: `#[warn(unreachable_patterns)]` on by default

warning: unreachable pattern
   --> u2f-core/src/request.rs:158:13
    |
106 |             REGISTER_COMMAND_CODE => {
    |             --------------------- matches any value
...
158 |             VERSION_COMMAND_CODE => {
    |             ^^^^^^^^^^^^^^^^^^^^ unreachable pattern

warning: unreachable pattern
   --> u2f-core/src/request.rs:164:13
    |
106 |             REGISTER_COMMAND_CODE => {
    |             --------------------- matches any value
...
164 |             _ => panic!("Command not implemented"),
    |             ^ unreachable pattern

warning: unused variable: `REGISTER_COMMAND_CODE`
   --> u2f-core/src/request.rs:106:13
    |
106 |             REGISTER_COMMAND_CODE => {
    |             ^^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_REGISTER_COMMAND_CODE`
    |
    = note: `#[warn(unused_variables)]` on by default

warning: unused variable: `AUTHENTICATE_COMMAND_CODE`
   --> u2f-core/src/request.rs:121:13
    |
121 |             AUTHENTICATE_COMMAND_CODE => {
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_AUTHENTICATE_COMMAND_CODE`

warning: unused variable: `VERSION_COMMAND_CODE`
   --> u2f-core/src/request.rs:158:13
    |
158 |             VERSION_COMMAND_CODE => {
    |             ^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_VERSION_COMMAND_CODE`

warning: variable `REGISTER_COMMAND_CODE` should have a snake case name
   --> u2f-core/src/request.rs:106:13
    |
106 |             REGISTER_COMMAND_CODE => {
    |             ^^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `register_command_code`
    |
    = note: `#[warn(non_snake_case)]` on by default

warning: variable `AUTHENTICATE_COMMAND_CODE` should have a snake case name
   --> u2f-core/src/request.rs:121:13
    |
121 |             AUTHENTICATE_COMMAND_CODE => {
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `authenticate_command_code`

warning: variable `VERSION_COMMAND_CODE` should have a snake case name
   --> u2f-core/src/request.rs:158:13
    |
158 |             VERSION_COMMAND_CODE => {
    |             ^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `version_command_code`

warning: `fido2-authenticator-api` (lib) generated 16 warnings
warning: `u2f-core` (lib) generated 9 warnings
   Compiling tokio-linux-uhid v0.4.2 (/home/build2/softu2f-newer/src/rust-u2f/linux/uhid-tokio)
   Compiling zvariant v3.1.2
warning: unused import: `rc::Rc`
 --> ctaphid/src/api.rs:1:11
  |
1 | use std::{rc::Rc, sync::Arc};
  |           ^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

warning: unused imports: `debug`, `trace`
  --> ctaphid/src/protocol.rs:19:15
   |
19 | use tracing::{debug, info, trace};
   |               ^^^^^        ^^^^^

warning: unused import: `message::ResponseMessage`
  --> ctaphid/src/server.rs:13:30
   |
13 | use crate::{api::CtapHidApi, message::ResponseMessage, packet::Packet, protocol::Protocol};
   |                              ^^^^^^^^^^^^^^^^^^^^^^^^

warning: unreachable call
   --> ctaphid/src/protocol.rs:157:48
    |
157 |             ChannelState::Processing { .. } => Err(todo!("Channel busy")),
    |                                                ^^^ --------------------- any code following this expression is unreachable
    |                                                |
    |                                                unreachable call
    |
    = note: `#[warn(unreachable_code)]` on by default

warning: unused variable: `msg`
  --> ctaphid/src/api.rs:87:25
   |
87 |     async fn msg(&self, msg: &[u8]) -> Result<Vec<u8>, Self::Error> {
   |                         ^^^ help: if this is intentional, prefix it with an underscore: `_msg`
   |
   = note: `#[warn(unused_variables)]` on by default

warning: unused variable: `cbor`
  --> ctaphid/src/api.rs:90:26
   |
90 |     async fn cbor(&self, cbor: &[u8]) -> Result<Vec<u8>, Self::Error> {
   |                          ^^^^ help: if this is intentional, prefix it with an underscore: `_cbor`

warning: unused variable: `status`
   --> ctaphid/src/message.rs:269:35
    |
269 |             Response::KeepAlive { status } => {
    |                                   ^^^^^^ help: try ignoring the field: `status: _`

warning: unused variable: `lock_time`
   --> ctaphid/src/protocol.rs:140:45
    |
140 | ...                   Request::Lock { lock_time } => todo!(),
    |                                       ^^^^^^^^^ help: try ignoring the field: `lock_time: _`

warning: field `next_allocation` is never read
  --> ctaphid/src/channel.rs:35:5
   |
34 | pub struct Channels {
   |            -------- field in this struct
35 |     next_allocation: ChannelId,
   |     ^^^^^^^^^^^^^^^
   |
   = note: `#[warn(dead_code)]` on by default
   = note: `Channels` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis

warning: associated function `allocate` is never used
  --> ctaphid/src/channel.rs:45:12
   |
45 |     pub fn allocate(&mut self) -> Result<ChannelId, ()> {
   |            ^^^^^^^^

warning: associated function `is_valid` is never used
  --> ctaphid/src/channel.rs:55:12
   |
55 |     pub fn is_valid(&self, channel_id: ChannelId) -> bool {
   |            ^^^^^^^^

warning: variant `Cancel` is never constructed
   --> ctaphid/src/message.rs:141:5
    |
136 | pub enum Request {
    |          ------- variant in this enum
...
141 |     Cancel,
    |     ^^^^^^
    |
    = note: `Request` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis

warning: variants `KeepAlive` and `Lock` are never constructed
   --> ctaphid/src/message.rs:225:5
    |
206 | pub enum Response {
    |          -------- variants in this enum
...
225 |     KeepAlive {
    |     ^^^^^^^^^
...
232 |     Lock,
    |     ^^^^
    |
    = note: `Response` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis

warning: associated function `project_ref` is never used
  --> ctaphid/src/protocol.rs:38:1
   |
38 | #[pin_project]
   | ^^^^^^^^^^^^^^

warning: associated function `project` is never used
  --> ctaphid/src/server.rs:15:1
   |
15 | #[pin_project]
   | ^^^^^^^^^^^^^^

warning: associated function `project_ref` is never used
  --> ctaphid/src/server.rs:15:1
   |
15 | #[pin_project]
   | ^^^^^^^^^^^^^^

   Compiling zvariant v2.10.0
warning: unused `#[macro_use]` import
 --> fido2-authenticator-service/src/lib.rs:9:1
  |
9 | #[macro_use]
  | ^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

warning: unused import: `std::fmt::Debug`
 --> fido2-authenticator-service/src/service.rs:1:5
  |
1 | use std::fmt::Debug;
  |     ^^^^^^^^^^^^^^^

warning: unused import: `std::io`
 --> fido2-authenticator-service/src/service.rs:2:5
  |
2 | use std::io;
  |     ^^^^^^^

warning: unused import: `std::rc::Rc`
 --> fido2-authenticator-service/src/service.rs:4:5
  |
4 | use std::rc::Rc;
  |     ^^^^^^^^^^^

warning: unused import: `std::sync::Arc`
 --> fido2-authenticator-service/src/service.rs:6:5
  |
6 | use std::sync::Arc;
  |     ^^^^^^^^^^^^^^

warning: unused import: `async_trait::async_trait`
  --> fido2-authenticator-service/src/service.rs:10:5
   |
10 | use async_trait::async_trait;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^

warning: unused imports: `BigEndian`, `WriteBytesExt`
  --> fido2-authenticator-service/src/service.rs:11:17
   |
11 | use byteorder::{BigEndian, WriteBytesExt};
   |                 ^^^^^^^^^  ^^^^^^^^^^^^^

warning: unused import: `thiserror::Error`
  --> fido2-authenticator-service/src/service.rs:16:5
   |
16 | use thiserror::Error;
   |     ^^^^^^^^^^^^^^^^

warning: unused imports: `error`, `info`
  --> fido2-authenticator-service/src/service.rs:18:22
   |
18 | use tracing::{debug, error, info, trace};
   |                      ^^^^^  ^^^^

warning: unused import: `u2f_core::AppId`
  --> fido2-authenticator-service/src/service.rs:19:5
   |
19 | use u2f_core::AppId;
   |     ^^^^^^^^^^^^^^^

warning: unused import: `u2f_core::KeyHandle`
  --> fido2-authenticator-service/src/service.rs:21:5
   |
21 | use u2f_core::KeyHandle;
   |     ^^^^^^^^^^^^^^^^^^^

warning: unused import: `crate::attestation::AttestationCertificate`
  --> fido2-authenticator-service/src/service.rs:25:5
   |
25 | use crate::attestation::AttestationCertificate;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: unused import: `crate::public_key::PublicKey`
  --> fido2-authenticator-service/src/service.rs:27:5
   |
27 | use crate::public_key::PublicKey;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: unused import: `crate::user_presence_byte`
  --> fido2-authenticator-service/src/service.rs:29:5
   |
29 | use crate::user_presence_byte;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^

warning: unused import: `crate::AuthenticateError`
  --> fido2-authenticator-service/src/service.rs:30:5
   |
30 | use crate::AuthenticateError;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^

warning: unused import: `crate::Authentication`
  --> fido2-authenticator-service/src/service.rs:31:5
   |
31 | use crate::Authentication;
   |     ^^^^^^^^^^^^^^^^^^^^^

warning: unused import: `crate::Challenge`
  --> fido2-authenticator-service/src/service.rs:32:5
   |
32 | use crate::Challenge;
   |     ^^^^^^^^^^^^^^^^

warning: unused import: `crate::Counter`
  --> fido2-authenticator-service/src/service.rs:33:5
   |
33 | use crate::Counter;
   |     ^^^^^^^^^^^^^^

warning: unused import: `crate::RegisterError`
  --> fido2-authenticator-service/src/service.rs:34:5
   |
34 | use crate::RegisterError;
   |     ^^^^^^^^^^^^^^^^^^^^

warning: unused import: `crate::Registration`
  --> fido2-authenticator-service/src/service.rs:35:5
   |
35 | use crate::Registration;
   |     ^^^^^^^^^^^^^^^^^^^

warning: unused import: `std::pin::Pin`
  --> fido2-authenticator-service/src/lib.rs:29:5
   |
29 | use std::pin::Pin;
   |     ^^^^^^^^^^^^^

warning: unused import: `std::rc::Rc`
  --> fido2-authenticator-service/src/lib.rs:30:5
   |
30 | use std::rc::Rc;
   |     ^^^^^^^^^^^

warning: unused import: `std::result::Result`
  --> fido2-authenticator-service/src/lib.rs:31:5
   |
31 | use std::result::Result;
   |     ^^^^^^^^^^^^^^^^^^^

warning: unused import: `std::task::Context`
  --> fido2-authenticator-service/src/lib.rs:32:5
   |
32 | use std::task::Context;
   |     ^^^^^^^^^^^^^^^^^^

warning: unused import: `std::task::Poll`
  --> fido2-authenticator-service/src/lib.rs:33:5
   |
33 | use std::task::Poll;
   |     ^^^^^^^^^^^^^^^

warning: unused import: `async_trait::async_trait`
  --> fido2-authenticator-service/src/lib.rs:35:5
   |
35 | use async_trait::async_trait;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^

warning: unused import: `futures::Future`
  --> fido2-authenticator-service/src/lib.rs:37:5
   |
37 | use futures::Future;
   |     ^^^^^^^^^^^^^^^

warning: unused imports: `debug`, `info`, `trace`
  --> fido2-authenticator-service/src/lib.rs:40:15
   |
40 | use tracing::{debug, error, info, trace};
   |               ^^^^^         ^^^^  ^^^^^

warning: unused import: `crate::public_key::PublicKey`
  --> fido2-authenticator-service/src/lib.rs:45:5
   |
45 | use crate::public_key::PublicKey;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: unreachable expression
   --> fido2-authenticator-service/src/service.rs:112:37
    |
111 |                         versions: todo!(),
    |                                   ------- any code following this expression is unreachable
112 |                         extensions: todo!(),
    |                                     ^^^^^^^ unreachable expression
    |
    = note: `#[warn(unreachable_code)]` on by default
    = note: this warning originates in the macro `todo` (in Nightly builds, run with -Z macro-backtrace for more info)

warning: fields `user_public_key`, `key_handle`, `attestation_certificate` and `signature` are never read
   --> fido2-authenticator-service/src/lib.rs:108:5
    |
107 | pub struct Registration {
    |            ------------ fields in this struct
108 |     user_public_key: Vec<u8>,
    |     ^^^^^^^^^^^^^^^
109 |     key_handle: KeyHandle,
    |     ^^^^^^^^^^
110 |     attestation_certificate: AttestationCertificate,
    |     ^^^^^^^^^^^^^^^^^^^^^^^
111 |     signature: Box<dyn Signature>,
    |     ^^^^^^^^^
    |
    = note: `#[warn(dead_code)]` on by default
    = note: `Registration` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis

warning: fields `counter`, `signature` and `user_present` are never read
   --> fido2-authenticator-service/src/lib.rs:116:5
    |
115 | pub struct Authentication {
    |            -------------- fields in this struct
116 |     counter: Counter,
    |     ^^^^^^^
117 |     signature: Box<dyn Signature>,
    |     ^^^^^^^^^
118 |     user_present: bool,
    |     ^^^^^^^^^^^^
    |
    = note: `Authentication` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis

warning: function `user_presence_byte` is never used
   --> fido2-authenticator-service/src/lib.rs:152:4
    |
152 | fn user_presence_byte(user_present: bool) -> u8 {
    |    ^^^^^^^^^^^^^^^^^^

warning: fields `certificate` and `key` are never read
 --> fido2-authenticator-service/src/attestation.rs:8:16
  |
7 | pub struct Attestation {
  |            ----------- fields in this struct
8 |     pub(crate) certificate: AttestationCertificate,
  |                ^^^^^^^^^^^
9 |     pub(crate) key: PrivateKey,
  |                ^^^
  |
  = note: `Attestation` has a derived impl for the trait `Clone`, but this is intentionally ignored during dead code analysis

warning: associated function `to_der` is never used
  --> fido2-authenticator-service/src/attestation.rs:20:19
   |
20 |     pub(crate) fn to_der(&self) -> Vec<u8> {
   |                   ^^^^^^

warning: associated function `from_key` is never used
  --> fido2-authenticator-service/src/public_key.rs:11:19
   |
11 |     pub(crate) fn from_key(key: &PrivateKey) -> PublicKey {
   |                   ^^^^^^^^

warning: associated function `to_raw` is never used
  --> fido2-authenticator-service/src/public_key.rs:40:19
   |
40 |     pub(crate) fn to_raw(&self) -> Vec<u8> {
   |                   ^^^^^^

warning: fields `secrets`, `crypto` and `presence` are never read
  --> fido2-authenticator-service/src/service.rs:45:16
   |
44 | pub struct Authenticator<Secrets, Crypto, Presence> {
   |            ------------- fields in this struct
45 |     pub(crate) secrets: Secrets,
   |                ^^^^^^^
46 |     pub(crate) crypto: Crypto,
   |                ^^^^^^
47 |     pub(crate) presence: Presence,
   |                ^^^^^^^^

warning: `ctaphid` (lib) generated 16 warnings
warning: `fido2-authenticator-service` (lib) generated 38 warnings
error: reference to packed field is unaligned
   --> linux/uhid-tokio/src/codec.rs:231:31
    |
231 |                 let payload = &event.u.start;
    |                               ^^^^^^^^^^^^^^
    |
    = note: `#[deny(unaligned_references)]` on by default
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
    = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
    = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
    = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)

warning: associated function `project_ref` is never used
  --> linux/uhid-tokio/src/event_framed.rs:53:1
   |
53 | #[pin_project]
   | ^^^^^^^^^^^^^^
   |
   = note: `#[warn(dead_code)]` on by default

warning: `tokio-linux-uhid` (lib) generated 1 warning
error: could not compile `tokio-linux-uhid` due to 2 previous errors; 1 warning emitted
warning: build failed, waiting for other jobs to finish...
==> ERROR: A failure occurred in build().
    Aborting...
tl;dr

I'm guessing this is because the version of tokio-linux-uhid pinned is incompatible with

[build2@cb90fada0e7d softu2f]$ pacman -Q rust
rust 1:1.64.0-1

I'm not really sure how to fix this, but if I figure it out you can all be sure I'll follow-up!

1ace commented on 2022-07-06 16:36 (UTC)

@grdgkjrpdihe: I've posted your PKGBUILD (with a few changes), and added you as a co-maintainer. I've also added @grawity. Feel free both to make any change as you see fit :)

grdgkjrpdihe commented on 2022-06-08 02:39 (UTC)

i wrote a git version based on your work

pkgname=softu2f-git
pkgver=0.4.2.r33.ged469b7
pkgrel=1
pkgdesc="Software U2F HID token daemon (rust-u2f)"
url="https://github.com/danstiner/rust-u2f"
arch=(x86_64)
depends=(libdbus libsystemd openssl)
makedepends=(rust)
source=("git+https://github.com/danstiner/rust-u2f#commit=ed469b742cdd6465664e749378c6abbf088dff6b")
sha256sums=('SKIP')

prepare() {
    cd rust-u2f
    cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
    sed -i 's,/libexec/,/lib/,' linux/{system,user}-daemon/softu2f.service
}

pkgver() {
    cd rust-u2f
    git describe --tags | sed 's/^v//; s/-/.r/; s/-/./'
}

build() {
    cd rust-u2f
    export RUSTUP_TOOLCHAIN=stable
    export CARGO_TARGET_DIR=target
    cargo build --frozen --release --all-features
}

package() {
    cd rust-u2f

    install -Dm 755 target/release/softu2f-user-daemon \
                    "$pkgdir"/usr/lib/softu2f/user-daemon

    install -Dm 755 target/release/softu2f-system-daemon \
                    "$pkgdir"/usr/lib/softu2f/system-daemon

    install -Dm 644 linux/user-daemon/softu2f.service \
                    "$pkgdir"/usr/lib/systemd/user/softu2f.service

    install -Dm 644 linux/system-daemon/softu2f.service \
                    "$pkgdir"/usr/lib/systemd/system/softu2f.service

    install -Dm 644 linux/system-daemon/softu2f.socket \
                    "$pkgdir"/usr/lib/systemd/system/softu2f.socket

    install -Dm 644 linux/system-daemon/softu2f-tmpfiles.conf \
                    "$pkgdir"/usr/lib/tmpfiles.d/softu2f.conf
}

grawity commented on 2022-01-25 14:23 (UTC) (edited on 2022-01-25 14:24 (UTC) by grawity)

Sounds like I missed the entire prepare() section of the guidelines, which downloads sources as a separate step.

I don't use this package anymore (and don't really understand Rust build system yet), so I'd much prefer if someone else maintained it.

BlackDex commented on 2022-01-25 07:35 (UTC)

@grawity i just did a new install of this package, but it fails now. You need to remove the --offline flag during the build, else Cargo will not download the crates. This is no issue if you have them cached already but with a clean install it will not work.

grawity commented on 2021-02-22 09:44 (UTC)

It enables a local socket that doesn't result in any running processes (quite similar to all the packages which install stuff to /usr/share/dbus-1/system-services), so I think I can get away with it.

egrupled commented on 2021-02-21 21:40 (UTC) (edited on 2021-02-21 21:44 (UTC) by egrupled)

Hi, the latest commit[1] automatically enables systemd socket after package install which overrides Arch Linux default policy that leave newly installed services/sockets disabled[2] unless there is a good reason for that. I don't see that reason for softu2f therefore I think enabling softu2f service should be left to users. Could you revert that change?

[1] https://aur.archlinux.org/cgit/aur.git/commit/?h=softu2f&id=3f6f50703dc3168f136350e4f65ef6167dbd3592

[2] https://wiki.archlinux.org/index.php/systemd#Enable_installed_units_by_default