OyvindLGjesdal commented on issue #4053:
URL: https://github.com/apache/jena/issues/4053#issuecomment-5011047766

   Upgrading to a modern yarn sounds good.
   
   I am working on an attempt following https://yarnpkg.com/migration/guide.  
It looks like migration to a new yarn works, but breaks some of the current 
scripts in package.json ($ has to be escaped for urls , env var expansion has 
to be changed, following the rules in https://yarnpkg.com/configuration/yarnrc?)
   
   I tried to simplify by removing the environment-specific versions, since it 
looks like Yarn 4 is more OS agnostic, but the builds failed for other reasons 
in #4065.
   
   Currently only linux builds ok in the actions.
   
   I started in 
   
https://github.com/apache/jena/compare/main...OyvindLGjesdal:jena:yarn?expand=1,
 but feel free to open a PR @ThomasThelen. I'm not sure if I completely 
understand all the changes suggested by Claude, and by looking at the docs.
   
   I think maybe some of the ENV vars that are updated shouldn't have to be 
(e.g if they are not arguments, but leading env_vars).
   
   The .yarnrc file that was generated during the migration (I think) also 
looks a bit broad, I changed the ageGate, but it should not be wildcard for 
git-repositories, and allow scripts
   
   Summary from Claude so far:
   
   ```
    - Replace the install-node-and-yarn goal with install-node-and-corepack     
                                                                                
                                              
       (bound to generate-resources). Corepack ships with the installed Node    
                                                                                
                                               
       and activates the Yarn version pinned by the "packageManager" field in   
                                                                                
                                               
       package.json ([email protected]), so the yarn.version property is removed.     
                                                                                
                                               
     - Run all build/test steps through the plugin's corepack goal              
                                                                                
                                               
       (corepack yarn ...) instead of the yarn goal.                            
                                                                                
                                               
     - Use "yarn install --immutable" (the Yarn 4 equivalent of                 
                                                                                
                                               
       --frozen-lockfile) so CI fails on lockfile drift.                        
                                                                                
                                               
                                                                                
                                                                                
                                               
     package.json:                                                              
                                                                                
                                               
     - Set packageManager to [email protected] and regenerate yarn.lock in the        
                                                                                
                                               
       Yarn 4 format.                                                           
                                                                                
                                               
     - Rework test:e2e for Yarn 4's built-in portable shell, which is stricter  
                                                                                
                                               
       than the Yarn 1 sh passthrough: use ${VAR:-default} instead of the       
                                                                                
                                               
       unsupported ${VAR:=default}, escape the Fuseki "$/ping" endpoint so it   
                                                                                
                                               
       is not parsed as a variable, and give every port reference a default so  
                                                                                
                                               
       the shell does not error on an unbound variable.                         
                                                                                
                                               
     - Because Yarn 4's portable shell is cross-platform, collapse the          
                                                                                
                                               
       run-script-os / test:e2e:nix / test:e2e:win32 split into a single        
                                                                                
                                               
       test:e2e script and drop the run-script-os dependency and cross-env      
                                                                                
                                               
       usage from it.                                                           
                                                                                
                                               
                                                                                
                                                                                
                                               
     Add a Yarn 4 .yarnrc.yml (node-modules linker) and exclude it from the     
                                                                                
                                               
     RAT license check.                                                         
                                                                                
                                               
                                                                                
                                                                                
                                               
     Co-Authored-By: Claude Opus 4.8 <[email protected]>                   
   ```


-- 
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