Skip to content

chore: crate organization #1002

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

Merged
merged 10 commits into from
Jun 5, 2025

Conversation

nabetti1720
Copy link
Contributor

@nabetti1720 nabetti1720 commented Jun 1, 2025

Description of changes

As the size of our assets has grown, in this PR we will be organizing our crates.

  • Removed crates that were never referenced in the code.
  • We set default-features=false for all external crates, whether they have feature flags or not, to prevent unintentional introduction of unwanted features, and honestly. We didn't have time to evaluate them one by one. :)
  • llrt_crypto: Fixed some missing feature flag settings.
  • llrt_os: Introduced the systems feature flag. Turning off all of the included feature flags will prevent the inclusion of the sysinfo crate.

Looking at the diff of Cargo.lock, we have made progress in removing dependencies on several crates, resulting in a 48KB reduction in size. Below is the execution result using full-sdk.

before:

% du -k ./target/aarch64-apple-darwin/release/llrt
10604   ./target/aarch64-apple-darwin/release/llrt

after:

% du -k ./target/aarch64-apple-darwin/release/llrt
10556   ./target/aarch64-apple-darwin/release/llrt

Checklist

  • Created unit tests in tests/unit and/or in Rust for my feature if needed
  • Ran make fix to format JS and apply Clippy auto fixes
  • Made sure my code didn't add any additional warnings: make check
  • Added relevant type info in types/ directory
  • Updated documentation if needed (API.md/README.md/Other)

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@Sytten
Copy link
Collaborator

Sytten commented Jun 1, 2025

Good change, we should also do feature testing of modules to ensure they dont break and deps are correctly set.

@nabetti1720
Copy link
Contributor Author

nabetti1720 commented Jun 1, 2025

Good change, we should also do feature testing of modules to ensure they dont break and deps are correctly set.

Is there a good and generic way to do this?

NOTE: At least some detection was possible by running the following command locally. I'd like to make it possible.

% cargo check -p [crate_name]

@nabetti1720 nabetti1720 force-pushed the chore/crate-organization branch from bc4731b to 8b6923a Compare June 3, 2025 08:38
@nabetti1720
Copy link
Contributor Author

@richarddavison I've accomplished what I wanted to do with this PR.

@richarddavison
Copy link
Collaborator

@richarddavison I've accomplished what I wanted to do with this PR.

Currently traveling but I'll take a look ASAP! Thanks for this!

@nabetti1720
Copy link
Contributor Author

Did you enjoy the travel? I made some tweaks, but I think I accomplished what I wanted to do with this PR. :)

Copy link
Collaborator

@richarddavison richarddavison left a comment

Choose a reason for hiding this comment

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

Looks good! I As we are very sensitive to size it's better to opt out of features. Let me just verify lambda variant builds!

@richarddavison richarddavison merged commit 5eee4cf into awslabs:main Jun 5, 2025
21 of 22 checks passed
@nabetti1720 nabetti1720 deleted the chore/crate-organization branch June 5, 2025 09:11
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