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

[feature] #2645: Unions in FFI #2837

Merged
merged 1 commit into from
Oct 12, 2022

Conversation

mversic
Copy link
Contributor

@mversic mversic commented Oct 6, 2022

Signed-off-by: Marin Veršić [email protected]

Description of the Change

  • introduce a handy ffi_type! function like macro to declare your type
  • disable the use of mutable non robust references by default
  • attach ffi_type prefix to FfiType helper macro attributes
  • add repr(transparent) where applicable
  • improve serialization of transparent structures (introduce ffi_type(unsafe {robust}) or derive the Transmute trait manually)
  • implement serialization for unions
  • implement serialization of ConstString (out-pointers are still TBD)
  • fix NonLocal impls

Issue

Closes #2645 #2669 #2800 #2790 #2796

Benefits

Possible Drawbacks

Usage Examples or Tests [optional]

Alternate Designs [optional]

@github-actions github-actions bot added the iroha2-dev The re-implementation of a BFT hyperledger in RUST label Oct 6, 2022
@appetrosyan appetrosyan self-assigned this Oct 7, 2022
ffi/Cargo.toml Show resolved Hide resolved
primitives/src/fixed.rs Outdated Show resolved Hide resolved
@mversic mversic force-pushed the union_ffi branch 4 times, most recently from 937d396 to fd71cd2 Compare October 7, 2022 17:39
data_model/src/name.rs Outdated Show resolved Hide resolved
primitives/src/fixed.rs Outdated Show resolved Hide resolved
primitives/src/conststr.rs Show resolved Hide resolved
ffi/tests/ffi_export.rs Outdated Show resolved Hide resolved
ffi/src/ir.rs Outdated Show resolved Hide resolved
ffi/derive/src/convert.rs Outdated Show resolved Hide resolved
@mversic mversic force-pushed the union_ffi branch 5 times, most recently from adaeb9d to efbdb1f Compare October 11, 2022 07:59
@mversic mversic marked this pull request as ready for review October 11, 2022 08:03
@mversic mversic force-pushed the union_ffi branch 2 times, most recently from 31ba785 to 2a7bf5d Compare October 11, 2022 10:59
@mversic mversic force-pushed the union_ffi branch 2 times, most recently from d701c46 to fc34be4 Compare October 11, 2022 11:34
ffi/src/slice.rs Outdated Show resolved Hide resolved
appetrosyan
appetrosyan previously approved these changes Oct 12, 2022
ffi/tests/gen_shared_fns.rs Outdated Show resolved Hide resolved
ffi/src/lib.rs Outdated Show resolved Hide resolved
ffi/src/lib.rs Outdated Show resolved Hide resolved
ffi/src/lib.rs Outdated Show resolved Hide resolved
ffi/src/ir.rs Outdated Show resolved Hide resolved
ffi/derive/tests/ui_fail/fallible_transmute_mut_ref.rs Outdated Show resolved Hide resolved
ffi/Cargo.toml Outdated Show resolved Hide resolved
ffi/tests/ffi_export.rs Outdated Show resolved Hide resolved
ffi/src/repr_c.rs Outdated Show resolved Hide resolved
ffi/src/repr_c.rs Outdated Show resolved Hide resolved
ffi/src/repr_c.rs Outdated Show resolved Hide resolved
ffi/src/repr_c.rs Outdated Show resolved Hide resolved
primitives/src/conststr.rs Show resolved Hide resolved
primitives/src/conststr.rs Outdated Show resolved Hide resolved
ffi/derive/src/convert.rs Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Oct 12, 2022

Codecov Report

Merging #2837 (f1bb7e0) into iroha2-dev (a16d9c3) will decrease coverage by 4.88%.
The diff coverage is 75.89%.

@@              Coverage Diff               @@
##           iroha2-dev    #2837      +/-   ##
==============================================
- Coverage       67.61%   62.72%   -4.89%     
==============================================
  Files             140      168      +28     
  Lines           26173    29576    +3403     
==============================================
+ Hits            17696    18552     +856     
- Misses           8477    11024    +2547     
Impacted Files Coverage Δ
actor/src/actor_id.rs 90.00% <ø> (ø)
actor/src/deadlock.rs 85.93% <ø> (-14.07%) ⬇️
cli/derive/src/lib.rs 92.30% <ø> (+17.58%) ⬆️
cli/src/event.rs 0.00% <ø> (-41.87%) ⬇️
cli/src/main.rs 1.09% <0.00%> (-0.26%) ⬇️
cli/src/stream.rs 0.00% <ø> (-81.40%) ⬇️
client/src/http.rs 47.82% <ø> (ø)
client/src/http_default.rs 40.17% <0.00%> (-20.01%) ⬇️
client_cli/src/main.rs 0.27% <0.00%> (+0.01%) ⬆️
config/base/src/runtime_upgrades.rs 49.42% <0.00%> (ø)
... and 231 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

* implement conststring FFI conversion

Signed-off-by: Marin Veršić <[email protected]>
@appetrosyan appetrosyan merged commit 4a5b0c5 into hyperledger-iroha:iroha2-dev Oct 12, 2022
@mversic mversic deleted the union_ffi branch December 27, 2022 23:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
iroha2-dev The re-implementation of a BFT hyperledger in RUST macros
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants