Skip to content

build: making alwayslink optional in Enovy CC libraries#23676

Merged
alyssawilk merged 9 commits intoenvoyproxy:mainfrom
alyssawilk:noalwayslink
Nov 1, 2022
Merged

build: making alwayslink optional in Enovy CC libraries#23676
alyssawilk merged 9 commits intoenvoyproxy:mainfrom
alyssawilk:noalwayslink

Conversation

@alyssawilk
Copy link
Contributor

@alyssawilk alyssawilk commented Oct 25, 2022

This adds a variable to change Envoy library defaults to not always link, while fixing up Envoy libraries using singletons and factory registrations to still always link.

Risk Level: high
Testing: using existing tests
Docs Changes: n/a
Release Notes: yes
Platform Specific Features: no
Part of envoyproxy/envoy-mobile#175

Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
@alyssawilk
Copy link
Contributor Author

cc @keith I really want to run one of the Envoy builds with this true and I'm not sure how to do that. Ideas?

@keith
Copy link
Member

keith commented Oct 27, 2022

I don't follow, do you mean you want to run the binary, or CI, and do you mean envoy or envoy mobile?

@alyssawilk
Copy link
Contributor Author

I want to run one of the Envoy CIs with LIBRARY_DEFAULT_ALWAYSLINK = 0
Given this is currently defined in a file I don't think I can - I'd have to fix it upstream in E-M. Is there a way to get it from an environment variable or other so I can set it to 0 in one of the Envoy builds and prevent regressions?

Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
@alyssawilk alyssawilk changed the title build: removing alwayslink from Enovy CC libraries build: making alwayslink optional in Enovy CC libraries Oct 27, 2022
Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
deps += tcmalloc_external_deps(repository)
# If alwayslink is not specified, allow turning it off via --define=library_autolink=disabled
# alwayslink is defaulted on for envoy_cc_extensions to ensure the REGISTRY macros work.
if not(alwayslink):
Copy link
Member

Choose a reason for hiding this comment

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

huh, i've never seen this one. this is still false if the call site passes 0 right?

Signed-off-by: Alyssa Wilk <alyssar@chromium.org>

# If alwayslink is not specified, allow turning it off via --define=library_autolink=disabled
# alwayslink is defaulted on for envoy_cc_extensions to ensure the REGISTRY macros work.
if not (alwayslink):
Copy link
Member

Choose a reason for hiding this comment

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

if this is just the normal not keyword I think we need to check against None explicitly, otherwise I think 0 will be false-y

Suggested change
if not (alwayslink):
if alwayslink == None:

Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
@alyssawilk alyssawilk enabled auto-merge (squash) October 31, 2022 15:51
@alyssawilk alyssawilk merged commit 321fcb2 into envoyproxy:main Nov 1, 2022
alyssawilk added a commit to envoyproxy/envoy-mobile that referenced this pull request Nov 2, 2022
Fixing issue merging in envoyproxy/envoy#23676

Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
dubious90 pushed a commit to envoyproxy/nighthawk that referenced this pull request Nov 7, 2022
- Still good:
  - ci/run_envoy_docker.sh
  - tools/gen_compilation_database.py
  - python requirements
- `LEGACY_ALWAYSLINK` is needed after envoyproxy/envoy#23676

Signed-off-by: eric846 <56563761+eric846@users.noreply.github.com>
jpsim pushed a commit that referenced this pull request Nov 29, 2022
Fixing issue merging in #23676

Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
Signed-off-by: JP Simard <jp@jpsim.com>
@alyssawilk alyssawilk deleted the noalwayslink branch April 5, 2023 16:39
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