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

Non-existent sources don't fail the build #99

Closed
paullewis opened this issue Jul 22, 2022 · 7 comments
Closed

Non-existent sources don't fail the build #99

paullewis opened this issue Jul 22, 2022 · 7 comments
Assignees

Comments

@paullewis
Copy link

paullewis commented Jul 22, 2022

Hey, so if we have a ts_project and we declare a source file that doesn't exist, everything appears to build correctly even though the source file doesn't exist. This seems a bit odd to me, as I would have expected things to fail given a non-existent input.

So, for example, this:

load("@aspect_rules_ts//ts:defs.bzl", "ts_project")

ts_project(
    name = "src",
    srcs = [
        "baz",
    ],
    tsconfig = "//:tsconfig",
)

Here baz doesn't exist, and there is no other target in the same package by that name generating TS files.

If it's helpful, I will gladly put a repro repo together for this :)

@jbedard
Copy link
Member

jbedard commented Jul 25, 2022

You don't get the following errors?

Error in fail: ts_project target //path:invalid_src is configured to produce no outputs.

This might be because
- you configured it with `noEmit`
- the `srcs` are empty

This is an error because Bazel does not run actions unless their outputs are needed for the requested targets to build.

Or if I have a non-existing .ts file in the srcs instead of file without a file extension:

ERROR: /...path.../BUILD.bazel:3:11: Copying file ...path.../not_found.ts failed: missing input file '//examples/invalid_src:not_found.ts'
ERROR: /...path.../BUILD.bazel:3:11: Copying file ...path.../not_found.ts failed: 1 input file(s) do not exist
ERROR: /...path.../BUILD.bazel:3:11 Copying file ...path.../not_found.ts failed: 1 input file(s) do not exist

@paullewis
Copy link
Author

Not on version 0.10.0, no.

I've made a repo here for you so you can see what I mean: https://github.com/paullewis/repro-rules-ts-issue-99

@paullewis
Copy link
Author

paullewis commented Jul 26, 2022

Ah, so if I bump the http_archive in WORKSPACE to go to tip-of-tree then I do get the errors you mentioned:

http_archive(
    name = "aspect_rules_ts",
    sha256 = "966df4d5d7a6b55b645236db146086ed950c9a77c88d3fcaff68e6ab42cf2ec1",
    strip_prefix = "rules_ts-main",
    url = "https://github.com/aspect-build/rules_ts/archive/refs/heads/main.zip",
)

Would it be possible to cut a new release then?

@thesayyn thesayyn self-assigned this Jul 27, 2022
@thesayyn
Copy link
Member

I wonder when and which commit includes the fix for this.

@jbedard
Copy link
Member

jbedard commented Jul 28, 2022

@paullewis we'll publish a release soon, just a couple issues we'd like to fix first.

@alexeagle
Copy link
Member

https://github.com/aspect-build/rules_ts/releases/tag/v0.11.0 is out, @paullewis do you mind verifying and closing this?

@paullewis
Copy link
Author

LGTM - closing.

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

4 participants