From mboxrd@z Thu Jan 1 00:00:00 1970 From: Danny Milosavljevic Subject: Re: Question about Rust bootstrap Date: Thu, 20 Sep 2018 11:39:07 +0200 Message-ID: <20180920113907.3c11c024@scratchpost.org> References: <20180916141235.2c36a0b4@scratchpost.org> <8736u4ekwg.fsf@netris.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; boundary="Sig_/zL7tUgCQkSnh5MhcRujDSdr"; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42408) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g2vQi-0007xF-MI for guix-devel@gnu.org; Thu, 20 Sep 2018 05:39:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g2vQe-0003HU-LG for guix-devel@gnu.org; Thu, 20 Sep 2018 05:39:24 -0400 Received: from dd26836.kasserver.com ([85.13.145.193]:40936) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g2vQe-0003EY-81 for guix-devel@gnu.org; Thu, 20 Sep 2018 05:39:20 -0400 In-Reply-To: <8736u4ekwg.fsf@netris.org> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Mark H Weaver Cc: guix-devel@gnu.org --Sig_/zL7tUgCQkSnh5MhcRujDSdr Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Hi Mark, On Thu, 20 Sep 2018 02:35:27 -0400 Mark H Weaver wrote: > Speaking of our Rust packages, I have a question: is it intentional that > 'rust-1.23' is still built using 'rust-bootstrap' and not 'rust-1.22'? Yes, because I'm not done yet :) > The reason I ask is that, to my delight, there appears to be (almost?) > everything needed for a complete source-only bootstrap chain for recent > Rust: >=20 > * rust-1.19.0 is built using mrustc > * rust-1.20.0 is built using rust-1.19.0 > * rust-1.21.0 is built using rust-1.20.0 > * rust-1.22.1 is built using rust-1.21.0 > * rust-1.23.0 is built using pre-built 'rust-bootstrap' (1.22.1) (???) > * rust-1.24.1 is built using rust-1.23.0 > * rust-1.25.0 is built using rust-1.24.1 > * rust-1.26.2 is built using rust-1.25.0 > * rust-1.27.2 is built using rust-1.26.2 >=20 > This chain would be complete if 'rust-1.23' were built using 'rust-1.22' > instead of 'rust-bootstrap'. Since both 'rust-1.22' and > 'rust-bootstrap' are apparently for the same version of Rust (1.22.1), > I would naturally expect one to work in place of the other one. > Have you tried it? rust 1.20.0 has a failure when creating the documentation (check phase) because it does not create "version_info.html" from "version_info.html.temp= late" - although it should. On the other hand it passes all the tests (about 7000 of them). I'm investigating why the documentation does not build. Every guix build rust takes about half a day to complete on my machine, so = it will still take a week or so I'd say. The build rule for version_info.html is in src/bootstrap/doc.rs , search for "version_info.html". I'm tempted to just patch "!up_to_date(&version_input, &version_info)" out = of it - but maybe it's covering up a deeper issue. There's this: pub fn mtime(path: &Path) -> FileTime { fs::metadata(path).map(|f| { FileTime::from_last_modification_time(&f) }).unwrap_or(FileTime::zero()) } pub fn up_to_date(src: &Path, dst: &Path) -> bool { let threshold =3D mtime(dst); let meta =3D match fs::metadata(src) { Ok(meta) =3D> meta, Err(e) =3D> panic!("source {:?} failed to get metadata: {}", src, e= ), }; if meta.is_dir() { dir_up_to_date(src, &threshold) } else { FileTime::from_last_modification_time(&meta) <=3D threshold } } So what if the destination does not exist? Then the source would have to have zero timestamp for up_to_date to return = true (which we don't want), right? So we should have non-zero timestamps for source files. And I've checked the guix-build-rust directory, they all have timestamps of= zero. Sigh. So I'll change all the source timestamps to 1, problem maybe solved. Rebuilding... Aha, newer rust version have: pub fn up_to_date(src: &Path, dst: &Path) -> bool { if !dst.exists() { // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! return false; } let threshold =3D mtime(dst); let meta =3D match fs::metadata(src) { Ok(meta) =3D> meta, Err(e) =3D> panic!("source {:?} failed to get metadata: {}", src, e= ), }; if meta.is_dir() { dir_up_to_date(src, threshold) } else { meta.modified().unwrap_or(UNIX_EPOCH) <=3D threshold } } --Sig_/zL7tUgCQkSnh5MhcRujDSdr Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAlujarsACgkQ5xo1VCww uqVmQQf/UwLotWfXFrXHlx3WFfGTHGf10zey86JqxzFyXRgdHdps0sSyiFgkAeG3 vGEQdOVEaKjFrEX9TWynf+NCWzWZjCwKhbFceRgyUUEBTb6t66d44lyqp7BwRA/D n/lzhqDr3slQq58zUKHn65YJ4xSGZeud/QGfcdXbMzkOU+USBGz4WcZ7f9RM3OJf wPYC7uJdIhlVGg4+nr+YUXNIgSS+wXC/TvlbaaOC6yKnkHr0qARYFLbCAHbBfP9Y cdbyKfZFG/Oe+ADjWSWJ3xxqksGWnMoNx8/bsJoQGNCVCMmzaLSJqpBHAerHawhi gfIhfAEqgYaa7xEAxlIP5TrUlnw4qw== =57u2 -----END PGP SIGNATURE----- --Sig_/zL7tUgCQkSnh5MhcRujDSdr--