Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include generated files in releases of packages depending on proto-lens #69

Closed
judah opened this issue Jan 29, 2017 · 1 comment
Closed

Comments

@judah
Copy link
Collaborator

judah commented Jan 29, 2017

We should do something similar to happy/alex/etc for generated files, i.e., bundle them into the release archive that's uploaded to Hackage/Stackage. That way, packages that depend on protos won't require installing the protoc executable.

Cabal has special logic for happy and alex, but the logic around when to rebuild the generated files is somewhat flaky: haskell/cabal#2940, haskell/cabal#2311, haskell/cabal#2362. Part of the problem is that when Cabal unpacks the tarball of the package, it doesn't set the modification times consistently (this may be fixed on newer versions of Cabal, not sure though).

One option is for us to do something simpler than Cabal:

  • Never run protoc when building from an archive that was created by cabal sdist
  • Always run protoc otherwise (in particular: when building from the git repo).
    We'd need to make cabal sdist do something special in order for cabal build to tell the difference. One hacky option is to include an extra dummy file in extra-src-files. A more involved option would be to copy the generated files from the autogen dir (where they are now) to one of the hs-source-dirs; but that may be complicated in the presence of multiple binaries/tests.
judah added a commit to judah/tensorflow-haskell that referenced this issue May 10, 2017
- LICENSE files for all packages
- Descriptions for packages that were missing one
- Work around google/proto-lens#69 by symlinking third_party into
  tensorflow-proto

Symlink third_party into tensorflow-proto.
judah added a commit to judah/tensorflow-haskell that referenced this issue May 10, 2017
- Add LICENSE files for all packages.
- Add descriptions for packages that were missing one.
- Work around google/proto-lens#69 by symlinking third_party into
  tensorflow-proto.
blackgnezdo pushed a commit to tensorflow/haskell that referenced this issue May 10, 2017
- Add LICENSE files for all packages.
- Add descriptions for packages that were missing one.
- Work around google/proto-lens#69 by symlinking third_party into
  tensorflow-proto.
blackgnezdo added a commit that referenced this issue Aug 17, 2018
* Download protoc and libtensorflow instead of running bazel.
* Explicitly set permissions of protoc.
@judah
Copy link
Collaborator Author

judah commented Oct 27, 2019

I'm closing this ticket since we've continued to use the .proto files as the source of truth, and don't have plans to change that. Additionally, Cabal now supports an autogen-modules field which makes it more aware of these generated modules and allowed us to remove the custom sdist hook. I'd rather keep it that way than add back more complexity to proto-lens-setup.

@judah judah closed this as completed Oct 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant