Open Bug 1666491 Opened 2 years ago Updated 22 days ago

Create a tier-2 task for checking the use of idl constants to ensure they are valid

Categories

(Firefox Build System :: Task Configuration, task)

task

Tracking

(Not tracked)

People

(Reporter: standard8, Assigned: standard8)

References

(Depends on 1 open bug)

Details

For a while now, we have had a linter rule to validate that any idl constants used from Javascript are defined. This is currently run manually, and tends to pick up something that's broken once every couple of months.

We can't include this as part of the automatic ESLint, as it depends on the generated xpidl output, so would typcially require an opt build.

We would like to include this as a tier-2 task, that is run once a day. Picking up the failing patches is normally quite easy.

The basic process to run this would be:

  • Get the source.
  • Do an opt build, or get an opt build where we have the generated xpidl output.
  • Run ESLint with a special command that enables the extra rule.

:kats, I'd be interested in getting this over the line. I'm assuming searchfox has similar needs in terms of the xpt files - are these already exposed somewhere?

Flags: needinfo?(kats)

I'm unfamiliar with xpt files specifically, and I don't see any in searchfox. I do see some in my objdir/config/makefiles/xpidl/ folder - is that what you're referring to?

In general the searchfox task (e.g. this one) has a generated-files artifact that contains generated files that we want to index. But I don't see the xpt files in there, so maybe that's not useful to you. Searchfox also runs some sort of xpidl parsing directly, in this script but I suspect that is also not useful to you.

Flags: needinfo?(kats)

(In reply to Kartikaya Gupta (email:kats@mozilla.com) from comment #2)

I'm unfamiliar with xpt files specifically, and I don't see any in searchfox. I do see some in my objdir/config/makefiles/xpidl/ folder - is that what you're referring to?

Yep.

In general the searchfox task (e.g. this one) has a generated-files artifact that contains generated files that we want to index. But I don't see the xpt files in there, so maybe that's not useful to you. Searchfox also runs some sort of xpidl parsing directly, in this script but I suspect that is also not useful to you.

Hm, yeah - but it would seem that we could maybe add something to https://searchfox.org/mozilla-central/rev/35d927df97900a57ecb562ad13909e392440b0fb/toolkit/mozapps/installer/packager.mk#77-93 to package up the xpt files so they too appear as artifacts on this job? With that it should be possible to do this, I think.

Mark, in comment #0 you explicitly mentioned opt builds, but afaict these are debug builds - does that make a difference for the linter? I wouldn't have thought so, but I'm probably missing something...

Flags: needinfo?(standard8)

Alternatively, I guess with a src dir only generating the xpidl xpt info and nothing else shouldn't actually be that difficult - the xpidl thing is just a python parser, IIRC?

(In reply to :Gijs (he/him) from comment #3)

Mark, in comment #0 you explicitly mentioned opt builds, but afaict these are debug builds - does that make a difference for the linter? I wouldn't have thought so, but I'm probably missing something...

Oh, I think I was thinking "opt" vs "artifact". I don't think it would really matter.

(In reply to :Gijs (he/him) from comment #4)

Alternatively, I guess with a src dir only generating the xpidl xpt info and nothing else shouldn't actually be that difficult - the xpidl thing is just a python parser, IIRC?

If we can do that, it'd probably be nice, easy and quick-ish.

Flags: needinfo?(standard8)
Depends on: 1479515
No longer blocks: 1479513
Depends on: 1479513
Assignee: nobody → standard8
You need to log in before you can comment on or make changes to this bug.