Skip to content
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

[Gentoo] cannot generate complete go source for dbus-factory #241

Closed
zhtengw opened this issue Apr 6, 2017 · 9 comments
Closed

[Gentoo] cannot generate complete go source for dbus-factory #241

zhtengw opened this issue Apr 6, 2017 · 9 comments
Assignees

Comments

@zhtengw
Copy link

zhtengw commented Apr 6, 2017

Hi, I need some help for installing dbus-factory.
Suddenly, I just can not generate some go souce for dbus-factory, what I got is just a part of the files. For example, the contents of dbus/org/freedesktop/networkmanager/nm-device-macvlan.go are just 15 lines with

/*This file is automatically generated by pkg.deepin.io/dbus-generator. Don't edit
 it*/
package networkmanager
import "pkg.deepin.io/lib/dbus"
import "pkg.deepin.io/lib/dbus/property"
import "reflect"
import "sync"
import "runtime"
import "fmt"
import "errors"
/*prevent compile error*/
var _ = fmt.Println
var _ = runtime.SetFinalizer
var _ = sync.NewCond
var _ = reflect.TypeOf
var _ = property.BaseObserver{}

Same in dbus/org/freedesktop/networkmanager/nm-device-gre.go

I have dbus-generator installed. And This issue never occurs before with the same version of dbus-generator.

I don't know what I am missing. Can any one give me some tips to find out the solution?

@zhtengw
Copy link
Author

zhtengw commented Apr 7, 2017

I reviewed the build log of dbus-factory, and found something may help.

2017/04/06 17:01:26 Generate "golang" code for service:"org.freedesktop.NetworkManager" interface:"org.freedesktop.NetworkManager.Device.Gre" ObjectName:"DeviceGre"
panic: dbus: invalid signature: "String_Variant_Map" (invalid type character) [recovered]
	panic: dbus: invalid signature: "String_Variant_Map" (invalid type character)

goroutine 1 [running]:
text/template.errRecover(0xc420111930)
	/usr/lib/go/src/text/template/exec.go:146 +0x62
panic(0x5e0840, 0xc42000daa0)
	/usr/lib/go/src/runtime/panic.go:489 +0x2cf
pkg.deepin.io/lib/dbus.typeFor(0xc42045ee20, 0x12, 0x411f82, 0x7f4df12e9988)
	/usr/share/gocode/src/pkg.deepin.io/lib/dbus/sig.go:253 +0x280
pkg.deepin.io/lib/dbus.TypeFor(0xc42045ee20, 0x12, 0xc420110b28, 0x40fde2)
	/usr/share/gocode/src/pkg.deepin.io/lib/dbus/sig.go:273 +0x35
main.renderInterface.func14(0xc42045a870, 0x1, 0x1, 0x0, 0x0)
	/var/tmp/portage/dev-go/go-dbus-generator-0.6.5/work/go-dbus-generator-0.6.5/render.go:132 +0x133
reflect.Value.call(0x5c8840, 0x6175c0, 0x13, 0x603e7a, 0x4, 0xc42000da60, 0x1, 0x1, 0xc42000da40, 0x1, ...)
	/usr/lib/go/src/reflect/value.go:434 +0x91f
reflect.Value.Call(0x5c8840, 0x6175c0, 0x13, 0xc42000da60, 0x1, 0x1, 0x6e6780, 0xc4200d88a0, 0x5bc7a0)
	/usr/lib/go/src/reflect/value.go:302 +0xa4
text/template.(*state).evalCall(0xc4201118b0, 0x5e2140, 0xc420455700, 0x199, 0x5c8840, 0x6175c0, 0x13, 0x6e66c0, 0xc4200d8840, 0x613d7c, ...)
	/usr/lib/go/src/text/template/exec.go:668 +0x51f
text/template.(*state).evalFunction(0xc4201118b0, 0x5e2140, 0xc420455700, 0x199, 0xc4200d8870, 0x6e66c0, 0xc4200d8840, 0xc42045f460, 0x2, 0x2, ...)
	/usr/lib/go/src/text/template/exec.go:536 +0x18e
text/template.(*state).evalCommand(0xc4201118b0, 0x5e2140, 0xc420455700, 0x199, 0xc4200d8840, 0x0, 0x0, 0x0, 0x0, 0xf, ...)
	/usr/lib/go/src/text/template/exec.go:433 +0x6cd
text/template.(*state).evalPipeline(0xc4201118b0, 0x5e2140, 0xc420455700, 0x199, 0xc42045bae0, 0x0, 0x0, 0x198)
	/usr/lib/go/src/text/template/exec.go:406 +0xf2
text/template.(*state).walk(0xc4201118b0, 0x5e2140, 0xc420455700, 0x199, 0x6e65a0, 0xc4200d88d0)
	/usr/lib/go/src/text/template/exec.go:232 +0x55a
text/template.(*state).walk(0xc4201118b0, 0x5e2140, 0xc420455700, 0x199, 0x6e68a0, 0xc4200d85a0)
	/usr/lib/go/src/text/template/exec.go:240 +0x139
text/template.(*state).walkRange.func1(0x5bfe80, 0xc420017698, 0x82, 0x5e2140, 0xc420455700, 0x199)
	/usr/lib/go/src/text/template/exec.go:327 +0x136
text/template.(*state).walkRange(0xc4201118b0, 0x5eb4e0, 0xc4200101c0, 0x99, 0xc420018600)
	/usr/lib/go/src/text/template/exec.go:336 +0x34e
text/template.(*state).walk(0xc4201118b0, 0x5eb4e0, 0xc4200101c0, 0x99, 0x6e6a20, 0xc420018600)
	/usr/lib/go/src/text/template/exec.go:243 +0x4f1
text/template.(*state).walk(0xc4201118b0, 0x5eb4e0, 0xc4200101c0, 0x99, 0x6e68a0, 0xc420440210)
	/usr/lib/go/src/text/template/exec.go:240 +0x139
text/template.(*Template).execute(0xc420455940, 0x6e4a00, 0xc42000e1e8, 0x5eb4e0, 0xc4200101c0, 0x0, 0x0)
	/usr/lib/go/src/text/template/exec.go:195 +0x20a
text/template.(*Template).Execute(0xc420455940, 0x6e4a00, 0xc42000e1e8, 0x5eb4e0, 0xc4200101c0, 0x0, 0xc420016bf2)
	/usr/lib/go/src/text/template/exec.go:178 +0x53
main.renderInterface(0x7ffef09a4d17, 0x6, 0xc420459830, 0x29, 0x0, 0x0, 0x0, 0xc420455700, 0x1, 0x1, ...)
	/var/tmp/portage/dev-go/go-dbus-generator-0.6.5/work/go-dbus-generator-0.6.5/render.go:189 +0x10e1
main.generateMain(0xc4200201b0)
	/var/tmp/portage/dev-go/go-dbus-generator-0.6.5/work/go-dbus-generator-0.6.5/dbus-generator.go:126 +0x3a9
main.main()
	/var/tmp/portage/dev-go/go-dbus-generator-0.6.5/work/go-dbus-generator-0.6.5/dbus-generator.go:145 +0x32d

@zhtengw
Copy link
Author

zhtengw commented Apr 7, 2017

I found out the key point. This issue is related to the version of golang. It occurs when the dbus-generator is compiled by go-1.8. Then dbus-factory can be generated completely with dbus-generator which is compiled by go-1.7.5.

Does the sources of dbus-generator not fully support go-1.8?

@hualet
Copy link
Contributor

hualet commented Apr 7, 2017

@jouyouyun @electricface

@jouyouyun
Copy link
Contributor

@zhtengw It should be a bug for golang, had summited an issue.
You can use this patch to compile dbus-factory.

@zhtengw
Copy link
Author

zhtengw commented Apr 10, 2017

Thanks @jouyouyun. Your patch fixed the error with dbus/org/freedesktop/networkmanager/nm-device-gre.go.
And strangely, the incompleteness of dbus/org/freedesktop/networkmanager/nm-device-macvlan.go can not be preproduced now in my machine.

@jouyouyun
Copy link
Contributor

@zhtengw How do you do? I can't reproduce it.

@zhtengw
Copy link
Author

zhtengw commented Apr 10, 2017

Are you asking for my operation steps to reproduce it? @jouyouyun
To get the incomplete "nm-device-gre.go", what I did are:

  1. update golang to version 1.8;
  2. recompile and reinstall go-dbus-generator-0.6.5;
  3. compile and install dbus-factory-3.1.3.

And I attach my system information:
System-INFO.txt

@jouyouyun
Copy link
Contributor

I test it, but no problems ocurred.

@jouyouyun
Copy link
Contributor

No problem found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants