-
Notifications
You must be signed in to change notification settings - Fork 62
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
Conversation
Signed-off-by: Dhi Aurrahman <dio@rockybars.com>
Signed-off-by: Dhi Aurrahman <dio@rockybars.com>
Signed-off-by: Dhi Aurrahman <dio@rockybars.com>
/assign @incfly |
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.PAT }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
Signed-off-by: Dhi Aurrahman <dio@rockybars.com>
_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. |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
[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 |
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 againstlibc++
on CI (Linux).This also adds a workflow to publish the Docker image.
Signed-off-by: Dhi Aurrahman dio@rockybars.com