Skip to content

Conversation

Sjors
Copy link
Member

@Sjors Sjors commented Dec 10, 2020

Followups based on #15382 review comments:

Sjors and others added 2 commits December 10, 2020 13:28
ax_check_compile_flag, ax_check_link_flag and ax_check_preproc_flag only have an updated copyright notice, https link and revision number. Pulling in these updates makes it easier to compare to upstream.

Adding a README to document the fact that as of this commit all files are unmodified compared to upstream.
This avoids boost's argument splitter and instead passes commands straight to the system shell. As explained in:
bitcoin#15382 (comment)

In addition, this commit permits multiline std_out and std_err.

Co-authored-by: Russell Yanofsky <russ@yanofsky.org>
@Sjors
Copy link
Member Author

Sjors commented Dec 10, 2020

@ryanofsky I'm not entirely sure if a5c05df fixes (all) the problem(s) you pointed at in your earlier review

Copy link
Member

@fanquake fanquake left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like > half the CIs currently either fail to compile, or run make check.

3d94f85: We no-longer use "trivial" in commit messages, so you can remove that. However, the commit should just be split up, separating changes to each file, and using a commit message like: macro name update to serial N.


All files in this folder are from the [Autoconf Archive](https://www.gnu.org/software/autoconf-archive/)
([Github](https://github.com/autoconf-archive/autoconf-archive/tree/master/m4) may be ahead of the site).
They are unmodified, but may not be the most recent serial.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this sentence adds much value, and is guaranteed to have to be modified in future.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I (briefly) found it useful myself when I cloned the most recent archive, copied the files and did a git diff.

They are unmodified, but may not be the most recent serial.

Future modifications to these files should be listed here and at the top of each file,
to prevent accidentally overriding them.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't need to list modifications to the .m4 files in 2 separate places. Any modifications should already be documented by the commits to this directory that introduce them.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We did that before and (at least I) managed to accidentally forget about those changes in a followup. That said, I don't know if this note in the README can prevent that either. A linter script might.

@Sjors
Copy link
Member Author

Sjors commented Dec 13, 2020

@fanquake thanks for the review. I'll split the commits (a bit later).

Copy link
Member

@luke-jr luke-jr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The actual code changes appear to just introduce bugs...?

Comment on lines +1203 to +1205
// This is here because boost::process quotes the argument given to
// system when used in combination with boost::process::shell.
// https://github.com/boostorg/process/issues/95
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does bp::child need this workaround too? If not, that seems like a reason to avoid bp::system...

stdin_stream << str_std_in << std::endl;
}
#endif
stdin_stream << str_std_in << std::endl;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't work: bp::system won't return until the child process is complete, which means it's done with stdin...

Comment on lines +1222 to +1226
if (exit) {
std::string error{std::istreambuf_iterator<char>(stderr_stream), {}};
throw std::runtime_error(strprintf("RunCommandParseJSON error: process(%s) returned %d: %s\n", str_command, exit, error));
}
std::string result{std::istreambuf_iterator<char>(stdout_stream), {}};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Depending on stdout/stderr buffer sizes and amount of output, the process may block and not exit until we read the output...

@Sjors
Copy link
Member Author

Sjors commented Feb 24, 2021

Some of this has been superseeded by changes on master, and the rest I'm not clear what to do. So closing this for now.

@Rspigler
Copy link
Contributor

Mark as up for grabs? For possible followup to #21935 ?

@Rspigler
Copy link
Contributor

Is boostorg/process#95 a pre-req for this?

@bitcoin bitcoin locked as resolved and limited conversation to collaborators Aug 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants