google/data-transfer-project

Gradle broken?

vorburger opened this issue · 3 comments

While I raised #1021 I tried to build this project locally, but it failed:

$ ./gradlew version
Starting a Gradle Daemon, 4 busy Daemons could not be reused, use --status for details
The message received from the daemon indicates that the daemon has disappeared.
Build request sent: Build{id=5296f9f9-e1ba-41d5-b312-e2bdc751fdf5, currentDir=/home/vorburger/git/github.com/google/data-transfer-project}
Attempting to read last messages from the daemon log...
Daemon pid: 3345760
  log file: /home/vorburger/.gradle/daemon/4.10.2/daemon-3345760.out.log
----- Last  20 lines from daemon log file - daemon-3345760.out.log -----
16:46:41.104 [DEBUG] [org.gradle.launcher.daemon.bootstrap.DaemonStartupCommunication] Completed writing the daemon greeting. Closing streams...
16:46:41.107 [DEBUG] [org.gradle.launcher.daemon.server.Daemon] stopOnExpiration() called on daemon
16:46:41.108 [DEBUG] [org.gradle.launcher.daemon.server.Daemon] awaitExpiration() called on daemon
16:46:41.109 [DEBUG] [org.gradle.launcher.daemon.server.DaemonStateCoordinator] daemon is running. Sleeping until state changes.
16:46:41.111 [DEBUG] [org.gradle.internal.remote.internal.inet.TcpIncomingConnector] Accepted connection from /0:0:0:0:0:0:0:1:49564 to /0:0:0:0:0:0:0:1:37981.
16:46:41.126 [DEBUG] [org.gradle.launcher.daemon.server.SynchronizedDispatchConnection] thread 17: received class org.gradle.launcher.daemon.protocol.Build
16:46:41.127 [DEBUG] [org.gradle.launcher.daemon.server.DefaultDaemonConnection] thread 17: Received non-IO message from client: Build{id=5296f9f9-e1ba-41d5-b312-e2bdc751fdf5, currentDir=/home/vorburger/git/github.com/google/data-transfer-project}
16:46:41.127 [INFO] [org.gradle.launcher.daemon.server.DefaultIncomingConnectionHandler] Received command: Build{id=5296f9f9-e1ba-41d5-b312-e2bdc751fdf5, currentDir=/home/vorburger/git/github.com/google/data-transfer-project}.
16:46:41.127 [DEBUG] [org.gradle.launcher.daemon.server.DefaultIncomingConnectionHandler] Starting executing command: Build{id=5296f9f9-e1ba-41d5-b312-e2bdc751fdf5, currentDir=/home/vorburger/git/github.com/google/data-transfer-project} with connection: socket connection from /0:0:0:0:0:0:0:1:37981 to /0:0:0:0:0:0:0:1:49564.
16:46:41.129 [ERROR] [org.gradle.launcher.daemon.server.DaemonStateCoordinator] Command execution: started DaemonCommandExecution[command = Build{id=5296f9f9-e1ba-41d5-b312-e2bdc751fdf5, currentDir=/home/vorburger/git/github.com/google/data-transfer-project}, connection = DefaultDaemonConnection: socket connection from /0:0:0:0:0:0:0:1:37981 to /0:0:0:0:0:0:0:1:49564] after 0.0 minutes of idle
16:46:41.129 [INFO] [org.gradle.launcher.daemon.server.DaemonRegistryUpdater] Marking the daemon as busy, address: [11f516db-8d90-4873-b2a6-6de807a3b541 port:37981, addresses:[/0:0:0:0:0:0:0:1%lo, /127.0.0.1]]
16:46:41.129 [DEBUG] [org.gradle.launcher.daemon.registry.PersistentDaemonRegistry] Marking busy by address: [11f516db-8d90-4873-b2a6-6de807a3b541 port:37981, addresses:[/0:0:0:0:0:0:0:1%lo, /127.0.0.1]]
16:46:41.130 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire exclusive lock on daemon addresses registry.
16:46:41.130 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
16:46:41.131 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
16:46:41.131 [DEBUG] [org.gradle.launcher.daemon.server.DaemonStateCoordinator] resetting idle timer
16:46:41.131 [DEBUG] [org.gradle.launcher.daemon.server.DaemonStateCoordinator] daemon is running. Sleeping until state changes.
16:46:41.131 [INFO] [org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy] Daemon is about to start building Build{id=5296f9f9-e1ba-41d5-b312-e2bdc751fdf5, currentDir=/home/vorburger/git/github.com/google/data-transfer-project}. Dispatching build started information...
16:46:41.131 [DEBUG] [org.gradle.launcher.daemon.server.SynchronizedDispatchConnection] thread 19: dispatching class org.gradle.launcher.daemon.protocol.BuildStarted
16:46:41.133 [DEBUG] [org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment] Configuring env variables: {PATH=/home/vorburger/dev/vorburger-dotfiles-bin-etc/bin:/home/vorburger/go/bin:/home/vorburger/.cargo/bin:/home/vorburger/bin:/home/vorburger/.nix-profile/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/home/vorburger/.web3j, INVOCATION_ID=863f0ba926ee4fac996c07490cb2b73a, XAUTHORITY=/run/user/1000/.mutter-Xwaylandauth.7U94B1, HISTCONTROL=ignoredups, XMODIFIERS=@im=ibus, GDMSESSION=gnome, XDG_DATA_DIRS=/home/vorburger/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share/:/usr/share/, NIX_PROFILES=/nix/var/nix/profiles/default /home/vorburger/.nix-profile, GUESTFISH_RESTORE=\e[0m, DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus, XDG_CURRENT_DESKTOP=GNOME, JOURNAL_STREAM=8:36023, MAIL=/var/spool/mail/vorburger, AUTOJUMP_SOURCED=1, ABBR_TIPS_PROMPT=\n💡 \e[1m{{ .abbr }}\e[0m =>{{ .cmd }}, COLORTERM=truecolor, OSTYPE=linux-gnu, USERNAME=vorburger, SESSION_MANAGER=local/unix:@/tmp/.ICE-unix/1911,unix/unix:/tmp/.ICE-unix/1911, LOGNAME=vorburger, MANAGERPID=1710, PWD=/home/vorburger/git/github.com/google/data-transfer-project, GJS_DEBUG_TOPICS=JS ERROR;JS LOG, LESSOPEN=||/usr/bin/lesspipe.sh %s, SHELL=/usr/bin/fish, TERMINFO=/usr/lib64/kitty/terminfo, GIO_LAUNCHED_DESKTOP_FILE=/usr/share/applications/kitty.desktop, STEAM_FRAME_FORCE_CLOSE=1, OLDPWD=/home/vorburger/git/github.com/google/data-transfer-project, GUESTFISH_INIT=\e[1;34m, NIX_SSL_CERT_FILE=/etc/ssl/certs/ca-bundle.crt, SYSTEMD_EXEC_PID=1941, GNOME_SETUP_DISPLAY=:1, XDG_SESSION_DESKTOP=gnome, SHLVL=2, AUTOJUMP_ERROR_PATH=/home/vorburger/.local/share/autojump/errors.log, TMUX_PANE=%59, QT_IM_MODULE=ibus, STARSHIP_SESSION_KEY=5230445558873330, HISTSIZE=1000, TERM=screen-256color, LANG=en_US.UTF-8, MOZ_GMP_PATH=/usr/lib64/mozilla/plugins/gmp-gmpopenh264/system-installed, XDG_SESSION_TYPE=wayland, DISPLAY=:0, WAYLAND_DISPLAY=wayland-0, STARSHIP_SHELL=fish, which_declare=declare -f, XDG_SESSION_CLASS=user, GDM_LANG=en_US.UTF-8, GUESTFISH_PS1=\[\e[1;32m\]><fs>\[\e[0;31m\] , NIX_PATH=/home/vorburger/.nix-defexpr/channels, DESKTOP_SESSION=gnome, USER=vorburger, XDG_MENU_PREFIX=gnome-, GIO_LAUNCHED_DESKTOP_FILE_PID=162035, ABBR_TIPS_REGEXES=(^(\w+\s+)+(-{1,2})\w+)(\s\S+) (^(\s?(\w-?)+){3}).* (^(\s?(\w-?)+){2}).* (^(\s?(\w-?)+){1}).*, GJS_DEBUG_OUTPUT=stderr, SSH_AUTH_SOCK=/home/vorburge
r/.ssh.agent, SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS=0, EDITOR=nano, HOSTNAME=lycanroc, __ABBR_TIPS_VALUES=bazelisk  bat  gcloud cloud-shellssh --ssh-flag=-A nano  /usr/bin/fish_key_reader git add git commit -m  git commit --amend git checkout  git wdiff git ls git lg git ll git push --force vorburger git pull  git push  git status git pull --rebase && git push kubectl  lsd  nix , TMUX=/tmp//tmux-1000/default,162061,0, XDG_RUNTIME_DIR=/run/user/1000, __ABBR_TIPS_KEYS=a__b a__c a__cloud a__e a__fish_key_reader a__ga a__gc a__gca a__gco a__gd a__gl a__glg a__gll a__gpf a__gpl a__gpu a__gst a__gsy a__kc a__l a__n a__, KITTY_WINDOW_ID=1, HOME=/home/vorburger, GUESTFISH_OUTPUT=\e[0m}
----- End of the daemon log -----

$ java -version
openjdk version "11.0.13" 2021-10-19
OpenJDK Runtime Environment 18.9 (build 11.0.13+8)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.13+8, mixed mode, sharing)

Build error: > Task :distributions:api-default:shadowJar FAILED ex groovy.lang.MissingPropertyException: No such property: count for class: com.github.jengelman.gradle.plugins.shadow.transformers.ServiceFileTransformer

The suggested fix is to upgrade our version of the shadow jar from 2.0.2 to 7.0.0. However doing that also requires us to upgrade the gradlew version


* Where:
Build file '/Users/sihamh/Documents/GitHub/data-transfer-project/distributions/api-default/build.gradle' line: 18

* What went wrong:
An exception occurred applying plugin request [id: 'com.github.johnrengelman.shadow', version: '7.0.0']
> Failed to apply plugin [class 'com.github.jengelman.gradle.plugins.shadow.ShadowBasePlugin']
   > This version of Shadow supports Gradle 7.0+ only. Please upgrade.

Upgrading gradlew using this command: ./gradlew wrapper --gradle-version=7.3.2 --distribution-type=bin was successful however build is still broken because in version 7, the maven plugin was deprecated in favor of maven-publish

* Where:
Build file '/Users/sihamh/Documents/GitHub/data-transfer-project/build.gradle' line: 53

* What went wrong:
Plugin [id: 'maven'] was not found in any of the following sources:

- Gradle Core Plugins (not a core plugin, please see https://docs.gradle.org/7.3.2/userguide/standard_plugins.html for available core plugins)
- Plugin Repositories (plugin dependency must include a version number for this source)

We need to rewrite our maven configuration to fix this: https://github.com/google/data-transfer-project/blob/master/build.gradle#L108-L165

Switching to gradle v 6 broke in a different way: ./gradlew wrapper --gradle-version=6.8.3 --distribution-type=bin

> Task :portability-api-launcher:compileJava FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':portability-api-launcher:compileJava'.
> java.lang.IllegalAccessError: class org.gradle.internal.compiler.java.ClassNameCollector (in unnamed module @0x6798c9c1) cannot access class com.sun.tools.javac.code.Symbol$TypeSymbol (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.code to unnamed module @0x6798c9c1

I'll take a look at this later but posting my notes in case anyone else on the team picks this up

We recently migrated to Gradle 6 and shadow 6 in #1114.

@vorburger when you have time, could you please try to reproduce the issue?

FYI: I'm still encountering the issues described in the comment above while running ./gradlew build commands off of forked master.

Is it possible that the Gradle wrapper still needs to be regenerated at master despite the version bumps in #1114?