-
Notifications
You must be signed in to change notification settings - Fork 907
[devbundle] Statically link opentitantool & hsmtool #28561
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
base: earlgrey_1.0.0
Are you sure you want to change the base?
Conversation
Opentitantool depends on libudev which can cause portability issues between different runtime environments. 1. Add a flag which permits statically linking host tools. 2. Supply `libudev-zero` which is a no-dependencies replacement for libudev. 3. Add some flags machinery for controlling whether opentitantool is statically linked (default: no). 4. Deliver statically linked opentitantool and hsmtool in the devbundle. Signed-off-by: Chris Frantz <[email protected]>
2f9caef to
e66fd37
Compare
|
|
||
| def _flags_transition_impl(settings, attr): | ||
| result = {} | ||
| for label, value in attr.flags.items(): |
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 haven't tested locally but I think the most reliable way to avoid the issue with @@/ is to convert every label-string to its canonical form by doing str(Label(s)). If you do the same in the definition of _FLAG_CONVERSIONS, I think you can avoid the hack.
It might also be a good idea to fail in the rule if you get a flag which is not in _FLAG_CONVERSIONS?
|
|
||
| def _build_with_flags_impl(ctx): | ||
| # Start with DefaultInfo and then forward on any other providers we know about. | ||
| result = [ctx.attr.target[DefaultInfo]] |
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 surprised that this works, bazel often complains if you try to copy a DefaultInfo and forces you to recreate it in the rule. Maybe it depends on the content?
| configure_make( | ||
| name = "libelf", | ||
| args = ["-j"], | ||
| #autoreconf = True, |
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.
Is this commented on purpose?
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.
Overall it makes sense to me. I didn't know about libudev-zero and I don't know how well it plays with opentitantool, I guess the main user would be libusb?
|
Yes, libusb is my question too. On my machine OT-tool binary depends on (apart from libssl,libcrypto and glibc libraries), |
In order to run in foreign CI environments, we need to statically link verilator to avoid glibc versioning issues. Worse, the current debian/ubuntu package for `libelf` has an error that prevents static linking. - Include the latest upstream libelf which corrects the linking error. - Set the CFLAGS and LDFLAGS environment variables during the build of the simulator to statically link and include the upstream libelf. Signed-off-by: Chris Frantz <[email protected]>
e66fd37 to
6a23f6d
Compare
Opentitantool depends on libudev which can cause portability issues
between different runtime environments.
libudev-zerowhich is a no-dependencies replacement forlibudev.
statically linked (default: no).