Closed Bug 1053714 Opened 10 years ago Closed 6 years ago

jpm produces invalid install.rdf maximum version from package.json engines ranges

Categories

(Add-on SDK Graveyard :: General, defect, P2)

x86
Windows XP
defect

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: anaran, Unassigned)

References

Details

I am testing jpm 0.0.12 on Windows XPP.

Following entry in package.json of my https://github.com/anaran/JotFirefox

  "engines": {
    "firefox": ">=30.0 < 35.0",
    "fennec": ">=30.0 < 35.0"
  },

leads to this AMO validation error (same for "android"):

Invalid maximum version number

Error: The maximum version that was specified is not an acceptable version number for the Mozilla product that it corresponds with.

Version ".-1" isn't compatible with "firefox".

Please check the list of valid versions at: https://addons.mozilla.org/en-US/firefox/pages/appversions/

----

  "engines": {
    "firefox": ">=30.0",
    "fennec": ">=30.0"
  },

leads to following AMO validation error (same for "android"):

Invalid maximum version number

Error: The maximum version that was specified is not an acceptable version number for the Mozilla product that it corresponds with.

Version "*" isn't compatible with "firefox".

Please check the list of valid versions at: https://addons.mozilla.org/en-US/firefox/pages/appversions/
install.rdf

----

  "engines": {
    "firefox": "30.0 - 34.0",
    "fennec": "30.0 - 34.0"
  },
allows me to upload to AMO and to install from there in Windows XPP and Android 4.3.

Due to Bug 1052803 neither the Windows nor Android installations has an Options button and does not display any options when clicking the addon in to addon manager.

A broken icon image is shown for the jpm build addon in about:addons in Android.
Assignee: nobody → evold
Priority: -- → P2
Assignee: evold → nobody
Erik, this should by fixed by PR #224[1], correct?

[1] https://github.com/mozilla/jpm/issues/224
Flags: needinfo?(evold)
Status: UNCONFIRMED → RESOLVED
Closed: 9 years ago
Flags: needinfo?(evold)
Resolution: --- → FIXED
The ">=30.0 < 35.0" syntax still produces .-1 as maxVersion, this part doesn't seem to be fixed (jpm 1.0.1). This appears to be a bug in https://github.com/jsantell/mozilla-toolkit-versioning/, it doesn't process whitespace correctly (at the very least I would expect < followed by a space to be rejected). But even without the space, maxVersion 35.0.-1 makes no sense and will be rejected by AMO - the <1.2.3 syntax really shouldn't be supported for Firefox versions, it cannot work correctly.
Status: RESOLVED → REOPENED
Ever confirmed: true
Resolution: FIXED → ---
I have a similar problem. For me, results of JPM 1.0.0 are:

	package.json:
"engines": {"Firefox": ">=39.0a1 < 45.0"}
	install.rdf:
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
<em:minVersion>39.0a1</em:minVersion>
<em:maxVersion>.-1</em:maxVersion>

	package.json:
"engines": {"Firefox": "39.* - 45.0"}
	install.rdf:
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
<em:minVersion>&gt;=39.*</em:minVersion>
<em:maxVersion>45.0</em:maxVersion>

	package.json:
"engines": {"Firefox": ">39.0a1"}
	install.rdf:
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
<em:minVersion>39.0a2</em:minVersion>
<em:maxVersion>39.0</em:maxVersion>

I don't know why JPM uses 39.0 as the max version if max version isn't specified, MB it's FF LTS version (I couldn't remeber what's the Mozilla analog for "LTS" is).
I'm seeing the same bug. 

package.json contains: 

  "engines": {
    "firefox": ">=38.0a1 <*",
    "fennec": ">=38.0a1 <*"
  },

install.rdf gets:

 27               <em:minVersion>38.0a1</em:minVersion>
 28               <em:maxVersion>*.-1</em:maxVersion>


If I drop the "<*" clause in package.json, I get a maxVersion of 43.0 generated in the install.rdf - this is effectively broken as Firefox stable today is 45.0.
Apologies if this is redundant, obvious, or otherwise not helpful. I'm just a larval-stage add-on developer who was struggling with this same issue. I found this syntax to work correctly:

  "engines": {
    "firefox": ">=38.0a1 <=45.0"
  }

The result is:

  <em:minVersion>38.0a1</em:minVersion>
  <em:maxVersion>45.0</em:maxVersion>

If I use only "<45.0" instead of "<=45.0", I get this:

  <em:minVersion>38.0a1</em:minVersion>
  <em:maxVersion>45.0.-1</em:maxVersion>

For us n00bs, it would be great if the doc page for package.json gave a clear example of specifying both min and max values. It only says to add a space between them, but no discussion of <, <=, *, etc.
Keywords: dev-doc-needed
Add-on SDK is no longer supported so resolving bugs as INCOMPLETE
Status: REOPENED → RESOLVED
Closed: 9 years ago6 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.