This reduces the text output when an error is hit, removing the tracebacks for known errors. Tracebacks are for unknown/unexpected errors - if you expect an error, it's better to print out an actual error message. I've also made the patch applying a bit more verbose in case it helps, as it sometimes does.

Example after the changes:

```
Building the following packages: yt
[1/1] (thread 1) building yt
Error building yt. Printing build logs.
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|diff --git a/setupext.py b/setupext.py
|index 92c456bab..ce2c5fbad 100644
|--- a/setupext.py
|+++ b/setupext.py
--------------------------
patching file setupext.py
Using Plan A...
Hunk #1 FAILED at 57.
1 out of 1 hunk FAILED -- saving rejects to file setupext.py.rej
done
[2022-03-02 17:35:58] Building package yt...
ERROR: Patch /src/packages/yt/patches/skip-openmp.patch failed
[2022-03-02 17:36:14] Succeeded building package yt in 16.5 seconds.
ERROR: cancelling buildall
[1/1] (thread 1) failed yt in 16.76 s
make[1]: *** [Makefile:12: all] Error 1
make[1]: Leaving directory '/src/packages'
make: *** [Makefile:187: build/packages.json] Error 2
```

fix: better error messages, fewer tracebacks. This reduces the text output when an error is hit, removing the tracebacks for known errors. Tracebacks are for unknown/unexpected errors - if you expect an error, it's better to print out an actual error message. I've also made the patch applying a bit more verbose in case it helps, as it sometimes does.

Example after the changes:

```
Building the following packages: yt
[1/1] (thread 1) building yt
Error building yt. Printing build logs.
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|diff --git a/setupext.py b/setupext.py
|index 92c456bab..ce2c5fbad 100644
|--- a/setupext.py
|+++ b/setupext.py
--------------------------
patching file setupext.py
Using Plan A...
Hunk #1 FAILED at 57.
1 out of 1 hunk FAILED -- saving rejects to file setupext.py.rej
done
[2022-03-02 17:35:58] Building package yt...
ERROR: Patch /src/packages/yt/patches/skip-openmp.patch failed
[2022-03-02 17:36:14] Succeeded building package yt in 16.5 seconds.
ERROR: cancelling buildall
[1/1] (thread 1) failed yt in 16.76 s
make[1]: *** [Makefile:12: all] Error 1
make[1]: Leaving directory '/src/packages'
make: *** [Makefile:187: build/packages.json] Error 2
```

from pyodide_build.testing import run_in_pyodide


@run_in_pyodide(
    packages=["nlopt"],
    xfail_browsers={
        "chrome": "nlopt set_min_objective triggers a fatal runtime error in chrome 89 see #1493",
    },
)
def test_nlopt():
    import nlopt
    import numpy as np

    # objective function
    def f(x, grad):
        x0 = x[0]
        x1 = x[1]
        y = (
            67.8306620138889
            - 13.5689721666667 * x0
            - 3.83269458333333 * x1
            + 0.720841066666667 * x0**2
            + 0.3427605 * x0 * x1
            + 0.0640322916666664 * x1**2
        )

        grad[0] = 1.44168213333333 * x0 + 0.3427605 * x1 - 13.5689721666667
        grad[1] = 0.3427605 * x0 + 0.128064583333333 * x1 - 3.83269458333333

        return y

    # inequality constraint (constrained to be <= 0)
    def h(x, grad):
        x0 = x[0]
        x1 = x[1]
        z = (
            -3.72589930555515
            + 128.965158333333 * x0
            + 0.341479166666643 * x1
            - 0.19642666666667 * x0**2
            + 2.78692500000002 * x0 * x1
            - 0.0000104166666686543 * x1**2
            - 468.897287036862
        )

        grad[0] = -0.39285333333334 * x0 + 2.78692500000002 * x1 + 128.965158333333
        grad[1] = 2.78692500000002 * x0 - 2.08333333373086e-5 * x1 + 0.341479166666643

        return z

    opt = nlopt.opt(nlopt.LD_SLSQP, 2)
    opt.set_min_objective(f)

    opt.set_lower_bounds(np.array([2.5, 7]))
    opt.set_upper_bounds(np.array([7.5, 15]))

    opt.add_inequality_constraint(h)

    opt.set_ftol_rel(1.0e-6)

    x0 = np.array([5, 11])

    xopt = opt.optimize(x0)

    assert np.linalg.norm(xopt - np.array([2.746310775, 15.0])) < 1e-7

from pyodide_build.testing import run_in_pyodide


@run_in_pyodide(
    packages=["nlopt"],
    xfail_browsers={
        "chrome": "nlopt set_min_objective triggers a fatal runtime error in chrome 89 see #1493",
    },
)
def test_nlopt():
    import nlopt
    import numpy as np

    # objective function
    def f(x, grad):
        x0 = x[0]
        x1 = x[1]
        y = (
            67.8306620138889
            - 13.5689721666667 * x0
            - 3.83269458333333 * x1
            + 0.720841066666667 * x0**2
            + 0.3427605 * x0 * x1
            + 0.0640322916666664 * x1**2
        )

        grad[0] = 1.44168213333333 * x0 + 0.3427605 * x1 - 13.5689721666667
        grad[1] = 0.3427605 * x0 + 0.128064583333333 * x1 - 3.83269458333333

        return y

    # inequality constraint (constrained to be <= 0)
    def h(x, grad):
        x0 = x[0]
        x1 = x[1]
        z = (
            -3.72589930555515
            + 128.965158333333 * x0
            + 0.341479166666643 * x1
            - 0.19642666666667 * x0**2
            + 2.78692500000002 * x0 * x1
            - 0.0000104166666686543 * x1**2
            - 468.897287036862
        )

        grad[0] = -0.39285333333334 * x0 + 2.78692500000002 * x1 + 128.965158333333
        grad[1] = 2.78692500000002 * x0 - 2.08333333373086e-5 * x1 + 0.341479166666643

        return z

    opt = nlopt.opt(nlopt.LD_SLSQP, 2)
    opt.set_min_objective(f)

    opt.set_lower_bounds(np.array([2.5, 7]))
    opt.set_upper_bounds(np.array([7.5, 15]))

    opt.add_inequality_constraint(h)

    opt.set_ftol_rel(1.0e-6)

    x0 = np.array([5, 11])

    xopt = opt.optimize(x0)

    assert np.linalg.norm(xopt - np.array([2.746310775, 15.0])) < 1e-7
