Issues rebuilding syncthing for GUI development (deprecated)

You will need Go, so you can rebuild the binary. Then look at “./build.sh guidev” in building syncthing. This will give you a binary that uses the gui directory in the current working directory instead of compiled in assets, so you can edit the html/css/js and just reload in the browser.

So pretty much as you assumed, except the binary has to be built for it.

When happy with a change, “./build.sh assets” to recreate the compiled-in stuff, then commit and pull request etc.

I have tried… But get a error:

workspace/syncthing$ ./build.sh setup
Installing godep...
Installing go vet...
# code.google.com/p/go.tools/go/types
/home/jens/workspace/syncthing/src/code.google.com/p/go.tools/go/types/exprstring.go:80: x.Slice3 undefined (type *ast.SliceExpr has no field or method Slice3)
/home/jens/workspace/syncthing/src/code.google.com/p/go.tools/go/types/exprstring.go:82: x.Max undefined (type *ast.SliceExpr has no field or method Max)
/home/jens/workspace/syncthing/src/code.google.com/p/go.tools/go/types/exprstring.go:83: x.Max undefined (type *ast.SliceExpr has no field or method Max)

At a guess, you have a Go version older than 1.2. What does go version say?

Anyway, that’s an error in installing go vet, which is not really necessary for the rest of the build. If nothing else breaks, you can ignore the errors above.

I didn’t want to start a new thread since my question falls under this topic. I don’t mena to hijack the thread so if I should create a new topic, please let me know.

I have a bug fix for the web gui (issue #239), but cant seem to build it into the binary.

When I run build.sh guidev and run syncthing, my fix is picked up and everything works nicely. I have run build.sh assets and everything still works fine. But, when I run build.sh to build the binary for distribution, my change is not picked up.

Does build.sh revert the GUI somehow or am I missing something? I just want to make sure everything is working before I issue a pull request.

Thanks! This is a great project and I look forward contributing more in the future.

That’s weird. The build.sh assets step takes the files in the gui directory and builds the compressed asset file in the auto directory. You should see that file change when you run the assets build. That file is then included when a normal build is made.

That all makes sense, I just dont see that happening. I checked the hex strings that build.sh assets is generating and they are different to what is currently in your repository, but my changes are not in there when I build the project normally. Ive made sure my browser is not caching anything, I have no idea why its not working. I’m going to start lookng through the build scripts to see if I can figure it out.

I can submit a pull request anyway, the fix works when I build with guidev. Maybe it’s an enviornment issue? I’m building on Fedora, if that makes a difference.

Update: I just tried pulling down your change which added a QR Code button in the Edit dropdown. That change is not showing up for me either. It is definitely something with my browser, or enviornment. Still have no idea what it could be though.

The environment shouldn’t matter, as long as it has the required stuff, which it does or the build would fail. To be honest I suspect it’s a browser issue even though you are sure it isn’t… The headers and stuff returned from the built in assets are a bit sparse compared to when the files are served from disk, I suspect some issue might arise there…

(I think so because you say the hex strings are updated, which does indicate the changes are copied in)

You are right:

$ go version
go version go1.1.2 linux/386

I have installed Go from the distro respository. In this case i have Linux Mint Debian that’s based on debian 8 jessie/sid…

Other idea: Can you change the normal binary: If there is a gui directory then it used this and if not, then it used the internal web page files? Or, add a optional commandline argument for this? That’s IMHO interesting for everyone how would like to modify the web stuff and hasn’t experience in Go.

I have downloaded go and try again:

$ ./build.sh guidev
/home/jens/workspace/syncthing/syncthing/src/code.google.com/p/go.tools/cmd/godex/godex.go:88: first argument to print is os.Stdout
exit status 1
/home/jens/workspace/syncthing/syncthing/src/code.google.com/p/go.tools/cmd/godoc/main.go:295: no args in Fprint call
exit status 1
/home/jens/workspace/syncthing/syncthing/src/code.google.com/p/go.tools/go/loader/importer_test.go:107: missing argument for Errorf("%d"): format reads arg 2, have only 1 args
/home/jens/workspace/syncthing/syncthing/src/code.google.com/p/go.tools/go/loader/loader.go:411: self-assignment of conf.ImportPkgs[path] to conf.ImportPkgs[path]
exit status 1
/home/jens/workspace/syncthing/syncthing/src/code.google.com/p/go.tools/go/ssa/interp/external.go:274: possible misuse of unsafe.Pointer
/home/jens/workspace/syncthing/syncthing/src/code.google.com/p/go.tools/go/ssa/interp/interp_test.go:244: types.StdSizes composite literal uses unkeyed fields
exit status 1
/home/jens/workspace/syncthing/syncthing/src/code.google.com/p/go.tools/go/types/api_test.go:635: possible formatting directive in Error call
/home/jens/workspace/syncthing/syncthing/src/code.google.com/p/go.tools/go/types/scope.go:109: method WriteTo(w io.Writer, n int, recurse bool) should have signature WriteTo(io.Writer) (int64, error)
exit status 1
/home/jens/workspace/syncthing/syncthing/src/code.google.com/p/go.tools/godoc/analysis/typeinfo.go:35: code.google.com/p/go.tools/go/types.StdSizes composite literal uses unkeyed fields
exit status 1
/home/jens/workspace/syncthing/syncthing/src/code.google.com/p/go.tools/oracle/describe.go:430: code.google.com/p/go.tools/go/types.StdSizes composite literal uses unkeyed fields
/home/jens/workspace/syncthing/syncthing/src/code.google.com/p/go.tools/oracle/freevars.go:57: unreachable code
/home/jens/workspace/syncthing/syncthing/src/code.google.com/p/go.tools/oracle/oracle.go:451: method WriteTo(out io.Writer) should have signature WriteTo(io.Writer) (int64, error)
exit status 1

I have literally no idea what’s going on there. That’s not stuff that’s part of syncthing nor required to build it…

This would be reasonable.