Skip to content

Fix for thrift rule issue that manifests with remote repos #83

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

Merged
merged 2 commits into from
Aug 18, 2016

Conversation

johnynek
Copy link
Contributor

The problem is that the path is not the same when remote as local. The current fix:

  1. makes sure that a prefix, if given, is an actual substring of the common prefix.
  2. ignores anything before the prefix that matches. So it is like the regex .*prefix(.*)$.

The above two fixes make this rule usable in both local and remote contexts for me.

@bazel-io
Copy link

Can one of the admins verify this patch?

@johnynek
Copy link
Contributor Author

@ianoc review?

@johnynek
Copy link
Contributor Author

@jcoveney ?

pass
else:
tmp_pref = pref
for end in range(0, len(pref) + 1):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

no while in skylark. :(

Copy link
Contributor Author

Choose a reason for hiding this comment

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

(skylark may be a total language... No recursion, only for loops on collections, I think everything terminates).

If you consider any method error to be a type error (which a better compiler would have caught, I think it may be total....)

@ianoc
Copy link
Contributor

ianoc commented Jul 31, 2016

looks reasonable to me. Is it possible to add a test for the issue so it doesn't re-occur?

@johnynek
Copy link
Contributor Author

@ianoc we can add a test. It is not super easy to do so. We need to set up some kind of remote repo (maybe a nested local repository will do it), then verify that the build of a target that depends on the remote thrift target has all the thrift files we expect.

@ianoc
Copy link
Contributor

ianoc commented Aug 18, 2016

I'd be inclined to merge it since its strictly better, but maybe we should just file an issue for future clean up?

@johnynek johnynek mentioned this pull request Aug 18, 2016
@johnynek
Copy link
Contributor Author

@ianoc yeah, added: #87

The testing story is not great. The bazel folks want us to drive the tests in bazel, but that requires a lot of shell hacking: #76

@johnynek johnynek merged commit f34ca28 into master Aug 18, 2016
@johnynek johnynek deleted the oscar/thrift-transitive2-fix branch August 18, 2016 18:53
@ittaiz
Copy link
Contributor

ittaiz commented Aug 18, 2016

Just as general inquiry:
What do you mean by drive the tests in Bazel?
On יום ה׳, 18 באוג׳ 2016 at 21:53 P. Oscar Boykin [email protected]
wrote:

Merged #83 #83.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#83 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/ABUIF7KkBmephF07aukPMOs_R8a2cER1ks5qhKopgaJpZM4JYsCd
.

@johnynek
Copy link
Contributor Author

@ittaiz the suggestion is for the tests to be run with bazel test. Then you inside a bazel sh_test you create a new temporary WORKSPACE and BUILD files, and inside that script again call bazel.

Did you see the movie Inception? Like that.

@ittaiz
Copy link
Contributor

ittaiz commented Aug 18, 2016

:) Got you.
Thanks for the explanation.
On יום ה׳, 18 באוג׳ 2016 at 23:13 P. Oscar Boykin [email protected]
wrote:

@ittaiz https://github.com/ittaiz the suggestion is for the tests to be
run with bazel test. Then you inside a bazel sh_test you create a new
temporary WORKSPACE and BUILD files, and inside that script again call
bazel.

Did you see the movie Inception? Like that.


You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub
#83 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABUIFwvtR4DYeICQ-SU0VicYkKwqmZHKks5qhLz3gaJpZM4JYsCd
.

petemounce pushed a commit to improbable-io/rules_scala that referenced this pull request Oct 20, 2016
* upstream/master:
  use strings rather than HOST/DATA_CFG
  Add cfg attribute on executable labels
  Switch to using shorter stack traces.
  Catch throwables from type errors
  make thrift targets quieter (bazel-contrib#94)
  Fix jvm_flag support (bazel-contrib#93)
  Make compile timing optional, with default false
  Update README.md
  Persistent/worker scala compiler (bazel-contrib#91)
  fix typo in README.md (bazel-contrib#89)
  Fix for thrift rule issue that manifests with remote repos (bazel-contrib#83)
  improve the deploy jar creation (bazel-contrib#85)
  Use bind's for twitter scrooge so local repo's can override scrooge and thrift versions (bazel-contrib#84)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants