From owner-svn-ports-all@freebsd.org Fri Jul 24 15:50:57 2020 Return-Path: Delivered-To: svn-ports-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B8AC736A37A; Fri, 24 Jul 2020 15:50:57 +0000 (UTC) (envelope-from tobik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BCtw14YMNz3SW1; Fri, 24 Jul 2020 15:50:57 +0000 (UTC) (envelope-from tobik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 661B8CD2C; Fri, 24 Jul 2020 15:50:57 +0000 (UTC) (envelope-from tobik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06OFovRQ098153; Fri, 24 Jul 2020 15:50:57 GMT (envelope-from tobik@FreeBSD.org) Received: (from tobik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06OFovZ9098152; Fri, 24 Jul 2020 15:50:57 GMT (envelope-from tobik@FreeBSD.org) Message-Id: <202007241550.06OFovZ9098152@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tobik set sender to tobik@FreeBSD.org using -f From: Tobias Kortkamp Date: Fri, 24 Jul 2020 15:50:57 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r543251 - head/lang/rust-nightly/files X-SVN-Group: ports-head X-SVN-Commit-Author: tobik X-SVN-Commit-Paths: head/lang/rust-nightly/files X-SVN-Commit-Revision: 543251 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jul 2020 15:50:57 -0000 Author: tobik Date: Fri Jul 24 15:50:56 2020 New Revision: 543251 URL: https://svnweb.freebsd.org/changeset/ports/543251 Log: lang/rust-nightly: Attempt to fix intermittent "can't find crate for `std`" build failures The location of rustc (found via env::current_exe()) is used to find the right libstd. However it might have been "copied" by creating a hard link to the new location instead. Like /proc/curproc/file, KERN_PROC_PATHNAME (used internally by current_exe()) can return any of the file's multiple paths. Most of the time it returns the right rustc path and the build will succeed but occasionally it will return the "wrong" path and the build fails with: error[E0463]: can't find crate for `std` If this is right a viable workaround should be to never create hard links during the build, so let's try that. Also drop the related llvm-config-wrapper workaround. PR: 248184 Added: head/lang/rust-nightly/files/patch-src_bootstrap_lib.rs (contents, props changed) Deleted: head/lang/rust-nightly/files/patch-src_bootstrap_native.rs Added: head/lang/rust-nightly/files/patch-src_bootstrap_lib.rs ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lang/rust-nightly/files/patch-src_bootstrap_lib.rs Fri Jul 24 15:50:56 2020 (r543251) @@ -0,0 +1,28 @@ +Attempt to fix intermittent "can't find crate for `std`" build failures + +The location of rustc (found via env::current_exe()) is used to +find the right libstd. However it might have been "copied" by +creating a hard link to the new location instead. Like /proc/curproc/file, +KERN_PROC_PATHNAME (used internally by current_exe()) can return +any of the file's multiple paths. Most of the time it returns the +right rustc path and the build will succeed but occasionally it +will return the "wrong" path and the build fails with: + + error[E0463]: can't find crate for `std` + +If this is right a viable workaround should be to never create hard +links during the build, so let's try that. + +--- src/bootstrap/lib.rs.orig 2020-07-23 20:16:43 UTC ++++ src/bootstrap/lib.rs +@@ -1173,10 +1173,6 @@ impl Build { + if metadata.file_type().is_symlink() { + let link = t!(fs::read_link(src)); + t!(symlink_file(link, dst)); +- } else if let Ok(()) = fs::hard_link(src, dst) { +- // Attempt to "easy copy" by creating a hard link +- // (symlinks don't work on windows), but if that fails +- // just fall back to a slow `copy` operation. + } else { + if let Err(e) = fs::copy(src, dst) { + panic!("failed to copy `{}` to `{}`: {}", src.display(), dst.display(), e)