Bug 242871 - editors/vscode: add warning for build Error: EMFILE: too many open files
Summary: editors/vscode: add warning for build Error: EMFILE: too many open files
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Ben Woods
Keywords: easy, needs-patch
Depends on:
Reported: 2019-12-25 04:57 UTC by Ben Woods
Modified: 2019-12-30 11:04 UTC (History)
4 users (show)

See Also:
woodsb02: maintainer-feedback+
koobs: maintainer-feedback? (bdrewery)


Note You need to log in before you can comment on or make changes to this bug.
Description Ben Woods freebsd_committer 2019-12-25 04:57:09 UTC
editors/vscode: add pkg-message for build Error: EMFILE: too many open files

When building vscode with poudriere, the build was failing with:
[04:20:50] Error: EMFILE: too many open files, open '/wrkdirs/usr/ports/editors/vscode/work/vscode-1.41.0/out-build/vs/workbench/common/editor/textDiffEditorModel.js.map'

This is because poudriere imposes a limit on the maximum files allowed open in the jail to 1024. This can be fixed by adding the following line to poudriere.conf:
Comment 1 Kubilay Kocak freebsd_committer freebsd_triage 2019-12-25 05:08:06 UTC
@Ben Thanks for the report. Presumably that means vscode wont package out of the box, for example on our official package builders, unless they also set a higher MAX_FILES setting. 

Could/should "complete resolution" of this issue also include either (or both) of the following:

 - Ability for ports to mark (metadata) specific settings to inform poudriere of additional things they need (including this MAX_FILES setting)

 - Request for portmgr to add this setting to the official builder configurations

Request feedback from Bryan whether poudriere might be amenable to a general 'ports metadata hints for poudriere' feature as he's likely aware of other 'hint types' where this might be useful

@Ben This (Adding pkg-message to help/inform a build failure) is probably as close to a portmgr blanket approval case without actually being one (explicitly listed as such). I'd just go ahead and commit it if the issue is verified and there's no better way to resolve it (in the short term)


 - Reporter is committer, assign accordingly
Comment 2 Ben Woods freebsd_committer 2019-12-25 14:00:49 UTC
On second thought, pkg-message is not the right answer here, because we need a warning during the port extract phase, rather than the pkg install phase (which we will never reach).

Comment 3 Hiroki Tagato freebsd_committer 2019-12-26 08:26:18 UTC
(In reply to Ben Woods from comment #2)

www/chromium port defines pre-everything target to warn users about memory and disk space requirements for building. Maybe we can prepare a similar warning message about EMFILE error?
Comment 4 Kurt Jaeger freebsd_committer 2019-12-30 09:06:44 UTC
adding MAX_FILES_vscode=4096 to poudriere.conf fixed the build for me, thanks!
Comment 5 commit-hook freebsd_committer 2019-12-30 11:00:03 UTC
A commit references this bug:

Author: woodsb02
Date: Mon Dec 30 10:59:43 UTC 2019
New revision: 521479
URL: https://svnweb.freebsd.org/changeset/ports/521479

  editors/vscode: add warning for build Error: EMFILE: too many open files

  PR:		242871
  Suggested by:	Hiroki Tagato <tagattie@yandex.com>
  Reported by:	woodsb02
  Approved by:	portmgr blanket

Comment 6 Ben Woods freebsd_committer 2019-12-30 11:03:59 UTC
pre-everything warning message added to port. Thanks for the idea Hiroki - it seems to align with other ports.

bdrewery - any thoughts on whether a port could indicate to poudriere it needs more resources than the default limits?

I'll mark this bug as closed for now, but feel free to still respond to it.