Demo compilation problem on Ubuntu20
This is completely fresh Ubuntu 20. Here's what I did:
sudo apt rake docker docker-compose
- (added myself to docker group, started docker: sudo systemctl start docker)
- got latest code from master
rake docker_up
Result:
46 packages are looking for funding
run `npm fund` for details
found 446 vulnerabilities (444 low, 2 high)
run `npm audit fix` to fix them, or `npm audit` for details
/repo/build-root/webui/node_modules/.bin/yamlinc -o swagger.yaml swagger.in.yaml
Analize : swagger.in.yaml
Include : users-paths.yaml
Include : services-paths.yaml
Include : dhcp-paths.yaml
Include : settings-paths.yaml
Include : search-paths.yaml
Include : users-defs.yaml
Include : services-defs.yaml
Include : dhcp-defs.yaml
Include : settings-defs.yaml
Include : search-defs.yaml
Compile : swagger.yaml
/repo/build-root/tools/v0.23.0/swagger_linux_amd64 generate server -s server/gen/restapi -m server/gen/models --name Stork --exclude-main --spec /repo/build-root/api/swagger.yaml --template stratoscale --regenerate-configureapi
runtime: mlock of signal stack failed: 12
runtime: increase the mlock limit (ulimit -l) or
runtime: update your kernel to 5.3.15+, 5.4.2+, or 5.5+
fatal error: mlock failed
runtime stack:
runtime.throw(0xd2780f, 0xc)
/usr/local/go/src/runtime/panic.go:1112 +0x72
runtime.mlockGsignal(0xc000580180)
/usr/local/go/src/runtime/os_linux_x86.go:72 +0x107
runtime.mpreinit(0xc000681180)
/usr/local/go/src/runtime/os_linux.go:341 +0x78
runtime.mcommoninit(0xc000681180)
/usr/local/go/src/runtime/proc.go:630 +0x108
runtime.allocm(0xc000061800, 0xd6dda8, 0x0)
/usr/local/go/src/runtime/proc.go:1390 +0x14e
runtime.newm(0xd6dda8, 0xc000061800)
/usr/local/go/src/runtime/proc.go:1704 +0x39
runtime.startm(0x0, 0xc000102a01)
/usr/local/go/src/runtime/proc.go:1869 +0x12a
runtime.wakep(...)
/usr/local/go/src/runtime/proc.go:1953
runtime.resetspinning()
/usr/local/go/src/runtime/proc.go:2415 +0x93
runtime.schedule()
/usr/local/go/src/runtime/proc.go:2527 +0x2de
runtime.park_m(0xc000102480)
/usr/local/go/src/runtime/proc.go:2690 +0x9d
runtime.mcall(0x0)
/usr/local/go/src/runtime/asm_amd64.s:318 +0x5b
goroutine 1 [runnable]:
text/template/parse.(*lexer).nextItem(...)
/usr/local/go/src/text/template/parse/lex.go:195
text/template/parse.(*Tree).next(...)
/usr/local/go/src/text/template/parse/parse.go:64
text/template/parse.(*Tree).nextNonSpace(0xc0007ba000, 0x11, 0x380, 0xc00051dd00, 0x1, 0x1c)
/usr/local/go/src/text/template/parse/parse.go:102 +0x14c
text/template/parse.(*Tree).action(0xc0007ba000, 0xa, 0x37e)
/usr/local/go/src/text/template/parse/parse.go:353 +0x43
text/template/parse.(*Tree).textOrAction(0xc0007ba000, 0xa, 0x37e)
/usr/local/go/src/text/template/parse/parse.go:340 +0x293
text/template/parse.(*Tree).itemList(0xc0007ba000, 0xd131eb, 0x2, 0xc000b860c0)
/usr/local/go/src/text/template/parse/parse.go:322 +0x196
text/template/parse.(*Tree).parseControl(0xc0007ba000, 0xc00051dc01, 0xd131eb, 0x2, 0x0, 0x0, 0xc000b860c0, 0x0, 0x0)
/usr/local/go/src/text/template/parse/parse.go:454 +0xef
text/template/parse.(*Tree).ifControl(0xc0007ba000, 0x1b, 0x318)
/usr/local/go/src/text/template/parse/parse.go:488 +0x4c
text/template/parse.(*Tree).action(0xc0007ba000, 0xa, 0x314)
/usr/local/go/src/text/template/parse/parse.go:361 +0x512
text/template/parse.(*Tree).textOrAction(0xc0007ba000, 0xa, 0x314)
/usr/local/go/src/text/template/parse/parse.go:340 +0x293
text/template/parse.(*Tree).itemList(0xc0007ba000, 0xd14f1f, 0x4, 0xc0007be2a0)
/usr/local/go/src/text/template/parse/parse.go:322 +0x196
text/template/parse.(*Tree).parseControl(0xc0007ba000, 0xc000680000, 0xd14f1f, 0x4, 0x0, 0x0, 0xc0007be2a0, 0x0, 0x0)
/usr/local/go/src/text/template/parse/parse.go:454 +0xef
text/template/parse.(*Tree).withControl(0xc0007ba000, 0x1f, 0x1bc)
/usr/local/go/src/text/template/parse/parse.go:504 +0x4c
text/template/parse.(*Tree).action(0xc0007ba000, 0xa, 0x1b9)
/usr/local/go/src/text/template/parse/parse.go:367 +0x55d
text/template/parse.(*Tree).textOrAction(0xc0007ba000, 0xc0007ba080, 0xc000b25620)
/usr/local/go/src/text/template/parse/parse.go:340 +0x293
text/template/parse.(*Tree).parse(0xc0007ba000)
/usr/local/go/src/text/template/parse/parse.go:286 +0x381
text/template/parse.(*Tree).Parse(0xc0007ba000, 0xc00051d980, 0x18bc, 0x0, 0x0, 0x0, 0x0, 0xc0007a8090, 0xc0007a2030, 0x2, ...)
/usr/local/go/src/text/template/parse/parse.go:225 +0x21c
text/template/parse.Parse(0xc0007a0080, 0x12, 0xc00051d980, 0x18bc, 0x0, 0x0, 0x0, 0x0, 0xc0007a2030, 0x2, ...)
/usr/local/go/src/text/template/parse/parse.go:55 +0x115
text/template.(*Template).Parse(0xc0007a6000, 0xc00051d980, 0x18bc, 0x12, 0x40c016, 0x0)
/usr/local/go/src/text/template/template.go:201 +0x111
github.com/go-swagger/go-swagger/generator.(*Repository).addFile(0xc00038a000, 0xd44200, 0x1a, 0xc00051d980, 0x18bc, 0x1801, 0x0, 0x0)
/go/src/github.com/go-swagger/go-swagger/generator/template_repo.go:283 +0x12d
github.com/go-swagger/go-swagger/generator.(*Repository).LoadDefaults(0xc00038a000)
/go/src/github.com/go-swagger/go-swagger/generator/template_repo.go:221 +0x10d
github.com/go-swagger/go-swagger/generator.(*GenOpts).setTemplates(0xc000435d40, 0x0, 0x0)
/go/src/github.com/go-swagger/go-swagger/generator/shared.go:659 +0x31
github.com/go-swagger/go-swagger/generator.newAppGenerator(0x7ffe82dd8dec, 0x5, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc000435d40, 0xc000768540, ...)
/go/src/github.com/go-swagger/go-swagger/generator/support.go:57 +0x64
github.com/go-swagger/go-swagger/generator.GenerateServer(0x7ffe82dd8dec, 0x5, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc000435d40, 0xc000435d40, ...)
/go/src/github.com/go-swagger/go-swagger/generator/support.go:36 +0x94
github.com/go-swagger/go-swagger/cmd/swagger/commands/generate.(*Server).generate(0xc00000a5a0, 0xc000435d40, 0x0, 0x0)
/go/src/github.com/go-swagger/go-swagger/cmd/swagger/commands/generate/server.go:88 +0x94
github.com/go-swagger/go-swagger/cmd/swagger/commands/generate.createSwagger(0xea6e40, 0xc00000a5a0, 0x8b4a01, 0x7f2c6edd14a0)
/go/src/github.com/go-swagger/go-swagger/cmd/swagger/commands/generate/shared.go:175 +0x225
github.com/go-swagger/go-swagger/cmd/swagger/commands/generate.(*Server).Execute(0xc00000a5a0, 0xc0000c68c0, 0x0, 0xe, 0xc00000a5a0, 0x1)
/go/src/github.com/go-swagger/go-swagger/cmd/swagger/commands/generate/server.go:115 +0x37
github.com/jessevdk/go-flags.(*Parser).ParseArgs(0xc0007393e0, 0xc000030100, 0xe, 0xe, 0x10, 0xd54c3a, 0x2a, 0xbda6e0, 0xc0002a4240)
/go/pkg/mod/github.com/jessevdk/go-flags@v1.4.0/parser.go:316 +0x8c0
github.com/jessevdk/go-flags.(*Parser).Parse(...)
/go/pkg/mod/github.com/jessevdk/go-flags@v1.4.0/parser.go:186
main.main()
/go/src/github.com/go-swagger/go-swagger/cmd/swagger/swagger.go:145 +0xafc
goroutine 113 [chan send]:
text/template/parse.(*lexer).emit(...)
/usr/local/go/src/text/template/parse/lex.go:157
text/template/parse.lexSpace(0xc0007bc000, 0xd6e0b0)
/usr/local/go/src/text/template/parse/lex.go:442 +0x172
text/template/parse.(*lexer).run(0xc0007bc000)
/usr/local/go/src/text/template/parse/lex.go:230 +0x37
created by text/template/parse.lex
/usr/local/go/src/text/template/parse/lex.go:223 +0x190
rake aborted!
Command failed with status (2): [/repo/build-root/tools/v0.23.0/swagger_lin...]
/repo/build-root/Rakefile:194:in `block (2 levels) in <top (required)>'
/repo/build-root/Rakefile:193:in `chdir'
/repo/build-root/Rakefile:193:in `block in <top (required)>'
Tasks: TOP => install_server => build_server => gen_server => /repo/build-root/backend/server/gen/restapi/configure_stork.go
(See full trace by running task with --trace)
rake aborted!
Command failed with status (1): [cd ./build-root && GOPATH=/repo/build-root...]
/repo/Rakefile:537:in `block in <top (required)>'
Tasks: TOP => build_all_copy_in_subdir
(See full trace by running task with --trace)
rake aborted!
Command failed with status (1): [docker run -v $PWD:/repo --rm -ti stork-bu...]
/home/thomson/devel/stork/Rakefile:530:in `block in <top (required)>'
/usr/share/rubygems-integration/all/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'
Tasks: TOP => docker_up => build_all_in_container
(See full trace by running task with --trace)
This is yet another problem with swagger. There are two things to do here:
-
somehow fix this particular problem (I suspect increasing mlock limit will do the trick, so this may be a doc update only) -
change the build process, so docker generated files are checked into repo.
The second item will also greatly speed up and simplify (no need for Java or swagger, unless you change the API). This is of particular importance on FreeBSD. But the speed up should be observed everywhere.