vaticle / typedb

TypeDB: the polymorphic database powered by types
https://typedb.com
Mozilla Public License 2.0
3.72k stars 337 forks source link

Configurable java path in startup script #6302

Closed haskie-lambda closed 3 years ago

haskie-lambda commented 3 years ago

Problem to Solve

linked to this discussion i am working on NixOS and there is no package available for Grank/TypeDB. I wrote a package description, but there are a lot of patches in there because the java command might not be in scope directly but in a built derivation of the system somewhere. these patches make the package unstable because string replaces break fast.

Current Workaround

Currently I replace all calls to java in the install script with a qualified path to the java install location.

Proposed Solution

@lolski 's proposed solution was this:

" We could introduce an option JAVA_HOME which allows you to supply path to your chosen version of Java:

JAVA_HOME=/a/b/c ./grakn server

Otherwise, you want don't supply your own path, the default java that exist in your system will be chosen:

./grakn server

"

Additional Information

linked to this pull request on nixpkgs

lolski commented 3 years ago

I think the idea makes sense @haskie-lambda ! Configuring JAVA_HOME is something that's quite common across various software.

Right @haikalpribadi @vmax ?

haskie-lambda commented 3 years ago

@lolski : where is the start script located within the typedb repo? I am unfamiliar with the codebase; when you tell me where it is, I will change it and do a pull request.

vmax commented 3 years ago

@haskie-lambda it's here: https://github.com/vaticle/typedb-common/blob/master/binary/grakn

haskie-lambda commented 3 years ago

@vmax is there any convention regarding the commit messages or the pull requests in that repo?

haikalpribadi commented 3 years ago

Once you open a pull request (just try it, without submitting) you will be provided with template in the input form, @haskie-lambda.

haikalpribadi commented 3 years ago

Note that I'm in the midst of refactoring github.com/vaticle/typedb-common @haskie-lambda - I'll be done in about an hour.

haskie-lambda commented 3 years ago

I'll do the pull anyway and change it later if needed; it is a pretty small change so i guess it should even merge afterwards