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

Completes the prototype implementation of Bazel persistent worker mode #1055

Merged
merged 2 commits into from Aug 28, 2019

Conversation

@ulysses4ever
Copy link
Contributor

commented Aug 24, 2019

Started in 132d0af. This commit imports worker's code and sets everything to make
the persistent worker mode available to a regular rules_haskell user.

The worker code lives in tools/worker.

The mode is supported in ghc_nixpkgs-toolchain only, at this point.

@ulysses4ever ulysses4ever requested review from mboes and aherrmann Aug 24, 2019
@ulysses4ever ulysses4ever changed the title Completes the prototype implementation of Bazel persistent worker mode Complets the prototype implementation of Bazel persistent worker mode Aug 24, 2019
@ulysses4ever ulysses4ever changed the title Complets the prototype implementation of Bazel persistent worker mode Completes the prototype implementation of Bazel persistent worker mode Aug 24, 2019
@ulysses4ever ulysses4ever force-pushed the worker-packaging-release branch from cb390d7 to ee5eafe Aug 24, 2019
haskell/private/context.bzl Outdated Show resolved Hide resolved
tests/haskell_proto_library/BUILD.bazel Outdated Show resolved Hide resolved
tests/haskell_proto_library/Bar.hs Outdated Show resolved Hide resolved
tools/worker/Compile.hs Outdated Show resolved Hide resolved
tools/worker/Compile.hs Outdated Show resolved Hide resolved
tools/worker/Main.hs Outdated Show resolved Hide resolved
@ulysses4ever ulysses4ever changed the title Completes the prototype implementation of Bazel persistent worker mode [WIP] Completes the prototype implementation of Bazel persistent worker mode Aug 27, 2019
@ulysses4ever

This comment has been minimized.

Copy link
Contributor Author

commented Aug 27, 2019

Note. CI fails on examples and tutorial because, as it turns out, we accidentally added the requirement to load worker dependencies even when the worker is not used. A solution based on select is currently being crafted.

@ulysses4ever ulysses4ever force-pushed the worker-packaging-release branch from ee5eafe to 53d847d Aug 27, 2019
@ulysses4ever

This comment has been minimized.

Copy link
Contributor Author

commented Aug 27, 2019

Thanks @aherrmann for the review! Hopefully, all the comments are addressed. I also changed the implementation of the worker switch to use select so that we don't require loading worker dependencies when the worker is not used. Please, take a look when have time.

@ulysses4ever ulysses4ever changed the title [WIP] Completes the prototype implementation of Bazel persistent worker mode Completes the prototype implementation of Bazel persistent worker mode Aug 27, 2019
Copy link
Member

left a comment

Great work, thank you! Only one minor comment about the rule_type tag.

I've tested this on my machine and bazel test --define use_worker=True --worker_sandboxing //... passes.

haskell/nixpkgs.bzl Show resolved Hide resolved
haskell/defs.bzl Show resolved Hide resolved
haskell/defs.bzl Outdated Show resolved Hide resolved
@ulysses4ever

This comment has been minimized.

Copy link
Contributor Author

commented Aug 27, 2019

@aherrmann thanks!

I've tested this on my machine and bazel test --define use_worker=True --worker_sandboxing //... passes.

Yes, if you enable worker dependencies -- it's all good! But if you don't, plain bazel test //... fails (for me, not sure if it's some local issue). Instead, bazel test //tests/... succeeds. Could you try it? If it fails for you too we might need to fix the README: it mentions bazel test //... now.

@aherrmann

This comment has been minimized.

Copy link
Member

commented Aug 27, 2019

Yes, if you enable worker dependencies -- it's all good! But if you don't, plain bazel test //... fails (for me, not sure if it's some local issue). Instead, bazel test //tests/... succeeds. Could you try it?

Yes, same for me. That makes sense as //... includes //tools/worker:bin. bazel test //... will also try to build (not execute) non-test targets. You can observe the same if you turn e.g. //tests/binary-simple:binary-simple into a haskell_binary instead of haskell_test and run bazel test //tests/binary-simple/....

@ulysses4ever

This comment has been minimized.

Copy link
Contributor Author

commented Aug 27, 2019

Thanks for checking! It doesn't seem entirely reasonable to me to build non-test targets during bazel test but well… I guess I'll change README then.

@ulysses4ever ulysses4ever force-pushed the worker-packaging-release branch 3 times, most recently from 143ded4 to 35a2b55 Aug 27, 2019
@ulysses4ever

This comment has been minimized.

Copy link
Contributor Author

commented Aug 28, 2019

Andreas, I tried to address all your comments. What do you think?

tools/worker/Compile.hs Outdated Show resolved Hide resolved
@ulysses4ever

This comment has been minimized.

Copy link
Contributor Author

commented Aug 28, 2019

I tried to use “Apply suggestion” button for the first time in my life to see what happens. I wonder if it's possible to squash the resulting tiny commit, on merge.

Copy link
Member

left a comment

AFAIK mergify is not configured to squash-merge.

Thanks for addressing the comments. Looks good to me.

@ulysses4ever

This comment has been minimized.

Copy link
Contributor Author

commented Aug 28, 2019

I'll squash manually then. What's the proper way to proceed after that? Add the merge-queue label?

@ulysses4ever ulysses4ever force-pushed the worker-packaging-release branch from 115afbd to fea9482 Aug 28, 2019
@ulysses4ever

This comment has been minimized.

Copy link
Contributor Author

commented Aug 28, 2019

The netlify failure doesn't seem related to the PR. I'm confused…

…e support in rules_haskell

Started in 132d0af. This commit imports worker's code and sets everything to make
the persistent worker mode available to a regular `rules_haskell` user.

The worker code lives in `tools/worker`.

The mode is supported in ghc_nixpkgs-toolchain only, at this point.
@ulysses4ever ulysses4ever force-pushed the worker-packaging-release branch from 7f45c59 to 89b6d14 Aug 28, 2019
@mergify mergify bot merged commit a42b91d into master Aug 28, 2019
5 of 6 checks passed
5 of 6 checks passed
Rule: automatic merge (merge) The rule doesn't match anymore, this action has been cancelled
Details
Summary 2 rules match and 1 potential rule
Details
build Workflow: build
Details
buildkite/rules-haskell/pr Build #235 passed (4 minutes, 57 seconds)
Details
deploy/netlify Deploy preview ready!
Details
tweag.rules_haskell #20190828.19 succeeded
Details
@mergify mergify bot deleted the worker-packaging-release branch Aug 28, 2019
@mergify mergify bot removed the merge-queue label Aug 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.