Skip to content

semaphore: set upstream build profile and set default branch to debian/master#31444

Merged
mrc0mmand merged 5 commits intosystemd:mainfrom
bluca:semaphore
Feb 28, 2024
Merged

semaphore: set upstream build profile and set default branch to debian/master#31444
mrc0mmand merged 5 commits intosystemd:mainfrom
bluca:semaphore

Conversation

@bluca
Copy link
Copy Markdown
Member

@bluca bluca commented Feb 22, 2024

Leave TEST_UPSTREAM=1 for now in case we switch branches via the hook

@mrc0mmand
Copy link
Copy Markdown
Member

I can actually reproduce this locally in a Bookworm container, if you give me a couple of minutes I should be able to conjure an exact reproducer.

@bluca
Copy link
Copy Markdown
Member Author

bluca commented Feb 22, 2024

I can actually reproduce this locally in a Bookworm container, if you give me a couple of minutes I should be able to conjure an exact reproducer.

Uh I tried and could not in a simple chroot - did you run it in lxc? I guess that's the only difference

@mrc0mmand
Copy link
Copy Markdown
Member

I can actually reproduce this locally in a Bookworm container, if you give me a couple of minutes I should be able to conjure an exact reproducer.

Uh I tried and could not in a simple chroot - did you run it in lxc? I guess that's the only difference

No, it's a simple podman container. I just compared the compiler options from the CI job with my local build and it looks like the right constellation of build options to trigger that issue is:

# rm -rf build
# meson build --werror --buildtype=plain -Dc_args="-flto=auto -ffat-lto-objects -O2"
# ninja -C build
...
../src/boot/efi/stub.c: In function 'load_addons.constprop.0':
../src/boot/efi/stub.c:475:40: error: using a dangling pointer to 'p' [-Werror=dangling-pointer=]
  475 |                         dt_bases[n_dt] = xmemdup((uint8_t*)loaded_addon->ImageBase + addrs[UNIFIED_SECTION_DTB],
      |                         ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  476 |                                                  dt_sizes[n_dt]);
      |                                                  ~~~~~~~~~~~~~~~
In file included from ../src/boot/efi/stub.c:20:
../src/boot/efi/util.h:33:15: note: 'p' declared here
   33 |         void *p;
      |               ^
cc1: all warnings being treated as errors

@bluca
Copy link
Copy Markdown
Member Author

bluca commented Feb 22, 2024

That's weird, I disabled LTO in one build and it still failed with the same error

@mrc0mmand
Copy link
Copy Markdown
Member

Looks like -flto=auto is not necessary at all, just -O2 -ffat-lto-objects seems to be enough.

@mrc0mmand
Copy link
Copy Markdown
Member

Looks like -flto=auto is not necessary at all, just -O2 -ffat-lto-objects seems to be enough.

Hah, scratch that, just -O2 seems to be enough:

# rm -rf build; meson build --werror --buildtype=plain -Dc_args=" -O2"; ninja -C build
...
rc/boot/efi/stub.c
../src/boot/efi/stub.c: In function 'load_addons.constprop':
../src/boot/efi/stub.c:475:40: error: using a dangling pointer to 'p' [-Werror=dangling-pointer=]
  475 |                         dt_bases[n_dt] = xmemdup((uint8_t*)loaded_addon->ImageBase + addrs[UNIFIED_SECTION_DTB],
      |                         ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  476 |                                                  dt_sizes[n_dt]);
      |                                                  ~~~~~~~~~~~~~~~
In file included from ../src/boot/efi/stub.c:20:
../src/boot/efi/util.h:33:15: note: 'p' declared here
   33 |         void *p;
      |               ^
cc1: all warnings being treated as errors
[643/2428] Compiling C object src/udev/libudev-core.a.p/udev-rules.c.o
ninja: build stopped: subcommand failed.

That would explain why disabling LTO didn't work.

@bluca
Copy link
Copy Markdown
Member Author

bluca commented Feb 22, 2024

Looks like de-inlining and initializing the var does the trick, thanks for the quick repro

@bluca bluca force-pushed the semaphore branch 5 times, most recently from 8295fdf to c27f600 Compare February 27, 2024 14:37
@bluca bluca marked this pull request as ready for review February 27, 2024 14:37
@github-actions github-actions bot added the please-review PR is ready for (re-)review by a maintainer label Feb 27, 2024
@bluca bluca added install and removed sd-boot/sd-stub/bootctl please-review PR is ready for (re-)review by a maintainer labels Feb 27, 2024
@bluca bluca added the please-review PR is ready for (re-)review by a maintainer label Feb 27, 2024
On ppc64el with gcc 13.2 on Ubuntu 24.04:

3s In file included from ../src/basic/macro.h:386,
483s                  from ../src/basic/alloc-util.h:10,
483s                  from ../src/shared/install.c:12:
483s ../src/shared/install.c: In function ‘install_changes_dump’:
483s ../src/shared/install.c:432:64: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
483s   432 |                         err = log_error_errno(changes[i].type, "Failed to %s unit, unit %s does not exist.",
483s       |                                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
483s ../src/shared/install.c:432:75: note: format string is defined here
483s   432 |                         err = log_error_errno(changes[i].type, "Failed to %s unit, unit %s does not exist.",
Required due to building with debian/master branch
…n/master

Leave TEST_UPSTREAM=1 for now in case we switch branches via the hook
@mrc0mmand
Copy link
Copy Markdown
Member

What's slightly worrying is that with this the Semaphore build seems to be ~10 minutes slower, and we're getting dangerously close to the 1h timeout, but I guess I can play with this later and disable LTO/optimizations when (if) needed.

@mrc0mmand mrc0mmand merged commit 78816ce into systemd:main Feb 28, 2024
@github-actions github-actions bot removed the please-review PR is ready for (re-)review by a maintainer label Feb 28, 2024
@bluca
Copy link
Copy Markdown
Member Author

bluca commented Feb 28, 2024

What's slightly worrying is that with this the Semaphore build seems to be ~10 minutes slower, and we're getting dangerously close to the 1h timeout, but I guess I can play with this later and disable LTO/optimizations when (if) needed.

Yeah there's a bunch of things that can be done, like disabling debug symbols packages/stripping, disabling LTO, disabling compression

@bluca bluca deleted the semaphore branch February 28, 2024 14:06
@mbiebl
Copy link
Copy Markdown
Contributor

mbiebl commented Feb 28, 2024

What's slightly worrying is that with this the Semaphore build seems to be ~10 minutes slower, and we're getting dangerously close to the 1h timeout, but I guess I can play with this later and disable LTO/optimizations when (if) needed.

I'm wondering, why those packaging changes would cause a 10min increase in runtime. That seems odd.

@bluca bluca linked an issue Mar 1, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

Systemd failed to compile when opening -O3

4 participants