Skip to content

Conversation

nmarley
Copy link
Contributor

@nmarley nmarley commented Sep 20, 2019

Currently in Alpine Linux (latest, 3.10) in the depends system, one of the ZeroMQ patches won't apply cleanly because the context around the patch has changed and Alpine's patch implementation can't handle the diff.

Some patch implementations can't handle fuzz / too much divergence from the original code.

This PR just tweaks the context code around the patch so that less-sophisticated patch implementations (such as on Alpine Linux) can apply the patch without errors.

This partially fixes #16925

Some patch implementations can't handle fuzz / too much divergence from the
original code.

This just tweaks the context code around the patch so that less-sophisticated
patch implementations (such as on Alpine Linux) can apply the patch without
errors.
@fanquake
Copy link
Member

fanquake commented Sep 21, 2019

ACK 463a1d5 - Tested building zeromq in depends inside an Alpine container as well as on macOS.
The changes in the zeromq source come from this commit . Also worth noting this wasn't an issue if you'd had the GNU patch installed on Alpine.

/bitcoin # make zeromq -C depends/
make: Entering directory '/bitcoin/depends'
Extracting zeromq...
/bitcoin/depends/sources/zeromq-4.3.1.tar.gz: OK
Preprocessing zeromq...
patching file src/windows.hpp
patching file src/thread.cpp
Hunk 2 FAILED 323/323.
 #elif defined(ZMQ_HAVE_PTHREAD_SET_NAME)
     pthread_set_name_np (descriptor, name_);
 #endif
+#endif
+    return;
 }
 
 #endif
make: *** [funcs.mk:254: /bitcoin/depends/work/build/x86_64-pc-linux-gnu/zeromq/4.3.1-41472d87c95/.stamp_preprocessed] Error 1
make: Leaving directory '/bitcoin/depends'
/bitcoin # git fetch origin pull/16927/head:16927
remote: Enumerating objects: 5, done.
remote: Counting objects: 100% (5/5), done.
remote: Total 6 (delta 5), reused 5 (delta 5), pack-reused 1
Unpacking objects: 100% (6/6), done.
From https://github.com/bitcoin/bitcoin
 * [new ref]             refs/pull/16927/head -> 16927
/bitcoin # git checkout 16927
Switched to branch '16927'
/bitcoin # make zeromq -C depends/
make: Entering directory '/bitcoin/depends'
Extracting zeromq...
/bitcoin/depends/sources/zeromq-4.3.1.tar.gz: OK
Preprocessing zeromq...
patching file src/windows.hpp
patching file src/thread.cpp
Configuring zeromq...
checking for a BSD-compatible install... /usr/bin/install -c
....
Postprocessing zeromq...
Caching zeromq...
make: Leaving directory '/bitcoin/depends'

@DrahtBot
Copy link
Contributor

Gitian builds for commit f8b0b19 (master):

Gitian builds for commit bbddbbf (master and this pull):

@nmarley
Copy link
Contributor Author

nmarley commented Sep 21, 2019

Also worth noting this wasn't an issue if you'd had the GNU patch installed on Alpine.

Ah, thanks for the info. I didn't realize it was as easy as using apk to install GNU patch. I wouldn't have opened if I had known, but at this point it probably won't hurt to shore up the patch since this is already in-progress.

@laanwj
Copy link
Member

laanwj commented Sep 25, 2019

I think we should make sure that depends in travis uses a non-GNU patch, before merging this (if we decide that depends should support this). Otherwise this will come around and around again because the people bumping the versions are not going to test this obscure case.

@laanwj
Copy link
Member

laanwj commented Sep 30, 2019

Going to merge this (to have it not miss 0.19 split-off), but reluctantly: I hope a check for this will be integrated into a CI at some point.

laanwj added a commit that referenced this pull request Sep 30, 2019
463a1d5 Refresh ZeroMQ 4.3.1 patch (Nathan Marley)

Pull request description:

  Currently in Alpine Linux (latest, 3.10) in the depends system, one of the ZeroMQ patches won't apply cleanly because the context around the patch has changed and Alpine's `patch` implementation can't handle the diff.

  Some patch implementations can't handle fuzz / too much divergence from the original code.

  This PR just tweaks the context code around the patch so that less-sophisticated patch implementations (such as on Alpine Linux) can apply the patch without errors.

  This partially fixes #16925

ACKs for top commit:
  fanquake:
    ACK 463a1d5 - Tested building zeromq in depends inside an [Alpine container](https://github.com/fanquake/core-review/blob/master/docker/alpine.dockerfile) as well as on macOS.

Tree-SHA512: d6e3cb60835cdd090b9b864ca9cb33961687606bc9184fbbeb7a54ec23db4057b9317b65c5c276fb8c5492cb3cfcc4a7f3369f049551f4eb0915db971f2290ce
@laanwj laanwj merged commit 463a1d5 into bitcoin:master Sep 30, 2019
@nmarley nmarley deleted the btc-zmq431-patches branch October 1, 2019 14:17
@nmarley
Copy link
Contributor Author

nmarley commented Oct 1, 2019

@laanwj Thanks for merging. I was going to ask how this could be accomplished but I see it's been addressed by adding busybox in another PR. 😄

sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Oct 2, 2019
463a1d5 Refresh ZeroMQ 4.3.1 patch (Nathan Marley)

Pull request description:

  Currently in Alpine Linux (latest, 3.10) in the depends system, one of the ZeroMQ patches won't apply cleanly because the context around the patch has changed and Alpine's `patch` implementation can't handle the diff.

  Some patch implementations can't handle fuzz / too much divergence from the original code.

  This PR just tweaks the context code around the patch so that less-sophisticated patch implementations (such as on Alpine Linux) can apply the patch without errors.

  This partially fixes bitcoin#16925

ACKs for top commit:
  fanquake:
    ACK 463a1d5 - Tested building zeromq in depends inside an [Alpine container](https://github.com/fanquake/core-review/blob/master/docker/alpine.dockerfile) as well as on macOS.

Tree-SHA512: d6e3cb60835cdd090b9b864ca9cb33961687606bc9184fbbeb7a54ec23db4057b9317b65c5c276fb8c5492cb3cfcc4a7f3369f049551f4eb0915db971f2290ce
laanwj added a commit that referenced this pull request Oct 8, 2019
ddddd89 ci: Use busybox utils for one build (MarcoFalke)

Pull request description:

  To make sure Bitcoin Core can be built with BusyBox, see #16927 (comment)

ACKs for top commit:
  laanwj:
    ACK ddddd89

Tree-SHA512: da3a4654ee7975206d04643675d309b4973a510ca344acaec97fb1ed19c43cf13489bdf236c92c4a90499ec5b3c18c3338fff096110b26abee5ffe955089f267
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Oct 8, 2019
ddddd89 ci: Use busybox utils for one build (MarcoFalke)

Pull request description:

  To make sure Bitcoin Core can be built with BusyBox, see bitcoin#16927 (comment)

ACKs for top commit:
  laanwj:
    ACK ddddd89

Tree-SHA512: da3a4654ee7975206d04643675d309b4973a510ca344acaec97fb1ed19c43cf13489bdf236c92c4a90499ec5b3c18c3338fff096110b26abee5ffe955089f267
deadalnix pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Mar 31, 2020
Summary:
From [[bitcoin/bitcoin#15188 | PR15188]]:
```
Addresses https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-6250
```

From [[bitcoin/bitcoin#16927 | PR16927]]:
```
Currently in Alpine Linux (latest, 3.10) in the depends system, one of
the ZeroMQ patches won't apply cleanly because the context around the
patch has changed and Alpine's patch implementation can't handle the
diff.

Some patch implementations can't handle fuzz / too much divergence from
the original code.

This PR just tweaks the context code around the patch so that
less-sophisticated patch implementations (such as on Alpine Linux) can
apply the patch without errors.
```

Backport of core [[bitcoin/bitcoin#15188 | PR15188]] and [[bitcoin/bitcoin#16927 | PR16927]].

Depends on D5603.

Test Plan: Run the Gitian builds.

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D5607
ftrader pushed a commit to bitcoin-cash-node/bitcoin-cash-node that referenced this pull request Aug 13, 2021
Summary:
From [[bitcoin/bitcoin#15188 | PR15188]]:
```
Addresses https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-6250
```

From [[bitcoin/bitcoin#16927 | PR16927]]:
```
Currently in Alpine Linux (latest, 3.10) in the depends system, one of
the ZeroMQ patches won't apply cleanly because the context around the
patch has changed and Alpine's patch implementation can't handle the
diff.

Some patch implementations can't handle fuzz / too much divergence from
the original code.

This PR just tweaks the context code around the patch so that
less-sophisticated patch implementations (such as on Alpine Linux) can
apply the patch without errors.
```

Backport of core [[bitcoin/bitcoin#15188 | PR15188]] and [[bitcoin/bitcoin#16927 | PR16927]].

Depends on D5603.

Test Plan: Run the Gitian builds.

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D5607
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Dec 16, 2021
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.

Alpine Linux 3.10 (latest stable) has some build issues w/dependencies
5 participants