You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Simply running make bin is not sufficient when testing changes #1547
coder --version: Coder v0.0.0-devel+ba818b3 Wed May 18 00:07:20 UTC 2022 ba818b3
Steps to Reproduce
Have coder repo in some fringe state with old builds and what not
Run make bin
Run coder server --dev ...
Run coder templates create -d examples/docker-local
Run coder create dev
See error in Docker container: Syntax error: redirection unexpected (not reproducible after make build)
Expected
No error, or protection against serving an incompatible agent binary.
It seems coder server is serving an incompatible agent for the given architecture. I'm not entirely sure how my project ended up in that state, but it's something that could possibly trip up someone contributing to this project, or prefer to build it themselves.
Actual
Workspace creation fails:
docker_container.workspace[0]: Creating...
docker_container.workspace[0]: Creation errored after 1s
Error: container exited immediately
✘ Starting workspace [5921ms]
exit status 1
(The lack of error information is already documented in #1544, this is not about that.)
If we view the docker log we simply see:
Syntax error: redirection unexpected
Indicating that the binary was incompatible with the target architecture (server macOS amd64, container linux amd64).
Notes
I've not dug into exactly what went wrong here, it could be that the issue sits between keyboard and chair.
Running make bin isn't perhaps the supported approach, but I imagine simply running go build -tags embed ./cmd/coder or make dev could have similar issues given the right circumstance.
changed the title [-]Bug: Simply running `make bin` is not sufficient when testing changes[/-][+]Simply running `make bin` is not sufficient when testing changes[/+]on Jun 7, 2022
Syntax error: redirection unexpected actually doesn't indicate that it was incompatible, it just means you didn't download an ELF file. This is probably the SPA index.html file, which we shouldn't serve on 404 under /bin/ but we do due to a bug #2510
... which probably means you ran a slim binary instead of a full binary. The build order for coder is site, slim binaries, fat binaries. We need to build the slim binaries first because the fat binaries have to embed the slim binaries for the agents. The slim binaries are built without -tags embed.
(make build does it in the correct order, and make bin prints a warning telling you that slim binaries are only for CLI usage and not for servers)
Activity
[-]Bug: Simply running `make bin` is not sufficient when testing changes[/-][+]Simply running `make bin` is not sufficient when testing changes[/+]deansheather commentedon Jun 19, 2022
Syntax error: redirection unexpectedactually doesn't indicate that it was incompatible, it just means you didn't download an ELF file. This is probably the SPA index.html file, which we shouldn't serve on 404 under /bin/ but we do due to a bug #2510deansheather commentedon Jun 19, 2022
... which probably means you ran a slim binary instead of a full binary. The build order for coder is site, slim binaries, fat binaries. We need to build the slim binaries first because the fat binaries have to embed the slim binaries for the agents. The slim binaries are built without
-tags embed.(
make builddoes it in the correct order, andmake binprints a warning telling you that slim binaries are only for CLI usage and not for servers)