Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot add 'JS_STRUCTURED_SPEW' to configuration: Key already exists #246

Open
leeN opened this issue Jan 8, 2025 · 3 comments
Open

Cannot add 'JS_STRUCTURED_SPEW' to configuration: Key already exists #246

leeN opened this issue Jan 8, 2025 · 3 comments
Assignees
Labels
bug Something isn't working build Issues related to building Foxhound

Comments

@leeN
Copy link
Collaborator

leeN commented Jan 8, 2025

If I have ac_add_options --enable-jitspew in my .mozconfig, the build will fail with the following error:

0:06.97 checking bindgen cflags... -x c++ -fno-sized-deallocation -fno-aligned-new -DTRACING=1 -DIMPL_LIBXUL -DMOZILLA_INTERNAL_API -DRUST_BINDGEN --sysroot /home/taintfox/.mozbuild/sysroot-x86_64-linux-gnu
 0:06.97 Traceback (most recent call last):
 0:06.97   File "/mnt/storage/taintfox/project-foxhound/configure.py", line 351, in <module>
 0:06.97     sys.exit(main(sys.argv))
 0:06.97              ^^^^^^^^^^^^^^
 0:06.98   File "/mnt/storage/taintfox/project-foxhound/configure.py", line 141, in main
 0:06.98     sandbox.run()
 0:06.98   File "/mnt/storage/taintfox/project-foxhound/python/mozbuild/mozbuild/configure/__init__.py", line 573, in run
 0:06.98     func(*args)
 0:06.98   File "/mnt/storage/taintfox/project-foxhound/python/mozbuild/mozbuild/configure/__init__.py", line 1125, in _resolve_and_set
 0:06.98     raise ConfigureError(
 0:06.98 mozbuild.configure.ConfigureError: Cannot add 'JS_STRUCTURED_SPEW' to configuration: Key already exists
*** Fix above errors and then restart with "./mach build"

I assume this is related to the TaintSpewing changeset in PR #242. This failed the automated build for the binaries, oops.

I can try to have a look next week on how we can keep jitspewing an option while allowing taints to be spewed as well.

@leeN leeN added bug Something isn't working build Issues related to building Foxhound labels Jan 8, 2025
@leeN leeN self-assigned this Jan 8, 2025
@leeN
Copy link
Collaborator Author

leeN commented Jan 8, 2025

I think the issue is that we define JS_STRUCTURED_SPEW twice.

set_define("JS_STRUCTURED_SPEW", depends_if("--enable-jitspew")(lambda _: True))
set_config("JS_STRUCTURED_SPEW", depends_if("--enable-jitspew")(lambda _: True))

option(
    "--enable-taintspew",
    default=False,
    help="{Enable|Disable} the taint flow spew variable",
)

# Also enable the structured spewer for tainting
set_define("JS_STRUCTURED_SPEW", depends_if("--enable-taintspew")(lambda _: True))
set_config("JS_STRUCTURED_SPEW", depends_if("--enable-taintspew")(lambda _: True))

Maybe it can be selectively enabled like this

@tmbrbr
Copy link
Contributor

tmbrbr commented Jan 9, 2025

Good catch, I didn't test both configuration options together.

Having an option to enable both flags would be great.

On the other hand, perhaps we don't need a dedicated --enable-taintspew flag at all? At the moment both flags provide the same functionality, and only the JS_STRUCTURED_SPEW flag is ever checked in the code.

@leeN
Copy link
Collaborator Author

leeN commented Jan 9, 2025

Considering that whether we spew anything is controlled via environment variables, it may be easiest to remove the said flag. Agreed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working build Issues related to building Foxhound
Projects
None yet
Development

No branches or pull requests

2 participants