# www/chromium fails to build



## einsibjani (Mar 2, 2022)

www/chromium fails to build for me.
The error in the log is:


```
[ 99% 49143/49382] python3 "../../build/toolchain/gcc_link_wrapper.py" --output="./mksnapshot" -- c++ -pie -fuse-ld=lld -Wl,--build-id=sha1 -fPIC -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--icf=all -Wl,--color-diagnostics -Wl,--no-call-graph-profile-sort -m64 -no-canonical-prefixes -rdynamic -pie -Wl,--disable-new-dtags -Wl,-O2 -Wl,--gc-sections  -fstack-protector-strong -L/usr/local/lib  -o "./mksnapshot" -Wl,--start-group @"./mksnapshot.rsp"  -Wl,--end-group  -lpthread -lexecinfo
[ 99% 49144/49382] python3 ../../v8/tools/run.py ./mksnapshot --turbo_instruction_scheduling --target_os=freebsd --target_arch=x64 --embedded_src gen/v8/embedded.S --embedded_variant Default --random-seed 314159265 --startup_blob snapshot_blob.bin --no-native-code-counters
FAILED: gen/v8/embedded.S snapshot_blob.bin
python3 ../../v8/tools/run.py ./mksnapshot --turbo_instruction_scheduling --target_os=freebsd --target_arch=x64 --embedded_src gen/v8/embedded.S --embedded_variant Default --random-seed 314159265 --startup_blob snapshot_blob.bin --no-native-code-counters
ninja: build stopped: subcommand failed.
===> Compilation failed unexpectedly.
```

I'm running poudriere-devel and this config:

```
ZPOOL=zroot
ZROOTFS=/poudriere
FREEBSD_HOST=https://download.freebsd.org
SVN_HOST=svn.freebsd.org
BASEFS=/usr/local/poudriere
POUDRIERE_DATA=/usr/local/poudriere/data
USE_PORTLINT=yes
USE_TMPFS="wrkdir data"
PKG_REPO_SIGNING_KEY=/usr/local/etc/poudriere.d/repo.key
KEEP_OLD_PACKAGES=yes
KEEP_OLD_PACKAGES_COUNT=10
MAX_EXECUTION_TIME=172800
NOHANG_TIME=7200
DISTFILES_CACHE=/usr/local/poudriere/distfiles

CCACHE_DIR=/var/cache/ccache



GIT_URL=https://xxxxx:xxxxxx@gitlab.isnic.is/is/nic/ports.git

# These limits are per-builder
TMPFS_LIMIT=32
MAX_MEMORY=32
MAX_FILES=1024

RESOLV_CONF=/etc/resolv.conf
CHECK_CHANGED_OPTIONS=verbose
CHECK_CHANGED_DEPS=yes
ATOMIC_PACKAGE_REPOSITORY=yes

ALLOW_MAKE_JOBS_PACKAGES="firefox llvm* node gcc* rust chromium"

PACKAGE_FETCH_BRANCH=latest
PACKAGE_FETCH_WHITELIST="chromium"
```

Any idea why the build is failing?


----------



## astyle (Mar 2, 2022)

Offhand, looking at your post, you seem to both try to build chromium and fetch a premade package:


einsibjani said:


> `PACKAGE_FETCH_WHITELIST="chromium"`


To troubleshoot properly, I'd suggest just straight make:

```
# cd /usr/ports/www/chromium
# script
# make && make package
# exit
```
Your poudriere config is *not* the issue here. Your issue will be hiding in /usr/ports/www/chromium/typescript once you run the troubleshooting commands I just pointed you to.


----------



## einsibjani (Mar 2, 2022)

Forgot to add this line from /var/log/messages:

Mar  2 22:14:31 pkgbuild kernel: pid 65888 (mksnapshot), jid 287, uid 0: exited on signal 5 (core dumped)


----------



## grahamperrin@ (Mar 3, 2022)

astyle said:


> Offhand, looking at your post, you seem to both try to build chromium and fetch a premade package: …



Part of the bigger picture might be clearer with these snippets, from the opening post of the parent topic:



einsibjani said:


> We have a poudriere server that builds all the packages we need on our servers..
> 
> (We want the) FreeBSD repository … only used to install chromium …



– (if I understand correctly), so a successful run of, for example, the command below _might_ be intended to:

fetch the available package for `www/chromium`; _and_
build (not fetch) the packages required for `www/chromium`.
`poudriere bulk -j 12amd64 -z default -p 12amd64_default www/chromium`

<https://github.com/freebsd/poudrier...6a964004873a2ef4edc6f22570f345270432R339-R342>


einsibjani a hint: your `PACKAGE_FETCH_BRANCH=latest` in poudriere.conf negates the need for `-b latest` at the command line.


----------



## grahamperrin@ (Mar 3, 2022)

einsibjani said:


> `Mar 2 22:14:31 pkgbuild kernel: pid 65888 (mksnapshot), jid 287, uid 0: exited on signal 5 (core dumped)`



Can you tell more about this computer? Physical or virtual? Its amount of memory; the exact version of FreeBSD; the version of ZFS; whether UFS is used; and so on. 

`freebsd-version -kru ; uname -aKU`
`pkg -vv | grep -e url -e enabled`

Also: 

`poudriere jail -i -j 12amd64`


----------



## zirias@ (Mar 3, 2022)

Signal 5 is a SIGTRAP, the chromium code is full of runtime checks causing that when the check fails. If you enable the `DEBUG` option, you will see an exact error message, which might be helpful for submitting a PR for the port.

I experienced a similar problem with the v8 snapshot builder in chromium 97 on 13.0/i386 and could quickly attribute it to chromium's custom "partition allocator", but even trying for days (with `poudriere testport -i`, you get the chance to analyze the `.core` with `lldb`), I wasn't able to identify the _actual_ problem... in chromium 98, it was solved again. This custom allocator is really a can of worms.

Maybe it's something simple -- could your building jail just run out of RAM? In this case, you could try to use these poudriere settings:

```
# List of package globs that are not allowed to use tmpfs for their WRKDIR
# Note that you *must* set TMPFS_BLACKLIST_TMPDIR
# EXAMPLE: TMPFS_BLACKLIST="rust"

# The host path where tmpfs-blacklisted packages can be built in.
# A temporary directory will be generated here and be null-mounted as the
# WRKDIR for any packages listed in TMPFS_BLACKLIST.
# EXAMPLE: TMPFS_BLACKLIST_TMPDIR=${BASEFS}/data/cache/tmp
```


----------



## einsibjani (Mar 4, 2022)

grahamperrin said:


> Can you tell more about this computer? Physical or virtual? Its amount of memory; the exact version of FreeBSD; the version of ZFS; whether UFS is used; and so on.
> 
> `freebsd-version -kru ; uname -aKU`
> `pkg -vv | grep -e url -e enabled`
> ...


It's a physical server with 128 GB RAM. 

```
$ freebsd-version -kru
13.0-RELEASE-p7
13.0-RELEASE-p7
13.0-RELEASE-p7

$ zpool version
zfs-2.0.0-FreeBSD_gf11b09dec
zfs-kmod-2.0.0-FreeBSD_gf11b09dec

$ pkg -vv|grep -e url -e enabled
    url             : "pkg+[URL]http://pkg.FreeBSD.org/FreeBSD:13:amd64/latest[/URL]",
    enabled         : yes,

$ poudriere jail -i -j 12amd64
Jail name:         12amd64
Jail version:      12.2-RELEASE-p13
Jail arch:         amd64
Jail method:       http
Jail mount:        /usr/local/poudriere/jails/12amd64
Jail fs:           zroot/poudriere/jails/12amd64
Jail updated:      2022-03-02 23:27:55
Jail pkgbase:      disabled
```


----------



## einsibjani (Mar 29, 2022)

For what it's worth, I've given up on building chromium.
I've tried everything I could think of and got lots of advice on things to try but it wouldn't build.

We were only building chromium to use with selenium for automated web tests, and our solution was to spin up a dedicated selenium VM which is configured to use upstream pkg repo.

Thank you all for your advice, unfortunately, it wasn't to be


----------

