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

Fix CI error for x86_64-pc-windows-msvc #95

Merged
merged 1 commit into from
Aug 3, 2022
Merged

Fix CI error for x86_64-pc-windows-msvc #95

merged 1 commit into from
Aug 3, 2022

Conversation

hug-dev
Copy link
Member

@hug-dev hug-dev commented Aug 3, 2022

Had a weird error happening when compiling for x86_64-pc-windows-msvc:

error: reference to packed field is unaligned                                                                                                                                                                                                                                               
   --> cryptoki/src/context/general_purpose.rs:46:30                                                                                                                                                                                                                                        
    |                                                                                                                                                                                                                                                                                       
46  |                     .is_some()                                                                                                                                                                                                                                                        
    |                              ^                                                                                                                                                                                                                                                        
...                                                                                                                                                                                                                                                                                         
188 |         Function::GenerateKeyPair => check_fn!(ctx, GenerateKeyPair),                                                                                                                                                                                                                 
    |                                      ------------------------------- in this macro invocation                                                                                                                                                                                         
    |                                                                                                                                                                                                                                                                                       
    = 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)                                                           
    = note: this error originates in the macro `check_fn` (in Nightly builds, run with -Z macro-backtrace for more info)                                                                                                                                                                    
                                                                                                                                                                                                                                                                                            

This applies the tip and move things in a local variable.

@wiktor-k
Copy link
Collaborator

wiktor-k commented Aug 3, 2022

In general this looks weird but good to me 👍

In a more broader context two notes:

  1. it seems CI is already configured to run with MSVC and it didn't complain :-/
  2. maybe we should adjust the CI workflow yaml to use matrix builds since currently it's not easily visible if and when given target build fails.

@ionut-arm
Copy link
Member

I'm hoping to get some time after August to improve the CI, testing, and expand support of this repo... :] but it'll have to wait

@ionut-arm ionut-arm merged commit b51a6cb into main Aug 3, 2022
@ionut-arm ionut-arm deleted the fix-ci branch April 23, 2023 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants