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

feat: no-std #42

Merged
merged 21 commits into from
Sep 4, 2023
Merged

feat: no-std #42

merged 21 commits into from
Sep 4, 2023

Conversation

KSXGitHub
Copy link
Contributor

closes #41

echo 'FEATURES: serde'
cargo clippy --no-default-features --features=serde
echo 'FEATURES: std, serde'
cargo clippy --no-default-features --features=std,serde
Copy link
Member

Choose a reason for hiding this comment

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

--all-features supports the same thing. Why do we need this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We are not testing --all-features, we are testing every combination of features. Explicitly listing them would be better.

Besides, --all-features would include libcpp, libcpp currently doesn't work. Fixing libcpp is not the purpose of this PR.

Copy link
Member

Choose a reason for hiding this comment

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

Can you open an issue for libcpp?

bench/parse.rs Show resolved Hide resolved
src/lib.rs Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
test.sh Outdated
msg 'TEST: serde'
cmd cargo test --no-default-features --features=serde
cmd cargo clippy --no-default-features --features=serde
cmd env RUSTDOCFLAGS='-D warnings' cargo doc --no-default-features --features=serde
Copy link
Member

Choose a reason for hiding this comment

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

Is there a more elegant way of testing these?

Copy link
Contributor Author

@KSXGitHub KSXGitHub Sep 1, 2023

Choose a reason for hiding this comment

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

Is there a more elegant way of testing these?

I suppose you can write a script that reads Cargo.toml and create every feature combination and loop over them? But that would be overly complicated. Our time is better spent on the code of the library itself.

We can also reduce the number of combination by making serde requires std, or merging serde into std.

(BTW, --all-features does not replace this script, --all-features is but one amongst the possible combinations).

But if what you meant is you don't like .sh file then we can switch to justfile or Makefile (preferably on another PR).

This comment was marked as resolved.

Copy link
Member

Choose a reason for hiding this comment

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

Can you move this file to .github folder and rename it to something like test-all-features.sh?

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can you move this file to .github folder and rename it to something like test-all-features.sh?

This script is not actually used by the CI. It is used by me in the terminal.

Also cargo hack supports this https://github.com/taiki-e/cargo-hack#--feature-powerset

Does it support doc checking and clippy linting?

@anonrig
Copy link
Member

anonrig commented Sep 1, 2023

cc @steveklabnik can you review too?

@steveklabnik
Copy link
Contributor

I would love to but cannot guarantee that I can until Sunday. Maybe earlier but no promises, sorry about that!

Copy link
Member

@anonrig anonrig left a comment

Choose a reason for hiding this comment

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

It looks good to me, although we should wait for @steveklabnik's review before merging this, and releasing a new version

@KSXGitHub
Copy link
Contributor Author

@anonrig

and releasing a new version

Just a reminder that #37 and #36 are breaking changes.

Also, the README.md currently contain reference to ada-url's version (version = "1"). You may want to remove that.

@anonrig
Copy link
Member

anonrig commented Sep 2, 2023

Agree. Can you fix the conflict in this pr @KSXGitHub? I'll release the next version as v2

@KSXGitHub
Copy link
Contributor Author

Agree. Can you fix the conflict in this pr @KSXGitHub? I'll release the next version as v2

I just pushed the change as the same time as you made this request, it seems.

.github/workflows/ci.yml Outdated Show resolved Hide resolved
Copy link
Contributor

@steveklabnik steveklabnik 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 to me!

@anonrig anonrig merged commit 2ca96f2 into ada-url:main Sep 4, 2023
9 checks passed
@KSXGitHub KSXGitHub deleted the no-std branch September 4, 2023 15:02
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.

None yet

4 participants