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

Projects
None yet
2 participants
@cosmicexplorer
Copy link
Contributor

commented Jun 3, 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!

@stuhood

stuhood approved these changes Jun 3, 2019

Copy link
Member

left a comment

Thanks!

Show resolved Hide resolved src/python/pants/backend/jvm/targets/scala_library.py Outdated

@stuhood stuhood added this to the 1.16.x milestone Jun 3, 2019

@stuhood

stuhood approved these changes Jun 4, 2019

Copy link
Member

left a comment

Thanks!

@stuhood

This comment has been minimized.

Copy link
Member

commented Jun 4, 2019

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

cosmicexplorer added some commits Jun 3, 2019

@cosmicexplorer cosmicexplorer force-pushed the cosmicexplorer:fix-java-sources-snapshot branch from 0ece427 to ed3956c Jun 5, 2019

@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

1 check was pending

continuous-integration/travis-ci/pr The Travis CI build is in progress
Details

cosmicexplorer added a commit that referenced this pull request Jun 5, 2019

add java_sources to scala_library() snapshot (#7840)
### 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!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.