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

openjdk17: init at 17.0.1+12 #140257

Merged
merged 1 commit into from
Oct 21, 2021
Merged

openjdk17: init at 17.0.1+12 #140257

merged 1 commit into from
Oct 21, 2021

Conversation

Uthar
Copy link
Contributor

@Uthar Uthar commented Oct 2, 2021

Motivation for this change

Package OpenJDK 17 LTS #137956

Notify maintainers: @edwtjo @asbachb

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • 21.11 Release Notes (or backporting 21.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

@ofborg ofborg bot added 8.has: clean-up 8.has: package (new) This PR adds a new package labels Oct 2, 2021
@ofborg ofborg bot requested review from asbachb and edwtjo October 2, 2021 09:47
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 101-500 labels Oct 2, 2021

/* default JDK */

jdk = jdk16;
jdk-lts = jdk17;
Copy link
Member

@KamilaBorowska KamilaBorowska Oct 4, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think introducing jdk-lts attribute is a good idea. If an application doesn't use internal APIs and doesn't parse its own bytecode then using jdk will work fine. If that's not the case then updating to newest JDK is going to break stuff. If a user wants an LTS, I think having to specify a version makes sense.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, the existing jdk alias itself seems good enough

@KamilaBorowska
Copy link
Member

Result of nixpkgs-review pr 140257 run on x86_64-linux 1

15 packages marked as broken and skipped:
  • aldor
  • foo-yc20
  • junit
  • junixsocket
  • mindustry
  • mindustry-server
  • mindustry-wayland
  • octave-jit
  • octavePackages.fem-fenics
  • octavePackages.vibes
  • octavePackages.vrml
  • openfire
  • purePackages.faust
  • python38Packages.skein
  • python39Packages.skein
352 packages failed to build:
  • DisnixWebService
  • adobe_flex_sdk (apache-flex-sdk)
  • agi
  • alchemy
  • alda
  • amidst
  • ammonite (ammonite-repl)
  • ammonite_2_12
  • android-backup-extractor
  • apache-directory-studio
  • apache-jena
  • fuseki (apache-jena-fuseki ,joseki)
  • apksigcopier
  • apksigner
  • apktool
  • archi
  • arduino
  • arduino-core (arduino_core)
  • asciidoc-full-with-plugins
  • asciidoctorj
  • aspectj
  • astrolabe-generator
  • atlassian-cli
  • avro-tools
  • aws_mturk_clt
  • awstats
  • axis2
  • basex
  • bfg-repo-cleaner
  • bftools
  • bitwig-studio1
  • bitwig-studio2
  • bloop
  • bonnmotion
  • boot
  • briss
  • ccemux
  • cfr
  • checkstyle
  • clooj
  • closurecompiler
  • confluent-platform
  • coursier
  • crowdin-cli
  • cryptomator
  • davmail
  • dbqn
  • dcs
  • dex2jar
  • diffoscope
  • ditaa
  • domination
  • ec2_api_tools
  • eddy
  • emem
  • emscripten
  • emscriptenPackages.json_c
  • emscriptenPackages.libxml2
  • emscriptenPackages.xmlmirror
  • emscriptenPackages.zlib
  • epubcheck
  • ergo
  • exhibitor
  • fabric-installer
  • faust
  • faust2alqt
  • faust2alsa
  • faust2csound
  • faust2firefox
  • faust2jack
  • faust2jackrust
  • faust2jaqt
  • faust2ladspa
  • faust2lv2
  • faustPhysicalModeling
  • faustStk
  • faustlive
  • fdroidserver
  • flexibee
  • flink
  • flyway
  • frostwire
  • frostwire-bin
  • gama
  • ganttproject-bin
  • geogebra
  • geoipjava
  • gephi
  • global-platform-pro
  • gogui
  • google-java-format
  • gpsprune
  • groove
  • groovy
  • h2
  • haxePackages.hxjava
  • hdfview
  • hsqldb
  • html5validator
  • hydraAntLogger
  • imagej
  • ino
  • ipscan
  • jadx
  • jameica
  • java-language-server
  • jbake
  • jbang
  • jd-gui
  • jdiskreport
  • jdk
  • jdk17_headless
  • jedit
  • jenkins
  • jflex
  • jibri
  • jicofo
  • jing (trang)
  • jitsi-videobridge
  • jmeter
  • jmusicbot
  • jnetmap
  • josm
  • jre_minimal
  • jruby
  • jsvc
  • jugglinglab
  • jython
  • kapitonov-plugins-pack
  • key
  • keycloak
  • kotlin
  • ktlint
  • languagetool
  • leiningen
  • leo3-bin
  • libreoffice (libreoffice-still)
  • libreoffice-fresh
  • libreoffice-fresh-unwrapped
  • libreoffice-qt
  • libreoffice-still-unwrapped
  • librsb
  • liquibase
  • logisim
  • logisim-evolution
  • lombok
  • lumo
  • ma1sd
  • macse
  • magnetophonDSP.CharacterCompressor
  • magnetophonDSP.CompBus
  • magnetophonDSP.ConstantDetuneChorus
  • magnetophonDSP.LazyLimiter
  • magnetophonDSP.MBdistortion
  • magnetophonDSP.RhythmDelay
  • magnetophonDSP.VoiceOfFaust
  • magnetophonDSP.faustCompressors
  • magnetophonDSP.pluginUtils
  • magnetophonDSP.shelfMultiBand
  • makemkv
  • mars-mips
  • martyr
  • marvin
  • maven
  • metals
  • micronaut
  • minc_widgets
  • minecraft
  • minecraft-server
  • mkgmap
  • mkgmap-splitter
  • mooSpace
  • msgviewer
  • multimc
  • munin
  • nailgun
  • netlogo
  • octave
  • octaveFull
  • octavePackages.arduino
  • octavePackages.audio
  • octavePackages.bim
  • octavePackages.bsltl
  • octavePackages.cgi
  • octavePackages.communications
  • octavePackages.control
  • octavePackages.data-smoothing
  • octavePackages.database
  • octavePackages.dataframe
  • octavePackages.dicom
  • octavePackages.divand
  • octavePackages.doctest
  • octavePackages.econometrics
  • octavePackages.financial
  • octavePackages.fits
  • octavePackages.fpl
  • octavePackages.fuzzy-logic-toolkit
  • octavePackages.ga
  • octavePackages.general
  • octavePackages.generate_html
  • octavePackages.geometry
  • octavePackages.gsl
  • octavePackages.image
  • octavePackages.image-acquisition
  • octavePackages.instrument-control
  • octavePackages.interval
  • octavePackages.io
  • octavePackages.level-set
  • octavePackages.linear-algebra
  • octavePackages.lssa
  • octavePackages.ltfat
  • octavePackages.mapping
  • octavePackages.matgeom
  • octavePackages.miscellaneous
  • octavePackages.msh
  • octavePackages.mvn
  • octavePackages.nan
  • octavePackages.ncarray
  • octavePackages.netcdf
  • octavePackages.nurbs
  • octavePackages.ocl
  • octavePackages.octclip
  • octavePackages.octproj
  • octavePackages.optics
  • octavePackages.optim
  • octavePackages.optiminterp
  • octavePackages.parallel
  • octavePackages.quaternion
  • octavePackages.queueing
  • octavePackages.signal
  • octavePackages.sockets
  • octavePackages.sparsersb
  • octavePackages.splines
  • octavePackages.statistics
  • octavePackages.stk
  • octavePackages.strings
  • octavePackages.struct
  • octavePackages.symbolic
  • octavePackages.tisean
  • octavePackages.tsa
  • octavePackages.video
  • octavePackages.windows
  • octavePackages.zeromq
  • omegat
  • opa
  • open-ecard
  • openapi-generator-cli
  • openapi-generator-cli-unstable
  • openems
  • opengrok
  • openjump
  • openlp
  • openlpFull
  • optifine
  • papermc
  • perl532Packages.NetZooKeeper
  • perl534Packages.NetZooKeeper
  • picard-tools
  • picolisp
  • plantuml
  • plantuml-server
  • plm
  • polylith
  • polymake
  • portmod
  • prometheus-jmx-httpserver
  • python38Packages.databricks-connect
  • python38Packages.hydra
  • python38Packages.omegaconf
  • python38Packages.python-csxcad
  • python38Packages.python-openems
  • python38Packages.sphinxcontrib-plantuml (python38Packages.sphinxcontrib_plantuml)
  • python39Packages.databricks-connect
  • python39Packages.hydra
  • python39Packages.omegaconf
  • python39Packages.python-csxcad
  • python39Packages.python-openems
  • python39Packages.sphinxcontrib-plantuml (python39Packages.sphinxcontrib_plantuml)
  • quantomatic
  • rascal
  • riemann
  • runelite
  • saxon
  • saxon-he
  • saxonb
  • saxonb_9_1
  • sbt
  • sbt-extras
  • sbt-with-scala-native
  • scalafmt
  • scenic-view
  • schemaspy
  • selendroid
  • selenium-server-standalone
  • seyren
  • shattered-pixel-dungeon
  • signald
  • sleuthkit
  • smc
  • snapdragon-profiler
  • snpeff
  • solr (solr_8)
  • sonar-scanner-cli
  • sourcetrail
  • spring
  • spring-boot (spring-boot-cli)
  • springLobby
  • squirrel-sql
  • sshoogr
  • storm
  • subgit
  • subsonic
  • sumo
  • swagger-codegen
  • swagger-codegen3
  • swingsane
  • swt
  • tabula
  • tabula-java
  • tambura
  • teensyduino
  • tessera
  • timedoctor
  • tomcat-native
  • tomcat_connectors
  • tr-patcher
  • turbovnc
  • tvbrowser-bin
  • umlet
  • unciv
  • unoconv
  • varscan
  • vassal
  • vimPlugins.lens-vim
  • vimPlugins.vim-grammarous
  • visualvm
  • vscode-extensions.redhat.java
  • vue
  • vuze
  • weka
  • welkin
  • workcraft
  • xmind
  • xmloscopy
  • yed
  • yuicompressor
  • zap
  • zgrviewer
  • zipkin
  • zkfuse
  • zookeeper_mt
  • zxing

@Uthar
Copy link
Contributor Author

Uthar commented Oct 4, 2021

Result of nixpkgs-review pr 140257 run on x86_64-linux 1

15 packages marked as broken and skipped:
352 packages failed to build:

Patch went bad, pushed a fix

@pschyska
Copy link
Contributor

@Uthar Thanks for working on this! Just wanted to chime in and say that I pulled in this PR in my workstation config, and so far everything works fine with jdk17 as far as I can tell (IDEA, my gradle builds, etc.).

Cheers

@erasmas
Copy link

erasmas commented Oct 12, 2021

Looking forward for this package to get merged. 🤞🏼

Copy link
Member

@VergeDX VergeDX left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@erasmas
Copy link

erasmas commented Oct 18, 2021

Is anything blocking this PR from getting merged? 👀

mkdir -p $out/share
ln -s $out/lib/openjdk/include $out/include
ln -s $out/lib/openjdk/man $out/share/man
ln -s $out/lib/openjdk/lib/src.zip $out/lib/src.zip
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this required? Seems really random.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IDEs use the provided src.zip to navigate the java codebase.
#95081

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this really need to be /lib/src.zip? This will cause problems when you use multiple versions of openjdk.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also this should have a comment with that information.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to this, the src.zip file should be at $JAVA_HOME/lib/src.zip. I guess previous nix maintainers mirror the /include and /lib/src.zip in top level so that they can set $JAVA_HOME to $PROFILE/ or /nix/store/xxxx...xxxx-openjdk-xx/ rather than $PROFILE/lib/openjdk/ or /nix/store/xxxx....xxxx-openjdk-xx/lib/openjdk/. This is only a guess.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess the /lib/src.zip symlink can be removed if people set their JAVA_HOME to /nix/store/xxxx....xxxx-openjdk-xx/lib/openjdk correctly.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you don't set JAVA_HOME, java determines it correctly already:

$ java -XshowSettings:properties -version 2>&1 > /dev/null | grep 'java.home'
    java.home = /nix/store/krhlgdsmmcxqf4szq6z1m1wl2fsarx48-openjdk-17+35/lib/openjdk

I'm already using a version of this PR, and my IDE (idea-ultimate) correctly detected the new jdk installation. I never set JAVA_HOME because it shouldn't be set IMHO ;-)
That said, the src.zip symlink was there for e.g. jdk11:

dr-xr-xr-x  - root  1 Jan  1970 openjdk
lrwxrwxrwx 19 root  1 Jan  1970 src.zip -> openjdk/lib/src.zip
/nix/store/lvmz1yy4v20f0c7rg55bhfxwiaqfi2rj-openjdk-11.0.12+7/

To not break workflows that relied on that, I'd keep it like that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would just leave it as it is, because a change here would break some people's setup, and it would IMO be more of an issue than a potential clash with multiple jdks in profile. There doesn't seem to be any bug in the issue tracker related to this, so I would simply not touch it until it becomes a real problem for somebody.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There doesn't seem to be any bug in the issue tracker related to this

That is a really bad metric. There are enough issues in NixOS which do not have an issue and there are people like me which never create issues for problems and just fix the issue.

it would IMO be more of an issue than a potential clash with multiple jdks in profile.

That would still be an issue if it would be under /lib/openjdk. It would need to be moved to a versioned directory which is also not great. For now I would just merge this PR until we have a better way to fix this.

@Uthar Uthar requested a review from SuperSandro2000 October 18, 2021 21:39
@Uthar
Copy link
Contributor Author

Uthar commented Oct 19, 2021

Reverted those two because the build broke

@pmeiyu
Copy link
Member

pmeiyu commented Oct 20, 2021

@Uthar The git history is full of useless commits. We don't need 15 commits for this patch. Please merge this pull request into one or two commits using git rebase. That will make git log easier to read.

@pmeiyu
Copy link
Member

pmeiyu commented Oct 20, 2021

@Uthar After that, you can do a force push to your own branch.

By the way, I like your work. Thank you for this PR.

@Uthar
Copy link
Contributor Author

Uthar commented Oct 20, 2021

I agree, it's a lot of commits - squashed and force pushed now
Thanks, it feels good to contribute !

mkdir -p $out/share
ln -s $out/lib/openjdk/include $out/include
ln -s $out/lib/openjdk/man $out/share/man
ln -s $out/lib/openjdk/lib/src.zip $out/lib/src.zip
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The $out/lib/src.zip symlink is indeed weird. The reason why this symlink is created here should be put in a comment above this line. Otherwise future maintainers will be confused.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea - added in bcf9864

@VergeDX
Copy link
Member

VergeDX commented Oct 20, 2021

Always remember do git commit --amend & git push -f : )
GitHub will still track your history : )

@asbachb
Copy link
Contributor

asbachb commented Oct 20, 2021

Just FYI there's a new release of java 17.0.1: https://github.com/openjdk/jdk17u/tags

@pmeiyu
Copy link
Member

pmeiyu commented Oct 21, 2021

Just FYI there's a new release of java 17.0.1: https://github.com/openjdk/jdk17u/tags

Yes. We should use the jdk-17.0.1-ga tag. jdk-17+35 seems too old.

@Uthar Uthar changed the title openjdk17: init at 17+35 openjdk17: init at 17.0.1+12 Oct 21, 2021
@Uthar
Copy link
Contributor Author

Uthar commented Oct 21, 2021

Bumped it to the latest tag

@gvolpe
Copy link
Member

gvolpe commented Oct 21, 2021

Exciting work, can't wait for this to be merged! I'm already using it in a private repo and seems to work fine, thanks a lot for putting up the effort @Uthar 🤩

@SuperSandro2000 SuperSandro2000 merged commit eb7efbb into NixOS:master Oct 21, 2021
@Uthar
Copy link
Contributor Author

Uthar commented Oct 21, 2021

Thanks everyone for help with this package :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.has: clean-up 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 101-500
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants