Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove problematic comments between package name in apt install #3060

Merged
merged 1 commit into from
Mar 3, 2025

Conversation

musaprg
Copy link
Contributor

@musaprg musaprg commented Jan 25, 2025

Description

This PR fixes an issue where several packages are not installed properly because of syntax error by unintended comments.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Performance improvement
  • Test updates
  • CI/CD related changes
  • Other (please describe):

Testing

  • Added new unit tests
  • Added new integration tests
  • Ran existing test suite
  • Tested manually (please provide steps)
  1. Open VSCode and press Cmd+Shift+P
  2. Type and click "Dev Containers: Rebuild Container Without Cache"
  3. Create a devcontainer after checking out this PR's branch
  4. Run just clean and cargo clean
  5. Run just lint and check it completes properly.

Related Issues

In devcontainer, we cannot build youki because of the following error.

Build error when executing `just lint`
error: failed to run custom build command for `libbpf-sys v1.5.0+v1.5.0`

Caused by:
  process didn't exit successfully: `/workspaces/youki/target/debug/build/libbpf-sys-29d574c8a895b7b8/build-script-build` (exit status: 101)
  --- stdout
  Using feature vendored-libbpf=true
  Using feature vendored-libelf=false
  Using feature vendored-zlib=false
  Using feature static-libbpf=true
  Using feature static-libelf=false
  Using feature static-zlib=false
  OPT_LEVEL = Some(0)
  TARGET = Some(aarch64-unknown-linux-gnu)
  OUT_DIR = Some(/workspaces/youki/target/aarch64-unknown-linux-gnu/debug/build/libbpf-sys-9d921a874c62a25e/out)
  HOST = Some(aarch64-unknown-linux-gnu)
  cargo:rerun-if-env-changed=CC_aarch64-unknown-linux-gnu
  CC_aarch64-unknown-linux-gnu = None
  cargo:rerun-if-env-changed=CC_aarch64_unknown_linux_gnu
  CC_aarch64_unknown_linux_gnu = None
  cargo:rerun-if-env-changed=HOST_CC
  HOST_CC = None
  cargo:rerun-if-env-changed=CC
  CC = None
  cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
  RUSTC_WRAPPER = None
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some(true)
  CARGO_CFG_TARGET_FEATURE = Some(neon)
  cargo:rerun-if-env-changed=CFLAGS_aarch64-unknown-linux-gnu
  CFLAGS_aarch64-unknown-linux-gnu = None
  cargo:rerun-if-env-changed=CFLAGS_aarch64_unknown_linux_gnu
  CFLAGS_aarch64_unknown_linux_gnu = None
  cargo:rerun-if-env-changed=HOST_CFLAGS
  HOST_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = None
  cargo:rerun-if-env-changed=LIBBPF_SYS_EXTRA_CFLAGS
    MKDIR    /workspaces/youki/target/aarch64-unknown-linux-gnu/debug/build/libbpf-sys-9d921a874c62a25e/out/obj/staticobjs
    INSTALL  bpf.h libbpf.h btf.h libbpf_common.h libbpf_legacy.h bpf_helpers.h bpf_helper_defs.h bpf_tracing.h bpf_endian.h bpf_core_read.h skel_internal.h libbpf_version.h usdt.bpf.h
    CC       /workspaces/youki/target/aarch64-unknown-linux-gnu/debug/build/libbpf-sys-9d921a874c62a25e/out/obj/staticobjs/bpf.o
    CC       /workspaces/youki/target/aarch64-unknown-linux-gnu/debug/build/libbpf-sys-9d921a874c62a25e/out/obj/staticobjs/btf.o
    CC       /workspaces/youki/target/aarch64-unknown-linux-gnu/debug/build/libbpf-sys-9d921a874c62a25e/out/obj/staticobjs/libbpf.o
    CC       /workspaces/youki/target/aarch64-unknown-linux-gnu/debug/build/libbpf-sys-9d921a874c62a25e/out/obj/staticobjs/netlink.o
    CC       /workspaces/youki/target/aarch64-unknown-linux-gnu/debug/build/libbpf-sys-9d921a874c62a25e/out/obj/staticobjs/nlattr.o
    CC       /workspaces/youki/target/aarch64-unknown-linux-gnu/debug/build/libbpf-sys-9d921a874c62a25e/out/obj/staticobjs/str_error.o
    CC       /workspaces/youki/target/aarch64-unknown-linux-gnu/debug/build/libbpf-sys-9d921a874c62a25e/out/obj/staticobjs/bpf_prog_linfo.o
    CC       /workspaces/youki/target/aarch64-unknown-linux-gnu/debug/build/libbpf-sys-9d921a874c62a25e/out/obj/staticobjs/libbpf_errno.o
    CC       /workspaces/youki/target/aarch64-unknown-linux-gnu/debug/build/libbpf-sys-9d921a874c62a25e/out/obj/staticobjs/libbpf_probes.o
    CC       /workspaces/youki/target/aarch64-unknown-linux-gnu/debug/build/libbpf-sys-9d921a874c62a25e/out/obj/staticobjs/btf_dump.o
    CC       /workspaces/youki/target/aarch64-unknown-linux-gnu/debug/build/libbpf-sys-9d921a874c62a25e/out/obj/staticobjs/hashmap.o

  --- stderr
  Package libelf was not found in the pkg-config search path.
  Perhaps you should add the directory containing `libelf.pc'
  to the PKG_CONFIG_PATH environment variable
  No package 'libelf' found
  In file included from bpf.c:37:
  libbpf_internal.h:20:10: fatal error: libelf.h: No such file or directory
     20 | #include <libelf.h>
        |          ^~~~~~~~~~
  In file included from nlattr.c:14:
  libbpf_internal.h:20:10: fatal error: libelf.h: No such file or directory
     20 | #include <libelf.h>
        |          ^~~~~~~~~~
  compilation terminated.
  compilation terminated.
  btf.c:18:10: fatal error: gelf.h: No such file or directory
     18 | #include <gelf.h>
        |          ^~~~~~~~
  compilation terminated.
  make: *** [Makefile:134: /workspaces/youki/target/aarch64-unknown-linux-gnu/debug/build/libbpf-sys-9d921a874c62a25e/out/obj/staticobjs/bpf.o] Error 1
  make: *** Waiting for unfinished jobs....
  make: *** [Makefile:134: /workspaces/youki/target/aarch64-unknown-linux-gnu/debug/build/libbpf-sys-9d921a874c62a25e/out/obj/staticobjs/btf.o] Error 1
  make: *** [Makefile:134: /workspaces/youki/target/aarch64-unknown-linux-gnu/debug/build/libbpf-sys-9d921a874c62a25e/out/obj/staticobjs/nlattr.o] Error 1
  In file included from bpf_prog_linfo.c:9:
  libbpf_internal.h:20:10: fatal error: libelf.h: No such file or directory
     20 | #include <libelf.h>
        |          ^~~~~~~~~~
  compilation terminated.
  make: *** [Makefile:134: /workspaces/youki/target/aarch64-unknown-linux-gnu/debug/build/libbpf-sys-9d921a874c62a25e/out/obj/staticobjs/bpf_prog_linfo.o] Error 1
  libbpf.c:46:10: fatal error: libelf.h: No such file or directory
     46 | #include <libelf.h>
        |          ^~~~~~~~~~
  compilation terminated.
  make: *** [Makefile:134: /workspaces/youki/target/aarch64-unknown-linux-gnu/debug/build/libbpf-sys-9d921a874c62a25e/out/obj/staticobjs/libbpf.o] Error 1
  In file included from netlink.c:19:
  libbpf_internal.h:20:10: fatal error: libelf.h: No such file or directory
     20 | #include <libelf.h>
        |          ^~~~~~~~~~
  compilation terminated.
  make: *** [Makefile:134: /workspaces/youki/target/aarch64-unknown-linux-gnu/debug/build/libbpf-sys-9d921a874c62a25e/out/obj/staticobjs/netlink.o] Error 1
  In file included from libbpf_errno.c:15:
  libbpf_internal.h:20:10: fatal error: libelf.h: No such file or directory
     20 | #include <libelf.h>
        |          ^~~~~~~~~~
  compilation terminated.
  make: *** [Makefile:134: /workspaces/youki/target/aarch64-unknown-linux-gnu/debug/build/libbpf-sys-9d921a874c62a25e/out/obj/staticobjs/libbpf_errno.o] Error 1
  In file included from libbpf_probes.c:19:
  libbpf_internal.h:20:10: fatal error: libelf.h: No such file or directory
     20 | #include <libelf.h>
        |          ^~~~~~~~~~
  compilation terminated.
  In file included from btf_dump.c:23:
  libbpf_internal.h:20:10: fatal error: libelf.h: No such file or directory
     20 | #include <libelf.h>
        |          ^~~~~~~~~~
  compilation terminated.
  make: *** [Makefile:134: /workspaces/youki/target/aarch64-unknown-linux-gnu/debug/build/libbpf-sys-9d921a874c62a25e/out/obj/staticobjs/libbpf_probes.o] Error 1
  make: *** [Makefile:134: /workspaces/youki/target/aarch64-unknown-linux-gnu/debug/build/libbpf-sys-9d921a874c62a25e/out/obj/staticobjs/btf_dump.o] Error 1
  thread 'main' panicked at /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/libbpf-sys-1.5.0+v1.5.0/build.rs:384:5:
  make failed
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: Recipe `lint` failed on line 130 with exit code 101

After I looked into the container, I've found that required packages were not installed properly even though they're specified in the Dockerfile.

vscode ➜ /workspaces/youki (main) $ sudo apt list | grep -e "libclang-dev" -e "libelf-dev" -e "libseccomp-dev" -e "libsystemd-d
ev" -e "bpftrace" -e "podman"

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

This seems probably because of the comments in the middle of the heredoc part.

...
RUN <<EOF
apt-get update
apt-get install -y \
  # For building        <-- syntaxtically wrong
  build-essential \
  git \
  libclang-dev \
  libelf-dev \
  libseccomp-dev \
  libssl-dev \
  libsystemd-dev \
  pkg-config \
  # For debugging        <-- syntaxtically wrong
  bpftrace \
  podman
...
execution result of the problematic part
vscode ➜ /workspaces/youki (main) $ apt-get install -y \
  # For building
  build-essential \
  git \
  libclang-dev \
  libelf-dev \
  libseccomp-dev \
  libssl-dev \
  libsystemd-dev \
  pkg-config \
  # For debugging
  bpftrace \
  podman
E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?
bash: build-essential: command not found
bash: bpftrace: command not found

The built image should be equivalent even after splitting package installation into two lines as they're in the single heredoc. This PR splits a heredoc part including installation commands so that we can easily see which packages would be intended to be installed for what.

Additional Context

@musaprg musaprg marked this pull request as ready for review January 26, 2025 10:21
@musaprg musaprg marked this pull request as draft January 26, 2025 10:27
@musaprg
Copy link
Contributor Author

musaprg commented Jan 26, 2025

hmm... still I got another error because of insufficient permissions.

error
error: failed to run custom build command for `libbpf-sys v1.5.0+v1.5.0`

Caused by:
  process didn't exit successfully: `/workspaces/youki/target/debug/build/libbpf-sys-29d574c8a895b7b8/build-script-build` (exit status: 101)
  --- stdout
  Using feature vendored-libbpf=true
  Using feature vendored-libelf=false
  Using feature vendored-zlib=false
  Using feature static-libbpf=true
  Using feature static-libelf=false
  Using feature static-zlib=false
  OPT_LEVEL = Some(0)
  TARGET = Some(aarch64-unknown-linux-gnu)
  OUT_DIR = Some(/workspaces/youki/target/aarch64-unknown-linux-gnu/debug/build/libbpf-sys-9d921a874c62a25e/out)
  HOST = Some(aarch64-unknown-linux-gnu)
  cargo:rerun-if-env-changed=CC_aarch64-unknown-linux-gnu
  CC_aarch64-unknown-linux-gnu = None
  cargo:rerun-if-env-changed=CC_aarch64_unknown_linux_gnu
  CC_aarch64_unknown_linux_gnu = None
  cargo:rerun-if-env-changed=HOST_CC
  HOST_CC = None
  cargo:rerun-if-env-changed=CC
  CC = None
  cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
  RUSTC_WRAPPER = None
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some(true)
  CARGO_CFG_TARGET_FEATURE = Some(neon)
  cargo:rerun-if-env-changed=CFLAGS_aarch64-unknown-linux-gnu
  CFLAGS_aarch64-unknown-linux-gnu = None
  cargo:rerun-if-env-changed=CFLAGS_aarch64_unknown_linux_gnu
  CFLAGS_aarch64_unknown_linux_gnu = None
  cargo:rerun-if-env-changed=HOST_CFLAGS
  HOST_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = None
  cargo:rerun-if-env-changed=LIBBPF_SYS_EXTRA_CFLAGS
    CC       /workspaces/youki/target/aarch64-unknown-linux-gnu/debug/build/libbpf-sys-9d921a874c62a25e/out/obj/staticobjs/btf_dump.o
    CC       /workspaces/youki/target/aarch64-unknown-linux-gnu/debug/build/libbpf-sys-9d921a874c62a25e/out/obj/staticobjs/ringbuf.o
    CC       /workspaces/youki/target/aarch64-unknown-linux-gnu/debug/build/libbpf-sys-9d921a874c62a25e/out/obj/staticobjs/hashmap.o
    CC       /workspaces/youki/target/aarch64-unknown-linux-gnu/debug/build/libbpf-sys-9d921a874c62a25e/out/obj/staticobjs/gen_loader.o
    CC       /workspaces/youki/target/aarch64-unknown-linux-gnu/debug/build/libbpf-sys-9d921a874c62a25e/out/obj/staticobjs/relo_core.o
    CC       /workspaces/youki/target/aarch64-unknown-linux-gnu/debug/build/libbpf-sys-9d921a874c62a25e/out/obj/staticobjs/strset.o
    CC       /workspaces/youki/target/aarch64-unknown-linux-gnu/debug/build/libbpf-sys-9d921a874c62a25e/out/obj/staticobjs/linker.o
    CC       /workspaces/youki/target/aarch64-unknown-linux-gnu/debug/build/libbpf-sys-9d921a874c62a25e/out/obj/staticobjs/usdt.o
    CC       /workspaces/youki/target/aarch64-unknown-linux-gnu/debug/build/libbpf-sys-9d921a874c62a25e/out/obj/staticobjs/elf.o
    CC       /workspaces/youki/target/aarch64-unknown-linux-gnu/debug/build/libbpf-sys-9d921a874c62a25e/out/obj/staticobjs/zip.o
    CC       /workspaces/youki/target/aarch64-unknown-linux-gnu/debug/build/libbpf-sys-9d921a874c62a25e/out/obj/staticobjs/features.o
    CC       /workspaces/youki/target/aarch64-unknown-linux-gnu/debug/build/libbpf-sys-9d921a874c62a25e/out/obj/staticobjs/btf_iter.o
    CC       /workspaces/youki/target/aarch64-unknown-linux-gnu/debug/build/libbpf-sys-9d921a874c62a25e/out/obj/staticobjs/btf_relocate.o
    INSTALL  bpf.h libbpf.h btf.h libbpf_common.h libbpf_legacy.h bpf_helpers.h bpf_helper_defs.h bpf_tracing.h bpf_endian.h bpf_core_read.h skel_internal.h libbpf_version.h usdt.bpf.h

  --- stderr
  ringbuf.c: In function ‘ringbuf_process_ring’:
  ringbuf.c:272:12: warning: comparison of integer expressions of different signedness: ‘int64_t’ {aka ‘long int’} and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
    272 |    if (cnt >= n)
        |            ^~
  ringbuf.c: In function ‘ring_buffer__ring’:
  ringbuf.c:367:10: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]
    367 |  if (idx >= rb->ring_cnt)
        |          ^~
  btf_dump.c: In function ‘pfx’:
  btf_dump.c:30:13: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘const long unsigned int’} [-Wsign-compare]
     30 |  return lvl >= PREFIX_CNT ? PREFIXES : &PREFIXES[PREFIX_CNT - lvl];
        |             ^~
  btf_dump.c: In function ‘str_hash_fn’:
  btf_dump.c:121:43: warning: unused parameter ‘ctx’ [-Wunused-parameter]
    121 | static size_t str_hash_fn(long key, void *ctx)
        |                                     ~~~~~~^~~
  btf_dump.c: In function ‘str_equal_fn’:
  btf_dump.c:126:48: warning: unused parameter ‘ctx’ [-Wunused-parameter]
    126 | static bool str_equal_fn(long a, long b, void *ctx)
        |                                          ~~~~~~^~~
  ringbuf.c: At top level:
  cc1: note: unrecognized command-line option ‘-Wno-unknown-warning-option’ may have been intended to silence earlier diagnostics
  btf_dump.c: In function ‘btf_is_struct_packed’:
  btf_dump.c:833:63: warning: unused parameter ‘id’ [-Wunused-parameter]
    833 | static bool btf_is_struct_packed(const struct btf *btf, __u32 id,
        |                                                         ~~~~~~^~
  btf_dump.c: In function ‘btf_dump_emit_bit_padding’:
  btf_dump.c:894:16: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Wsign-compare]
    894 |  for (i = 0; i < ARRAY_SIZE(pads); i++) {
        |                ^
  btf_dump.c: In function ‘btf_dump_emit_missing_aliases’:
  btf_dump.c:1046:16: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Wsign-compare]
   1046 |  for (i = 0; i < ARRAY_SIZE(missing_base_types); i++) {
        |                ^
  In file included from gen_loader.c:15:
  skel_internal.h: In function ‘skel_free_map_data’:
  skel_internal.h:179:54: warning: unused parameter ‘addr’ [-Wunused-parameter]
    179 | static inline void skel_free_map_data(void *p, __u64 addr, size_t sz)
        |                                                ~~~~~~^~~~
  gen_loader.c: In function ‘bpf_gen__init’:
  gen_loader.c:144:16: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
    144 |  for (i = 0; i < nr_progs_sz; i += 4) {
        |                ^
  gen_loader.c: In function ‘bpf_gen__finish’:
  gen_loader.c:374:15: warning: comparison of integer expressions of different signedness: ‘int’ and ‘__u32’ {aka ‘unsigned int’} [-Wsign-compare]
    374 |  if (nr_progs < gen->nr_progs || nr_maps != gen->nr_maps) {
        |               ^
  gen_loader.c:374:42: warning: comparison of integer expressions of different signedness: ‘int’ and ‘__u32’ {aka ‘unsigned int’} [-Wsign-compare]
    374 |  if (nr_progs < gen->nr_progs || nr_maps != gen->nr_maps) {
        |                                          ^~
  gen_loader.c:381:16: warning: comparison of integer expressions of different signedness: ‘int’ and ‘__u32’ {aka ‘unsigned int’} [-Wsign-compare]
    381 |  for (i = 0; i < gen->nr_progs; i++)
        |                ^
  gen_loader.c:388:16: warning: comparison of integer expressions of different signedness: ‘int’ and ‘__u32’ {aka ‘unsigned int’} [-Wsign-compare]
    388 |  for (i = 0; i < gen->nr_maps; i++)
        |                ^
  gen_loader.c: In function ‘bpf_gen__map_create’:
  btf_dump.c:1041:31: warning: unused parameter ‘t’ [-Wunused-parameter]
   1041 |        const struct btf_type *t)
        |        ~~~~~~~~~~~~~~~~~~~~~~~^
  btf_dump.c: In function ‘btf_dump_emit_enum_fwd’:
  gen_loader.c:545:21: warning: comparison of integer expressions of different signedness: ‘int’ and ‘__u32’ {aka ‘unsigned int’} [-Wsign-compare]
    545 |  } else if (map_idx != gen->nr_maps) {
        |                     ^~
  gen_loader.c: In function ‘bpf_gen__record_attach_target’:
  btf_dump.c:1056:31: warning: unused parameter ‘t’ [-Wunused-parameter]
   1056 |        const struct btf_type *t)
        |        ~~~~~~~~~~~~~~~~~~~~~~~^
  gen_loader.c:569:10: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Wsign-compare]
    569 |  if (ret >= sizeof(gen->attach_target))
        |          ^~
  gen_loader.c: In function ‘get_ksym_desc’:
  gen_loader.c:622:16: warning: comparison of integer expressions of different signedness: ‘int’ and ‘__u32’ {aka ‘unsigned int’} [-Wsign-compare]
    622 |  for (i = 0; i < gen->nr_ksyms; i++) {
        |                ^
  gen_loader.c: In function ‘cleanup_relos’:
  gen_loader.c:940:16: warning: comparison of integer expressions of different signedness: ‘int’ and ‘__u32’ {aka ‘unsigned int’} [-Wsign-compare]
    940 |  for (i = 0; i < gen->nr_ksyms; i++) {
        |                ^
  gen_loader.c:935:52: warning: unused parameter ‘insns’ [-Wunused-parameter]
    935 | static void cleanup_relos(struct bpf_gen *gen, int insns)
        |                                                ~~~~^~~~~
  gen_loader.c: In function ‘info_blob_bswap’:
  gen_loader.c:976:16: warning: comparison of integer expressions of different signedness: ‘int’ and ‘__u32’ {aka ‘unsigned int’} [-Wsign-compare]
    976 |  for (i = 0; i < load_attr->func_info_cnt; i++)
        |                ^
  gen_loader.c:979:16: warning: comparison of integer expressions of different signedness: ‘int’ and ‘__u32’ {aka ‘unsigned int’} [-Wsign-compare]
    979 |  for (i = 0; i < load_attr->line_info_cnt; i++)
        |                ^
  gen_loader.c: In function ‘bpf_gen__prog_load’:
  gen_loader.c:1014:17: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
   1014 |   for (i = 0; i < insn_cnt; i++, insn++)
        |                 ^
  usdt.c: In function ‘parse_elf_segs’:
  linker.c: In function ‘linker_load_obj_file’:
  btf_dump.c: In function ‘btf_dump_name_dups’:
  btf_dump.c:1634:51: warning: unused parameter ‘d’ [-Wunused-parameter]
   1634 | static size_t btf_dump_name_dups(struct btf_dump *d, struct hashmap *name_map,
        |                                  ~~~~~~~~~~~~~~~~~^
  usdt.c:415:16: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
    415 |  for (i = 0; i < n; i++) {
        |                ^
  btf_dump.c: In function ‘btf_dump_unsupported_data’:
  usdt.c: In function ‘find_elf_seg’:
  btf_dump.c:1742:16: warning: unused parameter ‘id’ [-Wunused-parameter]
   1742 |          __u32 id)
        |          ~~~~~~^~
  usdt.c:549:28: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
    549 |  for (i = 0, seg = segs; i < seg_cnt; i++, seg++) {
        |                            ^
  usdt.c: In function ‘find_vma_seg’:
  usdt.c:565:28: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
    565 |  for (i = 0, seg = segs; i < seg_cnt; i++, seg++) {
        |                            ^
  btf_dump.c: In function ‘btf_dump_get_bitfield_value’:
  btf_dump.c:1748:57: warning: unused parameter ‘d’ [-Wunused-parameter]
   1748 | static int btf_dump_get_bitfield_value(struct btf_dump *d,
        |                                        ~~~~~~~~~~~~~~~~~^
  btf_dump.c: In function ‘btf_dump_int_data’:
  usdt.c: In function ‘bpf_link_usdt_detach’:
  btf_dump.c:1873:20: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Wsign-compare]
   1873 |  if (sz == 0 || sz > sizeof(buf)) {
        |                    ^
  usdt.c:830:16: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
    830 |  for (i = 0; i < usdt_link->uprobe_cnt; i++) {
        |                ^
  usdt.c: In function ‘specs_hash_fn’:
  usdt.c:890:45: warning: unused parameter ‘ctx’ [-Wunused-parameter]
    890 | static size_t specs_hash_fn(long key, void *ctx)
        |                                       ~~~~~~^~~
  usdt.c: In function ‘specs_equal_fn’:
  btf_dump.c:1866:14: warning: unused parameter ‘bits_offset’ [-Wunused-parameter]
   1866 |         __u8 bits_offset)
        |         ~~~~~^~~~~~~~~~~
  usdt.c:895:56: warning: unused parameter ‘ctx’ [-Wunused-parameter]
    895 | static bool specs_equal_fn(long key1, long key2, void *ctx)
        |                                                  ~~~~~~^~~
  btf_dump.c: In function ‘btf_dump_var_data’:
  btf_dump.c:1995:15: warning: unused parameter ‘id’ [-Wunused-parameter]
   1995 |         __u32 id,
        |         ~~~~~~^~
  btf_dump.c: In function ‘btf_dump_struct_data’:
  btf_dump.c:2091:11: warning: unused parameter ‘id’ [-Wunused-parameter]
   2091 |     __u32 id,
        |     ~~~~~~^~
  btf_dump.c: In function ‘btf_dump_ptr_data’:
  btf_dump.c:2136:33: warning: unused parameter ‘t’ [-Wunused-parameter]
   2136 |          const struct btf_type *t,
        |          ~~~~~~~~~~~~~~~~~~~~~~~^
  btf_dump.c: In function ‘btf_dump_enum_data’:
  usdt.c: In function ‘usdt_manager_attach_usdt’:
  strset.c: In function ‘strset__new’:
  linker.c:537:40: warning: unused parameter ‘opts’ [-Wunused-parameter]
    537 |     const struct bpf_linker_file_opts *opts,
        |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
  linker.c: In function ‘linker_sanity_check_elf_symtab’:
  linker.c:807:48: warning: comparison of integer expressions of different signedness: ‘Elf64_Word’ {aka ‘unsigned int’} and ‘int’ [-Wsign-compare]
    807 |  if (!sec->shdr->sh_link || sec->shdr->sh_link >= obj->sec_cnt) {
        |                                                ^~
  linker.c: In function ‘linker_sanity_check_elf_relos’:
  linker.c:889:48: warning: comparison of integer expressions of different signedness: ‘Elf64_Word’ {aka ‘unsigned int’} and ‘int’ [-Wsign-compare]
    889 |  if (!sec->shdr->sh_info || sec->shdr->sh_info >= obj->sec_cnt) {
        |                                                ^~
  linker.c: In function ‘linker_sanity_check_btf’:
  linker.c:990:17: warning: comparison of integer expressions of different signedness: ‘__u32’ {aka ‘unsigned int’} and ‘int’ [-Wsign-compare]
    990 |    if (*type_id >= n)
        |                 ^~
  strset.c:66:21: warning: comparison of integer expressions of different signedness: ‘long int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
     66 |   for (off = 0; off < set->strs_data_len; off += strlen(set->strs_data + off) + 1) {
        |                     ^
  linker.c: In function ‘sec_content_is_same’:
  linker.c:1119:22: warning: comparison of integer expressions of different signedness: ‘int’ and ‘Elf64_Xword’ {aka ‘long unsigned int’} [-Wsign-compare]
   1119 |  if (dst_sec->sec_sz != src_sec->shdr->sh_size)
        |                      ^~
  linker.c: In function ‘glob_map_defs_match’:
  linker.c:1651:37: warning: unused parameter ‘sym’ [-Wunused-parameter]
   1651 |     struct src_obj *obj, Elf64_Sym *sym, int btf_id)
        |                          ~~~~~~~~~~~^~~
  linker.c: In function ‘glob_syms_match’:
  linker.c:1691:52: warning: unused parameter ‘sym_idx’ [-Wunused-parameter]
   1691 |        struct src_obj *obj, Elf64_Sym *sym, size_t sym_idx, int btf_id)
        |                                             ~~~~~~~^~~~~~~
  btf_dump.c:2221:14: warning: comparison of integer expressions of different signedness: ‘__s64’ {aka ‘long long int’} and ‘__u64’ {aka ‘long long unsigned int’} [-Wsign-compare]
   2221 |    if (value != btf_enum64_value(e))
        |              ^~
  usdt.c:1030:16: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
   1030 |  for (i = 0; i < target_cnt; i++) {
        |                ^
  relo_core.c: In function ‘is_flex_arr’:
  btf_dump.c: In function ‘btf_dump_datasec_data’:
  btf_dump.c:2235:12: warning: unused parameter ‘id’ [-Wunused-parameter]
   2235 |      __u32 id,
        |      ~~~~~~^~
  relo_core.c:83:18: warning: comparison of integer expressions of different signedness: ‘__u32’ {aka ‘const unsigned int’} and ‘int’ [-Wsign-compare]
     83 |  return acc->idx == btf_vlen(t) - 1;
        |                  ^~
  usdt.c: In function ‘parse_usdt_note’:
  usdt.c:1133:33: warning: unused parameter ‘elf’ [-Wunused-parameter]
   1133 | static int parse_usdt_note(Elf *elf, const char *path, GElf_Nhdr *nhdr,
        |                            ~~~~~^~~
  btf_dump.c: In function ‘btf_dump_type_data_check_zero’:
  usdt.c:1133:50: warning: unused parameter ‘path’ [-Wunused-parameter]
   1133 | static int parse_usdt_note(Elf *elf, const char *path, GElf_Nhdr *nhdr,
        |                                      ~~~~~~~~~~~~^~~~
  btf_dump.c:2369:17: warning: comparison of integer expressions of different signedness: ‘int’ and ‘__u32’ {aka ‘const unsigned int’} [-Wsign-compare]
   2369 |   for (i = 0; i < array->nelems; i++) {
        |                 ^
  relo_core.c: In function ‘bpf_core_parse_spec’:
  relo_core.c:374:28: warning: comparison of integer expressions of different signedness: ‘int’ and ‘__u32’ {aka ‘const unsigned int’} [-Wsign-compare]
    374 |    if (!flex && access_idx >= a->nelems)
        |                            ^~
  relo_core.c: In function ‘bpf_core_patch_insn’:
  linker.c: In function ‘find_glob_sym_btf’:
  linker.c:1772:25: warning: comparison of integer expressions of different signedness: ‘int’ and ‘__u32’ {aka ‘const unsigned int’} [-Wsign-compare]
   1772 |    if (btf_id && btf_id != vi->type) {
        |                         ^~
  linker.c:1727:62: warning: unused parameter ‘sym’ [-Wunused-parameter]
   1727 | static int find_glob_sym_btf(struct src_obj *obj, Elf64_Sym *sym, const char *sym_name,
        |                                                   ~~~~~~~~~~~^~~
  relo_core.c:1052:34: warning: comparison of integer expressions of different signedness: ‘__s32’ {aka ‘int’} and ‘__u64’ {aka ‘long long unsigned int’} [-Wsign-compare]
   1052 |   if (res->validate && insn->imm != orig_val) {
        |                                  ^~
  relo_core.c:1068:34: warning: comparison of integer expressions of different signedness: ‘__s16’ {aka ‘short int’} and ‘__u64’ {aka ‘long long unsigned int’} [-Wsign-compare]
   1068 |   if (res->validate && insn->off != orig_val) {
        |                                  ^~
  relo_core.c:1096:22: warning: comparison of integer expressions of different signedness: ‘int’ and ‘__u32’ {aka ‘const unsigned int’} [-Wsign-compare]
   1096 |    if (insn_bytes_sz != res->orig_sz) {
        |                      ^~
  relo_core.c:1025:46: warning: unused parameter ‘relo’ [-Wunused-parameter]
   1025 |    int insn_idx, const struct bpf_core_relo *relo,
        |                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
  relo_core.c: In function ‘bpf_core_format_spec’:
  relo_core.c:1168:9: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
   1168 |   if (r >= buf_sz)    \
        |         ^~
  relo_core.c:1178:2: note: in expansion of macro ‘append_buf’
   1178 |  append_buf("<%s> [%u] %s %s",
        |  ^~~~~~~~~~
  relo_core.c:1168:9: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
   1168 |   if (r >= buf_sz)    \
        |         ^~
  relo_core.c:1194:4: note: in expansion of macro ‘append_buf’
   1194 |    append_buf(fmt_str, s, e->val);
        |    ^~~~~~~~~~
  relo_core.c:1168:9: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
   1168 |   if (r >= buf_sz)    \
        |         ^~
  relo_core.c:1202:4: note: in expansion of macro ‘append_buf’
   1202 |    append_buf(fmt_str, s, (unsigned long long)btf_enum64_value(e));
        |    ^~~~~~~~~~
  relo_core.c:1168:9: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
   1168 |   if (r >= buf_sz)    \
        |         ^~
  relo_core.c:1210:5: note: in expansion of macro ‘append_buf’
   1210 |     append_buf(".%s", spec->spec[i].name);
        |     ^~~~~~~~~~
  relo_core.c:1168:9: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
   1168 |   if (r >= buf_sz)    \
        |         ^~
  relo_core.c:1212:5: note: in expansion of macro ‘append_buf’
   1212 |     append_buf("[%u]", spec->spec[i].idx);
        |     ^~~~~~~~~~
  relo_core.c:1168:9: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
   1168 |   if (r >= buf_sz)    \
        |         ^~
  relo_core.c:1215:3: note: in expansion of macro ‘append_buf’
   1215 |   append_buf(" (");
        |   ^~~~~~~~~~
  relo_core.c:1168:9: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
   1168 |   if (r >= buf_sz)    \
        |         ^~
  relo_core.c:1217:4: note: in expansion of macro ‘append_buf’
   1217 |    append_buf("%s%d", i == 0 ? "" : ":", spec->raw_spec[i]);
        |    ^~~~~~~~~~
  relo_core.c:1168:9: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
   1168 |   if (r >= buf_sz)    \
        |         ^~
  relo_core.c:1220:4: note: in expansion of macro ‘append_buf’
   1220 |    append_buf(" @ offset %u.%u)", spec->bit_offset / 8, spec->bit_offset % 8);
        |    ^~~~~~~~~~
  relo_core.c:1168:9: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
   1168 |   if (r >= buf_sz)    \
        |         ^~
  relo_core.c:1222:4: note: in expansion of macro ‘append_buf’
   1222 |    append_buf(" @ offset %u)", spec->bit_offset / 8);
        |    ^~~~~~~~~~
  strset.c: At top level:
  cc1: note: unrecognized command-line option ‘-Wno-unknown-warning-option’ may have been intended to silence earlier diagnostics
  elf.c: In function ‘elf_find_next_scn_by_type’:
  elf.c:72:18: warning: comparison of integer expressions of different signedness: ‘Elf64_Word’ {aka ‘unsigned int’} and ‘int’ [-Wsign-compare]
     72 |   if (sh.sh_type == sh_type)
        |                  ^~
  elf.c: In function ‘elf_find_func_offset’:
  linker.c: In function ‘linker_append_btf_ext’:
  elf.c:314:16: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Wsign-compare]
    314 |  for (i = 0; i < ARRAY_SIZE(sh_types); i++) {
        |                ^
  elf.c:334:29: warning: comparison of integer expressions of different signedness: ‘long unsigned int’ and ‘long int’ [-Wsign-compare]
    334 |     if (elf_sym_offset(sym) == ret) {
        |                             ^~
  linker.c:2537:33: warning: comparison of integer expressions of different signedness: ‘__u32’ {aka ‘unsigned int’} and ‘int’ [-Wsign-compare]
   2537 |   if (dst_sec->func_info.rec_sz != rec_sz) {
        |                                 ^~
  elf.c: In function ‘elf_resolve_syms_offsets’:
  In file included from linker.c:21:
  libbpf_internal.h:442:9: warning: comparison of integer expressions of different signedness: ‘int’ and ‘__u32’ {aka ‘const unsigned int’} [-Wsign-compare]
    442 |       i < (sec)->num_info;     \
        |         ^
  linker.c:2542:3: note: in expansion of macro ‘for_each_btf_ext_rec’
   2542 |   for_each_btf_ext_rec(&obj->btf_ext->func_info, ext_sec, i, src_rec) {
        |   ^~~~~~~~~~~~~~~~~~~~
  elf.c:439:16: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Wsign-compare]
    439 |  for (i = 0; i < ARRAY_SIZE(sh_types); i++) {
        |                ^
  elf.c: In function ‘elf_resolve_pattern_offsets’:
  elf.c:520:16: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Wsign-compare]
    520 |  for (i = 0; i < ARRAY_SIZE(sh_types); i++) {
        |                ^
  In file included from /usr/include/stdio.h:33,
                   from libbpf.h:14,
                   from libbpf_internal.h:43,
                   from btf_iter.c:13:
  btf_iter.c: In function ‘btf_field_iter_init’:
  btf_iter.c:44:61: warning: missing initializer for field ‘m_sz’ of ‘struct btf_field_desc’ [-Wmissing-field-initializers]
     44 |    it->desc = (struct btf_field_desc) { 1, {offsetof(struct btf_type, type)} };
        |                                                             ^~~~~~~~
  In file included from btf_iter.c:13:
  libbpf_internal.h:552:6: note: ‘m_sz’ declared here
    552 |  int m_sz;
        |      ^~~~
  btf_iter.c:50:4: warning: missing initializer for field ‘m_sz’ of ‘struct btf_field_desc’ [-Wmissing-field-initializers]
     50 |    };
        |    ^
  In file included from btf_iter.c:13:
  libbpf_internal.h:552:6: note: ‘m_sz’ declared here
    552 |  int m_sz;
        |      ^~~~
  btf_iter.c:99:4: warning: missing initializer for field ‘m_sz’ of ‘struct btf_field_desc’ [-Wmissing-field-initializers]
     99 |    };
        |    ^
  In file included from btf_iter.c:13:
  libbpf_internal.h:552:6: note: ‘m_sz’ declared here
    552 |  int m_sz;
        |      ^~~~
  linker.c:2566:33: warning: comparison of integer expressions of different signedness: ‘__u32’ {aka ‘unsigned int’} and ‘int’ [-Wsign-compare]
   2566 |   if (dst_sec->line_info.rec_sz != rec_sz) {
        |                                 ^~
  In file included from linker.c:21:
  libbpf_internal.h:442:9: warning: comparison of integer expressions of different signedness: ‘int’ and ‘__u32’ {aka ‘const unsigned int’} [-Wsign-compare]
    442 |       i < (sec)->num_info;     \
        |         ^
  linker.c:2571:3: note: in expansion of macro ‘for_each_btf_ext_rec’
   2571 |   for_each_btf_ext_rec(&obj->btf_ext->line_info, ext_sec, i, src_rec) {
        |   ^~~~~~~~~~~~~~~~~~~~
  linker.c:2608:38: warning: comparison of integer expressions of different signedness: ‘__u32’ {aka ‘unsigned int’} and ‘int’ [-Wsign-compare]
   2608 |   if (dst_sec->core_relo_info.rec_sz != rec_sz) {
        |                                      ^~
  In file included from linker.c:21:
  libbpf_internal.h:442:9: warning: comparison of integer expressions of different signedness: ‘int’ and ‘__u32’ {aka ‘const unsigned int’} [-Wsign-compare]
    442 |       i < (sec)->num_info;     \
        |         ^
  linker.c:2613:3: note: in expansion of macro ‘for_each_btf_ext_rec’
   2613 |   for_each_btf_ext_rec(&obj->btf_ext->core_relo_info, ext_sec, i, src_rec) {
        |   ^~~~~~~~~~~~~~~~~~~~
  install: btf_iter.c: At top level:
  cc1: note: unrecognized command-line option ‘-Wno-unknown-warning-option’ may have been intended to silence earlier diagnostics
  setting permissions for ‘/workspaces/youki/target/aarch64-unknown-linux-gnu/debug/build/libbpf-sys-9d921a874c62a25e/out//include/bpf/bpf.h’: Operation not permitted
  install: setting permissions for ‘/workspaces/youki/target/aarch64-unknown-linux-gnu/debug/build/libbpf-sys-9d921a874c62a25e/out//include/bpf/libbpf.h’: Operation not permitted
  install: setting permissions for ‘/workspaces/youki/target/aarch64-unknown-linux-gnu/debug/build/libbpf-sys-9d921a874c62a25e/out//include/bpf/btf.h’: Operation not permitted
  install: setting permissions for ‘/workspaces/youki/target/aarch64-unknown-linux-gnu/debug/build/libbpf-sys-9d921a874c62a25e/out//include/bpf/libbpf_common.h’: Operation not permitted
  install: setting permissions for ‘/workspaces/youki/target/aarch64-unknown-linux-gnu/debug/build/libbpf-sys-9d921a874c62a25e/out//include/bpf/libbpf_legacy.h’: Operation not permitted
  install: setting permissions for ‘/workspaces/youki/target/aarch64-unknown-linux-gnu/debug/build/libbpf-sys-9d921a874c62a25e/out//include/bpf/bpf_helpers.h’: Operation not permitted
  install: setting permissions for ‘/workspaces/youki/target/aarch64-unknown-linux-gnu/debug/build/libbpf-sys-9d921a874c62a25e/out//include/bpf/bpf_helper_defs.h’: Operation not permitted
  install: setting permissions for ‘/workspaces/youki/target/aarch64-unknown-linux-gnu/debug/build/libbpf-sys-9d921a874c62a25e/out//include/bpf/bpf_tracing.h’: Operation not permitted
  install: setting permissions for ‘/workspaces/youki/target/aarch64-unknown-linux-gnu/debug/build/libbpf-sys-9d921a874c62a25e/out//include/bpf/bpf_endian.h’: Operation not permitted
  install: elf.c: At top level:
  setting permissions for ‘/workspaces/youki/target/aarch64-unknown-linux-gnu/debug/build/libbpf-sys-9d921a874c62a25e/out//include/bpf/bpf_core_read.h’: Operation not permitted
  install: setting permissions for ‘/workspaces/youki/target/aarch64-unknown-linux-gnu/debug/build/libbpf-sys-9d921a874c62a25e/out//include/bpf/skel_internal.h’: Operation not permitted
  install: setting permissions for ‘/workspaces/youki/target/aarch64-unknown-linux-gnu/debug/build/libbpf-sys-9d921a874c62a25e/out//include/bpf/libbpf_version.h’: Operation not permitted
  install: setting permissions for ‘/workspaces/youki/target/aarch64-unknown-linux-gnu/debug/build/libbpf-sys-9d921a874c62a25e/out//include/bpf/usdt.bpf.h’: Operation not permitted
  make: *** [Makefile:161: install_headers] Error 1
  make: *** Waiting for unfinished jobs....
  cc1: note: unrecognized command-line option ‘-Wno-unknown-warning-option’ may have been intended to silence earlier diagnostics
  btf_relocate.c: In function ‘btf_relocate_rewrite_strs’:
  btf_relocate.c:426:16: warning: comparison of integer expressions of different signedness: ‘__u32’ {aka ‘unsigned int’} and ‘int’ [-Wsign-compare]
    426 |   if (*str_off >= r->dist_str_len) {
        |                ^~
  usdt.c: At top level:
  cc1: note: unrecognized command-line option ‘-Wno-unknown-warning-option’ may have been intended to silence earlier diagnostics
  gen_loader.c: At top level:
  cc1: note: unrecognized command-line option ‘-Wno-unknown-warning-option’ may have been intended to silence earlier diagnostics
  btf_relocate.c: At top level:
  cc1: note: unrecognized command-line option ‘-Wno-unknown-warning-option’ may have been intended to silence earlier diagnostics
  relo_core.c: At top level:
  cc1: note: unrecognized command-line option ‘-Wno-unknown-warning-option’ may have been intended to silence earlier diagnostics
  btf_dump.c: At top level:
  cc1: note: unrecognized command-line option ‘-Wno-unknown-warning-option’ may have been intended to silence earlier diagnostics
  linker.c: At top level:
  cc1: note: unrecognized command-line option ‘-Wno-unknown-warning-option’ may have been intended to silence earlier diagnostics
  thread 'main' panicked at /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/libbpf-sys-1.5.0+v1.5.0/build.rs:384:5:
  make failed
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: Recipe `lint` failed on line 130 with exit code 101

@musaprg musaprg force-pushed the fix-devcontainer-issue branch from 0a7daa4 to 8de549f Compare January 27, 2025 04:10
@musaprg
Copy link
Contributor Author

musaprg commented Jan 27, 2025

I've tried the following configuration, but it didn't work.

diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json
index d2945b19..60ad6e20 100644
--- a/.devcontainer/devcontainer.json
+++ b/.devcontainer/devcontainer.json
@@ -31,5 +31,8 @@
        ],
        "build": {
                "dockerfile": "Dockerfile"
-       }
+       },
+       "remoteUser": "vscode",
+       "containerUser": "vscode",
+       "postAttachCommand": "sudo chown -R vscode /workspaces"
 }
\ No newline at end of file

@musaprg musaprg marked this pull request as ready for review January 27, 2025 04:29
@musaprg
Copy link
Contributor Author

musaprg commented Jan 27, 2025

The permission problem was resolved by changing remoteUser to root, however, which sounds like an anti-pattern to me. I currently don't have any other ideas for a workaround.

@YJDoc2 YJDoc2 added the kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. label Jan 27, 2025
@YJDoc2
Copy link
Collaborator

YJDoc2 commented Jan 27, 2025

Hey, so the the comments need to be removed that is correct. I am personally fine with simply removing the comments without splitting the command into two, a small issue with it that it might generate two docker image layers instead of one, but should be ok either way.

As for the perm error, that is sensible, because the apt install needs the root perms to install deps. However I think there is a way to do that without having to make the remote user as root, I'll try to check and get back.

Thanks for noticing this and letting us know!

@YJDoc2
Copy link
Collaborator

YJDoc2 commented Jan 27, 2025

Hey, So I simply removed the comments from the dockerfile apt command, and no changes in the devcontainer.json , it seems to work for me, the

sudo apt list | grep -e "libclang-dev" -e "libelf-dev" -e "libseccomp-dev" -e "libsystemd-d
ev" -e "bpftrace" -e "podman"

showed list of appropriate packages. Can you try this, and check if that and just lint works?

@musaprg
Copy link
Contributor Author

musaprg commented Jan 27, 2025

Hey, so the the comments need to be removed that is correct. I am personally fine with simply removing the comments without splitting the command into two, a small issue with it that it might generate two docker image layers instead of one, but should be ok either way.

My change won't increase the total number of layes of the built image because they're inside a single RUN instruction. That's just for maintaining readability, but I'm OK with removing comments.

@YJDoc2
Copy link
Collaborator

YJDoc2 commented Feb 25, 2025

Hey @musaprg , may I ask you to update the PR so that the comments are removed and no changes in dev container json?
I think as I mentioned above, even just removing the comment works, no need to change the json file. If you do that, I will go ahead and merge this.

@musaprg
Copy link
Contributor Author

musaprg commented Feb 25, 2025

hmm... I'm not sure why the build of libbpf failed then. I tried again now on the current master branch and it succeeded without changing the contents of devcontainer.json.

@musaprg musaprg force-pushed the fix-devcontainer-issue branch 2 times, most recently from ab857db to 36d5ac2 Compare February 25, 2025 16:48
@musaprg
Copy link
Contributor Author

musaprg commented Feb 25, 2025

@YJDoc2 Hi. I've reverted my change on devcontainer.json. IMO it's worth mentioning the purposes of each package, not just removing them. The number of layers in the built image should be the same before and after this change. Could you check it at your earliest convenience? Thanks!

@musaprg
Copy link
Contributor Author

musaprg commented Feb 25, 2025

CI is failing, but that should be fixed after #3086 is merged.

Signed-off-by: Kotaro Inoue <k.musaino@gmail.com>
@musaprg musaprg force-pushed the fix-devcontainer-issue branch from 36d5ac2 to 0957dcf Compare March 1, 2025 17:48
Copy link
Collaborator

@YJDoc2 YJDoc2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

yes, I think my comment about the image layers was not much sensible. This is in a single RUN so should be ok + this is local dev container, so even if there was one more layer, it would not be that big of an issue.

Thanks for the fix :)

@YJDoc2 YJDoc2 merged commit 3c3ef4d into youki-dev:main Mar 3, 2025
27 checks passed
@github-actions github-actions bot mentioned this pull request Mar 3, 2025
@musaprg musaprg deleted the fix-devcontainer-issue branch March 5, 2025 05:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants