Comments (5)
@bjchambers thanks for filing this issue and for including a test that catches it. This does seem like a bug. I'll see if we can get a fix in over the next couple days.
from rules_scala.
It looks like this is an issue with the C++ implementation of singlejar. If I'm reading this right:
INFO: From singlejar resources plain:
singlejar_local: src/tools/singlejar/output_jar.cc:923: Duplicate resource name reference.conf in the --classpath_resource or --resource option
If I look at
https://github.com/bazelbuild/bazel/blob/master/src/tools/singlejar/output_jar.cc#L933
I see this, which makes it look the resource is skipped if it is already present and warn_duplicate_resources is on:
if (known_members_.count(resource_name)) {
if (options_->warn_duplicate_resources) {
diag_warnx(
"%s:%d: Duplicate resource name %s in the --classpath_resource or "
"--resource option",
__FILE__, __LINE__, resource_name.c_str());
// TODO(asmundak): this mimics old behaviour. Confirm that unless
// we run with --warn_duplicate_resources, the output zip file contains
// the concatenated contents of the all the resources with the same name.
return;
}
}
Later in the same file, I see:
void OutputJar::ExtraCombiner(const std::string &entry_name,
Combiner *combiner) {
extra_combiners_.emplace_back(combiner);
known_members_.emplace(entry_name, EntryInfo{combiner});
}
And in the main file
https://github.com/bazelbuild/bazel/blob/master/src/tools/singlejar/singlejar_main.cc
I see:
output_jar.ExtraCombiner("reference.conf",
new Concatenator("reference.conf"));
Comparing bazel aquery :plain
to bazel aquery :plain_java
reveals the java_library
doesn't pass the warn_duplicate_resources
, and removing it from the rules/common/private/utils.bzl
fixes the test (see second commit in the PR).
from rules_scala.
Very interesting. Good find! I'm surprised that Bazel skips the resource altogether if warn_duplicate_resources
is specified..
I think the solution here is, as you saw, to stop passing that flag. If you'd like to promote your draft PR to a regular PR I will gladly approve it :)
from rules_scala.
Done -- Thanks!
from rules_scala.
Closed by #215
from rules_scala.
Related Issues (20)
- How do I use a different scala version? HOT 7
- scala library doesn't show up in intellij HOT 5
- NoClassDefFoundError HOT 5
- Cannot configure scala_deps_used via --define HOT 9
- "Failed to save cached analysis" error HOT 5
- NoSuchFileException when running scalafmt HOT 3
- deps_used error when used with rules_docker's scala_image HOT 19
- Comparison/Document relationship with bazelbuild/rules_scala HOT 3
- Error when using repl with a compiler plugin configured with global_scalacopts
- scala_format_test vs scala_with_scalafmt.bzl HOT 1
- Compiling Scala 2.13 HOT 7
- Error on build: depset elements must not be mutable values HOT 4
- Add some comments to tests/WORKSPACE HOT 6
- scala_library from generated sources not showing up in intellij HOT 3
- ScalaCheckDeps error with --jobs build option HOT 5
- Cannot build a scala_test rule HOT 2
- Zinc AnalysisCache outputs are not reproducible HOT 2
- error running coverage command
- Travis merge check status not updating on PRs
- Is this project dead? HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rules_scala.