When building [code]grafana[/code] on Arch Linux ARM with [code]nodejs-lts-iron[/code] (a required dependency), the build fails with the error shown below
[code]
> nx run grafana:themes-generate
[stdin]:2826
value[symToStringTag] = undefined;
^
TypeError: Cannot assign to read only property 'Symbol(Symbol.toStringTag)' of object '#<WeakMap>'
at getRawTag ([stdin]:2826:35)
at baseGetTag ([stdin]:1429:71)
at runInContext2 ([stdin]:2858:227)
at Object.<anonymous> ([stdin]:5547:15)
at node_modules/lodash/lodash.js ([stdin]:5559:8)
at __require ([stdin]:39:50)
at [stdin]:6756:29
at runScriptInThisContext (node:internal/vm:209:10)
at node:internal/process/execution:118:14
at [stdin]-wrapper:6:24
Node.js v20.17.0
NX Ran target themes-generate for project grafana (11s)
_ 1/1 failed
_ 0/1 succeeded [0 read from cache]
[/code]
(Note - error is copied from an old build, but you get the same error with version 20.18.0)
I found that recompiling the latest version of nodejs-lts-iron (currently 20.18.0) without the [code]-O2[/code] CXXFLAGS fixes this. However, CXXFLAGS pulls from CFLAGS, so I removed it from there in [code]/etc/makepkg.conf[/code].
In other words, the default /etc/makepkg.conf section looks like this:
[code]
CPPFLAGS=""
CFLAGS="-march=armv8-a -O2 -pipe -fstack-protector-strong -fno-plt -fexceptions \
-Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security \
-fstack-clash-protection \
-fno-omit-frame-pointer -mno-omit-leaf-frame-pointer"
CXXFLAGS="$CFLAGS -Wp,-D_GLIBCXX_ASSERTIONS"
LDFLAGS="-Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now \
-Wl,-z,pack-relative-relocs"
LTOFLAGS=""
[/code]
I changed it to look like this:
[code]
CPPFLAGS=""
CFLAGS="-march=armv8-a -pipe -fstack-protector-strong -fno-plt -fexceptions \
-Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security \
-fstack-clash-protection \
-fno-omit-frame-pointer -mno-omit-leaf-frame-pointer"
CXXFLAGS="$CFLAGS -Wp,-D_GLIBCXX_ASSERTIONS"
LDFLAGS="-Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now \
-Wl,-z,pack-relative-relocs"
LTOFLAGS=""
[/code]
Do you think it would be a good idea / possible to create a custom PKGBUILD (that drops the -O2 flag) for nodejs-lts-iron and add it to the github repo for ArchLinux ARM given that this is such a small change? Would it be better to change the default flags in /etc/makepkg.conf? Or is this a bug that needs to be submitted upstream?