Bazel: add define flag for exporting symbols#2331
Bazel: add define flag for exporting symbols#2331mattklein123 merged 1 commit intoenvoyproxy:masterfrom
Conversation
6e667f4 to
b4dca3e
Compare
bazel/envoy_build_system.bzl
Outdated
| # See note here: http://luajit.org/install.html | ||
| "-pagezero_size 10000", "-image_base 100000000", | ||
| ], | ||
| "//bazel:enable_exported_symbols": [ |
There was a problem hiding this comment.
I think this could be a separate select statement which is + with the existing one. You can actually factor out a bunch of common list entries into a separate item that is + with this as well.
bazel/envoy_build_system.bzl
Outdated
| "-pagezero_size 10000", "-image_base 100000000", | ||
| ], | ||
| "//bazel:enable_exported_symbols": [ | ||
| '-L/usr/local/lib/lua/5.1/', |
There was a problem hiding this comment.
This won't work in many environments. Is there a more generic way to handle this?
There was a problem hiding this comment.
oops, Let me relook into this I was doing a lot of troubleshooting before and this just slipped by me :|
bazel/envoy_build_system.bzl
Outdated
| # --build-id and avoid doing the following. | ||
| '-Wl,--build-id=md5', | ||
| '-Wl,--hash-style=gnu', | ||
| '-Wl,-E', |
There was a problem hiding this comment.
Can you add a comment above this line also explaining what it does and why needed?
mattklein123
left a comment
There was a problem hiding this comment.
Thank you for doing this! Few comments. @jmillikin-stripe or @htuch do you mind taking a look also?
bazel/envoy_build_system.bzl
Outdated
| "-static-libgcc", | ||
| ], | ||
| "//conditions:default": [ | ||
| '-L/usr/local/lib/lua/5.1/', |
There was a problem hiding this comment.
Is this needed in the default static linking case?
bazel/envoy_build_system.bzl
Outdated
| "-pagezero_size 10000", "-image_base 100000000", | ||
| ], | ||
| "//bazel:enable_exported_symbols": [ | ||
| '-L/usr/local/lib/lua/5.1/', |
There was a problem hiding this comment.
Is this path going to be consistent across machines? Does it also need to be configurable?
bazel/envoy_build_system.bzl
Outdated
| # --build-id and avoid doing the following. | ||
| '-Wl,--build-id=md5', | ||
| '-Wl,--hash-style=gnu', | ||
| '-Wl,-E', |
There was a problem hiding this comment.
Instead of replicating the entire block just to add -E could we possibly have this be the output of a function that keys off of whether this feature is enabled or not? Then we can just call the function below?
bazel/README.md
Outdated
|
|
||
| The following optional features can be enabled on the Bazel build command-line: | ||
|
|
||
| * Exported symbols during linking with `--define exported_symbols=enabled` |
There was a problem hiding this comment.
nit: Could we add a brief description of why someone would want to do this?
bazel/envoy_build_system.bzl
Outdated
There was a problem hiding this comment.
This comment isn't very descriptive :) Probably best to say what exported symbols are..
There was a problem hiding this comment.
embarrassing, i did some work on this and pushed it up before i left the office 😱
bazel/envoy_build_system.bzl
Outdated
There was a problem hiding this comment.
More Pythonic to write if not linkopts: here.
RAW_RELEASE_NOTES.md
Outdated
|
Also, needs DCO fixup (https://github.com/envoyproxy/envoy/blob/master/CONTRIBUTING.md#fixing-dco). |
bazel/envoy_build_system.bzl
Outdated
There was a problem hiding this comment.
I believe you can use a hardcoded @envoy for the repository -- the only place where that wouldn't work (the Google internal fork) rewrites this file entirely (per htuch).
There was a problem hiding this comment.
I'll give that a shot thanks
htuch
left a comment
There was a problem hiding this comment.
Great, thanks. Still needs DCO fixup, see https://github.com/envoyproxy/envoy/blob/master/CONTRIBUTING.md#fixing-dco.
|
Just an update to this, while testing i ran into an error so i'll be doing some more work on this before its ready to go. |
8fb4876 to
c1778c6
Compare
|
@taion809 this looks good to merge. Are you suggesting we hold back or GTG? |
|
@htuch good to go, i did some more manual tests to make sure it was working as expected 👍 |
|
@taion809 looks like it needs to be merged again with master. |
The current problem with lua is that it is unable to use external libraries such as lrexlib installed via luarocks. The solution is to export the symbols needed by those libraries. Signed-off-by: Nicholas J <nicholas.a.johns5@gmail.com>
c1778c6 to
cb177f6
Compare
* initial commit * Add common as a dep * add common context * WIP3 * WIP5 * WIP7 * WIP3 * unblock client config * write mapper * add mapper * added all 4 http metrics * fix fast cache key * Temporarily disable test * enable common test * review comments * add explicit initialization to mappings * more review comments * more comments2 * make cache return reference instead of a pointer * remove copy * WIP direct mapping * more direct code * more simplification * refactor common, and StatsGen * add httbin backend for testing, add better logging * fix test namespace * prepare to add custom hash * add trivial local httpbin impl for testing * which to absl:hashValue * add missing test file * fix nits * add license header * fix function name * set max cache size * make istio_dimensions_ a member of rootContext. The mappings are overwritten before evaluation * elimiate Node abstraction from NodeInfoCache * try V4 only testing for prow * Fix getMetadataStruct return values
Signed-off-by: GitHub Action <noreply@github.com> Co-authored-by: jpsim <jpsim@users.noreply.github.com> Signed-off-by: JP Simard <jp@jpsim.com>
Signed-off-by: GitHub Action <noreply@github.com> Co-authored-by: jpsim <jpsim@users.noreply.github.com> Signed-off-by: JP Simard <jp@jpsim.com>
Bazel: add define flag for exporting symbols
Description:
The current problem with lua is that it is unable to use external
libraries such as lrexlib installed via luarocks.
The solution is to export the symbols needed by those libraries.
Risk Level: Low
Testing:
I tested this manually. Here is an example lua script and envoy configuration.
{ "listeners": [ { "address": "tcp://0.0.0.0:5555", "filters": [ { "name": "http_connection_manager", "config": { "codec_type": "auto", "add_user_agent": true, "use_remote_address": true, "idle_timeout_s": 840, "stat_prefix": "frontrouter", "route_config": { "virtual_hosts": [ { "name": "backend", "domains": ["*"], "routes": [ { "prefix": "", "cluster": "echoer-backend", "auto_host_rewrite": false } ] } ] }, "filters": [ { "name": "lua", "config": { "inline_code": "dofile(\"script.lua\")" } }, { "name": "router", "config": {} } ] } } ] } ], "cluster_manager": { "clusters": [ { "name": "echoer-backend", "connect_timeout_ms": 250, "type": "static", "lb_type": "round_robin", "hosts": [ { "url": "tcp://127.0.0.1:3000" } ] } ] } }Docs Changes:
envoyproxy/data-plane-api#405
Fixes issue #2251
Signed-off-by: Nicholas J nicholas.a.johns5@gmail.com