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

Regression: short form repository labels don't work anymore #41

Closed
mboes opened this issue Nov 11, 2018 · 3 comments · Fixed by #43
Closed

Regression: short form repository labels don't work anymore #41

mboes opened this issue Nov 11, 2018 · 3 comments · Fixed by #43
Assignees

Comments

@mboes
Copy link
Member

mboes commented Nov 11, 2018

It used to be possible to write this:

nixpkgs_package(
  name = "foo",
  repository = "@nixpkgs",
)

This is a lot shorter than repositories = {"nixpkgs": "@nixpkgs//:default.nix"}. The reason this worked before is that we had a symlink that had the same name as the repository, pointing to default.nix, since @foo is actually syntactic sugar for @foo//:foo in Bazel.

It would be nice to have this shorthand available again. Incidentally, I think we should not deprecate repository, even though repositories now exists.

@Profpatsch
Copy link
Contributor

Profpatsch commented Nov 12, 2018

I don’t understand where the symlink was before. IIRC I didn’t remove any symlinks (perhaps implicitly?).

Since @foo points to @foo//:foo, the repository needs a BUILD file with a foo target, right? Or alternatively export a foo file from its default package.

We only control the target repository if it was fetched via nixpkgs_git_repository, but download_and_extract only adds an empty BUILD file.

@thufschmitt
Copy link
Contributor

@Profpatsch The symlink wasn't needed because of the dirname hack removed by #34

@Profpatsch
Copy link
Contributor

Profpatsch commented Nov 12, 2018

Yeah, that’s what I suspected. But then I don’t see how it defaulted to the target anyway. @foo//:foo is not @foo//:default.nix after all.

@mboes mboes assigned mboes and unassigned Profpatsch Nov 13, 2018
mboes added a commit that referenced this issue Nov 13, 2018
Before #29, we'd write

```python
nixpkgs_package(name = "hello", repository = "@nixpkgs")
```

and this would just work. Now we write

```python
nixpkgs_package(name = "hello", repositories = { "nixpkgs": "@nixpkgs//:default.nix" })
```

which is quite a bit more verbose. With this fix, writing the
repository label as `"@nixpkgs"` works again.

Fixes #41.
mboes added a commit that referenced this issue Nov 14, 2018
Before #29, we'd write

```python
nixpkgs_package(name = "hello", repository = "@nixpkgs")
```

and this would just work. Now we write

```python
nixpkgs_package(name = "hello", repositories = { "nixpkgs": "@nixpkgs//:default.nix" })
```

which is quite a bit more verbose. With this fix, writing the
repository label as `"@nixpkgs"` works again.

Fixes #41.
@mboes mboes closed this as completed in #43 Nov 14, 2018
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 a pull request may close this issue.

3 participants