Skip to content

Conversation

fanquake
Copy link
Member

Since requiring C++17, this is just pointless abstraction. I think we should just "tear the band-aid off" and remove it. Similar to the changes happening in #21366.

Also, having a comment saying this is deprecated doesn't prevent it's usage in new code. i.e : #20946 (comment).

The repository is fairly quiet at the moment, so any potential complaints about having to rebase should be minimal. Might as well get this over and done with.

@maflcko
Copy link
Member

maflcko commented Mar 10, 2021

Seems fine, but let's wait for the list of conflicts. Two minor style nits (feel free to ignore):

  • I think git rm is preferred over rm -f because it will fail if the file is not tracked by git
  • I think a third commit can be added to bump the copyright header of the files. For some files this will be the only change this year and to avoid touching them twice for a trivial change, both changes could be done in this pull.

Copy link
Contributor

@jnewbery jnewbery left a comment

Choose a reason for hiding this comment

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

Concept ACK, although I agree with Marco that we should wait for drahtbot to tell us how many PRs this conflicts with, and hold back if any of those are important and close to being merged.

Will this silently conflict with PRs that introduce MakeUnique() calls? Is there a way to find those and force a CI rerun?

@DrahtBot
Copy link
Contributor

DrahtBot commented Mar 10, 2021

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

Reviewers, this pull request conflicts with the following ones:

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@practicalswift
Copy link
Contributor

Concept ACK: nice cleanup!

-BEGIN VERIFY SCRIPT-
git rm src/util/memory.h
sed -i -e 's/MakeUnique/std::make_unique/g' $(git grep -l MakeUnique src)
sed -i -e '/#include <util\/memory.h>/d' $(git grep -l '#include <util/memory.h>' src)
sed -i -e '/util\/memory.h \\/d' src/Makefile.am
-END VERIFY SCRIPT-
@fanquake fanquake force-pushed the remove_makeunique branch from 271cc06 to 1a6323b Compare March 11, 2021 05:50
@fanquake
Copy link
Member Author

fanquake commented Mar 11, 2021

Looks like the list of potential conflicts is fairly small, only 13. With some of those already being rebased regularly, and some based on other PRs, i.e #21206.
There's one with any ACKs, #20228, which has a single ACK on the latest commit hash.
There's at least one, #21365, which introduces new MakeUnique usage, so I've commented there.

I've taken the git rm suggestion, and dropped std::make_unique from the developer docs.

@jnewbery
Copy link
Contributor

utACK 1a6323b

Change looks correct. No comment on when this should be merged. I'll defer to the wisdom of the maintainers 🧙 🧙 🧙

@practicalswift
Copy link
Contributor

cr ACK 1a6323b: patch looks correct

Copy link
Member

@glozow glozow left a comment

Choose a reason for hiding this comment

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

ACK 1a6323b looks correct

Will this silently conflict with PRs that introduce MakeUnique() calls? Is there a way to find those and force a CI rerun?

Sounds like fanquake has been 👀ing the MakeUniques for a while. But generally, it sounds like we have a lot of things we want to get rid of. If we want to soak the bandaid a little first, could write a linter for them, add the linter to CI and give it some time to catch new occurrences, then land the removal PR. Otherwise you basically have to flush the pipeline, either by searching for the silent conflicts manually or re-running a bunch of CI?

@fanquake
Copy link
Member Author

could write a linter for them, add the linter to CI and give it some time to catch new occurrences, then land the removal PR.

Instead of a new linter, I wrote a few lines of Python to call the GitHub API, and list me all the PRs that introduce new MakeUnique<> usage. I've now left comments on all the relevant PRs advising that std::make_unique should be used. i.e: here, here and here.

@ajtowns
Copy link
Contributor

ajtowns commented Mar 12, 2021

ACK 1a6323b -- code review only

Rescanning open PRs after this is merged should be enough for CI to catch everything I think? Maybe close/reopen any PRs that still hit so CI gets rerun and errors on them?

@maflcko maflcko merged commit e0bc27a into bitcoin:master Mar 12, 2021
@fanquake fanquake deleted the remove_makeunique branch March 12, 2021 09:08
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Mar 12, 2021
laanwj added a commit that referenced this pull request Mar 17, 2021
ebc4ab7 refactor: post Optional<> removal cleanups (fanquake)
57e980d scripted-diff: remove Optional & nullopt (fanquake)

Pull request description:

  Same rationale & motivation as #21404, which turned out to be quite low in the number of potential conflicts. Lets see what the bot has to say here.

ACKs for top commit:
  practicalswift:
    cr ACK ebc4ab7: patch looks correct
  jnewbery:
    utACK ebc4ab7
  laanwj:
    Code review ACK ebc4ab7

Tree-SHA512: 550fbeef09b9d35ddefaa805d1755c18c8fd499c4b0f77ebfece8c20296a7abd1cf6c699e2261f92fe3552deeb7555ec2a2287ffe3ab9e98bb9f8612a4d43be3
@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.

7 participants