Git Product home page Git Product logo

Comments (15)

JaredNeil avatar JaredNeil commented on June 22, 2024 5

One benefit of a lock file not yet discussed here is that the artifacts are pre-resolved to an artifact URL and shasum. This can save a lot of time every time you would normally need to re-run the coursier resolver (several minutes in our repository). Doing the resolution once and storing that information to a lock file saves us a ton of time in our CI builds.

from rules_jvm_external.

jin avatar jin commented on June 22, 2024 2

I agree. This is something that I'll discuss with @aehlig, who implemented the Bazel-wide lock file for external repositories (--experimental_workspace_resolved_file).

from rules_jvm_external.

jin avatar jin commented on June 22, 2024 2

Work in progress to support artifact checksum pinning in a file read and exported by maven_install: #169

from rules_jvm_external.

jin avatar jin commented on June 22, 2024

I'm probably doing this incorrectly, but the --checksum flag doesn't seem to be doing what I think it should do:

$ sha1sum /usr/local/google/home/jingwen/.cache/coursier/v1/https/repo1.maven.org/maven2/com/google/errorprone/error_prone_annotations/2.2.0/error_prone_annotations-2.2.0.jar
88e3c593e9b3586e1c6177f89267da6fc6986f0c  /usr/local/google/home/jingwen/.cache/coursier/v1/https/repo1.maven.org/maven2/com/google/errorprone/error_prone_annotations/2.2.0/error_prone_annotations-2.2.0.jar

$ cat /usr/local/google/home/jingwen/.cache/coursier/v1/https/repo1.maven.org/maven2/com/google/errorprone/error_prone_annotations/2.2.0/error_prone_annotations-2.2.0.jar.sha1 
88e3c593e9b3586e1c6177f89267da6fc6986f0c

$ coursier fetch com.google.errorprone:error_prone_annotations:2.2.0 --checksum 88e3c593e9b3586e1c6177f89267da6fc6986f0c
mirrorConfFiles=List(MirrorConfFile(/usr/local/google/home/jingwen/.config/coursier/mirror.properties, true))
allMirrors0=List()
Resolution error: Error downloading com.google.errorprone:error_prone_annotations:2.2.0
  not found: /usr/local/google/home/jingwen/.ivy2/local/com.google.errorprone/error_prone_annotations/2.2.0/ivys/ivy.xml
  checksum not found: 

from rules_jvm_external.

jin avatar jin commented on June 22, 2024

Looks like Coursier CLI doesn't support this yet, according to the referenced issue. We may have to do the checksum verification out of band, after downloading the jars and possibly while generating the BUILD targets.

from rules_jvm_external.

arjantop avatar arjantop commented on June 22, 2024

Would this issue also cover "locking" versions of all transitive dependencies? (Like Cargo.lock etc.)

from rules_jvm_external.

jin avatar jin commented on June 22, 2024

@arjantop That's #107

from rules_jvm_external.

JaredNeil avatar JaredNeil commented on June 22, 2024

@jin #107, does not seem to be about generating or using a .lock file.

from rules_jvm_external.

jin avatar jin commented on June 22, 2024

My understanding is that locking and pinning are similar to each other. #107 talks about locking top level artifacts to specific versions, but doesn't cover transitive dependencies. Let's continue discussions there?

from rules_jvm_external.

arjantop avatar arjantop commented on June 22, 2024

@jin If I understand #107 it is about overriding/pinning specific transitive dependencies to some version, .lock file would be generated automatically, pinning all versions to the resolved ones

from rules_jvm_external.

jin avatar jin commented on June 22, 2024

Yes, and I imagine lock file generation will involve Bazel WORKSPACE resolve files to a large extent.

from rules_jvm_external.

mandrean avatar mandrean commented on June 22, 2024

@jin Maybe this issue should be renamed "Support artifact checksum pinning" or something to differentiate it from #134 which is more actually verification IMHO

from rules_jvm_external.

borkaehw avatar borkaehw commented on June 22, 2024

@jin any thought on the benefit of a lock file that @JaredNeil mentioned?

from rules_jvm_external.

borkaehw avatar borkaehw commented on June 22, 2024

@jin just a follow-up. Any update on the lock file?

from rules_jvm_external.

jin avatar jin commented on June 22, 2024

Sorry, no updates on this yet.

from rules_jvm_external.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.