Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Build: support non $GOPATH/src location for codegen #6

Merged
merged 1 commit into from
Aug 12, 2019

Conversation

hiddeco
Copy link
Member

@hiddeco hiddeco commented Aug 12, 2019

This commit fixes two things:

  • it ensures the code generation works no matter the location of the
    project directory
  • as a side effect; fixes the hack/verify-codegen.sh ran during CI

The previous script (or more specific: the code-generator library)
made the assumption during execution that the project was placed
inside $GOPATH/src and made the modifications there.

The idea of Go Modules is however that a project and/or package can
be placed anywhere, and this is also what the CI did, resulting in a
comparison of two identical cp -r copied directories. Giving a
false green light on every CI run.

To work around this limitation in code-generator: create a
temporary directory, use this as an output base, and copy
everything back once generated.

@hiddeco hiddeco force-pushed the build/check-generated branch 5 times, most recently from 4ebf968 to b2aaaa0 Compare August 12, 2019 19:57
This commit fixes two things:

- it ensures the code generation works no matter the location of the
  project directory
- as a side effect; fixes the `hack/verify-codegen.sh` ran during CI

The previous script (or more specific: the `code-generator` library)
made the assumption during execution that the project was placed
inside `$GOPATH/src` and made the modifications there.

The idea of Go Modules is however that a project and/or package can
be placed anywhere, and this is also what the CI did, resulting in a
comparison of two identical `cp -r` copied directories. Giving a
false green light on every CI run.

To work around this limitation in `code-generator`: create a
temporary directory, use this as an output base and copy
everything back once generated.
@hiddeco hiddeco changed the title Build: small codegen adjustments Build: support non $GOPATH/src location for codegen Aug 12, 2019
@hiddeco hiddeco merged commit 004ee5e into prepare-helm-op Aug 12, 2019
@hiddeco hiddeco deleted the build/check-generated branch August 12, 2019 21:00
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants