-
Notifications
You must be signed in to change notification settings - Fork 140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Repro for CGO errors on alpine #119
Comments
I think it's because go/loader expects to load a compiled version of the package and compiles it if it's not available. It seems like the installation of Go you have doesn't have a cgo-enabled net package and so it wants to compile it, which requires gcc. At least that's my guess based on the log output. |
I actually think this is a separate problem from #16 |
Ah, just to clarify:
|
Right, I agree with all that. I don't think there's a better way to fix it. Really if you are developing anything with CGO code, you should have a copy of gcc available. |
I'm seeing this happen on Ubuntu after installing go from the official download page. My installation process is here and is simply a wget of go, then go get of errcheck. I'm attempting to run errcheck on a project (https://github.com/lionelbarrow/braintree-go) that does not use CGO. Running errcheck, this is what I get:
But if I explicitly disable CGO it works as expected.
|
@leighmcculloch, same here for alpine images when not using cgo at all, it's sad to explicitly tell |
I'm now using Go1.9 on Ubuntu with revision b1445a9 of errcheck and I no longer have this issue. |
Currently the gometalinter does not work correctly with the alpine docker image, as it scans too many directory. See github issues: - kisielk/errcheck#119 - alecthomas/gometalinter#149 As a solution, we add an additional layer with a debian image to the multi-staged docker image. In this image, the gometalinter works correctly.
Closing since it seems this was resolved. |
* working demo for ServiceBroker CRUD Operations * remove unused code * Fix formatting and lint errors * Revert "remove unused code" This reverts commit a01455b. * Add Andreas example; periodically ping the service manager; - Add Andreas example to to a new file 'servicecatalog', which provides methods to list/register/unregister service brokers form the k8s serivce catalog. - Add function to periodically ping the service manager. - Formatting. * Start broker proxy in main.go * Fix constructor, check for error when setting env variable * Use broker lib * First working draft of k8s * Use enablement service-manager * Pin service-catalog to version v0.1.13 * Fix log messages in k8s client * Proxy not needed anymore; Remove secrets/config of the k8s deployment * Downstrip to minimal setup * use in cluster configuration and strip down Dockerfile for friday demo. Adding clusterrole and permissions to access the API server/servicecatalog resources. * fix wrong service declaration - no endpoints assign regarding wrong selector * Fix linter errors - Use 'envProxy' instead of 'env_proxy' - Add short documentation to exported methods to create/update/list/delete brokers in kubernetes - Remove not needed exports. * Use helm for isntallation of service-broker-proxy * Add vendor/ to SCM Not ignoring the vendor folder eases the initial development onboarding and can guarantee reliable builds. * Update dependencies and pin service-broker-proxy lib to fixed version - Set dependencies to version of dem from last week. - Pin version of service-broker-proxy library do working version of last week. * Fix port in service definition in helm chart * Use gcr docker repository as the default in the helm chart * Improve installation instructions * Add additional docker image for gometalinter. Currently the gometalinter does not work correctly with the alpine docker image, as it scans too many directory. See github issues: - kisielk/errcheck#119 - alecthomas/gometalinter#149 As a solution, we add an additional layer with a debian image to the multi-staged docker image. In this image, the gometalinter works correctly. * Update service-broker-proxy library. Update service-broker-proxy library to the most recent version. Adopt client.go to use the newest library version. * Fix client go type error * Improve in-code documentation. * Improve build script for development. Use helm to install the service-broker-proxy-k8s. * Tests: implement tests for successfull service-broker operation. Implement tests for successful service broker operations: create/delete/update/get/sync * File system mock obsolete in client_internal_test * Add go dep dependencies for ginkgo and gomega. * Use better fake urls in unit test. * Improve logging and log levels. - Use warn log-level when an error with the service-catalog occurs and return the error to the service-broker-proxy framework. - Use fatal log level when the creation of a k8s client occurs. * Test output prints more information in docker build. * Test service-broker-creation when catalog returns an error. * Test service-broker-deletion when catalog returns an error. * Test getting service-brokers when catalog returns an error. * Test service-broker-delete when catalog returns an error. * Test syncing service-brokers when catalog returns an error. * Print broker guids/names with log messages * Print go test coverage during build * Print test coverage Added a script to print the test coverage information with the following outputs: - html report - stdout * Use .html filending for coverage report * Return error when clusterconfig cannot be loaded. * More coverage details during Docker build * Improve test coverage Review with @AlexRieder: - use warn log-level when error with service-catalog occurs - Improve test for service-broker-creation - Add test to check getBrokers with empty list of brokers * README badge: Add go report and add branch to coveralls * No error handling, as log.Fatal exists the program * Log error and return error when configuration cannot be loaded * Template values for service-manager-instance
I have an easy repro (and workaround) for the problem mentioned in #16 (comment) (which is also mentioned in alecthomas/gometalinter#149) re: running errcheck in a CGO_ENABLED build on alpine.
The error's pretty inscrutable when run via GML but pretty obvious when run through errcheck directly. Now if I install gcc and musl-dev, the error is resolved:
So, the source of the error is actually that CGO is configured but kinda broken, and the fix is to install the compiler and the libc headers. I'm not actually sure if there's anything errcheck (or GML) can do about this, but I figured I'd open this to at least provide google fuel for the next poor soul who runs into the problem like I did.
The text was updated successfully, but these errors were encountered: