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

Make src_root optional when there's only one srcs #7

Open
laurentlb opened this issue Jan 3, 2018 · 2 comments
Open

Make src_root optional when there's only one srcs #7

laurentlb opened this issue Jan 3, 2018 · 2 comments

Comments

@laurentlb
Copy link

It would be nice to allow this:

ocaml_native_binary(
    name = "ocaml",
    srcs = "hello.ml",
)

In other words, when there's only one source file, it should be used as the root one.

Suggestion: Maybe rename src_root to main? I think it's a more common name.

@jin
Copy link
Owner

jin commented Jan 4, 2018

Which of the following do you think is better?

ocaml_native_binary(
    name = "hello",
    srcs = ["hello.ml"],
    # implies: main = "hello.ml"
)

or

ocaml_native_binary(
    name = "hello",
    main = "hello.ml",
    # implies: srcs = ["hello.ml"]
)

I prefer the first.

@laurentlb
Copy link
Author

Yes, I also prefer the first one.
You may add allow_empty=False to srcs.

@jin jin self-assigned this Jan 8, 2018
@jin jin removed their assignment Jun 7, 2019
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

No branches or pull requests

2 participants