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

docs.rs build failures #720

Open
RReverser opened this issue Oct 28, 2022 · 13 comments · Fixed by #724
Open

docs.rs build failures #720

RReverser opened this issue Oct 28, 2022 · 13 comments · Fixed by #724
Labels
help wanted Extra attention is needed

Comments

@RReverser
Copy link

Hi, it looks like the docs.rs build has been failing for all versions starting from 0.18 all the way to latest (0.55): https://docs.rs/crate/skia-safe/latest.

All of them are failing at DNS level for valid URLs:

Dns Failed: resolve dns name 'github.com:443': failed to lookup address information: Temporary failure in name resolution
...
Dns Failed: resolve dns name 'codeload.github.com:443': failed to lookup address information: Temporary failure in name resolution)

Not sure if this is a failure of docs.rs builder itself, or in rust-skia, but worth investigation and / or reporting upstream?

@pragmatrix
Copy link
Member

This is a known problem, docs.rs build scripts execute rustdoc in a docker container without network access. I'm planning to detect the DOCS_RS environment variable and copy over a pre-generated bindings.rs file with features gl,textlayout,webp in the upcoming 0.56 release to see if the docs get rendered.

@RReverser
Copy link
Author

This is a known problem, docs.rs build scripts execute rustdoc in a docker container without network access

Huh TIL.

@pragmatrix
Copy link
Member

Reopening because 0.56 failed:

[INFO] [stderr]    Compiling skia-bindings v0.56.0 (/opt/rustwide/workdir)
[INFO] [stderr] error: failed to run custom build command for `skia-bindings v0.56.0 (/opt/rustwide/workdir)`
[INFO] [stderr] 
[INFO] [stderr] Caused by:
[INFO] [stderr]   process didn't exit successfully: `/opt/rustwide/target/debug/build/skia-bindings-ad0c2506a80e8256/build-script-build` (exit status: 1)
[INFO] [stderr]   --- stdout
[INFO] [stderr]   cargo:rerun-if-env-changed=DOCS_RS
[INFO] [stderr]   DETECTED DOCS_RS BUILD
[INFO] [stderr]   COPYING bindings_docs.rs to src/bindings.rs
[INFO] [stderr] 
[INFO] [stderr]   --- stderr
[INFO] [stderr]   Error: Os { code: 30, kind: ReadOnlyFilesystem, message: "Read-only file system" }

This is also related to #10.

@pragmatrix pragmatrix reopened this Nov 8, 2022
@marc2332
Copy link
Contributor

Is there any plan to fix this? I can't seem to make the docs build in freya because of this issue

https://docs.rs/crate/freya/0.1.2/builds/887492

thanks 👌

@marc2332
Copy link
Contributor

Have you considered asking the docs.rs team to make an exception on rust-skia to allow it to run without the offline mode, so it can download the prebuilt binaries?

@pragmatrix
Copy link
Member

Have you considered asking the docs.rs team to make an exception on rust-skia to allow it to run without the offline mode, so it can download the prebuilt binaries?

No, from https://docs.rs/about/builds:

Network access will not be enabled for any crate.

Since #10 we are referring to bindings.rs in OUT_DIR, so the strategy originally attempted in #724 may now work. I'll try this with the next release.

@pragmatrix pragmatrix self-assigned this Aug 17, 2023
@marc2332
Copy link
Contributor

Awesome, hopefully it will work 🤞

Any ETA for the next release? No hurries, I just want to be ready 😄

Thank you again Armin! 🙏

@marc2332
Copy link
Contributor

Hi! it's me again, looks like I found a "working" approach

I have mocked all the APIs I use from skia-safe, these mocked APIs will only be enabled when building on docs.rs and skia-safe will be disabled. This way it builds on docs.rs! https://docs.rs/freya/

Thoughts? I know it's ugly but it seems like the best workaround I can do right now

Thanks!

@pragmatrix
Copy link
Member

pragmatrix commented Sep 10, 2023

I've tried to patch in the bindings in with the 0.66.0 release, but failed. The current showstopper here is that with --allow-dirty, cargo publish won't generate a .cargo_vcs_info file and I have not idea how to trick cargo publish into allowing a dirty repository and a .cargo_vcs_info file. Even if I include the .cargo_vcs_info as file to the project, it won't land in the .crate file.

@marc2332 I am glad that you found a workaround.

@pragmatrix pragmatrix removed their assignment Sep 10, 2023
@marc2332
Copy link
Contributor

I appreciate the attemps @pragmatrix 😄, thank you. The workaround seems to be good enough for now ✌️

PS: In case you didn't know, I released Freya last week https://marc0.hashnode.dev/freya , it wouldn't have been possible without you 💪

@pragmatrix
Copy link
Member

@marc2332 This is awesome, congratulations 🎉 ! And thank you a lot for the credits.

@tronical
Copy link
Contributor

Thanks for the release!

It looks like the lack of .cargo_vcs_info means that in this release the binaries are never used, because crate_repository_hash() fails and therefore skia-binding's build.rs fails to determine the correct download url.

@pragmatrix
Copy link
Member

@tronical You are right, seems like that --allow-dirty slipped through because of all the experiments made. I'll prepare a new release which takes a few hours. Sorry for that.

@pragmatrix pragmatrix added the help wanted Extra attention is needed label Oct 1, 2023
@pragmatrix pragmatrix pinned this issue Oct 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants