triggermesh / triggermesh

TriggerMesh is the open-source AWS EventBridge alternative. It provides a unified eventing experience, a developer-friendly CLI, and runs on Docker or natively on Kubernetes.
https://www.triggermesh.com
Apache License 2.0
606 stars 74 forks source link

Enable running `codegen` even if the project is checked out outside of GOPATH #173

Open antoineco opened 3 years ago

antoineco commented 3 years ago

It would be nice to be able to run make codegen without having to clone the repository inside the legacy GOPATH.

Knative solved that problem by

  1. creating a temporary directory (${TMP_DIR})
  2. initializing a GOPATH-like directory hierarchy inside that temporary directory (e.g. ${TMP_DIR}/src/github.com/triggermesh/triggermesh)
  3. symlinking the GOPATH-like project path to the actual project path (e.g. -> ~/git/triggermesh)
  4. exporting GOPATH to the value of the temporary directory
antoineco commented 3 years ago

The trick described above is extremely hacky to implement in pure Make configuration: https://stackoverflow.com/questions/589252/how-can-i-automatically-create-and-remove-a-temp-directory-in-a-makefile

We might be better off moving hack/inc.Codegen.mk to some shell script.