Open Cynical-Optimist opened 3 years ago
In GitLab by [Gitlab user @valentindavid] on Jul 31, 2018, 16:27
It seems SandboxConfig
uses os.uname
to add host architecture to the cache keys.
In GitLab by [Gitlab user @bochecha] on Sep 13, 2018, 09:23
It seems
SandboxConfig
usesos.uname
to add host architecture to the cache keys.
I tried hardcoding that to 'aarch64', but bst still didn't hit the cache.
In GitLab by [Gitlab user @tristanvb] on Sep 13, 2018, 14:12
[Gitlab user @bochecha] it is indeed confusing to me that hard coding that did not produce the same key.
Do you think this might be a symptom of #641 ? I.e. max-jobs
variable being used directly in build instructions somewhere ?
That said, the comment in the referred code of SandboxConfig
is pretty telling. BuildStream does not support cross building, at least not yet.
It is intended that to support that, we need:
In GitLab by [Gitlab user @bochecha] on Sep 14, 2018, 07:22
changed the description
In GitLab by [Gitlab user @bochecha] on Sep 28, 2018, 09:42
I tried again with Buildstream 1.2.2.
Do you think this might be a symptom of #641 ? I.e.
max-jobs
variable being used directly in build instructions somewhere ?
That could have been the case in the past, but we don't use max-jobs
any more thanks to a contribution by [Gitlab user @tacgomes] (https://gitlab.com/freedesktop-sdk/freedesktop-sdk/merge_requests/513)
The latest FDO Sdk 18.08 uses max-jobs
in exactly one place:
environment-nocache:
- MAXJOBS
environment:
MAXJOBS: "%{max-jobs}"
It shouldn't cause any problem, since it's an environment-nocache
variable?
In any case, the native Aarch64 build in the CI had the following key for all.bst
:
On my x86_64 machine, if I run bst -o bootstrap_build_arch aarch64 -o target_arch aarch64 show all.bst
I get:
If I modify buildstream/sandbox/_config.py
, hardcoding 'aarch64'
as the arch, I get:
So hardcoding the arch in that file does have an impact on the cache key.
But there must be something else that also does, somewhere?
In GitLab by [Gitlab user @abderrahimk] on Oct 13, 2018, 20:18
[Gitlab user @bochecha]: This is weird. Hardcoding works for me. (using freedesktop-sdk/freedesktop-sdk[Gitlab user @e6939dcbaa31058434ca5b025db23733d11b05af], I get 364ee5a998a83e70d988d32e2dbd3220366214ae332e9c37ea55890cd93f0c40
, which is the same as the CI). Are you sure you are modifying the bst-1.2 branch?
Another case I'd like to use this for is setting a 32-bit personality (using setarch
) to build i686 on x86_64 without the buildscripts thinking they are cross compiling.
I did some tests, and here is what I get (on my x86_64). I ran uname -m
with different architectures for the uname
binary:
linux32
), I get i686;qemu-user
), I get aarch64 (regardless of whether I run under linux32
).So the thing is we cannot know for sure what running uname -m
in the sandbox will give before we actually run it.
It is intended that to support that, we need:
- SandboxConfig to ask for the correct machine architecture
- BuildStream to find out if there is a sandbox implementation available at runtime for the given architecture; and to either use that implementation or bail out with an error.
So IIUC, we need an option to pass the sandbox architecture to buildstream, and this will be used instead of os.uname()
(in both the cache key, and as a default for options of type arch).
Then, we need to check whether we can run the uname
binary in the sandbox, and whether it returns the correct value.
And to support my additional requirement, we also need to call bwrap
while setting a personality using setarch
.
Does this sound good?
In GitLab by [Gitlab user @abderrahimk] on Nov 4, 2018, 09:08
Today, I found this nifty tool https://github.com/kilobyte/arch-test. It can tell whether your machine can run binaries of the given arch (or list all the arches your machine can run binaries of).
The problem is that it gives architectures as Debian names them (amd64 instead of x86_64 for example), but I think this shouldn't be a problem.
In GitLab by [Gitlab user @juergbi] on Nov 4, 2018, 09:35
So IIUC, we need an option to pass the sandbox architecture to buildstream, and this will be used instead of
os.uname()
(in both the cache key, and as a default for options of type arch).
Yes, see https://mail.gnome.org/archives/buildstream-list/2018-November/msg00003.html for my proposal how to configure this.
And to support my additional requirement, we also need to call
bwrap
while setting a personality usingsetarch
.
Agreed, we should set the personality as well.
In GitLab by [Gitlab user @valentindavid] on Nov 22, 2018, 11:36
marked this issue as related to #775
In GitLab by [Gitlab user @abderrahimk] on May 16, 2020, 19:13
mentioned in merge request !1934
See original issue on GitLab In GitLab by [Gitlab user @bochecha] on Jul 27, 2018, 16:39
Summary
I'm building org.freedesktop.Sdk/arm/unstable on my x86_64 laptop. The exact same Git revision has already been built in the CI.
Yet BuildStream doesn't pull from the cache, it rebuilds everything instead.
Steps to reproduce
git clone https://gitlab.com/freedesktop-sdk/freedesktop-sdk
cd freedesktop-sdk
git checkout bochecha/qemu-bash
this is the branch I'm trying to build, I won't force-push so that it remains stable, which will help test more easily than on a moving "master"
cd sdk
bst -o bootstrap_build_arch aarch64 -o target_arch arm build all.bst
What is the current bug behavior?
BuildStream will pull some things, and then proceed to rebuilding pretty much everything.
What is the expected correct behavior?
BuildStream should have pulled everything from the shared cache, since everything has already been built by our CI.
Relevant logs and/or screenshots
Here is an extract from the CI build logs (just a few random lines) :
And here is an extract (the same 8 lines) from what I get on my laptop right now, running
bst -o bootstrap_build_arch aarch64 -o target_arch arm build all.bst
:As you can see, the cache keys are different.
I can't figure out what difference between my laptop and the CI could cause this though. They have the same
project.conf
andbuildstream.conf
, the same version ofbst
andbst-external
.The only difference seems to be the arch of the host, but I don't think that should be considered when computing the cache key.
[Gitlab user @jjardon]