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

Append -static-libgcc on Linux #215

Merged
merged 7 commits into from
Mar 30, 2022

Conversation

dio
Copy link
Collaborator

@dio dio commented Mar 30, 2022

This patch makes sure we do: "-static-libgcc" on Linux (for the stripped binary). We also use --config libc++ (instead of --config clang) to link against libc++ on CI (Linux).

This also adds a workflow to publish the Docker image.

Signed-off-by: Dhi Aurrahman dio@rockybars.com

dio added 5 commits March 29, 2022 23:20
Signed-off-by: Dhi Aurrahman <dio@rockybars.com>
Signed-off-by: Dhi Aurrahman <dio@rockybars.com>
Signed-off-by: Dhi Aurrahman <dio@rockybars.com>
Signed-off-by: Dhi Aurrahman <dio@rockybars.com>
Signed-off-by: Dhi Aurrahman <dio@rockybars.com>
@dio
Copy link
Collaborator Author

dio commented Mar 30, 2022

/assign @incfly

with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.PAT }}
Copy link
Collaborator Author

@dio dio Mar 30, 2022

Choose a reason for hiding this comment

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

@incfly to make it work, we need your help to add this PAT to the secrets of this repo (make sure that PAT is allowed to push stuff to the registry). Thanks!

Copy link

Choose a reason for hiding this comment

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

cool. I created this secret using my personal access token for now, GH_REGISTRY_TOKEN_INCFLY. I name it this way to make it clear the relationship.
tried with following and works.

echo $ TOKEN | docker login -u incfly --passworld-stdin
docker push ghcr.io/istio-ecosystem/authservice/authservice:0.5.0-9-g45535d3

image

Copy link

Choose a reason for hiding this comment

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

oops. I forgot Approving the PR makes the PR merge automatically. let me send a fix to update the variable name used here.

dio added 2 commits March 30, 2022 00:08
Signed-off-by: Dhi Aurrahman <dio@rockybars.com>
Signed-off-by: Dhi Aurrahman <dio@rockybars.com>
@dio dio mentioned this pull request Mar 30, 2022
_DEFAULT_COPTS = ["-Wall", "-Wextra"]

def authsvc_cc_library(name, deps = [], srcs = [], hdrs = [], copts = [], defines = [], includes = [], textual_hdrs = [], visibility = None):
cc_library(name = name, deps = deps, srcs = srcs, hdrs = hdrs, copts = _DEFAULT_COPTS + copts, defines = defines, includes = includes, textual_hdrs = textual_hdrs, visibility = visibility)

# By default, we always do linkstatic: https://docs.bazel.build/versions/main/be/c-cpp.html#cc_binary.linkstatic.
Copy link

Choose a reason for hiding this comment

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

I am bit confused for the comment here. trying to understand.

bazel for cc by default always use static link. but for libgcc there might be an option (therefore we see the glibc.so errors before).
adding envoy_stdlib_deps ensures we cover that. because by adding this, we will have -static-libgcc to the compilation. this means even compiling using gcc we can ensure a static binary.

is that correct?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ah yes, seems like to force linking libgcc statically you need to ask for -static-libgcc. I haven't tried to do fully_static_link though since it will do static linking for glibc as well which is not recommended.

Copy link

@incfly incfly left a comment

Choose a reason for hiding this comment

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

Thanks!

@istio-testing
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dio, incfly

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@istio-testing istio-testing merged commit f78db6a into istio-ecosystem:master Mar 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants