[DRE-maint] Bug#1036699: unblock: ruby-terser/1.1.12+dfsg-2

Mohammed Bilal mdbilal at disroot.org
Wed May 24 14:25:25 BST 2023


Package: release.debian.org
Severity: normal
User: release.debian.org at packages.debian.org
Usertags: unblock
X-Debbugs-Cc: ruby-terser at packages.debian.org, mdbilal at disroot.org, praveen at debian.org
Control: affects -1 + src:ruby-terser

Please unblock package ruby-terser


[ Reason ]
This fixes the FTBFS in testing See #1036261

[ Impact ]
Ruby terser upstream uses a patched version of terser.js.
This has to be updated according to the version of node-terser in Debian as well else this will render the gem unusable.

[ Tests ]
Tests pass

[ Risks ]
No risk


[ Checklist ]
  [x] all changes are documented in the d/changelog
  [x] I reviewed all changes and I approve them
  [x] attach debdiff against the package in testing


unblock ruby-terser/1.1.12+dfsg-2
-------------- next part --------------
diff -Nru ruby-terser-1.1.12+dfsg/debian/changelog ruby-terser-1.1.12+dfsg/debian/changelog
--- ruby-terser-1.1.12+dfsg/debian/changelog	2022-09-07 22:43:41.000000000 +0530
+++ ruby-terser-1.1.12+dfsg/debian/changelog	2023-05-24 11:17:00.000000000 +0530
@@ -1,3 +1,10 @@
+ruby-terser (1.1.12+dfsg-2) unstable; urgency=medium
+
+  * Team upload.
+  * Refresh patch wrt node-terser 5.16.5 (Closes: #1036261)
+
+ -- Mohammed Bilal <mdbilal at disroot.org>  Wed, 24 May 2023 05:47:00 +0000
+
 ruby-terser (1.1.12+dfsg-1) unstable; urgency=medium
 
   [ Yadd ]
diff -Nru ruby-terser-1.1.12+dfsg/debian/patches/terser-sync.patch ruby-terser-1.1.12+dfsg/debian/patches/terser-sync.patch
--- ruby-terser-1.1.12+dfsg/debian/patches/terser-sync.patch	2022-09-06 19:51:14.000000000 +0530
+++ ruby-terser-1.1.12+dfsg/debian/patches/terser-sync.patch	2023-05-24 11:12:47.000000000 +0530
@@ -1,14 +1,14 @@
 Description: import upstream patches to render terser sync
 Origin: upstream,
  https://github.com/ahorek/terser-ruby/blob/master/patches/terser-sync.patch
- https://github.com/ahorek/terser-ruby/blob/master/patches/revert-source-maps.patch
+ https://github.com/ahorek/terser-ruby/blob/master/patches/revert-source-maps.p>
 Bug-Debian: https://bugs.debian.org/1017609
 Forwarded: not-needed
 Reviewed-By: Yadd <yadd at debian.org>
 
 --- a/terser.js
 +++ b/terser.js
-@@ -21156,7 +21156,7 @@
+@@ -21517,7 +21517,7 @@
   ***********************************************************************/
  
  // a small wrapper around source-map and @jridgewell/source-map
@@ -17,7 +17,7 @@
      options = defaults(options, {
          file : null,
          root : null,
-@@ -21164,31 +21164,20 @@
+@@ -21525,31 +21525,20 @@
          files: {},
      });
  
@@ -55,7 +55,7 @@
  
      function add(source, gen_line, gen_col, orig_line, orig_col, name) {
          let generatedPos = { line: gen_line, column: gen_col };
-@@ -21245,10 +21234,9 @@
+@@ -21606,10 +21595,9 @@
      }
  
      return {
@@ -69,7 +69,7 @@
      };
  }
  
-@@ -29459,6 +29447,10 @@
+@@ -29824,6 +29812,10 @@
  }
  
  async function minify(files, options, _fs_module) {
@@ -80,7 +80,23 @@
      if (
          _fs_module
          && typeof process === "object"
-@@ -29650,15 +29642,21 @@
+@@ -29995,13 +29987,10 @@
+     if (options.format.spidermonkey) {
+         result.ast = toplevel.to_mozilla_ast();
+     }
+-    let format_options;
+     if (!HOP(options.format, "code") || options.format.code) {
+-        // Make a shallow copy so that we can modify without mutating the user's input.
+-        format_options = {...options.format};
+-        if (!format_options.ast) {
++        if (!options.format.ast) {
+             // Destroy stuff to save RAM. (unless the deprecated `ast` option is on)
+-            format_options._destroy_ast = true;
++            options.format._destroy_ast = true;
+ 
+             walk(toplevel, node => {
+                 if (node instanceof AST_Scope) {
+@@ -30018,38 +30007,34 @@
          }
  
          if (options.sourceMap) {
@@ -89,12 +105,13 @@
 +            if (typeof options.sourceMap.content == "string") {
 +                options.sourceMap.content = JSON.parse(options.sourceMap.content);
              }
--            options.format.source_map = await SourceMap({
-+            options.format.source_map = SourceMap({
+-            format_options.source_map = await SourceMap({
++	    options.format.source_map = SourceMap({
                  file: options.sourceMap.filename,
                  orig: options.sourceMap.content,
-                 root: options.sourceMap.root,
+-                root: options.sourceMap.root,
 -                files: options.sourceMap.includeSources ? files : null,
++                root: options.sourceMap.root
              });
 +            if (options.sourceMap.includeSources) {
 +                if (files instanceof AST_Toplevel) {
@@ -104,9 +121,14 @@
 +                }
 +            }
          }
-         delete options.format.ast;
-         delete options.format.code;
-@@ -29667,21 +29665,11 @@
+-        delete format_options.ast;
+-        delete format_options.code;
+-        delete format_options.spidermonkey;
+-        var stream = OutputStream(format_options);
++        delete options.format.ast;
++        delete options.format.code;
++        delete options.format.spidermonkey;
++        var stream = OutputStream(options.format);
          toplevel.print(stream);
          result.code = stream.get();
          if (options.sourceMap) {
@@ -114,7 +136,7 @@
 -                configurable: true,
 -                enumerable: true,
 -                get() {
--                    const map = options.format.source_map.getEncoded();
+-                    const map = format_options.source_map.getEncoded();
 -                    return (result.map = options.sourceMap.asObject ? map : JSON.stringify(map));
 -                },
 -                set(value) {
@@ -122,27 +144,28 @@
 -                        value,
 -                        writable: true,
 -                    });
+-                }
+-            });
+-            result.decoded_map = format_options.source_map.getDecoded();
 +            if(options.sourceMap.asObject) {
 +                result.map = options.format.source_map.get().toJSON();
 +            } else {
 +                result.map = options.format.source_map.toString();
-                 }
--            });
--            result.decoded_map = options.format.source_map.getDecoded();
++            }
              if (options.sourceMap.url == "inline") {
                  var sourceMap = typeof result.map === "object" ? JSON.stringify(result.map) : result.map;
                  result.code += "\n//# sourceMappingURL=data:application/json;charset=utf-8;base64," + to_base64(sourceMap);
-@@ -29696,9 +29684,6 @@
+@@ -30064,9 +30049,6 @@
              options.nameCache.props = cache_to_json(options.mangle.properties.cache);
          }
      }
--    if (options.format && options.format.source_map) {
--        options.format.source_map.destroy();
+-    if (format_options && format_options.source_map) {
+-        format_options.source_map.destroy();
 -    }
      if (timings) {
          timings.end = Date.now();
          result.timings = {
-@@ -30214,5 +30199,6 @@
+@@ -30582,5 +30564,6 @@
  exports._default_options = _default_options;
  exports._run_cli = run_cli;
  exports.minify = minify;


More information about the Pkg-ruby-extras-maintainers mailing list