Add support for compile-time input files in java_binary and java_library
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- java
- Ambito
- build-system
Direzione di ricerca
Parti dalle definizioni delle regole java_binary e java_library e segui il percorso di javacopts e dei file di input fino al compilatore Java. Confronta il comportamento richiesto con additional_linker_inputs e user_link_flags delle regole C++, quindi verifica che i file in fase di compilazione e l’espansione delle posizioni funzionino con il sandboxing di processwrapper.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Description of the feature request:
Introduce a new attribute, tentatively named java_compiler_inputs, that would specifically hold references to compile-time input files. Additionally, provide support for expanding these file paths using $(location) or similar mechanisms, either within the existing javacopts attribute or a potentially new, toolchain-flag-specific attribute.
Example: Code snippet
java_library(
name = "dummy_library",
srcs = ["src/abc.java"],
java_compiler_inputs = ["compile.properties"],
javacopts = [
"-properties",
"$(location //:compile.properties)",
],
)
Which category does this issue belong to?
java rules
What underlying problem are you trying to solve with this feature?
I am working with a custom Java toolchain (specifically, ECJ https://github.com/salesforce/bazel-jdt-java-toolchain) that supports compile-time options like -properties to consume configuration files during compilation. Currently, there is no dedicated way to provide such files to the Java compiler within Bazel's Java rules. Including these files in the srcs attribute works in some sandbox environments but leads to failures with the processwrapper sandbox.
This feature would improve flexibility when using custom Java toolchains and ensure compatibility across different sandboxing strategies within Bazel. It would be valuable to draw parallels with a similar mechanism already present in Bazel's C++ rules for linker inputs (additional_linker_inputs and user_link_flags).
Which operating system are you running Bazel on?
RHEL7
What is the output of bazel info release?
7.0.2
If bazel info release returns development version or (@non-git), tell us how you built Bazel.
No response
What's the output of git remote get-url origin; git rev-parse HEAD ?
No response
Have you found anything relevant by searching the web?
Discussion on providing -properties file, no answers: https://github.com/salesforce/bazel-jdt-java-toolchain/discussions/19
Any other information, logs, or outputs that you want to share?
[Sandbox Error]: with processwrapper sandbox
exec env - \
LC_CTYPE=en_US.UTF-8 \
PATH=/bin:/usr/bin:/usr/local/bin \
/usr/lib/jvm/java-17/bin/java --module-path external/ecj/ecj.jar -jar external/bazel_jdt_java_toolchain/compiler/export/JdtJavaBuilder_deploy.jar @bazel-out/k8-opt/bin/bin-SystemLoggerApi-class.jar-0.params @bazel-out/k8-opt/bin/dummy_library-class.jar-1.params)
# Configuration: b958e1a85833ddcf110c5efdbae2648181c90445ef232e2d460d4a581e0c3ee6
# Execution platform: //:linux_gcc_x86
Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
properties file compile.properties does not exist
- Lingua principale
- Starlark
- Stelle
- 103
- Fork
- 102
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di bazelbuild/rules_java
-
P4
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
bazelbuild/rules_java#360 · 4 commenti · 2 reazioni ·
-
P4
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
bazelbuild/rules_java#354 · 8 commenti ·
-
P3 question
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
bazelbuild/rules_java#339 · 1 commento ·
-
P3
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
bazelbuild/rules_java#325 · 8 commenti ·
-
P4
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
bazelbuild/rules_java#316 · 2 reazioni ·
Tutte le issue di bazelbuild/rules_java
Issue simili
-
status: needs triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
conda-forge/spacy-feedstock#177 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
area:jail bug security severity:low track:open-source
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
micro-ROS/micro_ros_setup#837 ·