
ac_add_options --with-bing-api-keyfile=</path/to/keyfile>
bing API キー ( )を指定して Firefox をビルドしようとしました。ただし、構成を実行すると、ファイル内で64 文字の文字列として API を指定しました (末尾の改行の有無にかかわらず、どちらも機能しません) というエラーが.mozconfig
発生します。ERROR: Bing API key file has an invalid format.
</path/to/keyfile>
答え1
答えは次のとおりです。
APIキーが属するユーザー名を空白で区切って先頭に追加する必要があります。形式は次のようになります。
<https://www.bingmapsportal.com/-Username> <API key>
を見てfirefox-build-configuration をチェックする python スクリプトID などの情報が必要であることを示唆しています。
[...]
with MockedOpen({'key': 'fake-id fake-key\n'}):
config, output, status = self.get_result(
"id_and_secret_keyfile('Bing API')",
args=['--with-bing-api-keyfile=key'],
includes=includes)
self.assertEqual(status, 0)
self.assertEqual(output, textwrap.dedent('''\
checking for the Bing API key... yes
'''))
self.assertEqual(config, {
'MOZ_BING_API_CLIENTID': 'fake-id',
'MOZ_BING_API_KEY': 'fake-key',
})
with MockedOpen({'key': 'fake-key\n'}):
config, output, status = self.get_result(
"id_and_secret_keyfile('Bing API')",
args=['--with-bing-api-keyfile=key'],
includes=includes)
self.assertEqual(status, 1)
self.assertEqual(output, textwrap.dedent('''\
checking for the Bing API key... no
ERROR: Bing API key file has an invalid format.
'''))
self.assertEqual(config, {})
[...]