Linuxbrew-core: brew install mongodb fails: Error building mongoreplay

Created on 16 Apr 2019  路  9Comments  路  Source: Homebrew/linuxbrew-core

To help us debug your issue please explain:

  • What you were trying to do (and why)
    brew install mongodb
  • What happened (include command output)
==> Downloading https://fastdl.mongodb.org/src/mongodb-src-r4.0.3.tar.gz
Already downloaded: /home/ubuntu/.cache/Homebrew/downloads/74ae15923c12b036ac85b5b3ce6ee5f926b35df049702b8262ce7d0e976f3599--mongodb-src-r4.0.3.tar.gz
==> Downloading https://files.pythonhosted.org/packages/cd/b0/c2d700252fc251e91c08639ff41a8a5203b627f4e0a2ae18a6b662ab32ea/Cheetah-2.4.4.tar.gz
Already downloaded: /home/ubuntu/.cache/Homebrew/downloads/c52e4f886933984a2acee5548875e73402354db77f43459cc2d4d9c3d29959cb--Cheetah-2.4.4.tar.gz
==> python -c import setuptools... --no-user-cfg install --prefix=/tmp/mongodb-20190416-24823-c62r0k/mongodb-src-r4.0.3/vendor --install-scripts=/tmp/mongodb-20190416-24823-c62r0k/mongodb-src-r4.0.
==> Downloading https://files.pythonhosted.org/packages/9e/a3/1d13970c3f36777c583f136c136f804d70f500168edc1edea6daa7200769/PyYAML-3.13.tar.gz
Already downloaded: /home/ubuntu/.cache/Homebrew/downloads/727334bb3bb982386aa982ded847f9d71b2e6cbc42488534f20c44d36812ad77--PyYAML-3.13.tar.gz
==> python -c import setuptools... --no-user-cfg install --prefix=/tmp/mongodb-20190416-24823-c62r0k/mongodb-src-r4.0.3/vendor --install-scripts=/tmp/mongodb-20190416-24823-c62r0k/mongodb-src-r4.0.
==> Downloading https://files.pythonhosted.org/packages/bf/9b/2bf84e841575b633d8d91ad923e198a415e3901f228715524689495b4317/typing-3.6.6.tar.gz
Already downloaded: /home/ubuntu/.cache/Homebrew/downloads/3f3cc6492e2dbcf8a0fb5ea5ac1637e17f0afb3483a5b8309638286f3a638974--typing-3.6.6.tar.gz
==> python -c import setuptools... --no-user-cfg install --prefix=/tmp/mongodb-20190416-24823-c62r0k/mongodb-src-r4.0.3/vendor --install-scripts=/tmp/mongodb-20190416-24823-c62r0k/mongodb-src-r4.0.
==> ./build.sh ssl
Last 15 lines from /home/ubuntu/.cache/Homebrew/Logs/mongodb/04.build.sh:
mongodump version: 4.0.3
Building mongotop...
mongotop version: 4.0.3
Building mongoreplay...
# github.com/google/gopacket/pcap
vendor/src/github.com/google/gopacket/pcap/pcap.go:173:7: identifier "_Ctype_struct_bpf_program" may conflict with identifiers generated by cgo
vendor/src/github.com/google/gopacket/pcap/pcap.go:384:13: identifier "_Ctype_struct_pcap_stat" may conflict with identifiers generated by cgo
vendor/src/github.com/google/gopacket/pcap/pcap.go:421:49: identifier "_Ctype_struct_bpf_program" may conflict with identifiers generated by cgo
vendor/src/github.com/google/gopacket/pcap/pcap.go:444:10: identifier "_Ctype_struct_bpf_program" may conflict with identifiers generated by cgo
vendor/src/github.com/google/gopacket/pcap/pcap.go:462:41: identifier "_Ctype_struct_bpf_insn" may conflict with identifiers generated by cgo
vendor/src/github.com/google/gopacket/pcap/pcap.go:538:66: identifier "_Ctype_struct_bpf_program" may conflict with identifiers generated by cgo
vendor/src/github.com/google/gopacket/pcap/pcap.go:551:19: identifier "_Ctype_struct_bpf_insn" may conflict with identifiers generated by cgo
vendor/src/github.com/google/gopacket/pcap/pcap.go:659:34: identifier "_Ctype_struct_pcap_addr" may conflict with identifiers generated by cgo
vendor/src/github.com/google/gopacket/pcap/pcap.go:662:56: identifier "_Ctype_struct_pcap_addr" may conflict with identifiers generated by cgo
Error building mongoreplay

READ THIS: https://docs.brew.sh/Troubleshooting

  • What you expected to happen
    no error

  • Step-by-step reproduction instructions (by running brew install commands)
    brew install mongodb

build failure outdated

Most helpful comment

I personnaly spent some time on this, and @issyl0 too, see #13666.
We gave up on this as we have no clue on how to fix the build, or it would take too much time.

The licence change also does not encourage us to work on this, and it looks like the last mongodb version will slowly die due to this. Anyway, I will close this issue, but I would be willing to review a pull request if anybody finds a solution.

All 9 comments

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

Hi @timotheecour do you have any details how to resolve it?

had the same error. Any solutions?

Same exact problem here !

vendor/src/github.com/google/gopacket/pcap/pcap.go:173:7: identifier "_Ctype_struct_bpf_program" may conflict with identifiers generated by cgo
vendor/src/github.com/google/gopacket/pcap/pcap.go:384:13: identifier "_Ctype_struct_pcap_stat" may conflict with identifiers generated by cgo
vendor/src/github.com/google/gopacket/pcap/pcap.go:421:49: identifier "_Ctype_struct_bpf_program" may conflict with identifiers generated by cgo
vendor/src/github.com/google/gopacket/pcap/pcap.go:444:10: identifier "_Ctype_struct_bpf_program" may conflict with identifiers generated by cgo
vendor/src/github.com/google/gopacket/pcap/pcap.go:462:41: identifier "_Ctype_struct_bpf_insn" may conflict with identifiers generated by cgo
vendor/src/github.com/google/gopacket/pcap/pcap.go:538:66: identifier "_Ctype_struct_bpf_program" may conflict with identifiers generated by cgo
vendor/src/github.com/google/gopacket/pcap/pcap.go:551:19: identifier "_Ctype_struct_bpf_insn" may conflict with identifiers generated by cgo
vendor/src/github.com/google/gopacket/pcap/pcap.go:659:34: identifier "_Ctype_struct_pcap_addr" may conflict with identifiers generated by cgo
vendor/src/github.com/google/gopacket/pcap/pcap.go:662:56: identifier "_Ctype_struct_pcap_addr" may conflict with identifiers generated by cgo

This issue is still occurring, as reported today by @ecrvnr. Re-opening as this issue has more context.

This error is from Google's gopacket pcap code, and it was fixed in January. The mongo-tools libraries were updated to use the fix in March. MongoDB then updated their mongo-tools dependency in April, which included the fix.

However, we are still on Mongo 4.0.3 due to licensing (both MacOS and Linux - [the formulae versions are the same), and the fix was only released to version 4.3.0 and down to 4.1.11.

To fix this, I guess we could write a patch stanza in the formula that applies the first patch to the vendored modules, but I've never tried to do this so it would take some investigation and attempts. What do fellow @Homebrew/linux maintainers think? Would that run into any licensing issues given it was for a version that's later than 4.0.3? Also, I don't see any issues in Homebrew/homebrew-core for this, and I'd expect some as the formulae have the same version constraints? (I don't have a Mac to test on right now.)

If we need this patch from google/gopacket https://patch-diff.githubusercontent.com/raw/google/gopacket/pull/589.patch its license is permissive https://github.com/google/gopacket/blob/master/LICENSE so there should be no problem cherry picking that patch.

It looks as though https://github.com/mongodb/mongo-tools/commit/cd452f38eecd0b627edfb886b3bb26975310392e only affects files in vendor/github.com/* and Gopkg.toml and Gopkg.lock, so I think we can cherry pick that patch as well, since the copyright to that code does not belong to mongodb but to the vendors.

I personnaly spent some time on this, and @issyl0 too, see #13666.
We gave up on this as we have no clue on how to fix the build, or it would take too much time.

The licence change also does not encourage us to work on this, and it looks like the last mongodb version will slowly die due to this. Anyway, I will close this issue, but I would be willing to review a pull request if anybody finds a solution.

The same error exists on macOS, too. It doesn't build from source anymore :(
See https://github.com/Homebrew/homebrew-core/pull/43676

Was this page helpful?
0 / 5 - 0 ratings