The sound distributed version control system

#11 Merge Request: Fix missing newlines on Cargo files

Closed on November 14, 2020
fabian added a change on November 6, 2020
This change could not be retrieved at the moment
SL52FT2SJFQMOA2H25WXCYJBY4Z4ATQOAEIGDQULLLNZGLTIL3IAC
fabian on November 6, 2020

@pmeunier, seems that the issue wasn’t that the newline wasn’t committed but rather updating hunks is removing a newline.

lambda on November 6, 2020

I am fairly confused about whether this fix is applied or not.

After I cloned the repo, and tried running cargo build, I encountered an error because of a missing newline.

This is what I see:

$ head Cargo.toml 
[package]
name = "anu"
description = "The sound distributed version control system."
version = "1.0.0-alpha"authors = ["Pierre-Étienne Meunier <pe@pijul.org>"]
edition = "2018"
repository = "https://nest.anu.dev/anu/anu"
license = "GPL-2.0"
include = [
"Cargo.toml",
"src",
$ anu log | head
Change SL52FT2SJFQMOA2H25WXCYJBY4Z4ATQOAEIGDQULLLNZGLTIL3IAC
Author: [Author { name: "fabian", full_name: Some("Fabián Heredia Montiel"), email: None }]
Date: 2020-11-06 17:48:42.964439980 UTC

    Add missing new-lines

Change YG6QU7EERAJCJXRJ6JEMC3HZKZUDOEGHAURA3GWAQVOIGZEMT7IAC
Author: [Author { name: "fabian", full_name: Some("Fabián Heredia Montiel"), email: None }]
Date: 2020-11-06 16:31:34.841360852 UTC

Well, this is embarrassing.

anu had a problem and crashed. To help us diagnose the problem you can send us a crash report.

We have generated a report file at "/tmp/report-2231c892-7710-40b4-acbf-8bc698d5c64a.toml". Submit an issue or email with the subject of "anu Crash Report" and include the report as an attachment.

- Authors: Pierre-Étienne Meunier <pe@pijul.org>

We take privacy seriously, and do not perform any automated error collection. In order to improve the software, we rely on people to submit reports.

Thank you kindly!

So it looks like this patch should be applied, but there is still a missing newline here. Also as an aside, anu log seems to panic on EPIPE:

$ cat /tmp/report-2231c892-7710-40b4-acbf-8bc698d5c64a.toml 
name = 'anu'
operating_system = 'unix:Unknown'
crate_version = '1.0.0-alpha'
explanation = '''
Panic occurred in file 'library/std/src/io/stdio.rs' at line 895
'''
cause = 'failed printing to stdout: Broken pipe (os error 32)'
method = 'Panic'
backtrace = '''

   0: 0x5598e57bd70f - std::io::stdio::print_to::hfbd939ed8525dcd5
                at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/io/stdio.rs:895
                 - std::io::stdio::_print::h20eb70976f14aeea
                at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/io/stdio.rs:907
   1: 0x5598e50ef511 - anu::main::{{closure}}::he94106ae57136b4b
   2: 0x5598e52113e0 - tokio::runtime::enter::Enter::block_on::hceefaa5d8f872e42
   3: 0x5598e5154c87 - tokio::runtime::thread_pool::ThreadPool::block_on::h00631621e761f70d
   4: 0x5598e511eb40 - tokio::runtime::context::enter::hf25bd3282c301024
   5: 0x5598e52115af - tokio::runtime::handle::Handle::enter::hf6ee042f7fe93226
   6: 0x5598e516d627 - anu::main::h361615784e5e6fa7
   7: 0x5598e51133f3 - std::sys_common::backtrace::__rust_begin_short_backtrace::hd635a2ab15cf4df5
   8: 0x5598e5113409 - std::rt::lang_start::{{closure}}::h0479c4f6105238d0
   9: 0x5598e57c9901 - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h6a3209f124be2235
                at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/core/src/ops/function.rs:259
                 - std::panicking::try::do_call::h88ce358792b64df0
                at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/panicking.rs:373
                 - std::panicking::try::h6311c259678e50fc
                at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/panicking.rs:337
                 - std::panic::catch_unwind::h56c5716807d659a1
                at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/panic.rs:379
                 - std::rt::lang_start_internal::h73711f37ecfcb277
                at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/rt.rs:51
  10: 0x5598e516d732 - main
  11: 0x7f54a95f4042 - __libc_start_main
  12: 0x5598e504a26e - _start
  13:        0x0 - <unresolved>'''
fabian on November 6, 2020

Hi @lamda, seems like there is a bug on the hunk update code. I mentioned it on #13

pmeunier on November 9, 2020

I have never seen that panic. If that ever happens again, would you mind setting RUST_LOG="pijul=debug,libpijul=debug before running that command?

bjorn3 on November 9, 2020

The panic probably happens because head reads a limited amount of lines and then exits. This closes the reading end of the pipe that the stdout of pijul is connected to. Attempting to write any further data will then give an error. println!() responds to this by panicking.

pmeunier on November 14, 2020

That panic is fixed now, we don’t have any more println!/print! in the new release. Thanks for your patience and reporting!

pmeunier closed this discussion on November 14, 2020