From 04cf25068a824b5748dc955db866174f20d1755339d079472aadd3407985a1d5 Mon Sep 17 00:00:00 2001 From: Anton Shvetz Date: Wed, 25 Sep 2024 21:47:49 +0000 Subject: [PATCH] - Update to v1.15.2 * Changes of v1.15.2 + Add support for multi-release JAR files in ClassFileLocators and Plugin.Engine.Default. + Add Gradle task for transforming multiple jar files with ByteBuddyJarsTask. + Avoid validation of JarFile when extracting individual entries. + Rework discovery in ByteBuddyMojo. OBS-URL: https://build.opensuse.org/package/show/Java:packages/byte-buddy?expand=0&rev=30 --- .gitattributes | 23 ++++ .gitignore | 1 + 0001-Avoid-bundling-asm.patch | 100 ++++++++++++++ byte-buddy-1.14.18.tar.gz | 3 + byte-buddy-1.15.1.tar.gz | 3 + byte-buddy-1.15.2.tar.gz | 3 + byte-buddy.changes | 240 ++++++++++++++++++++++++++++++++++ byte-buddy.spec | 138 +++++++++++++++++++ 8 files changed, 511 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 0001-Avoid-bundling-asm.patch create mode 100644 byte-buddy-1.14.18.tar.gz create mode 100644 byte-buddy-1.15.1.tar.gz create mode 100644 byte-buddy-1.15.2.tar.gz create mode 100644 byte-buddy.changes create mode 100644 byte-buddy.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/0001-Avoid-bundling-asm.patch b/0001-Avoid-bundling-asm.patch new file mode 100644 index 0000000..18da22a --- /dev/null +++ b/0001-Avoid-bundling-asm.patch @@ -0,0 +1,100 @@ +From 68366dbea6762d338aaefa6d80caaf5abb05555a Mon Sep 17 00:00:00 2001 +From: Marian Koncek +Date: Thu, 23 Feb 2023 13:59:25 +0100 +Subject: [PATCH 1/2] Avoid bundling asm + +--- + byte-buddy/pom.xml | 56 +++++++++------------------------------------- + 1 file changed, 11 insertions(+), 45 deletions(-) + +diff --git a/byte-buddy/pom.xml b/byte-buddy/pom.xml +index 3a2c52000b..5372965676 100644 +--- a/byte-buddy/pom.xml ++++ b/byte-buddy/pom.xml +@@ -26,8 +26,6 @@ + --> + + +- org.objectweb.asm +- net.bytebuddy.jar.asm + + net.bytebuddy, + net.bytebuddy.agent.builder, +@@ -62,10 +60,7 @@ + net.bytebuddy.utility, + net.bytebuddy.utility.nullability, + net.bytebuddy.utility.privilege, +- net.bytebuddy.utility.visitor, +- ${shade.target}, +- ${shade.target}.signature, +- ${shade.target}.commons ++ net.bytebuddy.utility.visitor + + + net.bytebuddy.utility.dispatcher +@@ -83,6 +78,16 @@ + ${project.groupId} + byte-buddy-dep + ++ ++ org.ow2.asm ++ asm ++ ${version.asm} ++ ++ ++ org.ow2.asm ++ asm-commons ++ ${version.asm} ++ + + net.java.dev.jna + jna +@@ -254,45 +259,6 @@ + true + ${bytebuddy.extras} + true +- +- +- ${shade.source} +- ${shade.target} +- +- +- +- +- net.bytebuddy:byte-buddy-dep:* +- +- META-INF/MANIFEST.MF +- META-INF/maven/** +- +- +- +- org.ow2.asm:* +- +- META-INF/MANIFEST.MF +- **/module-info.class +- **/LICENSE +- **/NOTICE +- +- +- +- org.ow2.asm:asm-commons +- +- org/objectweb/asm/commons/AnnotationRemapper.** +- org/objectweb/asm/commons/ClassRemapper.** +- org/objectweb/asm/commons/FieldRemapper.** +- org/objectweb/asm/commons/MethodRemapper.** +- org/objectweb/asm/commons/ModuleHashesAttribute.** +- org/objectweb/asm/commons/ModuleRemapper.** +- org/objectweb/asm/commons/RecordComponentRemapper.** +- org/objectweb/asm/commons/Remapper.** +- org/objectweb/asm/commons/SignatureRemapper.** +- org/objectweb/asm/commons/SimpleRemapper.** +- +- +- + + + net.bytebuddy.build.Plugin$Engine$Default +-- +2.45.1 + diff --git a/byte-buddy-1.14.18.tar.gz b/byte-buddy-1.14.18.tar.gz new file mode 100644 index 0000000..b7dae7c --- /dev/null +++ b/byte-buddy-1.14.18.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6f4a7ea40eafd00cbf4690a0785786360cfb69b866297b1dd62528a73c3f1266 +size 2027694 diff --git a/byte-buddy-1.15.1.tar.gz b/byte-buddy-1.15.1.tar.gz new file mode 100644 index 0000000..0b9b37c --- /dev/null +++ b/byte-buddy-1.15.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:74129de1641d7d4090535b775ecb01bdd6fca4d44044f0844c875494fcfb6957 +size 2042176 diff --git a/byte-buddy-1.15.2.tar.gz b/byte-buddy-1.15.2.tar.gz new file mode 100644 index 0000000..25b3ac6 --- /dev/null +++ b/byte-buddy-1.15.2.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:70b6b9ba1e53e8df099fad19f6c7d2cc010f2572ee0cee303938b62ef1122116 +size 2049227 diff --git a/byte-buddy.changes b/byte-buddy.changes new file mode 100644 index 0000000..4ab8bb3 --- /dev/null +++ b/byte-buddy.changes @@ -0,0 +1,240 @@ +------------------------------------------------------------------- +Wed Sep 25 21:44:53 UTC 2024 - Anton Shvetz + +- Update to v1.15.2 + * Changes of v1.15.2 + + Add support for multi-release JAR files in ClassFileLocators + and Plugin.Engine.Default. + + Add Gradle task for transforming multiple jar files with + ByteBuddyJarsTask. + + Avoid validation of JarFile when extracting individual + entries. + + Rework discovery in ByteBuddyMojo. + +------------------------------------------------------------------- +Sun Sep 1 16:25:12 UTC 2024 - Anton Shvetz + +- Update to v1.15.1 + * Changes of v1.15.1 + + Revert default EntryPoint for Android Gradle plugin to use + DECORATE unless explicitly specified due to many generic type + errors in Kotlin classes. + * Changes of v1.15.0 + + Introduce AsmClassWriter and AsmClassReader abstractions that + allow for plugging different implementations of readers and + writers. + + Add configuration extension to the Android Gradle plugin and + make it behave like regular Gradle plugin with standard + configuration. + + Throw TypeNotPresentException upon discovering undeclared + type variables as it was recently fixed on the JVM. + * Changes of v1.14.19 + + Add Maven Mojo for transforming jars and for transforming + dependencies folder. + + Better error handling for unresolved type variables. + + Allow loading arguments of the instrumented method in + MemberSubstitution. + + Fix checks for method visibility. + +------------------------------------------------------------------- +Mon Jul 8 21:30:57 UTC 2024 - Anton Shvetz + +- Update to v1.14.18 + * Changes of v1.14.18 + + Avoid verification error if constructor advice meats dropped + implicit this frame and throw exception during + instrumentation instead. + + Add support to resolve ByteBuddyAgent from non-obfuscated + name if obfuscation is used. + + Make sure CircularityLock implementations never load classes + during locking. + + Offer use of istat if stat command is not available for + emulated attachment. + + Avoid locking entire class loader when child-first class + loader loads shadowed class and parallel class loading is + supported. + * Changes of v1.14.17 + + Avoid crashing of Android plugin when there are duplicate + files for licenses or license notices. + +------------------------------------------------------------------- +Thu May 23 05:28:12 UTC 2024 - Anton Shvetz + +- Update to v1.14.16 + * Changes of v1.14.16 + + Update ASM and introduce support for Java 23. + +------------------------------------------------------------------- +Tue May 21 10:58:11 UTC 2024 - Fridrich Strba + +- Upgrade to v1.14.15 + * Changes of v1.14.15 + + Allow attaching from root on J9. + * Changes of v1.14.14 + + Adjust type validation to accept additional names that are + legal in the class file format. + + Fix dynamic attach on Windows when a service user is active. + + Avoid failure when using Android's strict mode. +- Removed patch: + * 0002-Remove-dependencies.patch + + not needed since we have jna packaged + +------------------------------------------------------------------- +Thu Apr 18 11:25:23 UTC 2024 - Fridrich Strba + +- Split the whole package into sub-packages +- Added patch: + * 0001-Avoid-bundling-asm.patch + + Do not bundle asm, but use external artifact + * 0002-Remove-dependencies.patch + + Remove optional dependency on jna + +------------------------------------------------------------------- +Thu Mar 28 20:38:55 UTC 2024 - Anton Shvetz + +- Update to v1.14.13 + * Changes of v1.14.13 + + Avoid resolving type variables when generic type processing + is disabled. + + Improve error message for Byte Buddy agent external attach. + + Fix build for modular jars when using later version than Java + 8. + +------------------------------------------------------------------- +Sat Feb 17 15:42:45 UTC 2024 - Anton Shvetz + +- Update to v1.14.12 + * Changes of v1.14.12 + + Pin proxy class file version to avoid implicit changes when + using Graal native image. + + Add support for Java 23. + + Add missing @MaybeNull annotation. + +------------------------------------------------------------------- +Thu Dec 21 00:16:33 UTC 2023 - Anton Shvetz + +- Update to v1.14.11 + * Changes of v1.14.11 + + Adjusts Gradle plugin to support Gradle 8.4 without warnings. + + Avoid blurry exception on build plugin for fail fast. + +------------------------------------------------------------------- +Wed Dec 20 23:21:57 UTC 2023 - Anton Shvetz + +- Update to v1.14.10 + * Changes of v1.14.10 + + Add lazy facade to default TypePool in AgentBuilder to avoid + parsing of types ignored by name. + + Avoid module info classes in Android plugin. + +------------------------------------------------------------------- +Tue Oct 17 05:32:59 UTC 2023 - Anton Shvetz + +- Update to v1.14.9 + * Changes of v1.14.9 + + Update ASM to version 9.6 + + Support Android plugin to support APG version 7.4 + +------------------------------------------------------------------- +Wed Sep 27 05:14:22 UTC 2023 - Fridrich Strba + +- Remove dependency on findbugs +- Do not produce bootstrap package + +------------------------------------------------------------------- +Thu Sep 14 23:17:38 UTC 2023 - Anton Shvetz + +- Update to v1.14.8 + * Changes of v1.14.8 + + Correctly read versions from class file that would use both + bytes. + + Fix Byte Buddy Gradle plugin for Gradle 8.3+. + + Correct field and static method access on subtypes in + MemberSubstitution. + + Support APK 7.4+ versions in Byte Buddy Gradle for Android + plugin. +- Reproducible builds: use SOURCE_DATE_EPOCH for timestamp + +------------------------------------------------------------------- +Thu Aug 31 07:35:26 UTC 2023 - Anton Shvetz + +- Update to v1.14.7 + * Changes of v1.14.7 + + Correctly read minor version from class file. + + Catch type resolution errors when applying Plugin.Engine. + +------------------------------------------------------------------- +Tue Aug 15 03:26:43 UTC 2023 - Anton Shvetz + +- Update to v1.14.6 + * Changes of v1.14.6 + + Add PatchMode.SUBSTITUTE and + ResettableClassFileTransformer.Substitutable for in-order + patching. + + Allow for explicit specification og differential matcher when + patching an AgentBuilder. + + Add platform loader to locator for build plugins. + + Correctly resolve accessors for fields with capitalized first + letter. + + Make jars for Android read-only as newer versions require it. + +------------------------------------------------------------------- +Sat Jun 10 08:06:59 UTC 2023 - Anton Shvetz + +- Update to v1.14.5 + * Changes of v1.14.5 + + Avoid use of location if agent argument separator is + contained. + + Allow failure of member substitution if no element is + separated. + + Allow retry in case of parallel class injection. + +------------------------------------------------------------------- +Fri May 5 07:43:46 UTC 2023 - Fridrich Strba + +- Do not bootstrap using downloaded binaries, but build the + minimal bootstrap package from sources + +------------------------------------------------------------------- +Thu Apr 13 16:47:24 UTC 2023 - Anton Shvetz + +- Update to v1.14.4 + * Changes of v1.14.4 + + Include instrumented type and auxiliary types in TypePool + that is passed to TypeWriter. + +------------------------------------------------------------------- +Mon Apr 3 12:37:18 UTC 2023 - Anton Shvetz + +- Remove patch: + * 00-asm5.patch - not needed due to update of objectweb-asm + +------------------------------------------------------------------- +Sun Apr 2 18:09:26 UTC 2023 - Anton Shvetz + +- Update to v1.14.3 + * Changes of v1.14.3 + + Make MethodGraph.Compiler failsafe when processing incomplete + methods. + + Update ASM. + +------------------------------------------------------------------- +Mon Mar 20 13:10:06 UTC 2023 - Anton Shvetz + +- Update to v1.14.2 + * Changes of v1.14.2 + + Fix offset mapping for local variable array remapping in + Advice. + + Add possibility to specify an index for skipOn and repeatOn + which resolves the checked value from a returned array. + * Changes of 1.14.1 + + Add extended scope for Maven Byte Buddy plugin to include all + non-test-dependencies. + +------------------------------------------------------------------- +Wed Mar 8 04:33:02 UTC 2023 - Anton Shvetz + +- Initial packaging with v1.14.0 +- Add patch: + * 00-asm5.patch + ~ asm5 does not support the Opcodes.V20 constant diff --git a/byte-buddy.spec b/byte-buddy.spec new file mode 100644 index 0000000..b858cc1 --- /dev/null +++ b/byte-buddy.spec @@ -0,0 +1,138 @@ +# +# spec file for package byte-buddy +# +# Copyright (c) 2024 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +Name: byte-buddy +Version: 1.15.2 +Release: 0 +Summary: Runtime code generation for the Java virtual machine +License: Apache-2.0 +Group: Development/Libraries/Java +URL: https://bytebuddy.net/ +Source0: https://github.com/raphw/%{name}/archive/refs/tags/%{name}-%{version}.tar.gz +Patch0: 0001-Avoid-bundling-asm.patch +BuildRequires: fdupes +BuildRequires: jurand +BuildRequires: maven-local +BuildRequires: mvn(codes.rafael.modulemaker:modulemaker-maven-plugin) +BuildRequires: mvn(com.google.code.findbugs:jsr305) +BuildRequires: mvn(net.java.dev.jna:jna) +BuildRequires: mvn(net.java.dev.jna:jna-platform) +BuildRequires: mvn(org.apache.felix:maven-bundle-plugin) +BuildRequires: mvn(org.apache.maven.plugin-tools:maven-plugin-annotations) +BuildRequires: mvn(org.apache.maven.plugins:maven-plugin-plugin) +BuildRequires: mvn(org.apache.maven:maven-core) +BuildRequires: mvn(org.apache.maven:maven-plugin-api) +BuildRequires: mvn(org.eclipse.aether:aether-api) +BuildRequires: mvn(org.eclipse.aether:aether-util) +BuildRequires: mvn(org.ow2.asm:asm) >= 9.7 +BuildRequires: mvn(org.ow2.asm:asm-commons) +BuildRequires: mvn(org.sonatype.plexus:plexus-build-api) +BuildArch: noarch + +%description +Byte Buddy is a code generation and manipulation library for creating and +modifying Java classes during the runtime of a Java application and without the +help of a compiler. Other than the code generation utilities that ship with the +Java Class Library, Byte Buddy allows the creation of arbitrary classes and is +not limited to implementing interfaces for the creation of runtime proxies. +Furthermore, Byte Buddy offers a convenient API for changing classes either +manually, using a Java agent or during a build. + +%package agent +Summary: Byte Buddy Java agent +Group: Development/Libraries/Java + +%description agent +The Byte Buddy Java agent allows to access the JVM's HotSwap feature. + +%package maven-plugin +Summary: Byte Buddy Maven plugin +Group: Development/Libraries/Java + +%description maven-plugin +A plugin for post-processing class files via Byte Buddy in a Maven build. + +%package javadoc +Summary: API documentation for %{name} +Group: Documentation/HTML + +%description javadoc +API documentation for %{name}. + +%prep +%setup -q -n %{name}-%{name}-%{version} +%patch -P 0 -p1 + +# Don't ship android or benchmark modules +%pom_disable_module byte-buddy-android +%pom_disable_module byte-buddy-android-test +%pom_disable_module byte-buddy-benchmark + +# Don't ship gradle plugin +%pom_disable_module byte-buddy-gradle-plugin + +# Remove check plugins unneeded by RPM builds +%pom_remove_plugin :jacoco-maven-plugin +%pom_remove_plugin :license-maven-plugin +%pom_remove_plugin :pitest-maven +%pom_remove_plugin :coveralls-maven-plugin +%pom_remove_plugin :spotbugs-maven-plugin +%pom_remove_plugin :jitwatch-jarscan-maven-plugin +%pom_remove_plugin :maven-release-plugin +%pom_remove_plugin :nexus-staging-maven-plugin + +# Avoid circular dependency +%pom_remove_plugin :byte-buddy-maven-plugin byte-buddy-dep + +# Not interested in shading sources (causes NPE on old versions of shade plugin) +%pom_xpath_set "pom:createSourcesJar" "false" byte-buddy + +# Drop build dep on findbugs annotations, used only by the above check plugins +%pom_remove_dep -r :findbugs-annotations +%{java_remove_annotations} byte-buddy-agent byte-buddy-dep byte-buddy-maven-plugin -n SuppressFBWarnings + +%pom_remove_dep org.ow2.asm:asm-deprecated + +%pom_remove_plugin -r :maven-shade-plugin + +%{mvn_package} :byte-buddy-parent __noinstall + +%build +%{mvn_build} -f -s -- \ + -Dproject.build.outputTimestamp=$(date -u -d @${SOURCE_DATE_EPOCH:-$(date +%%s)} +%%Y-%%m-%%dT%%H:%%M:%%SZ) \ + -Dsource=8 + +%install +%mvn_install +%if %{without bootstrap} +%fdupes -s %{buildroot}%{_javadocdir} +%endif + +%files -f .mfiles-%{name} -f .mfiles-%{name}-dep +%doc README.md release-notes.md +%license LICENSE NOTICE + +%files agent -f .mfiles-%{name}-agent +%license LICENSE NOTICE + +%files maven-plugin -f .mfiles-%{name}-maven-plugin + +%files javadoc -f .mfiles-javadoc +%license LICENSE NOTICE + +%changelog