jprinet commented on PR #11639:
URL: https://github.com/apache/ozone/pull/11639#issuecomment-6290276302

   Thanks @adoroszlai! The `javah` output declaration LGTM: `javac -h` 
generates those headers from the module's own classes and the native build 
consumes them, so they have to be restored on a cache hit. Nit: the comment 
says "inputs" but they're declared as outputs.
   
   About `CMakeConfigureLog.yaml`: deleting it works (I reproduced the hit), 
but surefire still fingerprints the whole cmake build dir, so any other 
non-reproducible file cmake writes there would bring the miss back. Two inputs 
cover that dir:
   1. the `rocksdb-native-lib` fileSet in the root `pom.xml`
   2. `-Djava.library.path=…/native/rocksdb` in `argLine`, which the extension 
picks up as an input on its own
   
   I tested this in a Linux container: narrowing just one of them still misses, 
and narrowing both gives a hit without the delete:
   
   ```diff
   # pom.xml (rocksdb-native-lib fileSet)
   +                        <includes>
   +                          <include>lib*.*</include>
   +                        </includes>
   # hadoop-hdds/rocks-native/pom.xml
   -  -Djava.library.path=${project.build.directory}/native/rocksdb</argLine>
   +  -Djava.library.path=${project.build.outputDirectory}</argLine>
   ```
   
   (`copy-lib-file` already copies the libs to `target/classes`.) 
`rocksdb-checkpoint-differ` points `java.library.path` at the same dir and 
would need the same change, which I haven't tested.
   
   If you'd rather not change the runtime path, the more complex alternative is 
to 
[override](https://docs.develocity.ai/maven/2.6/maven-extension/#overriding-inputs-and-outputs)
 `argLine` in the cache key and keep the include pattern on the fileSet. I 
haven't tested this:
   
   ```xml
   <plugin>
     <artifactId>maven-surefire-plugin</artifactId>
     <inputs>
       <properties>
         <property>
           <name>argLine</name>
           <value>${maven-surefire-plugin.argLine} 
-Djava.library.path=ignored</value>
         </property>
       </properties>
     </inputs>
   </plugin>
   ```
   
   The catch is that the overridden value has to repeat everything in `argLine` 
that should still affect the cache key.
   
   Note: the native libs are specific to platform and toolchain, so cache hits 
for these tests will only happen between identical environments (e.g. CI↔CI). 
That's expected.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to