Openembedded Core Discussions
 help / color / mirror / Atom feed
From: "Aleksandar Nikolic" <an010@live.com>
To: openembedded-core@lists.openembedded.org
Subject: install-buildtools fails #poky
Date: Thu, 14 Dec 2023 13:32:10 -0800	[thread overview]
Message-ID: <aQyg.1702589530747273993.VOVe@lists.openembedded.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 8690 bytes --]

Hi,

I was trying to install the buildtools by using the scripts/install-buildtools script, however the call fails. The issue I found seems a bit weird, as IMHO the script would always fail, hence I am not sure whether it's really an issue or I am misusing the script. Anyway, I am using the script from the openembedded-core - OpenEmbedded Core layer ( https://git.openembedded.org/openembedded-core ) repository, commit 41390f52.

The command executed:

> 
> ./scripts/install-buildtools --debug --without-extended-buildtools
> --directory ./build-tools --base-url
> https://downloads.yoctoproject.org/releases/yocto --release yocto-4.0.14
> --installer-version 4.0.14

The command fails and its output is given in [1].

Now, I dug a bit deeper and found two potential issues (if they are even issues, I am not sure anymore).

1. First one is in here ( https://git.openembedded.org/openembedded-core/tree/scripts/install-buildtools#n304 ). Basically, while environment variables are read from build-tools/environment-setup-x86_64-pokysdk-linux (see [2] for its content), some of them are read with double quotes (e.g. PATH ) and as such written in os.environ ( here ( https://git.openembedded.org/openembedded-core/tree/scripts/install-buildtools#n306 ) ), which makes them not correctly used later on. Some come without quotes and are fine to be used (e.g., PKG_CONFIG_LIBDIR ). A solution to this problem is removing the double quotes from envvar if present in the envvar, e.g., ENVVAR="foo" becomes ENVVAR=foo and as such is written in os.environ.

2. Another issue I found is related to this line ( https://git.openembedded.org/openembedded-core/tree/scripts/install-buildtools#n334 ). If the command is called with --directory , as in my case, the function starts_with will always fail because which_tool will never start with install_dir. The only case where this is not an issue is in when --directory is omitted, since INSTALL_DIR is used in that case and its a full path already. A solution is also simple, we can just check if install_dir is in which_tool , instead of whether which_tool starts with install_dir.

Now my question is am I misunderstanding something or am I misusing the install-buildtools script somehow? If this is really an issue I'd be more than glad to provide a patch.

Cheers
Aleksandar

[1]

> 
> DEBUG: milestone regex: None
> INFO: Fetching buildtools installer
> INFO: Fetching buildtools installer checksum
> DEBUG: checksum regex match: <re.Match object; span=(0, 113),
> match='62e811c2f1a91f6d2d5e07ee3031af9bff58c15f515ff5968>
> DEBUG: checksum:
> 62e811c2f1a91f6d2d5e07ee3031af9bff58c15f515ff59688bf39f1f8a4341d
> DEBUG: path: None
> DEBUG: filename: x86_64-buildtools-nativesdk-standalone-4.0.14.sh
> INFO: Checksum success
> INFO: Making installer executable
> DEBUG: os.stat_result(st_mode=33252, st_ino=2376165, st_dev=2080,
> st_nlink=1, st_uid=1000, st_gid=1000, st_size=29509071,
> st_atime=1702587153, st_mtime=1699048064, st_ctime=1702587153)
> Build tools installer version 4.0.14
> ====================================
> You are about to install the SDK to
> "/home/anikolic/git/openembedded-core/build-tools". Proceed [Y/n]? Y
> Extracting SDK...........done
> Setting it up...done
> SDK has been successfully set up and is ready to be used.
> Each time you wish to use the SDK in a new shell session, you need to
> source the environment setup script e.g.
> $ .
> /home/anikolic/git/openembedded-core/build-tools/environment-setup-x86_64-pokysdk-linux
> 
> INFO: Setting up the environment
> DEBUG: export regex: <re.Match object; span=(0, 361), match='export
> PATH="/home/anikolic/git/openembedded-core>
> DEBUG: env_var: PATH
> DEBUG: env_val:
> "/home/anikolic/git/openembedded-core/build-tools/sysroots/x86_64-pokysdk-linux/usr/bin:/home/anikolic/git/openembedded-core/build-tools/sysroots/x86_64-pokysdk-linux/usr/sbin:/home/anikolic/git/openembedded-core/build-tools/sysroots/x86_64-pokysdk-linux/bin:/home/anikolic/git/openembedded-core/build-tools/sysroots/x86_64-pokysdk-linux/sbin:$PATH"
> 
> DEBUG: export regex: <re.Match object; span=(0, 109), match='export
> OECORE_NATIVE_SYSROOT="/home/anikolic/git/>
> DEBUG: env_var: OECORE_NATIVE_SYSROOT
> DEBUG: env_val:
> "/home/anikolic/git/openembedded-core/build-tools/sysroots/x86_64-pokysdk-linux"
> 
> DEBUG: export regex: <re.Match object; span=(0, 136), match='export
> GIT_SSL_CAINFO="/home/anikolic/git/openemb>
> DEBUG: env_var: GIT_SSL_CAINFO
> DEBUG: env_val:
> "/home/anikolic/git/openembedded-core/build-tools/sysroots/x86_64-pokysdk-linux/etc/ssl/certs/ca-certificates.crt"
> 
> DEBUG: export regex: <re.Match object; span=(0, 135), match='export
> SSL_CERT_FILE="/home/anikolic/git/openembe>
> DEBUG: env_var: SSL_CERT_FILE
> DEBUG: env_val:
> "/home/anikolic/git/openembedded-core/build-tools/sysroots/x86_64-pokysdk-linux/etc/ssl/certs/ca-certificates.crt"
> 
> DEBUG: export regex: <re.Match object; span=(0, 140), match='export
> REQUESTS_CA_BUNDLE="/home/anikolic/git/ope>
> DEBUG: env_var: REQUESTS_CA_BUNDLE
> DEBUG: env_val:
> "/home/anikolic/git/openembedded-core/build-tools/sysroots/x86_64-pokysdk-linux/etc/ssl/certs/ca-certificates.crt"
> 
> DEBUG: export regex: <re.Match object; span=(0, 136), match='export
> CURL_CA_BUNDLE="/home/anikolic/git/openemb>
> DEBUG: env_var: CURL_CA_BUNDLE
> DEBUG: env_val:
> "/home/anikolic/git/openembedded-core/build-tools/sysroots/x86_64-pokysdk-linux/etc/ssl/certs/ca-certificates.crt"
> 
> DEBUG: export regex: <re.Match object; span=(0, 80),
> match='HOST_PKG_PATH=$(command -p pkg-config --variable=>
> DEBUG: env_var: HOST_PKG_PATH
> DEBUG: env_val: $(command -p pkg-config --variable=pc_path pkg-config
> 2>/dev/null)
> DEBUG: export regex: <re.Match object; span=(0, 280), match='export
> PKG_CONFIG_LIBDIR=/home/anikolic/git/opene>
> DEBUG: env_var: PKG_CONFIG_LIBDIR
> DEBUG: env_val:
> /home/anikolic/git/openembedded-core/build-tools/sysroots/x86_64-pokysdk-linux//usr/lib/pkgconfig:/home/anikolic/git/openembedded-core/build-tools/sysroots/x86_64-pokysdk-linux//usr/share/pkgconfig:${HOST_PKG_PATH:-/usr/lib/pkgconfig:/usr/share/pkgconfig}DEBUG:
> export regex: None
> DEBUG: export regex: None
> DEBUG: export regex: None
> DEBUG: export regex: None
> DEBUG: export regex: None
> DEBUG: export regex: None
> DEBUG: export regex: None
> DEBUG: export regex: None
> INFO: Testing installation
> DEBUG: extended regex: None
> DEBUG: install_dir: ./build-tools
> DEBUG: cmd: ['/usr/bin/which', 'tar']
> DEBUG: tool: tar
> DEBUG: proc.args: ['/usr/bin/which', 'tar']
> DEBUG: proc.communicate(): output b''
> DEBUG: proc.communicate(): errors None
> DEBUG: which tar:
> ERROR: Something went wrong: tar not found in ./build-tools
> ERROR: Something went wrong: installation failed
> 

[2]

> 
> export
> PATH="/home/anikolic/git/openembedded-core/build-tools/sysroots/x86_64-pokysdk-linux/usr/bin:/home/anikolic/git/openembedded-core/build-tools/sysroots/x86_64-pokysdk-linux/usr/sbin:/home/anikolic/git/openembedded-core/build-tools/sysroots/x86_64-pokysdk-linux/bin:/home/anikolic/git/openembedded-core/build-tools/sysroots/x86_64-pokysdk-linux/sbin:$PATH"
> 
> export
> OECORE_NATIVE_SYSROOT="/home/anikolic/git/openembedded-core/build-tools/sysroots/x86_64-pokysdk-linux"
> 
> export
> GIT_SSL_CAINFO="/home/anikolic/git/openembedded-core/build-tools/sysroots/x86_64-pokysdk-linux/etc/ssl/certs/ca-certificates.crt"
> 
> export
> SSL_CERT_FILE="/home/anikolic/git/openembedded-core/build-tools/sysroots/x86_64-pokysdk-linux/etc/ssl/certs/ca-certificates.crt"
> 
> export
> REQUESTS_CA_BUNDLE="/home/anikolic/git/openembedded-core/build-tools/sysroots/x86_64-pokysdk-linux/etc/ssl/certs/ca-certificates.crt"
> 
> export
> CURL_CA_BUNDLE="/home/anikolic/git/openembedded-core/build-tools/sysroots/x86_64-pokysdk-linux/etc/ssl/certs/ca-certificates.crt"
> 
> HOST_PKG_PATH=$(command -p pkg-config --variable=pc_path pkg-config
> 2>/dev/null)
> export
> PKG_CONFIG_LIBDIR=/home/anikolic/git/openembedded-core/build-tools/sysroots/x86_64-pokysdk-linux//usr/lib/pkgconfig:/home/anikolic/git/openembedded-core/build-tools/sysroots/x86_64-pokysdk-linux//usr/share/pkgconfig:${HOST_PKG_PATH:-/usr/lib/pkgconfig:/usr/share/pkgconfig}
> 
> if [ -d "$OECORE_NATIVE_SYSROOT/environment-setup.d" ]; then
> for envfile in $OECORE_NATIVE_SYSROOT/environment-setup.d/*.sh; do
> . $envfile
> done
> fi
> # We have to unset this else it can confuse oe-selftest and other tools
> # which may also use the overlapping namespace.
> unset OECORE_NATIVE_SYSROOT
>

[-- Attachment #2: Type: text/html, Size: 11180 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: "Aleksandar Nikolic" <an010@live.com>
To: openembedded-core@lists.openembedded.org
Subject: install-buildtools fails #poky
Date: Thu, 14 Dec 2023 13:34:37 -0800	[thread overview]
Message-ID: <aQyg.1702589530747273993.VOVe@lists.openembedded.org> (raw)
Message-ID: <20231214213437.ifoaU35vHMfxdLIUQpU1eqbe8ScjrnlQLDLb4t84RK4@z> (raw)

[-- Attachment #1: Type: text/plain, Size: 8734 bytes --]

Hi,

I was trying to install the buildtools by using the scripts/install-buildtools script, however the call fails. The issue I found seems a bit weird, as IMHO the script would always fail, hence I am not sure whether it's really an issue or I am misusing the script. Anyway, I am using the script from the openembedded-core - OpenEmbedded Core layer ( https://git.openembedded.org/openembedded-core ) repository, commit 41390f52 (latest at the time of writing).

The command executed:

> 
> ./scripts/install-buildtools --debug --without-extended-buildtools
> --directory ./build-tools --base-url
> https://downloads.yoctoproject.org/releases/yocto --release yocto-4.0.14
> --installer-version 4.0.14

The command fails and its output is given in [1].

Now, I dug a bit deeper and found two potential issues (if they are even issues, I am not sure anymore).

1. First one is in here ( https://git.openembedded.org/openembedded-core/tree/scripts/install-buildtools#n304 ). Basically, while environment variables are read from build-tools/environment-setup-x86_64-pokysdk-linux (see [2] for its content), some of them are read with double quotes (e.g. PATH ) and as such written in os.environ ( here ( https://git.openembedded.org/openembedded-core/tree/scripts/install-buildtools#n306 ) ), which makes them not correctly used later on. Some come without the double quotes and are fine to be used (e.g., PKG_CONFIG_LIBDIR ). A solution to this problem is removing the double quotes from envvar if present in the envvar, e.g., ENVVAR="foo" becomes ENVVAR=foo and as such is written in os.environ.

2. Another issue I found is related to this line ( https://git.openembedded.org/openembedded-core/tree/scripts/install-buildtools#n334 ). If the command is called with --directory , as in my case, the function starts_with will always fail because which_tool will never start with install_dir. The only case where this is not an issue is in when --directory is omitted, since INSTALL_DIR is used in that case and its a full path already. A solution is also simple, we can just check if install_dir is in which_tool , instead of whether which_tool starts with install_dir.

Now my question is am I misunderstanding something or am I misusing the install-buildtools script somehow? If this is really an issue I'd be more than happy to provide a patch.

Cheers
Aleksandar

[1]

> 
> DEBUG: milestone regex: None
> INFO: Fetching buildtools installer
> INFO: Fetching buildtools installer checksum
> DEBUG: checksum regex match: <re.Match object; span=(0, 113),
> match='62e811c2f1a91f6d2d5e07ee3031af9bff58c15f515ff5968>
> DEBUG: checksum:
> 62e811c2f1a91f6d2d5e07ee3031af9bff58c15f515ff59688bf39f1f8a4341d
> DEBUG: path: None
> DEBUG: filename: x86_64-buildtools-nativesdk-standalone-4.0.14.sh
> INFO: Checksum success
> INFO: Making installer executable
> DEBUG: os.stat_result(st_mode=33252, st_ino=2376165, st_dev=2080,
> st_nlink=1, st_uid=1000, st_gid=1000, st_size=29509071,
> st_atime=1702587153, st_mtime=1699048064, st_ctime=1702587153)
> Build tools installer version 4.0.14
> ====================================
> You are about to install the SDK to
> "/home/anikolic/git/openembedded-core/build-tools". Proceed [Y/n]? Y
> Extracting SDK...........done
> Setting it up...done
> SDK has been successfully set up and is ready to be used.
> Each time you wish to use the SDK in a new shell session, you need to
> source the environment setup script e.g.
> $ .
> /home/anikolic/git/openembedded-core/build-tools/environment-setup-x86_64-pokysdk-linux
> 
> INFO: Setting up the environment
> DEBUG: export regex: <re.Match object; span=(0, 361), match='export
> PATH="/home/anikolic/git/openembedded-core>
> DEBUG: env_var: PATH
> DEBUG: env_val:
> "/home/anikolic/git/openembedded-core/build-tools/sysroots/x86_64-pokysdk-linux/usr/bin:/home/anikolic/git/openembedded-core/build-tools/sysroots/x86_64-pokysdk-linux/usr/sbin:/home/anikolic/git/openembedded-core/build-tools/sysroots/x86_64-pokysdk-linux/bin:/home/anikolic/git/openembedded-core/build-tools/sysroots/x86_64-pokysdk-linux/sbin:$PATH"
> 
> DEBUG: export regex: <re.Match object; span=(0, 109), match='export
> OECORE_NATIVE_SYSROOT="/home/anikolic/git/>
> DEBUG: env_var: OECORE_NATIVE_SYSROOT
> DEBUG: env_val:
> "/home/anikolic/git/openembedded-core/build-tools/sysroots/x86_64-pokysdk-linux"
> 
> DEBUG: export regex: <re.Match object; span=(0, 136), match='export
> GIT_SSL_CAINFO="/home/anikolic/git/openemb>
> DEBUG: env_var: GIT_SSL_CAINFO
> DEBUG: env_val:
> "/home/anikolic/git/openembedded-core/build-tools/sysroots/x86_64-pokysdk-linux/etc/ssl/certs/ca-certificates.crt"
> 
> DEBUG: export regex: <re.Match object; span=(0, 135), match='export
> SSL_CERT_FILE="/home/anikolic/git/openembe>
> DEBUG: env_var: SSL_CERT_FILE
> DEBUG: env_val:
> "/home/anikolic/git/openembedded-core/build-tools/sysroots/x86_64-pokysdk-linux/etc/ssl/certs/ca-certificates.crt"
> 
> DEBUG: export regex: <re.Match object; span=(0, 140), match='export
> REQUESTS_CA_BUNDLE="/home/anikolic/git/ope>
> DEBUG: env_var: REQUESTS_CA_BUNDLE
> DEBUG: env_val:
> "/home/anikolic/git/openembedded-core/build-tools/sysroots/x86_64-pokysdk-linux/etc/ssl/certs/ca-certificates.crt"
> 
> DEBUG: export regex: <re.Match object; span=(0, 136), match='export
> CURL_CA_BUNDLE="/home/anikolic/git/openemb>
> DEBUG: env_var: CURL_CA_BUNDLE
> DEBUG: env_val:
> "/home/anikolic/git/openembedded-core/build-tools/sysroots/x86_64-pokysdk-linux/etc/ssl/certs/ca-certificates.crt"
> 
> DEBUG: export regex: <re.Match object; span=(0, 80),
> match='HOST_PKG_PATH=$(command -p pkg-config --variable=>
> DEBUG: env_var: HOST_PKG_PATH
> DEBUG: env_val: $(command -p pkg-config --variable=pc_path pkg-config
> 2>/dev/null)
> DEBUG: export regex: <re.Match object; span=(0, 280), match='export
> PKG_CONFIG_LIBDIR=/home/anikolic/git/opene>
> DEBUG: env_var: PKG_CONFIG_LIBDIR
> DEBUG: env_val:
> /home/anikolic/git/openembedded-core/build-tools/sysroots/x86_64-pokysdk-linux//usr/lib/pkgconfig:/home/anikolic/git/openembedded-core/build-tools/sysroots/x86_64-pokysdk-linux//usr/share/pkgconfig:${HOST_PKG_PATH:-/usr/lib/pkgconfig:/usr/share/pkgconfig}DEBUG:
> export regex: None
> DEBUG: export regex: None
> DEBUG: export regex: None
> DEBUG: export regex: None
> DEBUG: export regex: None
> DEBUG: export regex: None
> DEBUG: export regex: None
> DEBUG: export regex: None
> INFO: Testing installation
> DEBUG: extended regex: None
> DEBUG: install_dir: ./build-tools
> DEBUG: cmd: ['/usr/bin/which', 'tar']
> DEBUG: tool: tar
> DEBUG: proc.args: ['/usr/bin/which', 'tar']
> DEBUG: proc.communicate(): output b''
> DEBUG: proc.communicate(): errors None
> DEBUG: which tar:
> ERROR: Something went wrong: tar not found in ./build-tools
> ERROR: Something went wrong: installation failed
> 

[2]

> 
> export
> PATH="/home/anikolic/git/openembedded-core/build-tools/sysroots/x86_64-pokysdk-linux/usr/bin:/home/anikolic/git/openembedded-core/build-tools/sysroots/x86_64-pokysdk-linux/usr/sbin:/home/anikolic/git/openembedded-core/build-tools/sysroots/x86_64-pokysdk-linux/bin:/home/anikolic/git/openembedded-core/build-tools/sysroots/x86_64-pokysdk-linux/sbin:$PATH"
> 
> export
> OECORE_NATIVE_SYSROOT="/home/anikolic/git/openembedded-core/build-tools/sysroots/x86_64-pokysdk-linux"
> 
> export
> GIT_SSL_CAINFO="/home/anikolic/git/openembedded-core/build-tools/sysroots/x86_64-pokysdk-linux/etc/ssl/certs/ca-certificates.crt"
> 
> export
> SSL_CERT_FILE="/home/anikolic/git/openembedded-core/build-tools/sysroots/x86_64-pokysdk-linux/etc/ssl/certs/ca-certificates.crt"
> 
> export
> REQUESTS_CA_BUNDLE="/home/anikolic/git/openembedded-core/build-tools/sysroots/x86_64-pokysdk-linux/etc/ssl/certs/ca-certificates.crt"
> 
> export
> CURL_CA_BUNDLE="/home/anikolic/git/openembedded-core/build-tools/sysroots/x86_64-pokysdk-linux/etc/ssl/certs/ca-certificates.crt"
> 
> HOST_PKG_PATH=$(command -p pkg-config --variable=pc_path pkg-config
> 2>/dev/null)
> export
> PKG_CONFIG_LIBDIR=/home/anikolic/git/openembedded-core/build-tools/sysroots/x86_64-pokysdk-linux//usr/lib/pkgconfig:/home/anikolic/git/openembedded-core/build-tools/sysroots/x86_64-pokysdk-linux//usr/share/pkgconfig:${HOST_PKG_PATH:-/usr/lib/pkgconfig:/usr/share/pkgconfig}
> 
> if [ -d "$OECORE_NATIVE_SYSROOT/environment-setup.d" ]; then
> for envfile in $OECORE_NATIVE_SYSROOT/environment-setup.d/*.sh; do
> . $envfile
> done
> fi
> # We have to unset this else it can confuse oe-selftest and other tools
> # which may also use the overlapping namespace.
> unset OECORE_NATIVE_SYSROOT
>

[-- Attachment #2: Type: text/html, Size: 11291 bytes --]

             reply	other threads:[~2023-12-14 21:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-14 21:32 Aleksandar Nikolic [this message]
2023-12-14 21:34 ` install-buildtools fails #poky Aleksandar Nikolic

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aQyg.1702589530747273993.VOVe@lists.openembedded.org \
    --to=an010@live.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox