[ 
https://issues.apache.org/jira/browse/SPARK-49221?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hyukjin Kwon resolved SPARK-49221.
----------------------------------
    Fix Version/s: 4.0.0
       Resolution: Fixed

Issue resolved by pull request 47739
[https://github.com/apache/spark/pull/47739]

> sbt compilation warning: `Regular tasks always evaluate task dependencies 
> (.value) regardless of if expressions`
> ----------------------------------------------------------------------------------------------------------------
>
>                 Key: SPARK-49221
>                 URL: https://issues.apache.org/jira/browse/SPARK-49221
>             Project: Spark
>          Issue Type: Improvement
>          Components: Build
>    Affects Versions: 4.0.0
>            Reporter: Yang Jie
>            Assignee: Yang Jie
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 4.0.0
>
>
> {code:java}
> [warn] 
> /Users/yangjie01/SourceCode/git/spark-sbt/project/SparkBuild.scala:1554:77: 
> value lookup of `/` inside an `if` expression
> [warn] 
> [warn] problem: `/.value` is inside an `if` expression of a regular task.
> [warn]   Regular tasks always evaluate task dependencies (`.value`) 
> regardless of `if` expressions.
> [warn] solution:
> [warn]   1. Use a conditional task `Def.taskIf(...)` to evaluate it when the 
> `if` predicate is true or false.
> [warn]   2. Or turn the task body into a single `if` expression; the task is 
> then auto-converted to a conditional task. 
> [warn]   3. Or make the static evaluation explicit by declaring `/.value` 
> outside the `if` expression.
> [warn]   4. If you still want to force the static lookup, you may annotate 
> the task lookup with `@sbtUnchecked`, e.g. `(/.value: @sbtUnchecked)`.
> [warn]   5. Add `import sbt.dsl.LinterLevel.Ignore` to your build file to 
> disable all task linting.
> [warn]     
> [warn]         val replClasspathes = (LocalProject("connect-client-jvm") / 
> Compile / dependencyClasspath)
>  {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to