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

Avoid compiling damlc twice #8428

Merged
merged 1 commit into from
Jan 7, 2021
Merged

Avoid compiling damlc twice #8428

merged 1 commit into from
Jan 7, 2021

Conversation

aherrmann-da
Copy link
Contributor

This only compiles damlc-bootstrap as a Haskell binary and damlc is a simple symlink with additional runfiles.

To that end this PR adds a small Bazel rule add_data that symlinks a binary (copy on Windows) and extends its runfiles. Ideally, we could achieve the same using sh_binary, however due to bazelbuild/bazel#11820 this would break some targets using damlc.

We now need to define damlc@ghci manually since it is no longer defined automatically. The manual definition was tested with

$ bazel run //:damlc@ghci --define ghci_data=True
> :main ide -d

The release tarball is not affected since package_app bundles the full binary.

To be sure I have tested the resulting HEAD SDK on Windows and Linux by following the quickstart-java/quickstart test steps defined in the relase test guide.

Pull Request Checklist

  • Read and understand the contribution guidelines
  • Include appropriate tests
  • Set a descriptive title and thorough description
  • Add a reference to the issue this PR will solve, if appropriate
  • Include changelog additions in one or more commit message bodies between the CHANGELOG_BEGIN and CHANGELOG_END tags
  • Normal production system change, include purpose of change in description

NOTE: CI is not automatically run on non-members pull-requests for security
reasons. The reviewer will have to comment with /AzurePipelines run to
trigger the build.

This only compiles `damlc-bootstrap` as a Haskell binary and `damlc` is
a simple symlink with additional runfiles.

We now need to define `damlc@ghci` manually since it is no longer
defined automatically. The manual definition was tested with

```
$ bazel run //:damlc@ghci --define ghci_data=True
> :main ide -d
```

changelog_begin
changelog_end
Copy link
Contributor

@cocreature cocreature left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very cool, thanks a lot!

@aherrmann-da aherrmann-da merged commit fa45a58 into main Jan 7, 2021
@aherrmann-da aherrmann-da deleted the damlc-runfiles branch January 7, 2021 15:58
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

Successfully merging this pull request may close these issues.

3 participants