Skip to content

[RTE-608] Remove mopa crate from the cargo#838

Merged
gilanghamidy merged 1 commit into
masterfrom
thomasvs/RTE-remove-mopa-Any
Nov 13, 2025
Merged

[RTE-608] Remove mopa crate from the cargo#838
gilanghamidy merged 1 commit into
masterfrom
thomasvs/RTE-remove-mopa-Any

Conversation

@gilanghamidy
Copy link
Copy Markdown
Member

mopa is used only in sgx-detect tool, as a legacy workaround on generic programming with polymorphic types. Newer Rust now supports type upcasting, allowing std::any::Any to be used instead of using mopa::Any.

This should fix the Dependabot alert related to mopa crate:

Credit fo solution: @tvsfx

Verified the tools are working on the SGX machine.

Taowyoo
Taowyoo previously approved these changes Nov 12, 2025
Comment thread intel-sgx/sgxs-tools/Cargo.toml Outdated
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit:
You need to bump version if need to publish new version.
(This could be done in separate PR.)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just update it now so to not make a separate PR. Thanks for noting this. :)

- Remove `mopa` dependency
- Update version of `sgxs-tools` and  Cargo.lock
- Eliminate Dependabot alert 5 and 40
@gilanghamidy gilanghamidy force-pushed the thomasvs/RTE-remove-mopa-Any branch from e1cf7c7 to 1ffbc87 Compare November 13, 2025 09:33
@gilanghamidy gilanghamidy added this pull request to the merge queue Nov 13, 2025
Merged via the queue into master with commit e3f61a5 Nov 13, 2025
1 check passed
@gilanghamidy gilanghamidy deleted the thomasvs/RTE-remove-mopa-Any branch November 13, 2025 10:47
@tvsfx
Copy link
Copy Markdown
Contributor

tvsfx commented Nov 14, 2025

Nit: I forgot to add this, but when adding modern compiler features, it might be worthwhile setting the rust-version key (documentation), in this case presumably to 1.86 (cargo msrv can tell you). This information is actually used properly by the resolver nowadays and gives warnings when trying to cargo add/ cargo install a crate.

For example, if I try to install a crate that has a higher MSRV than my selected toolchain, I get:

cargo install --path .                                                                                 ✔ 
  Installing msrv-test v0.0.0 (/home/thomas/rust-toy)
error: failed to compile `msrv-test v0.0.0 (/home/thomas/rust-toy)`, intermediate artifacts can be found at `/home/thomas/rust-toy/target
`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

Caused by:
  rustc 1.80.0-nightly is not supported by the following package:
    msrv-test@0.0.0 requires rustc 1.86

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.

4 participants