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

Unbreak publishing #303

Merged
merged 4 commits into from
Sep 2, 2024
Merged

Unbreak publishing #303

merged 4 commits into from
Sep 2, 2024

Conversation

jdm
Copy link
Member

@jdm jdm commented Aug 3, 2024

Fixes I made in order to publish 0.9.5.

@mrobinson
Copy link
Member

Sorry for breaking things and thanks for the fix. Let me know when this is ready and I'll give it a review.

@mukilan mukilan force-pushed the publish-fixes branch 2 times, most recently from c58ad0c to 69fda84 Compare August 30, 2024 06:12
Cargo.toml Outdated
@@ -42,14 +42,14 @@ sparkle = { version = "0.1", optional = true }
osmesa-sys = { version = "0.1", optional = true }
rwh_05 = { package = "raw-window-handle", version = "0.5.2", features = ["std"], optional = true }
rwh_06 = { package = "raw-window-handle", version = "0.6.2", features = ["std"], optional = true }
serial_test = "3.1.0"
Copy link
Member

Choose a reason for hiding this comment

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

Why does serial_test need to be added to the main packages dependencies?

Copy link
Member

Choose a reason for hiding this comment

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

It is to allow the compilation of android_example. It imports the test module from the main library in android-example/rust/src/lib.rs:17 for implementation of JNI methods.

Copy link
Member

@jschwe jschwe Aug 30, 2024

Choose a reason for hiding this comment

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

If serial_test is required by the example, then shouldn't it be added to the Cargo.toml of the example crate?
Adding a mod via path = shouldn't be affected by the Cargo.toml of the foreign crate. Not sure what I'm missing.

Copy link
Member

Choose a reason for hiding this comment

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

android-example doesn't use serial_test directly. It uses the test module of the surfman crate. It is the test module in surfman that uses the serial_test, so I don't think adding it to android-example's manifest will work.

However, I think another approach to eliminate this dependency would be to conditionally import serial_test in surfman/test.rs using cfg(not(feature = "sm-test")) and similarly use cfg_attr(not(feature="sm-test"), serial) on all the test methods.

Copy link
Member

Choose a reason for hiding this comment

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

I see. I believe we should at the very least make the serial_test dependency optional and move it behind a feature flag, since there is no need to pull in serial_test when compiling servo.

Copy link
Member

Choose a reason for hiding this comment

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

In 5ae1ac4, I've made the use of #[serial] conditional on not(feature = "sm-test") and I've move serial_test back to dev-dependencies.

Co-authored-by: Josh Matthews <josh@joshmatthews.net>
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
@mukilan
Copy link
Member

mukilan commented Aug 30, 2024

I've fixed some more errors in android-example (crate-type & edition in android-example/rust/Cargo.toml). The rust compilation fails at the final link step. That might need more investigation. @jdm was there anything else you wanted to address or is this in a state to be merged?

The #[serial] is used to serialize unit tests, but it is not needed
when building with sm-test feature enabled to expose the functions
to android-example client.
Copy link
Member Author

Choose a reason for hiding this comment

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

I was hoping to add a working symlink for this library but couldn't complete a build.

Copy link
Member

Choose a reason for hiding this comment

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

I see. I can look into this separately. I'll merge this PR for now to allow publishing of the crate.

@jdm jdm marked this pull request as ready for review September 1, 2024 12:20
@mukilan mukilan added this pull request to the merge queue Sep 2, 2024
Merged via the queue into main with commit f03bad7 Sep 2, 2024
17 checks passed
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