GithubHelp home page GithubHelp logo

sdkman-disco-integration's Introduction

SDKMAN! Golang CLI

Build Status

This project has been downgraded to a mere spike, the learnings of which will lead to the next phase of exploration of the CLI. We are also looking at Rust as an alternative implementation solution.

The current bash implementation is still completely fit for purpose and remains in full production use.

Living Documentation

SDKMAN's development is always driven by tests. More than that, we use Cucumber to describe the behaviour of the CLI in plain English. We do so using Cucumber features, all of which can be found under the features/ folder of this repo. These Features form a body of Living Documentation that evolves with the software implementation.

The Cucumber Features are backed by Step Definitions, snippets of matched code that are invoked in order as the Cucumber Feature are

Development

Prerequisites

Ensure that Go is installed on your system.

Optionally, install Godog for running the Cucumber specifications directly:

$ go get github.com/DATA-DOG/godog/cmd/godog

Running the tests

To run all tests using Go's builtin test support (unit and cukes):

$ cd path/to/the/repo/sdk
$ go test --godog.format=pretty

If Godog was installed earlier, run the Cucumber specs directly in isolation with the following command:

$ godog

Run

To kick the tyres before building:

$ go run sdk.go version

Build

To build and run the binary executable:

$ go build
$ ./sdk

sdkman-disco-integration's People

Contributors

eddumelendez avatar johnshajiang avatar msatina avatar zakkak avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

sdkman-disco-integration's Issues

Adapt to GraalVM changes by adding new distributions?

Hiya!

The discoapi just added new graal distributions to adapt to the fact that:

  1. in addition to the community edition, there is now an Oracle GraalVM release (also free but under a different license)
  2. versioning now matches JDK versioning scheme for both distributions

So the discoapi now has new distros:

And preserves existing legacy graalvm_ce* distributions. Example: https://api.foojay.io/disco/v3.0/packages?distro=graalvm_ce19

For some details see: foojayio/discoapi#75

Bug: [Installing azul jdk for aarch64 result in x86 binaries]

Bug report
Installing zulu distro of java on Mac with aarch64 architecture result in x86 installation.

To reproduce
Install java 17.0.6-zulu, 11.0.18-zulu and 8.0.362-zulu

$ sdk install java 17.0.6-zulu
$ sdk install java 11.0.18-zulu
$ sdk install java 8.0.362-zulu

Check installation

$ sdk list java
================================================================================
Available Java Versions for macOS ARM 64bit
================================================================================
 Vendor        | Use | Version      | Dist    | Status     | Identifier
--------------------------------------------------------------------------------
... skipping rows for brevity ...
 Zulu          |     | 20           | zulu    |            | 20-zulu             
               |     | 20.fx        | zulu    |            | 20.fx-zulu          
               |     | 20.0.1       | zulu    |            | 20.0.1-zulu         
               |     | 20.0.1.fx    | zulu    |            | 20.0.1.fx-zulu      
               |     | 19.0.2       | zulu    |            | 19.0.2-zulu         
               |     | 19.0.2.fx    | zulu    |            | 19.0.2.fx-zulu      
               |     | 19.0.1       | zulu    |            | 19.0.1-zulu         
               |     | 19.0.1.fx    | zulu    |            | 19.0.1.fx-zulu      
               |     | 17.0.7       | zulu    |            | 17.0.7-zulu         
               | >>> | 17.0.6       | zulu    | installed  | 17.0.6-zulu         
               |     | 17.0.6.fx    | zulu    |            | 17.0.6.fx-zulu      
               |     | 17.0.5       | zulu    |            | 17.0.5-zulu         
               |     | 17.0.5.fx    | zulu    |            | 17.0.5.fx-zulu      
               |     | 11.0.19      | zulu    |            | 11.0.19-zulu        
               |     | 11.0.18      | zulu    | installed  | 11.0.18-zulu        
               |     | 11.0.18.fx   | zulu    |            | 11.0.18.fx-zulu     
               |     | 11.0.17      | zulu    |            | 11.0.17-zulu        
               |     | 11.0.17.fx   | zulu    |            | 11.0.17.fx-zulu     
               |     | 8.0.362      | zulu    | installed  | 8.0.362-zulu        
               |     | 8.0.362.fx   | zulu    |            | 8.0.362.fx-zulu     
               |     | 8.0.352      | zulu    |            | 8.0.352-zulu        
               |     | 8.0.352.fx   | zulu    |            | 8.0.352.fx-zulu 

Check the java executable and see that all of them are for x86.

$ pwd
/Users/home/.sdkman/candidates/java/17.0.6-zulu/bin
$ file java
java: Mach-O 64-bit executable x86_64
$ pwd
/Users/antonpersson/.sdkman/candidates/java/11.0.18-zulu
$ file bin/java
bin/java: Mach-O 64-bit executable x86_64
$ pwd
/Users/antonpersson/.sdkman/candidates/java/8.0.362-zulu
$ file bin/java
bin/java: Mach-O 64-bit executable x86_64

System info
OS

$ uname -a
Darwin xxx-MacBook-Pro.local 21.6.0 Darwin Kernel Version 21.6.0: Mon Dec 19 20:43:09 PST 2022; root:xnu-8020.240.18~2/RELEASE_ARM64_T6000 arm64

Shell

$ zsh --version
zsh 5.5.1 (x86_64-apple-darwin16.7.0)

Sdkman

$ sdk version

SDKMAN!
script: 5.18.1
native: 0.1.3

Amazon Corretto 20.0.1 missing

It's been almost a week and the new Amazon Corretto 20.0.1 release is still not present.

$ sdk ls java
================================================================================
Available Java Versions for macOS ARM 64bit
================================================================================
 Vendor        | Use | Version      | Dist    | Status     | Identifier
--------------------------------------------------------------------------------
 Corretto      |     | 20           | amzn    | installed  | 20-amzn             
               |     | 19.0.2       | amzn    |            | 19.0.2-amzn         
               |     | 19.0.1       | amzn    |            | 19.0.1-amzn         
               | >>> | 17.0.7       | amzn    | installed  | 17.0.7-amzn         
               |     | 17.0.6       | amzn    |            | 17.0.6-amzn         
               |     | 17.0.5       | amzn    |            | 17.0.5-amzn         
               |     | 11.0.19      | amzn    | installed  | 11.0.19-amzn        
               |     | 11.0.18      | amzn    |            | 11.0.18-amzn        
               |     | 11.0.17      | amzn    |            | 11.0.17-amzn        
               |     | 8.0.372      | amzn    | installed  | 8.0.372-amzn        
               |     | 8.0.362      | amzn    |            | 8.0.362-amzn        
               |     | 8.0.352      | amzn    |            | 8.0.352-amzn        
...

When will it be made available via SDKMAN?

Wrong java sdk for current architecture gets installed

I have an Apple M1 Macbook Pro.

My terminal is executed without rosetta.

I have disabled rosetta compatible sdk's
$> sdk config | grep rosetta
sdkman_rosetta2_compatible=false

I have installed amazon two different versions

sdk install java 17.0.5-amzn
$> jshell
jshell> System.getProperty("os.arch")
$1 ==> "aarch64"

sdk install java 20.0.1-amzn
$> jshell
jshell> System.getProperty("os.arch")
$1 ==> "x86_64"

I expect that the architecture is aarch64 instead of x86_64.

I have doubled check my configuration and deinstalled sdkman. This problem is reproducible

GraalVM CE 22.2.0 picked up?

Thanks for all this cool automation!

Curious, Is Oracle GraalVM CE being automatically picked up?

I see something called "Gluon GraalVM" in the README but not Oracle GraalVM.

Bug: Error in format of downloading and installing Liberica NIK Java SDK zip package

Bug report

Using the command sdk install java 22.3.r11-nik to install Java SDK, the failure prompt is shown at the end:

Download has failed, aborting!

Can not install java 22.3.r11-nik at this time...

To reproduce

  1. Execute the command sdk install java 22.3.r11-nik;

System info

macOS Monterey 12.6.3 (21G419)

zsh 5.9 (x86_64-apple-darwin21.3.0)

SDKMAN!
script: 5.18.1
native: 0.2.2

Debug mode log information
From the final log information, it appears that the /Users/richard/.sdkman/tmp/hook_post_java_22.3.r11-nik.sh script verifies the format of the downloaded package and terminates execution if the format of the downloaded package does not match.

verification code:

function __sdkman_validate_binary_input {
    if ! tar tzf "$1" &> /dev/null; then
        echo "Download has failed, aborting!"
        echo ""
        echo "Can not install java 22.3.r11-nik at this time..."
        return 1
    fi
}

debug info:

Validate java 22.3.r11-nik for darwinx64: valid
Validation URL: https://api.sdkman.io/2/candidates/validate/java/22.3.r11-nik/darwinx64
Get pre-installation hook: https://api.sdkman.io/2/hooks/pre/java/22.3.r11-nik/darwinx64
Copy remote pre-installation hook: /Users/richard/.sdkman/tmp/hook_pre_java_22.3.r11-nik.sh
No macOS 64bit pre-install hook found for Java 22.3.r11-nik.
Completed pre-installation hook...

Downloading: java 22.3.r11-nik

In progress...

#################################################################################################################################################################################################################### 100.0%*   Trying 45.55.42.78:443...
* Connected to api.sdkman.io (45.55.42.78) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*  CAfile: /etc/ssl/cert.pem
*  CApath: none
* (304) (OUT), TLS handshake, Client hello (1):
} [318 bytes data]
* (304) (IN), TLS handshake, Server hello (2):
{ [122 bytes data]
* (304) (IN), TLS handshake, Unknown (8):
{ [25 bytes data]
* (304) (IN), TLS handshake, Certificate (11):
{ [4578 bytes data]
* (304) (IN), TLS handshake, CERT verify (15):
{ [264 bytes data]
* (304) (IN), TLS handshake, Finished (20):
{ [52 bytes data]
* (304) (OUT), TLS handshake, Finished (20):
} [52 bytes data]
* SSL connection using TLSv1.3 / AEAD-AES256-GCM-SHA384
* ALPN, server accepted to use http/1.1
* Server certificate:
*  subject: CN=*.sdkman.io
*  start date: Apr 10 00:00:00 2022 GMT
*  expire date: Apr 28 23:59:59 2023 GMT
*  subjectAltName: host "api.sdkman.io" matched cert's "*.sdkman.io"
*  issuer: C=GB; ST=Greater Manchester; L=Salford; O=Sectigo Limited; CN=Sectigo RSA Domain Validation Secure Server CA
*  SSL certificate verify ok.
> GET /2/broker/download/java/22.3.r11-nik/darwinx64 HTTP/1.1
> Host: api.sdkman.io
> Range: bytes=282468529-
> User-Agent: curl/7.79.1
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 302 Found
< Server: nginx/1.19.10
< Date: Fri, 07 Apr 2023 01:58:38 GMT
< Content-Length: 0
< Connection: keep-alive
< X-Sdkman-ArchiveType: zip
< location: https://download.bell-sw.com/vm/22.3.0/bellsoft-liberica-vm-openjdk11.0.17+7-22.3.0+2-macos-amd64.zip
<
* Connection #0 to host api.sdkman.io left intact
* Issue another request to this URL: 'https://download.bell-sw.com/vm/22.3.0/bellsoft-liberica-vm-openjdk11.0.17+7-22.3.0+2-macos-amd64.zip'
*   Trying 2606:4700::6812:b3:443...
*   Trying 104.18.0.179:443...
* Connected to download.bell-sw.com (2606:4700::6812:b3) port 443 (#1)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*  CAfile: /etc/ssl/cert.pem
*  CApath: none
* (304) (OUT), TLS handshake, Client hello (1):
} [325 bytes data]
* (304) (IN), TLS handshake, Server hello (2):
{ [122 bytes data]
* (304) (IN), TLS handshake, Unknown (8):
{ [19 bytes data]
* (304) (IN), TLS handshake, Certificate (11):
{ [4675 bytes data]
* (304) (IN), TLS handshake, CERT verify (15):
{ [264 bytes data]
* (304) (IN), TLS handshake, Finished (20):
{ [52 bytes data]
* (304) (OUT), TLS handshake, Finished (20):
} [52 bytes data]
* SSL connection using TLSv1.3 / AEAD-AES256-GCM-SHA384
* ALPN, server accepted to use h2
* Server certificate:
*  subject: CN=*.bell-sw.com
*  start date: Nov  3 00:00:00 2022 GMT
*  expire date: Dec  4 23:59:59 2023 GMT
*  subjectAltName: host "download.bell-sw.com" matched cert's "*.bell-sw.com"
*  issuer: C=GB; ST=Greater Manchester; L=Salford; O=Sectigo Limited; CN=Sectigo RSA Domain Validation Secure Server CA
*  SSL certificate verify ok.
* Using HTTP2, server supports multiplexing
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Using Stream ID: 1 (easy handle 0x7fe772812000)
> GET /vm/22.3.0/bellsoft-liberica-vm-openjdk11.0.17+7-22.3.0+2-macos-amd64.zip HTTP/2
> Host: download.bell-sw.com
> range: bytes=282468529-
> user-agent: curl/7.79.1
> accept: */*
>
* Connection state changed (MAX_CONCURRENT_STREAMS == 256)!
< HTTP/2 416
< date: Fri, 07 Apr 2023 01:58:39 GMT
< content-type: text/html
< x-content-type-options: nosniff
< content-security-policy: sandbox allow-forms allow-modals allow-popups allow-presentation allow-scripts allow-top-navigation
< x-xss-protection: 1; mode=block
< content-disposition: inline
< cache-control: public, max-age=2592000
< expires: Sun, 07 May 2023 01:58:39 GMT
< content-range: bytes */282468529
< cf-cache-status: HIT
< server: cloudflare
< cf-ray: 7b3eaab1ed569872-SJC
<
{ [596 bytes data]
#################################################################################################################################################################################################################### 100.0%* Connection sdkman/sdkman-cli#1 to host download.bell-sw.com left intact

Downloaded binary to: /Users/richard/.sdkman/tmp/java-22.3.r11-nik.bin (HTTP headers written to: /Users/richard/.sdkman/var/metadata/java-22.3.r11-nik.headers)
Get post-installation hook: https://api.sdkman.io/2/hooks/post/java/22.3.r11-nik/darwinx64
Copy remote post-installation hook: /Users/richard/.sdkman/tmp/hook_post_java_22.3.r11-nik.sh
A macOS 64bit post-install hook was found for Java 22.3.r11-nik-openjdk.
Download has failed, aborting!

Can not install java 22.3.r11-nik at this time...

Missing SapMachine & Zulu Java releases

The following Java releases appear to be missing even though they have been out for awhile:

  1. SapMachine 17.0.3.0.1
  2. SapMachine 11.0.15.0.1
  3. Zulu 18.0.1

When will these be made available for installation by SDKMAN?

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.