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

rust 1.64 now uses fd-lock->rustix->flock() for bootstraping where flock() is not available on Solaris #103630

Closed
psumbera opened this issue Oct 27, 2022 · 13 comments · Fixed by #108607
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. O-solaris Operating system: Solaris T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@psumbera
Copy link
Contributor

Seems that Rust now relies on fd-lock for bootstraping instead of using python code:

5a30316

Solaris doesn't support flock(). Insetad more modern fcntl() interface is used.

So even when I was able to make rustix compile on Solaris (without flock() support) it doesn't help since fd-lock requires flock().

Therefore I'm not able to compile Rust 1.64.0 on Solaris now.

@nagisa nagisa added T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) O-solaris Operating system: Solaris labels Oct 28, 2022
@jyn514
Copy link
Member

jyn514 commented Oct 28, 2022

@psumbera adding a cfg(not(target_os = "solaris")) to that code seems reasonable, happy to take a PR.

@psumbera
Copy link
Contributor Author

@psumbera adding a cfg(not(target_os = "solaris")) to that code seems reasonable, happy to take a PR.

But this way I still need to have buildable rustix for Solaris, right?

@jyn514
Copy link
Member

jyn514 commented Oct 31, 2022

Ah, I see. You can use those cfgs in Cargo.toml too I think. I'm surprised you get that error at compile time, is it trying to use something in libc that doesn't exist?

@psumbera
Copy link
Contributor Author

psumbera commented Nov 1, 2022

Oh, I see that @gco has already fixed rustix Solaris build problems via bytecodealliance/rustix@d96706a .

@jyn514
Copy link
Member

jyn514 commented Feb 3, 2023

@psumbera does that mean we just have to update rustix to fix this error? Happy to take a PR for that :) cargo update -p rustix --manifest-path src/bootstrap/Cargo.toml should work.

@jyn514 jyn514 added E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. labels Feb 3, 2023
@psumbera
Copy link
Contributor Author

psumbera commented Feb 3, 2023

It's not just about updating rustix. It would still miss support for flock(). But we could try to emulate it via fcntl() then...

@jyn514
Copy link
Member

jyn514 commented Feb 3, 2023

Sure, seems reasonable :) I think you would need to modify fd-lock for that directly, though.

@jyn514
Copy link
Member

jyn514 commented Feb 3, 2023

You can also just disable locking for that target, we use it to prevent running in parallel by accident, but you can just be careful to only run one process of bootstrap at a time.

@zephaniahong
Copy link
Contributor

@jyn514 Any help still needed here?

@jyn514
Copy link
Member

jyn514 commented Feb 10, 2023

@zephaniahong sure, but it will be hard to test your changes unless you have access to a Solaris machine ...

@zephaniahong
Copy link
Contributor

I see! In that case, I'll leave it for someone else😅

psumbera added a commit to psumbera/rustix that referenced this issue Feb 24, 2023
This should resolve problem with Rust build:
rust-lang/rust#103630
psumbera added a commit to psumbera/rustix that referenced this issue Feb 24, 2023
This should resolve problem with Rust build:
rust-lang/rust#103630
@psumbera
Copy link
Contributor Author

psumbera commented Mar 7, 2023

@jyn514 can you please have look at PR ##108607?

@albertlarsan68
Copy link
Member

It is on my to-do list, the only thing I see left to do is create an issue to track which platforms have locking and which haven't.

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Mar 13, 2023
…p, r=albertlarsan68

Don't use fd-lock on Solaris in bootstrap

...as Solaris is missing flock()

fixes rust-lang#103630
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Mar 13, 2023
…p, r=albertlarsan68

Don't use fd-lock on Solaris in bootstrap

...as Solaris is missing flock()

fixes rust-lang#103630
@bors bors closed this as completed in 04dfedb Mar 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. O-solaris Operating system: Solaris T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants