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

Buld for target powerpc-unknown-netbsd fails in 1.31.1; other powerpc targets also fail in the same way in later versions #57037

Closed
he32 opened this issue Dec 21, 2018 · 2 comments
Labels
O-netbsd Operating system: NetBSD O-PowerPC Target: PowerPC processors T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue.

Comments

@he32
Copy link
Contributor

he32 commented Dec 21, 2018

While release 1.31.1 of rust fixes the build issue reported in #55465, a new issue arises instead: the rls part of the build now uses AtomicU64, which is not natively supported on 32-bit powerpc, so the build fails with

no 'AtomicU64' in 'sync::atomic'. Did you mean to use 'AtomicU8'?

The following rather crude pair of patches makes the build complete for the target again, but obviously something is lost along the way -- whether that is crucial I am not able to tell myself.

--- src/tools/rls/src/cmd.rs.orig       2018-12-18 23:12:41.000000000 +0000
+++ src/tools/rls/src/cmd.rs
@@ -17,7 +17,7 @@ use crate::config::Config;
 use crate::server::{self, LsService, Notification, Request, RequestId};
 use rls_analysis::{AnalysisHost, Target};
 use rls_vfs::Vfs;
-use std::sync::atomic::{AtomicU64, Ordering};
+use std::sync::atomic::{AtomicU32, Ordering};
 
 use languageserver_types::{
     ClientCapabilities, CodeActionContext, CodeActionParams, CompletionItem,
@@ -424,8 +424,8 @@ fn url(file_name: &str) -> Url {
 }
 
 fn next_id() -> RequestId {
-    static ID: AtomicU64 = AtomicU64::new(1);
-    RequestId::Num(ID.fetch_add(1, Ordering::SeqCst))
+    static ID: AtomicU32 = AtomicU32::new(1);
+    RequestId::Num(ID.fetch_add(1, Ordering::SeqCst) as u64)
 }
 
 // Custom reader and output for the RLS server.
--- src/tools/rls/src/server/io.rs.orig 2018-12-18 23:12:41.000000000 +0000
+++ src/tools/rls/src/server/io.rs
@@ -17,7 +17,7 @@ use crate::lsp_data::{LSPNotification, L
 
 use std::fmt;
 use std::io::{self, BufRead, Write};
-use std::sync::atomic::{AtomicU64, Ordering};
+use std::sync::atomic::{AtomicU32, Ordering};
 use std::sync::Arc;
 
 use jsonrpc_core::{self as jsonrpc, response, version, Id};
@@ -190,14 +190,14 @@ pub trait Output: Sync + Send + Clone + 
 /// An output that sends notifications and responses on `stdout`.
 #[derive(Clone)]
 pub(super) struct StdioOutput {
-    next_id: Arc<AtomicU64>,
+    next_id: Arc<AtomicU32>,
 }
 
 impl StdioOutput {
     /// Construct a new `stdout` output.
     crate fn new() -> StdioOutput {
         StdioOutput {
-            next_id: Arc::new(AtomicU64::new(1)),
+            next_id: Arc::new(AtomicU32::new(1)),
         }
     }
 }
@@ -215,7 +215,7 @@ impl Output for StdioOutput {
     }
 
     fn provide_id(&self) -> RequestId {
-        RequestId::Num(self.next_id.fetch_add(1, Ordering::SeqCst))
+        RequestId::Num(self.next_id.fetch_add(1, Ordering::SeqCst) as u64)
     }
 }
 

This is also probably related to issue #56753.

@nagisa nagisa added the T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. label Dec 21, 2018
@sanxiyn sanxiyn added O-netbsd Operating system: NetBSD O-PowerPC Target: PowerPC processors labels Mar 21, 2019
@glaubitz
Copy link
Contributor

glaubitz commented Apr 2, 2019

I'm seeing this now for 1.33.0 on powerpc-unknown-linux-gnu but not 1.32.0, so it seems this particular regression got backported 1.31.1.

Debian 1.32.0 builds fine: https://buildd.debian.org/status/fetch.php?pkg=rustc&arch=powerpc&ver=1.32.0%2Bdfsg1-3&stamp=1552901706&raw=0

openSUSE 1.33.0 fails: https://build.opensuse.org/package/live_build_log/home:Andreas_Schwab:Factory/rust/p/ppc

So, this not specific to NetBSD. I suggest adjusting the bug title.

@he32 he32 changed the title Buld for target powerpc-unknown-netbsd fails in new way in 1.31.1 Buld for target powerpc-unknown-netbsd fails in 1.31.1; other powerpc targets also fail in the same way in later versions Oct 27, 2019
@workingjubilee
Copy link
Member

The Debian builds seem to pass now and we have announced a deprecation of RLS in favor of rust-analyzer, so I think that either this has been fixed or unfortunately it is not going to see any action on it if it hasn't already. My apologies.

@workingjubilee workingjubilee closed this as not planned Won't fix, can't repro, duplicate, stale Jul 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-netbsd Operating system: NetBSD O-PowerPC Target: PowerPC processors T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

5 participants