Comments (7)
Hi!
What version of Go are you running? And did you run make
or just tried go build -buildmode=c-shared -o go-auth.so
on its own?
from mosquitto-go-auth.
Thanks for getting back iegomez ...
go version
go version go1.10.2 linux/amd64
Using the make directly from git resulted in:
make
go build -buildmode=c-archive go-auth.go
go build -buildmode=c-shared -o go-auth.so
flag needs an argument: -o
usage: build [-o output] [-i] [build flags] [packages]
Run 'go help build' for details.
Makefile:2: recipe for target 'all' failed
make: *** [all] Error 2
I have also tried manually running each command from the Make file - with the same result.
Tweaking the position of the -o argument results in a clean compile - but then the resultant .so won't load.
Cheers
Vince.
from mosquitto-go-auth.
Well, that's kind of baffling. This week I built the plugin on an Azure VM running Ubuntu 17.10, on a Linode VM running Ubuntu 16.04, on my work machine running Debian 9 and a couple of hours ago on OS X 10.12, and all worked fine just executing make
.
I'll see if I can reproduce it at work on monday, but I think moving the flag position shouldn't matter and it's odd that it behaves differently . My first guess was that there's a specific bug in Go 1.10.2 regarding cgo or something of the sort, but I just downloaded 1.10.2 to test it and it builds fine here. For what is worth, I started the plugin with 1.9.2, did the last changes on 1.10 and built it this week with the latest stable version, 1.10.3. Could you try with the newest version?
My second guess is that you have some weird or custom C compiler in place that doesn't play well with Go. I'm not sure which are in use on the different setups I mentioned, but they are probably the latest stable gcc version. I'm on a Mac right now and the gcc version throws this: Apple LLVM version 9.0.0 (clang-900.0.39.2)
.
I'll let you know if I find or can think of anything leading to this issue.
from mosquitto-go-auth.
ok - not quite sure what I did yet - but I managed to get it to compile properly.
If I move the -o to before the build-mode argument it generates an ELF binary executable not a shared object. I'll experiment more tomorrow and try to narrow down what changed. I did upgrade to golang 1.10.3 - so maybe that was it ... will confirm.
from mosquitto-go-auth.
Did you have any luck? I haven't been able to reproduce it in any of my setups, so it sounds specific to yours. You could write some basic go file that exports functions using cgo and see if that compiles using the same schema from the Makefile. If it doesn't, then there's definitely something going on at your setup.
from mosquitto-go-auth.
Hi - after upgrading to 1.10.3 and testing my latest compile - which definitely generated a SO rather than an executable - things started working :) Not sure why - I'll experiment further once I have my project back on track - for now it's awesome to get a 'Not authorized' message :)
Thanks for your help.
from mosquitto-go-auth.
Great!
I'll be closing this for now, but let me know if you run into any other issue.
Cheers!
from mosquitto-go-auth.
Related Issues (20)
- Error in run tests with docker and mounted volume HOT 3
- Query : Mechanism to drop or block too many unauthorized requests HOT 5
- MongoDB backend error? pls help HOT 7
- Files backend issue HOT 7
- Implementing mosquitto_psk_key_get for certificate whitelisting HOT 8
- JWT backend JS mode not working HOT 1
- How to check if a client is disconnected from the broker HOT 2
- MongoDB is broken in test Docker image HOT 4
- Not authenticating with mysql db
- The plugin cannot be built HOT 1
- Request: Help in setting up Allow/Deny Access Control Rules based on Client ID HOT 4
- TARGETPLATFORM does not include linux/amd64 in Dockerfile HOT 2
- http backend: superuser check is made for every single acl check HOT 6
- Make order of plugin execution configurable
- Update/Fix dependencies with active vulnerabilities HOT 1
- error compiling on raspberry pi HOT 1
- Hasher configuration alway defaults to Base64 HOT 1
- the doc should specify which auth methods support TCP and Websocket connections HOT 1
- Container image on Dockerhub is outdated
- Inconsistent rw Permission Behavior Not Matching Documentation HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mosquitto-go-auth.