ungoogled-software / ungoogled-chromium-debian

Debian, Ubuntu, and others packaging for ungoogled-chromium
386 stars 49 forks source link

focal : clang-10 used before it's installed by pkgProblemResolver #111

Closed marksolaris closed 4 years ago

marksolaris commented 4 years ago

The clang-10 tool is used in the debian/rules file, before it's eventually installed during the mk-build-deps process. It seems a bit chicken-and-egg. The software eventually ends up being installed, but a restart of the whole build process is required since unknown things were happening with the use of missing binaries. At the very least the README could use language to say restart again if the mk-build-deps adds more tools.

Following this process from the README:

# Final setup steps for debian/ directory
./debian/rules setup-debian

# Install remaining requirements to build Chromium
sudo mk-build-deps -i debian/control

This output is seen:

focal:/local/ungoogled-chromium/build/src root# ./debian/rules setup-debian
make: clang-10: Command not found

focal:/local/ungoogled-chromium/build/src/debian root# grep CC rules
export CC=clang-$(LLVM_VERSION)
RESOURCE_DIR:=$(shell $(CC) --print-resource-dir)

focal:/local/ungoogled-chromium/build/src root# sudo mk-build-deps -i debian/control
[...]
Unpacking ungoogled-chromium-build-deps (80.0.3987.162-1.sid1) ...
[...]
Correcting dependencies...Starting pkgProblemResolver with broken count: 0
Starting 2 pkgProblemResolver with broken count: 0
Done
 Done
Starting pkgProblemResolver with broken count: 0
Starting 2 pkgProblemResolver with broken count: 0
Done
The following additional packages will be installed:
  clang-10 libc-ares2 libclang-common-10-dev libnode64 lld-10 nodejs
Suggested packages:
  clang-10-doc npm
Recommended packages:
  libomp-10-dev nodejs-doc
The following NEW packages will be installed:
  clang-10 libc-ares2 libclang-common-10-dev libnode64 lld-10 nodejs

It can be argued that folks who choose to compile instead of apt install would know to fix and repeat, but then projects like this are full of similar logged Issues where first time users encounter the same gotchas.

As an FYI, this is my entire build cut-and-paste which resulted in the above output:

setenv UGTAG 80.0.3987.162-1.sid1
mkdir -p /local/ungoogled-chromium
cd /local/ungoogled-chromium/
rm -rf ungoogled-chromium-* build/src
git clone --recurse-submodules https://github.com/ungoogled-software/ungoogled-chromium-debian.git
git -C ungoogled-chromium-debian checkout --recurse-submodules ${UGTAG}
mkdir -p build/src
cp -r ungoogled-chromium-debian/debian build/src/
cd build/src
perl -n -i.bak -e 'print unless m/^ lld-9,$/' debian/control
perl -n -i.bak -e 'print unless m/^ python,$/' debian/control
./debian/rules setup-debian
sudo mk-build-deps -i debian/control
rm ungoogled-chromium-build-deps_*.deb
./debian/rules setup-local-src
setenv PATH "/root/bin:/usr/local/bin:/bin:/usr/ccs/bin:/etc:/usr/etc:/usr/bin:/usr/local/X11/bin:/usr/bin/X11:/usr/proc/bin:/usr/local/sbin:/sbin:/usr/local/go/bin:/root/go/bin:/usr/local/etc:/usr/sbin"
touch /local/ungoogled-chromium/compile_`date +%Y-%m-%d-%H:%m:%S`_start
dpkg-buildpackage -b -uc
touch /local/ungoogled-chromium/compile_`date +%Y-%m-%d-%H:%m:%S`_stop
cd ..
rm *-dbgsym_*
apt -y purge chromium-browser chromium-browser-l10n ungoogled-chromium-driver
apt -y purge ungoogled-chromium ungoogled-chromium-build-deps ungoogled-chromium-common
apt -y purge ungoogled-chromium-sandbox ungoogled-chromium-shell
dpkg -i \
    ungoogled-chromium-common_${UGTAG}_amd64.deb \
    ungoogled-chromium-driver_${UGTAG}_amd64.deb \
    ungoogled-chromium-sandbox_${UGTAG}_amd64.deb \
    ungoogled-chromium-shell_${UGTAG}_amd64.deb \
    ungoogled-chromium_${UGTAG}_amd64.deb
ghost commented 4 years ago

rules is a Makefile and that error is harmless as what it is used for isn't used except during the actual build where it would already be installed by mk-build-deps. The source upload instructions also specify to disable dependency checks because none of them are required to build the resulting tarball and just wastes time otherwise.

Eloston commented 4 years ago

Hmm I made a questionable decision to include setup-debian Makefile rule inside of debian/rules because debian/rules should only be used to create .deb packages (EDIT: and source packages I think), while setup-debian is not really a part of the build.

Perhaps a better implementation would be to have a setup.sh script alongside debian that copies debian to a user-specified destination (e.g. build/src), then performs the necessary modifications to make debian complete?

ghost commented 4 years ago

@Eloston while you're at it would it make sense to make the branch's distro also a text file? It would simplify the setting up of new branches.

Edit: already did it myself in my latest PR

ghost commented 4 years ago

I think it would be best if the makefile targets at the end, get-orig-source, setup-debian, and setup-local-src were all moved to an external shell script in some capacity. This would allow them to reuse a lot of their overlap while being moved out of the build scripts. @Eloston I can work on this after you approve my latest PRs.

Eloston commented 4 years ago

@braewoods

I can work on this after you approve my latest PRs.

That would be pretty helpful, thanks!