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

add java_sources to scala_library() snapshot #7840

Merged

Conversation

cosmicexplorer
Copy link
Contributor

Problem

Zinc or rsc compiles with --execution-strategy=hermetic will fail on scala_library() targets with java_sources, because those sources aren't added into the source snapshot, and zinc fails with an opaque error:

[error] IO error while decoding /Users/dmcclanahan/tools/pants/.pants.d/tmp/tmpfv8ds506.pants.d/process-executionUP7R5m/testprojects/src/java/org/pantsbuild/testproject/javasources/JavaSource.java with UTF-8: /Users/dmcclanahan/tools/pants/.pants.d/tmp/tmpfv8ds506.pants.d/process-executionUP7R5m/testprojects/src/java/org/pantsbuild/testproject/javasources/JavaSource.java (No such file or directory)
[error] Please try specifying another one using the -encoding option

Solution

  • Add the sources from java_sources targets into the sources_snapshot() for a scala_library() target.

Result

java_sources works with hermetic compiles!

Copy link
Sponsor Member

@stuhood stuhood left a comment

Choose a reason for hiding this comment

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

Thanks!

src/python/pants/backend/jvm/targets/scala_library.py Outdated Show resolved Hide resolved
@stuhood stuhood added this to the 1.16.x milestone Jun 3, 2019
Copy link
Sponsor Member

@stuhood stuhood left a comment

Choose a reason for hiding this comment

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

Thanks!

@stuhood
Copy link
Sponsor Member

stuhood commented Jun 4, 2019

This had a bootstrap shard fail in travis: have restarted things.

@stuhood stuhood modified the milestones: 1.16.x, 1.17.x Jun 5, 2019
@cosmicexplorer cosmicexplorer merged commit 1fc8fea into pantsbuild:master Jun 5, 2019
cosmicexplorer added a commit that referenced this pull request Jun 5, 2019
### Problem

Zinc or rsc compiles with `--execution-strategy=hermetic` will fail on `scala_library()` targets with `java_sources`, because those sources aren't added into the source snapshot, and zinc fails with an opaque error:
```
[error] IO error while decoding /Users/dmcclanahan/tools/pants/.pants.d/tmp/tmpfv8ds506.pants.d/process-executionUP7R5m/testprojects/src/java/org/pantsbuild/testproject/javasources/JavaSource.java with UTF-8: /Users/dmcclanahan/tools/pants/.pants.d/tmp/tmpfv8ds506.pants.d/process-executionUP7R5m/testprojects/src/java/org/pantsbuild/testproject/javasources/JavaSource.java (No such file or directory)
[error] Please try specifying another one using the -encoding option
```

### Solution

- Add the sources from `java_sources` targets into the `sources_snapshot()` for a `scala_library()` target.

### Result

`java_sources` works with hermetic compiles!
@illicitonion illicitonion removed this from the 1.17.x milestone Jul 10, 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

Successfully merging this pull request may close these issues.

None yet

3 participants