Skip to content
This repository was archived by the owner on Sep 15, 2021. It is now read-only.

Overhaul workspace file to use only a single setup function #129

Merged
merged 10 commits into from
Nov 29, 2018

Conversation

c-parsons
Copy link
Contributor

Fix skydoc_repositories() so it does not require dependencies to be previously defined in the WORKSPACE file.

@c-parsons
Copy link
Contributor Author

Never mind for now. This is very, very, broken. Apparently my verification was insufficient.
I'll ping this PR when this is ready :\

@c-parsons
Copy link
Contributor Author

OK. PR looks good to go. Review at your leisure :)

Copy link

@dkelmer dkelmer left a comment

Choose a reason for hiding this comment

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

It would be nice to add some docs explaining to your users what they need to load to use skydoc :)

setup.bzl Outdated
# Protobuf expects an //external:python_headers label which would contain the
# Python headers if fast Python protos is enabled. Since we are not using fast
# Python protos, bind python_headers to a dummy target.
native.bind(
Copy link

Choose a reason for hiding this comment

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

This wasn't in the WORKSPACE file before, what changed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was part of skydoc_repositories(), which I've essentially moved into setup().

Copy link

Choose a reason for hiding this comment

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

Ah, I missed it when skimming setup()

setup.bzl Outdated
actual = "//:dummy",
)

http_archive(
Copy link

Choose a reason for hiding this comment

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

I think you should add these repositories conditionally as well. While you're at it, may as well let your users overwrite them

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

strip_prefix = "MarkupSafe-0.23",
)

native.bind(
Copy link

Choose a reason for hiding this comment

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

I know it's not new to this CL, but these binds are kind of unnecessary (this comment is not blocking but I don't think that's an option on github)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They are? I'm not sure what you mean they are unnecessary (though admittedly I haven't tried removing them)

Copy link

Choose a reason for hiding this comment

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

Ok, unnecessary is an exaggeration, but it is just a convenience rename and I believe that there is a movement to get rid of bind (and in this case I think alias would work just as well)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As discussed offline, it's pretty tricky removing these or replacing them with alias as-is :) Maybe another time

name = "six",
actual = "@six_archive//:six",
)
skydoc_repositories = _skydoc_repositories
Copy link

Choose a reason for hiding this comment

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

Why import it as _skydoc_repositories if you are renaming it its default name?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because

  1. Loading non-explicitly-exported symbols is disallowed (Without redefining skydoc_repositories in this file, a bzl file depending on this file would not be able to load skydoc_repositories)
  2. Overriding an imported global symbol is disallowed
    (I'm not allowed to do skydoc_repositories = skydoc_repositories)

Thus, I have to load it in as a different symbol name then re-export it under the desired name.

@c-parsons
Copy link
Contributor Author

It would be nice to add some docs explaining to your users what they need to load to use skydoc :)

I would indeed like to do this, but I'd like to do this as a followup separately.
My intention is:

  1. Fix this workspace file / repository madness (submit this PR)
  2. Prepare a PR to update all documentation. Repository loading, Stardoc usage, etc.
  3. Cut a release of Skydoc.
  4. Update the PR from (2) to confirm the new release tag as the recommended tag
  5. Submit the PR (update the site)
  6. Announce Stardoc

Copy link
Contributor

@laurentlb laurentlb left a comment

Choose a reason for hiding this comment

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

lgtm

cc @aehlig for best practices

@c-parsons c-parsons merged commit 4ea7b82 into master Nov 29, 2018
@c-parsons c-parsons deleted the workspace-overhaul branch December 3, 2018 23:02
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants