Bug 1207928

Summary: Rust 1.67 breaks rusticl build in Mesa:drivers (rust upstream fix available in git)
Product: [openSUSE] openSUSE Tumbleweed Reporter: Dominique Leuenberger <dimstar>
Component: OtherAssignee: William Brown <william.brown>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: sndirsch
Version: Current   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Dominique Leuenberger 2023-02-06 10:51:18 UTC
Rust 1.67 has been submitted for inclusion and as new default

  https://build.opensuse.org/request/show/1062360

Mesa:drivers seems to be the only ring package that fails to build against this update (only considering the rings of course)

Lin to failed build log:
https://build.opensuse.org/package/live_build_log/openSUSE:Factory:Staging:L/Mesa:drivers/standard/x86_64


[  938s] [2373/2465] rustc -C linker=cc --color=always --crate-type rlib --edition=2021 -C relocation-model=pic --crate-name mesa_rust_gen --emit dep-info=src/gallium/frontends/rusticl/mesa_rust_gen.d --emit link -Aclippy::all -Anon_snake_case -Anon_camel_case_types -Anon_upper_case_globals -o src/gallium/frontends/rusticl/libmesa_rust_gen.rlib -l static=gallium -l static=libclc -l dylib=drm -l dylib=LLVM -l dylib=m -l dylib=z -l dylib=clang-cpp -l dylib=LLVM -l dylib=LLVMSPIRVLib -l dylib=z -l dylib=m -l dylib=SPIRV-Tools-opt -l dylib=SPIRV-Tools -l dylib=SPIRV-Tools-link -L src/gallium/auxiliary -L src/compiler/clc -L /usr/lib64 src/gallium/frontends/rusticl/rusticl_mesa_bindings.rs
[  938s] FAILED: src/gallium/frontends/rusticl/libmesa_rust_gen.rlib 
[  938s] rustc -C linker=cc --color=always --crate-type rlib --edition=2021 -C relocation-model=pic --crate-name mesa_rust_gen --emit dep-info=src/gallium/frontends/rusticl/mesa_rust_gen.d --emit link -Aclippy::all -Anon_snake_case -Anon_camel_case_types -Anon_upper_case_globals -o src/gallium/frontends/rusticl/libmesa_rust_gen.rlib -l static=gallium -l static=libclc -l dylib=drm -l dylib=LLVM -l dylib=m -l dylib=z -l dylib=clang-cpp -l dylib=LLVM -l dylib=LLVMSPIRVLib -l dylib=z -l dylib=m -l dylib=SPIRV-Tools-opt -l dylib=SPIRV-Tools -l dylib=SPIRV-Tools-link -L src/gallium/auxiliary -L src/compiler/clc -L /usr/lib64 src/gallium/frontends/rusticl/rusticl_mesa_bindings.rs
[  938s] error: failed to add native library src/gallium/auxiliary/libgallium.a: Unsupported archive identifier
Comment 1 Dominique Leuenberger 2023-02-06 10:52:21 UTC
Possibly related to https://github.com/rust-lang/rust/issues/107334
Comment 2 Stefan Dirsch 2023-02-06 12:09:01 UTC
Hmm. How am I supposed to reproduce that issue? I was trying by running

  osc build -M drivers --alternative-project openSUSE:Factory:Staging:G standard

After this succeeded I noticed that there is still rust 1.66 installed in the buildsystem.
Comment 3 Stefan Dirsch 2023-02-06 12:10:24 UTC
Not knowing anything about rust could I use

BuildRequires:  rust = 1.66
BuildRequires:  rust-bindgen
Comment 4 Dominique Leuenberger 2023-02-06 12:14:37 UTC
(In reply to Stefan Dirsch from comment #2)
> Hmm. How am I supposed to reproduce that issue? I was trying by running
> 
>   osc build -M drivers --alternative-project openSUSE:Factory:Staging:G
> standard

It's in Staging:L - not :G

> After this succeeded I noticed that there is still rust 1.66 installed in
> the buildsystem.

According to comment#1 this seems more likely to be a rust regression which I don't think we should just work around by picking Rust 1.66 to avoid it. It should be fixed in Rust
Comment 5 Stefan Dirsch 2023-02-06 12:26:46 UTC
> It's in Staging:L - not :G

Ok. I didnt't read the comments in SR to the end. :-(

> According to comment#1 this seems more likely to be a rust regression which I don't think we should just work around by picking Rust 
> 1.66 to avoid it. It should be fixed in Rust

Well, I still don't understand when this issue was really fixed. According to git with

# git show 252741673b9c2b06267cd3a036d77489e92f963a
commit 252741673b9c2b06267cd3a036d77489e92f963a
Merge: 6cd6bad51fb de363d54c40
Author: bors <bors@rust-lang.org>
Date:   Sat Jan 28 04:02:25 2023 +0000

    Auto merge of #107360 - bjorn3:fix_thin_archive_reading, r=wesleywiser
    
    Fix thin archive reading
    
    This includes a revert of https://github.com/rust-lang/rust/pull/105221 to restore fat archive reading with LlvmArchiveBuilder.
    
    Should fix #107162, #107334 and https://github.com/google/shaderc-rs/issues/133

# git describe 252741673b9c2b06267cd3a036d77489e92f963a
1.0.0-beta-175357-g252741673b9

So long before 1.67 and even 1.66. OTOH this is just 9 days ago ...

References:

 https://github.com/rust-lang/rust/issues/107334
 https://github.com/rust-lang/rust/pull/107360
Comment 6 Stefan Dirsch 2023-02-06 12:57:03 UTC
https://gitlab.freedesktop.org/mesa/mesa/-/issues/8172

[...]
That is a known regression [1] in rust, which is already fixed upstream[2] and likely will soon make it to the point release.

[1] https://github.com/rust-lang/rust/issues/107334
[2] https://github.com/rust-lang/rust/pull/107360
Comment 7 Stefan Dirsch 2023-02-06 13:00:51 UTC
Reassigning ...
Comment 8 William Brown 2023-02-06 23:15:53 UTC
Okay, I guess we just have to wait on a .1 release then ...
Comment 9 Stefan Dirsch 2023-02-08 11:59:54 UTC
(In reply to William Brown from comment #8)
> Okay, I guess we just have to wait on a .1 release then ...

I guess so, if this is what they mean with a 'point release'.  

If we need to update urgently please let me know.  I think it's possible to temporarily buildrequire rust 1.66 by Mesa (IIRC; untested though). But we then need to track this, so I won't forget to go back to buildrequire rust without version number.
Comment 10 Stefan Dirsch 2023-02-08 12:00:32 UTC
IIRC --> IIUC
Comment 11 William Brown 2023-02-09 01:37:16 UTC
(In reply to Stefan Dirsch from comment #9)
> (In reply to William Brown from comment #8)
> > Okay, I guess we just have to wait on a .1 release then ...
> 
> I guess so, if this is what they mean with a 'point release'.  

Yep, that's what I mean. 

> 
> If we need to update urgently please let me know.  I think it's possible to
> temporarily buildrequire rust 1.66 by Mesa (IIRC; untested though). But we
> then need to track this, so I won't forget to go back to buildrequire rust
> without version number.

Really it comes down to two options:

* Delay the upgrade to 1.67.0 and release it for everyone when 1.67.1 is out.
* Set Mesa to 1.66, so we can release 1.67.0 for everyone else to use, and then undo the build-requires when 1.67.1 is out.

I'm just not sure when 1.67.1 will release, I've subscribed to the various github threads, and I'm waiting on it ...
Comment 12 Stefan Dirsch 2023-02-09 09:37:31 UTC
Thanks. I agree. 3rd option would be to add the required patches to fix the issue. But I'm afraid cherry-picking them isn't trivial. Also they may need additional patches before you can apply them ...
Comment 13 William Brown 2023-02-09 23:57:36 UTC
Seems like upstream rust are already drafting a release for 1.67.1 so hopefully it'll be out soon :)
Comment 15 Stefan Dirsch 2023-02-24 20:19:02 UTC
Seems rust 1.67.1 has been released, so can we close this now as fixed.
Comment 16 Maintenance Automation 2023-03-06 16:30:03 UTC
SUSE-RU-2023:0630-1: An update that has one recommended fix can now be installed.

Category: recommended (moderate)
Bug References: 1207928
Sources used:
openSUSE Leap 15.4 (src): rust-1.67.1-150400.24.9.1
Development Tools Module 15-SP4 (src): rust-1.67.1-150400.24.9.1

NOTE: This line indicates an update has been released for the listed product(s). At times this might be only a partial fix. If you have questions please reach out to maintenance coordination.
Comment 17 Stefan Dirsch 2023-03-11 11:18:00 UTC
So let's assume this issue is fixed now with current rust 1.67.1.