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

refactor: toolchain into multiple bldr packages #8

Merged
merged 1 commit into from
Oct 25, 2019

Conversation

smira
Copy link
Member

@smira smira commented Oct 24, 2019

There's one version bump: binutils is 2.33.1 as 2.31.1 had some bug
reading compressed object data, not sure how it wasn't triggered before.

Overview:

  • Alpine toolchain is used to build stage1 (bootstrap) binutils
    and gcc -> /boostrap
  • bootstrap musl is built (just to make programs compile) -> /bootstrap
  • bootstrap libstdcxx is built -> /bootstrap
  • musl is built -> /toolchain
  • binutils are built -> /toolchain
  • gcc is built -> /toolchain
  • linux-headers are built -> /toolchain
  • everything /toolchain is combined together

Signed-off-by: Andrey Smirnov [email protected]

@smira
Copy link
Member Author

smira commented Oct 24, 2019

wip, as I want to do a bit more testing before I consider it safe

vars:
BOOTSTRAP: /bootstrap

binutils_version: 2.33.1
Copy link
Member Author

Choose a reason for hiding this comment

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

I got these exposed top-level to avoid duplication between multiple packages using same sources, and so that we can't forget to bump all of them

@andrewrynhard
Copy link
Member

I'm just curious, what was the reason for dropping the --target flag?

@smira
Copy link
Member Author

smira commented Oct 24, 2019

I'm just curious, what was the reason for dropping the --target flag?

I think it's not needed, because there's no way toolchain stages can be mixed now:

  1. Alpine toolchain is used only to boostrap gcc & binutils, after that it's gone (we copy only /bootstrap tree at that phase)
  2. Once we build stage2 toolchain, boostrap toolchain goes away, once again via finalize: with /toolchain only.

--target is not a big deal, but we have to export all these export AS=${TARGET}-as while there's no other as in the path when we're building.

LFS does that, as both compilers are in the path as I understand (host and stage1), while for us it's not an issue

@andrewrynhard
Copy link
Member

I'm just curious, what was the reason for dropping the --target flag?

I think it's not needed, because there's no way toolchain stages can be mixed now:

  1. Alpine toolchain is used only to boostrap gcc & binutils, after that it's gone (we copy only /bootstrap tree at that phase)
  2. Once we build stage2 toolchain, boostrap toolchain goes away, once again via finalize: with /toolchain only.

--target is not a big deal, but we have to export all these export AS=${TARGET}-as while there's no other as in the path when we're building.

LFS does that, as both compilers are in the path as I understand (host and stage1), while for us it's not an issue

SGTM.

@smira smira marked this pull request as ready for review October 24, 2019 22:46
@smira
Copy link
Member Author

smira commented Oct 25, 2019

wip, as I want to do a bit more testing before I consider it safe

tested locally with tools/ and pkgs/, feels safe enough

There's one version bump: binutils is 2.33.1 as 2.31.1 had some bug
reading compressed object data, not sure how it wasn't triggered before.

Overview:

* Alpine toolchain is used to build stage1 (bootstrap) binutils
and gcc -> /boostrap
* bootstrap musl is built (just to make programs compile) -> /bootstrap
* bootstrap libstdcxx is built -> /bootstrap
* musl is built -> /toolchain
* binutils are built -> /toolchain
* gcc is built -> /toolchain
* linux-headers are built -> /toolchain
* everything /toolchain is combined together

Signed-off-by: Andrey Smirnov <[email protected]>
@smira
Copy link
Member Author

smira commented Oct 25, 2019

Pushed small update to remove security.insecure from Makefile (copy-paste from main talos repo).

@@ -74,8 +73,7 @@ ifneq ($(BUILDKIT_CONTAINER_RUNNING),$(BUILDKIT_CONTAINER_NAME))
--privileged \
-p 1234:1234 \
$(BUILDKIT_IMAGE) \
--addr $(BUILDKIT_HOST) \
--allow-insecure-entitlement security.insecure
--addr $(BUILDKIT_HOST)
Copy link
Member

Choose a reason for hiding this comment

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

We don't need --addr, buildkit will respect BUILDKIT_HOST env var, but we can clean this up later.

@andrewrynhard andrewrynhard merged commit 52e8abf into siderolabs:master Oct 25, 2019
smira added a commit to smira/tools that referenced this pull request Oct 25, 2019
See siderolabs/toolchain#8

Also removes insecure entitlement from Makefile (copy-paste bug).

Signed-off-by: Andrey Smirnov <[email protected]>
smira added a commit to siderolabs/tools that referenced this pull request Oct 25, 2019
See siderolabs/toolchain#8

Also removes insecure entitlement from Makefile (copy-paste bug).

Signed-off-by: Andrey Smirnov <[email protected]>
smira added a commit to smira/pkgs that referenced this pull request Oct 25, 2019
smira added a commit to siderolabs/pkgs that referenced this pull request Oct 25, 2019
smira added a commit to smira/talos that referenced this pull request Oct 25, 2019
smira added a commit to smira/talos that referenced this pull request Oct 25, 2019
smira added a commit to smira/talos that referenced this pull request Oct 25, 2019
smira added a commit to siderolabs/talos that referenced this pull request Oct 25, 2019
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.

2 participants