Bug 2225532

Summary: 389-ds-base FTBFS with rust-1.71.0
Product: Red Hat Enterprise Linux 9 Reporter: Tuomo Soini <tis>
Component: 389-ds-baseAssignee: Simon Pichugin <spichugi>
Status: VERIFIED --- QA Contact: LDAP QA Team <idm-ds-qe-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: CentOS StreamCC: bsmejkal, bstinson, idm-ds-dev-bugs, jwboyer, mreynolds, spichugi, vashirov
Target Milestone: rcKeywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 389-ds-base-2.3.6-2.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Work-around for rust-1.71.0 compiler issue
none
Remove unused mut which rust-1.71.0 does not tolerate none

Description Tuomo Soini 2023-07-25 13:36:50 UTC
Description of problem:

rust was updated to 1.71.0 on centos stream 9 causing FTBFS issues with 389-ds-base-2.3.4-3.el9

Issue #1:

error: using `.borrow()` on a double reference, which returns `&concread::cowcell::CowCellReadTxn<CacheStats>` instead of borrowing the inner type
  --> librslapd/src/cache.rs:60:28
   |
60 |     let stats = stat_rguard.borrow();
   |                            ^^^^^^^^^
   |
note: the lint level is defined here
  --> librslapd/src/lib.rs:1:9
   |
1  | #![deny(warnings)]
   |         ^^^^^^^^
   = note: `#[deny(suspicious_double_ref_op)]` implied by `#[deny(warnings)]`
error: could not compile `librslapd` (lib) due to previous error

This is also reported as bug#2225471

Issue #2:

error: variable does not need to be mutable
   --> slapi_r_plugin/src/value.rs:185:13
    |
185 |         let mut v = unsafe { slapi_value_new() };
    |             ----^
    |             |
    |             help: remove this `mut`
    |
note: the lint level is defined here
   --> slapi_r_plugin/src/lib.rs:1:9
    |
1   | #![deny(warnings)]
    |         ^^^^^^^^
    = note: `#[deny(unused_mut)]` implied by `#[deny(warnings)]`
error: could not compile `slapi_r_plugin` (lib) due to previous error

mut is obviously wrong here

Attaching work-around for issue #1 and fix for #2.

Comment 1 Tuomo Soini 2023-07-25 13:39:06 UTC
Created attachment 1977476 [details]
Work-around for rust-1.71.0 compiler issue

Comment 2 Tuomo Soini 2023-07-25 13:40:05 UTC
Created attachment 1977489 [details]
Remove unused mut which rust-1.71.0 does not tolerate

Comment 3 Viktor Ashirov 2023-07-25 13:50:13 UTC
Thank you for reporting this issue. I opened an upstream ticket for this: https://github.com/389ds/389-ds-base/issues/5861
Would you be okay to submit a PR upstream with your fixes?

Thanks!

Comment 4 Tuomo Soini 2023-07-25 14:45:37 UTC
Looks like these were both fixed upstream.

Comment 5 Viktor Ashirov 2023-08-14 15:42:12 UTC
Build 389-ds-base-2.3.6-2.el9 was successful with rust-1.71. Marking as Verified:Tested.

Comment 9 bsmejkal 2023-08-17 08:29:30 UTC
As per comment #c5 marking as VERIFIED.