Skip to content

Support any package architecture - #12

Merged
niemeyer merged 6 commits into
canonical:mainfrom
woky:multiarch
Jul 11, 2022
Merged

niemeyer merged 6 commits into
canonical:mainfrom
woky:multiarch

Conversation

@woky

@woky woky commented Jul 4, 2022

Copy link
Copy Markdown
Contributor

resolves #11

woky added 2 commits July 4, 2022 13:10
hostname package is architecture specific compared to run-one. It will
be used later when we introduce multiarchitecture operation.
@woky

woky commented Jul 4, 2022

Copy link
Copy Markdown
Contributor Author

Before merging this PR, please look at the outstanding issue: #11 (comment)

@niemeyer niemeyer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks very nice, Tomáš!

Here are a few suggestions, mainly with cosmetic tuning. Please let me know what you think.

Comment thread internal/archive/archive.go Resolved
Comment thread internal/archive/archive_test.go Resolved
Comment thread internal/archive/archive.go Resolved
Comment thread cmd/chisel/cmd_cut.go Resolved
Comment thread cmd/chisel/cmd_cut.go Resolved
@woky

woky commented Jul 11, 2022 •

Copy link
Copy Markdown
Contributor Author

Thanks @niemeyer :-) Addressed all your comments, go test ./internal/* went OK.

Also tested as in #11 (comment) via

for a in amd64 arm64 armhf i386 ppc64el riscv64 s390x; do
    mkdir output-$a
    chisel cut --release ~/devel/chisel-releases/ --root $PWD/output-$a --arch $a libc6_libs
done

and checked

$ file output-*/lib/*/libc.so.*
output-amd64/lib/x86_64-linux-gnu/libc.so.6:        ELF 64-bit LSB shared object, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=89c3cb85f9e55046776471fed05ec441581d1969, for GNU/Linux 3.2.0, stripped
output-arm64/lib/aarch64-linux-gnu/libc.so.6:       ELF 64-bit LSB shared object, ARM aarch64, version 1 (GNU/Linux), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, BuildID[sha1]=4c414febb48863e7ed248ade5a2ebbfc8fe10dca, for GNU/Linux 3.7.0, stripped
output-armhf/lib/arm-linux-gnueabihf/libc.so.6:     ELF 32-bit LSB shared object, ARM, EABI5 version 1 (GNU/Linux), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, BuildID[sha1]=ffc58eb5d5c62983ba60ccfeab92d14a9baf3e7d, for GNU/Linux 3.2.0, stripped
output-i386/lib/i386-linux-gnu/libc.so.6:           ELF 32-bit LSB shared object, Intel 80386, version 1 (GNU/Linux), dynamically linked, interpreter /lib/ld-linux.so.2, BuildID[sha1]=c376d41cff4473142a97ac1ff1eab433859dc3d4, for GNU/Linux 3.2.0, stripped
output-ppc64el/lib/powerpc64le-linux-gnu/libc.so.6: ELF 64-bit LSB shared object, 64-bit PowerPC or cisco 7500, OpenPOWER ELF V2 ABI, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld64.so.2, BuildID[sha1]=65fbec1a57faea0dff088bfc2ca33d2525e62e13, for GNU/Linux 3.10.0, stripped
output-riscv64/lib/riscv64-linux-gnu/libc.so.6:     ELF 64-bit LSB shared object, UCB RISC-V, RVC, double-float ABI, version 1 (GNU/Linux), dynamically linked, interpreter /lib/ld-linux-riscv64-lp64d.so.1, BuildID[sha1]=418d74b8f3f809a5e67e49122f85d4b24984cb7d, for GNU/Linux 4.15.0, stripped
output-s390x/lib/s390x-linux-gnu/libc.so.6:         ELF 64-bit MSB shared object, IBM S/390, version 1 (GNU/Linux), dynamically linked, interpreter /lib/ld64.so.1, BuildID[sha1]=fd6085665f229ac98371f1bcb9d92048fb4d8fe6, for GNU/Linux 3.2.0, stripped

and

$ mkdir output-auto
$ uname -m
x86_64
$ chisel cut --release ~/devel/chisel-releases/ --root $PWD/output-auto libc6_libs
...
2022/07/11 11:26:52 Extracting files from package "libc6"...
$ file output-auto/lib/*/libc.so.*
output-auto/lib/x86_64-linux-gnu/libc.so.6: ELF 64-bit LSB shared object, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=89c3cb85f9e55046776471fed05ec441581d1969, for GNU/Linux 3.2.0, stripped

@niemeyer niemeyer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the changes. Just a couple of bits and it's good to go.

Comment thread internal/deb/helpers.go Resolved
Comment thread internal/deb/helpers_test.go Resolved
@woky
woky force-pushed the multiarch branch 2 times, most recently from 3add120 to b5906e3 Compare July 11, 2022 10:50
@woky

woky commented Jul 11, 2022

Copy link
Copy Markdown
Contributor Author

@niemeyer Addressed your comments and tested the same as in my previous comment.

woky added 2 commits July 11, 2022 14:35
Add helper functions
- ValidateArch() to validate given package architecture
- InferArch() to infer package architecture from current platform

Also add unit tests.
Add option --arch <arch> to `cmd cut`. If the argument is not given (or
is empty), the architecture is inferred in archive.Open() from current
platform architecture (runtime.GOARCH). Architecture validation and
inferring is done by deb.ValidateArch().
@niemeyer

Copy link
Copy Markdown
Contributor

Thank you!

@niemeyer
niemeyer merged commit 0e6a45a into canonical:main Jul 11, 2022
rebornplusplus pushed a commit to rebornplusplus/chisel that referenced this pull request Oct 8, 2024
This commit adds support for fetching packages from multiple archives.
It introduces a new field `archives.<archive-name>.priority` which
takes in a signed integer and specifies the priority of a certain
archive. A package is fetched from the archive with highest priority.

It also deprecates the concept of default archive in chisel.yaml.
However, the field can still be present and it will be parsed but
IGNORED.

DEPRECATED: "archives.<archive>.default" field in chisel.yaml.
---------

Co-authored-by: Alberto Carretero <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feat: let chisel fetch DEBs for the same architecture as the underlying execution environment

2 participants