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

Fix broken build. #82

Merged
merged 2 commits into from
Apr 11, 2023
Merged

Fix broken build. #82

merged 2 commits into from
Apr 11, 2023

Conversation

dfabulich
Copy link
Contributor

@dfabulich dfabulich commented Apr 11, 2023

Fixes #80 and #83.

According to git bisect, the build was broken in revision f27b4a8, which added callback.rs.

Specifically, callback.rs added a pub enum SteamCallback. Any NAPI-RS file that exports an enum requires you to use napi::bindgen_prelude::ToNapiValue, which it did, but it also now requires you to use FromNapiValue.

As far as I can tell, this has always been true, even back at revision f27b4a8. The parent revision to f27b4a8 deleted Cargo.lock, but even when I brought Cargo.lock back, it still required FromNapiValue.

So, I have no idea why the build has been working at all for the last year, but adding FromNapiValue everywhere ToNapiValue is used definitely seems to fix it.

EDIT: Oops, I was accidentally restoring the wrong Cargo.lock file. Restoring the Cargo.lock file from 56e80a4 into revision f27b4a8 also fixes the build. I've filed PR #84 to bring back a Cargo.lock file so reproducibility issues like this don't happen in the future.

Furthermore, I've downgraded @napi-rs/cli to fix #83.

Fixes ceifa#80.

According to git bisect, the build was broken in revision f27b4a8, which added `callback.rs`.

Specifically, `callback.rs` added a `pub enum SteamCallback`. Any NAPI-RS file that exports an enum requires you to `use napi::bindgen_prelude::ToNapiValue`, which it did, but it also requires you to use `FromNapiValue`.

As far as I can tell, this has always been true, even back at revision f27b4a8. The parent revision to f27b4a8 deleted `Cargo.lock`, but even when I brought `Cargo.lock` back, it _still_ required `FromNapiValue`.

So, I have no idea why the build has been working at all for the last year, but this definitely seems to fix it.
@ceifa
Copy link
Owner

ceifa commented Apr 11, 2023

Great find, actually I think this is happening because of napi-rs/napi-rs#1551

@dfabulich
Copy link
Contributor Author

The Github builds have passed! Please merge at your earliest convenience.

@ceifa
Copy link
Owner

ceifa commented Apr 11, 2023

The duplication thing is happening since 2.15.1 IIRC: napi-rs/napi-rs#1531
Can you upgrade to 1.15.0 and also check if the exported cliend.d.ts is the same as now?

@dfabulich
Copy link
Contributor Author

Can you upgrade to 1.15.0 and also check if the exported cliend.d.ts is the same as now?

I assume you mean 2.15.0! Yes, we can do a smaller downgrade, from 2.15.2 to 2.15.0, and that also fixes #83. I've force pushed that change. Let's merge this PR as soon as those builds pass.

@dfabulich
Copy link
Contributor Author

Builds pass! 🚀

@ceifa ceifa mentioned this pull request Apr 11, 2023
@ceifa ceifa merged commit c482954 into ceifa:main Apr 11, 2023
4 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
2 participants