Skip to content

no-bug: A few quality-of-life tweaks, take 2#13637

Open
iskunk wants to merge 1 commit into
zen-browser:devfrom
iskunk:pr-iskunk
Open

no-bug: A few quality-of-life tweaks, take 2#13637
iskunk wants to merge 1 commit into
zen-browser:devfrom
iskunk:pr-iskunk

Conversation

@iskunk
Copy link
Copy Markdown
Contributor

@iskunk iskunk commented May 10, 2026

This should support npm run import on Windows. I looked into run-script-os, and a couple other approaches, but then figured it would be simpler to just call a small Python script that looks up the environment variable and calls cargo/$CARGO as appropriate.

Please give this a try, and let me know if you see any regressions.


package.json: Invoke cargo(1) through a Python script that honors the CARGO environment variable if set, and pass arguments to ffprefs using the new convention (see below)

run_cargo.py: Script to invoke cargo(1), as a workaround for reading an environment variable in a package.json script in a cross-platform manner

update_service_dumps.py: Allow specifying DUMPS_FOLDER and ENGINE_DUMPS_FOLDER on the command line

ffprefs/src/main.rs: Allow specifying the prefs and engine dirs on the command line instead of hard-coding their locations relative to a common root dir

@iskunk iskunk requested a review from mr-cheffy as a code owner May 10, 2026 06:09
@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. Improvement labels May 10, 2026
@mr-cheffy mr-cheffy requested a review from Copilot May 10, 2026 07:31

This comment was marked as resolved.

@iskunk
Copy link
Copy Markdown
Contributor Author

iskunk commented May 28, 2026

I've rebased and resolved the merge conflict, and also tweaked the Linux mozconfig to allow user-set values for CC and CXX.

Comment thread configs/linux/mozconfig
# bin directory
if test "$CC" && test "$CXX"; then
true
elif test -d "$HOME/.mozbuild/clang/bin"; then
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about this, maybe instead, we should just define CC and CXX if ZEN_RELEASE tests true?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's still good to set the variables generally, because the configuration might default to gcc/g++ otherwise. And the user might want to do a ZEN_RELEASE build using their compilers instead of the ones in .mozbuild/.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In that case, you should just use your own mozconfig file at the root directory to override these

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's non-obvious, however, for just overriding the compilers. It's customary across many build systems to use CC/CXX when set in the environment, and especially when the user isn't familiar with the ins and outs of the build system, supporting common conventions like that helps make it easier to deal with.

In any event, nothing changes here unless both variables are set, to avoid any ambiguity.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've rebased and resolved the new conflicts.

Note that a big part of the reason for using Surfer in the first place is to abstract the build away from the user, so that they don't have to be familiar with the Mozilla build system in order to build Zen. Requiring the user to mess with mozconfig files, for something as basic as CC/CXX, defeats that purpose.

Comment thread scripts/update_service_dumps.py Outdated
Comment thread tools/ffprefs/src/main.rs Outdated
linux/mozconfig: Honor the existing CC and CXX environment variables
if set

package.json: Invoke cargo(1) through a Python script that honors the
CARGO environment variable if set, and pass arguments to ffprefs using
the new convention (see below)

run_cargo.py: Script to invoke cargo(1), as a workaround for reading
an environment variable in a package.json script in a cross-platform
manner

update_service_dumps.py: Allow specifying DUMPS_FOLDER and
ENGINE_DUMPS_FOLDER on the command line

ffprefs/src/main.rs: Specify the prefs and engine dirs on the command
line instead of hard-coding their locations relative to a common root
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Improvement size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants