AOSC-Archive / autobuild3

AOSC OS package maintenance toolkit (version 3)
https://aosc.io
GNU General Public License v2.0
24 stars 17 forks source link

cross-$ARCH-$CROSS is not straightforward #82

Closed Artoria2e5 closed 8 years ago

Artoria2e5 commented 8 years ago

A quick scan using echo **/cross-*-*/ on core and abbs shows that nobody is using this dirname. So we are free to change it.

Perhaps cross-$CROSS@$ARCH?


Actually I prefer some suffix-based naming, but that's gonna cause a lot of renaming, i.e.:

With this scheme, ls sorting makes more sense.

MingcongBai commented 8 years ago

So there will be multiple build config for build hosts, for one cross target?

Artoria2e5 commented 8 years ago

There is support for that already, but the naming is just crap…

Artoria2e5 commented 8 years ago

The renaming should be straightforward anyway, assuming in abbs nobody references other arches' build files…

shopt -s nullglob
for r in aosc-os-*; do (
  IFS=-
  git pull
  for d in "$r"/{*/*,*/*/*}/autobuild/cross-*/; do
    d=${d%/}
    read -d '' -r -a a <<< "${d##*}" #>a=d.replace(/^.*\//, '').eachsplit(IFS)
    if [[ "${a[2]}" ]]; then
      git mv "$d" "${d%/*}/${a[2]}-cross-${a[1]}" 
    else
      git mv "$d" "${d%/*}/${a[1]}-cross"
    fi
  done
  git commit -am "*: apply new-ab3-archdirs"
  git push
) & done
wait
// supp lib for reading comments
String.prototype.eachsplit = function (str){
  let ret = [this];
  for (let i of str)
    ret = ret.map(j => j.split(i)).reduce((a,b) => a.concat(b));
  return ret
}
Artoria2e5 commented 8 years ago

Anyway I prefer to do this fast… Be advised, we are gonna need a major version bump for this.

MingcongBai commented 8 years ago

Do it.

Artoria2e5 commented 8 years ago

After writing this, I realize how brainfucking the names CROSS and ARCH are. Someday we will need to make them ABBUILD and ABHOST.

Artoria2e5 commented 8 years ago

Oh shit Oh shit Bai we triggered a trap in CORE!

We assumed ARCH to be ABHOST.

Artoria2e5 commented 8 years ago

@JeffBai By doing that we are checking against the builder arch instead of the runner arch. This is not good.

MingcongBai commented 8 years ago

@JeffBai By doing that we are checking against the builder arch instead of the runner arch. This is not good.

Got it. Will fix in a bit. The build test is far from beginning just yet...

Artoria2e5 commented 8 years ago

Uh, let's fix that in ab.

MingcongBai commented 8 years ago

Uh, let's fix that in ab.

Sounds good to me.

Artoria2e5 commented 8 years ago

Oh I love breaking changes. Major version bumps are fantastic. Blow the world up!

MingcongBai commented 8 years ago

Oh I love breaking changes. Major version bumps are fantastic. Blow the world up!

I will be working on backwards compatibility. Before that's done, no tags permitted.

Artoria2e5 commented 8 years ago

Uh.. should I tell git master users like @Icenowy to change that line to ARCH_FINDFILELIST=("autobuild/cross-$ARCH-$CROSS" "autobuild/cross-$CROSS" "autobuild/$ARCH" "autobuild") for now?