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

edit -> compile -> test cycle is unexpectedly long if project includes native target #7141

Open
coreyoconnor opened this issue Jan 20, 2025 · 0 comments
Assignees
Labels
improvement Not a bug or a feature, but something general we can improve

Comments

@coreyoconnor
Copy link
Contributor

Describe the bug

The project https://gitlab.com/coreyoconnor/wes

(specifically at https://gitlab.com/coreyoconnor/wes/-/commit/7d05ce58dceb85f52942039292bb13d0e7d68ce6 )

is a JVM and native project.

During the edit / compile / test dev cycle:

  1. start tests as ~ testQuick - in other words: Run tests on change to source code.
  2. change is made to shared source
  3. tests run after a ~20s. SBT shell indicates it is waiting on build server (bloop) tasks

Turning off the native target (commenting out) reduces the delay to the usual, very fast, speed.

Observing the compilation output indicates the time is being spent compiling and linking a native executable. However, for development the tests typically run in JVM mode. Running tests under native is an on-request activity via sbt. As a developer, I would not expect to wait for building a native executable that is never used during the normal edit/compile/test cycle.

link to conversation in discord with notes by Anton:

metals log:

2025.01.20 09:54:42 INFO  compiling 1 Scala source to /home/coconnor/Development/wes/lib/native/target/scala-3.6.2/test-classes ...                                                                                                                  
2025.01.20 09:54:44 INFO  time: compiled libNative-test in 2.06s                                                          
2025.01.20 09:54:46 INFO  Linking (multithreadingEnabled=true, disable if not used) (1437 ms)                                                                                                                                                        
2025.01.20 09:54:46 INFO  Discovered 1651 classes and 10029 methods after classloading                                                                                                                                                               
2025.01.20 09:54:46 INFO  Checking intermediate code (quick) (61 ms)                                                                                                                                                                                 
2025.01.20 09:54:48 INFO  Discovered 1360 classes and 5116 methods after optimization                                     
2025.01.20 09:54:48 INFO  Optimizing (release-fast mode) (2069 ms)                                                                                                                                                                                   
2025.01.20 09:54:48 INFO  Did not embed: /LICENSE.txt - Matched by 'glob:**', but excluded by 'glob:/LICENSE.txt'         
2025.01.20 09:54:48 INFO  Did not embed: /semanticdb.proto - Matched by 'glob:**', but excluded by 'glob:**/*.proto'      
2025.01.20 09:54:48 INFO  Did not embed: /BUILD - Matched by 'glob:**', but excluded by 'glob:/BUILD'                     
2025.01.20 09:54:48 INFO  Did not embed: /com/sourcegraph/shaded/google/protobuf/wrappers.proto - Matched by 'glob:**', but excluded by 'glob:**/*.proto'                                                                                            
2025.01.20 09:54:48 INFO  Did not embed: /com/sourcegraph/shaded/google/protobuf/type.proto - Matched by 'glob:**', but excluded by 'glob:**/*.proto'                                                                                                
2025.01.20 09:54:48 INFO  Did not embed: /com/sourcegraph/shaded/google/protobuf/timestamp.proto - Matched by 'glob:**', but excluded by 'glob:**/*.proto'                                                                                           
2025.01.20 09:54:48 INFO  Did not embed: /com/sourcegraph/shaded/google/protobuf/struct.proto - Matched by 'glob:**', but excluded by 'glob:**/*.proto'                                                                                              
2025.01.20 09:54:48 INFO  Did not embed: /com/sourcegraph/shaded/google/protobuf/source_context.proto - Matched by 'glob:**', but excluded by 'glob:**/*.proto'                                                                                      
2025.01.20 09:54:48 INFO  Did not embed: /com/sourcegraph/shaded/google/protobuf/field_mask.proto - Matched by 'glob:**', but excluded by 'glob:**/*.proto'                                                                                          
2025.01.20 09:54:48 INFO  Did not embed: /com/sourcegraph/shaded/google/protobuf/empty.proto - Matched by 'glob:**', but excluded by 'glob:**/*.proto'                                                                                               
2025.01.20 09:54:48 INFO  Did not embed: /com/sourcegraph/shaded/google/protobuf/duration.proto - Matched by 'glob:**', but excluded by 'glob:**/*.proto'                                                                                            
2025.01.20 09:54:48 INFO  Did not embed: /com/sourcegraph/shaded/google/protobuf/descriptor.proto - Matched by 'glob:**', but excluded by 'glob:**/*.proto'                                                                                          
2025.01.20 09:54:48 INFO  Did not embed: /com/sourcegraph/shaded/google/protobuf/api.proto - Matched by 'glob:**', but excluded by 'glob:**/*.proto'                                                                                                 
2025.01.20 09:54:48 INFO  Did not embed: /com/sourcegraph/shaded/google/protobuf/any.proto - Matched by 'glob:**', but excluded by 'glob:**/*.proto'                                                                                                 
2025.01.20 09:54:48 INFO  Did not embed: /com/sourcegraph/shaded/google/protobuf/compiler/plugin.proto - Matched by 'glob:**', but excluded by 'glob:**/*.proto'                                                                                     
2025.01.20 09:54:48 INFO  Did not embed: /LICENSE.txt - Matched by 'glob:**', but excluded by 'glob:/LICENSE.txt'                                                                                                                                    
2025.01.20 09:54:48 INFO  Did not embed: /LICENSE.txt - Matched by 'glob:**', but excluded by 'glob:/LICENSE.txt'                                                                                                                                    
2025.01.20 09:54:48 INFO  Did not embed: /LICENSE.txt - Matched by 'glob:**', but excluded by 'glob:/LICENSE.txt'                                                                                                                                    
2025.01.20 09:54:48 INFO  Embedded resource: /junit/runner/logo.gif                                                                                                                                                                                  
2025.01.20 09:54:48 INFO  Embedded resource: /junit/runner/smalllogo.gif                                                                                                                                                                             
2025.01.20 09:54:48 INFO  Embedded resource: /LICENSE-junit.txt                                                                                                                                                                                      
2025.01.20 09:54:48 INFO  Embedded resource: /library.properties                                                                                                                                                                                     
2025.01.20 09:54:48 INFO  Embedded resource: /Composite_wiki.pal                                                                                                                                                                                     
2025.01.20 09:54:51 INFO  Produced 79 LLVM IR files                                                                                                                                                                                                  
2025.01.20 09:54:51 INFO  Generating intermediate code (2787 ms)                                                                                                                                                                                     
2025.01.20 09:54:51 INFO  Compiling to native code (3085 ms)                                                              
2025.01.20 09:54:51 INFO  Linking with [pthread, dl]                                                                                                                                                                                                 
2025.01.20 09:54:56 INFO  Linking native code (immix gc, thin lto) (4333 ms)                                                                                                                                                                         
2025.01.20 09:54:56 INFO  Postprocessing (0 ms)                                                                                                                                                                                                      
2025.01.20 09:54:56 INFO  Total (11976 ms)                                                                                

Expected behavior

No response

Operating system

Linux

Editor/Extension

Nvim (nvim-metals)

Version of Metals

v1.4.2

Extra context or search terms

No response

@kasiaMarek kasiaMarek self-assigned this Jan 22, 2025
@kasiaMarek kasiaMarek assigned tgodzik and unassigned kasiaMarek Jan 22, 2025
@tgodzik tgodzik added the improvement Not a bug or a feature, but something general we can improve label Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Not a bug or a feature, but something general we can improve
Projects
Status: Triage
Development

No branches or pull requests

3 participants