-
Notifications
You must be signed in to change notification settings - Fork 7
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
Using With Rust Application? #40
Comments
PS. I managed to get .devcontainer running on Mac M1.
{
"runArgs": ["--platform=linux/amd64" ],
} |
Thanks for looking into the project. Can you share what you're trying to do? Update Rust? Something else? It has been a while since I spun this up in a devcontainer. Back in the day I had to lock this down. I noticed some tests are failing but not looked into it. Would gladly take any help here. |
@metaskills I was just trying to compile the extension on Mac M1 because Line 93 in 1c4dc29
and releases do not contain binaries in the assets. Only 1.0.0 has assets. It is most likely caused by CI error https://github.com/rails-lambda/crypteia/actions/runs/5038969425/job/13642324589#step:3:10 I remember getting the same error as the one in CI/CD https://github.com/rails-lambda/crypteia/actions/runs/5858183970/job/15881726916#step:3:561
Or something else as well. The benefit of compiling with I also discovered that project cannot build with the nightly rust
should fix the build errors. At the moment I do not have the capacity to look into CI/CD of this project but I think it may become a part of our infrastructure so I could spend some more time contributing back. A little bit OT: |
So, WRT to the x86... this project is not setup to work on arm64... at least from a dev environment. GitHub Actions is x86 (for now) and the whole project is setup to work from that perspective and build arm64 using QEMU emulation. When I would work with this project in Codespaces, since I too have an M2 Mac, my Codespace would be x86. Ideally the Devcontainer folder would work for local VS Code development, but that would require changing a bunch of code and hence break the CI/CD & Package pipelines because they use the Devcontainer. Does all that make sense? One way around this locally would be to install Colima which forces all Docker contexts to be x86 emulated on the Mac. But I should not ask folks to do that since running Colima default context is just going to make your Docker experience slow, but if you knew how to dynamic switch contexts... I do, pretty easy... then that could be a solution. Ideally, if GitHub would come out with arm64 runners for Actions... maybe the work to make it compatible with x86 and arm64 from a Dev, CI/CD, and Package would be worth the work.
Yup, should work with all managed runtimes on Amazon Linux 2. Last I checked. Simple Docker install should be fine. |
I see, all that makes sense. But I have no clue who LD_PRELOAD not working with it. I suspect it has to do something with linking. I asked about this issue in cargo lambda, so let's see if something comes up. I am trying to compile my project also in docker and see if that makes any difference with LD_PRELOAD UPDATE: even after all shenanigans dockers and OS's, LD_PRELOAD isn't working so I am quite confident with |
So are you saying you are using a certain version, like this and it is not working? If so I'd like to hear more about that. |
For example, would you try |
Yes, I did enable the debug Env var, it all works as expected. I will try the image in a week (going off). When navigating around the code I noticed the hack for Python and the mention of LibC vs Glib. Here I absolutely do not know what am I talking about because it's the first time I am trying to read anything about it and it's not easy to find digestible docs. But it makes me wonder if it has to do anything with rust as well but here are their rust versions |
Ouch. Heard. Docs are hard :(
Nah... PHP should be the only outlier. For some reason the team that wrote PHP did not use libc's getenv. Quick questions... are you trying to use this extension with a Rust runtime? |
Yes I wanted to use it with Rust runtime as well as other languages.
|
@metaskills do you have any idea why it does not work with the rust runtime? |
No idea. Googling suggests that there is nothing about a Rust app that would not be able to leverage LD_PRELOAD. I guess that could mean there are some ways you could writ the Rust app to not work with libc's getenv, such as Python did. |
I will need to make a small poc and override different functions. There are
other ways than redhook so may need to try that. Unfortunately I do not
have time for this atm. so I will just read the envs from ssm in runtime.
Maybe some weekend learning will allow me to build a poc. Can you point me
to some docs around this?
Or even concepts because I know nothing about C Api etc...
…On Fri, Aug 25, 2023, 13:57 Ken Collins ***@***.***> wrote:
No idea. Googling suggests that there is nothing about a Rust app that
would not be able to leverage LD_PRELOAD. I guess that could mean there are
some ways you could writ the Rust app to not work with libc's getenv, such
as Python did.
—
Reply to this email directly, view it on GitHub
<#40 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABZCK5RF7SYQRENWTGUS6HLXXCHJXANCNFSM6AAAAAA3PJKJ7I>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
I'd have to Google around myself and would look to you for help with that. One thing I would do is write a very very very small Rust program to test with and verify if/why at the smallest level this is not (or is) working. If it is, I can add a test case here like the other languages. If not, then we can look into other solutions. Like, could this repo be a cargo package that you can build in the behavior right into your app? |
Hi, I spent the afternoon trying to build this and I only managed to build this using cargo-lambda - because it is using zig build https://www.cargo-lambda.info/commands/build.html#compiler-backends
In Codespace and after modification of
.devcontainer
I've got an error + warnings in the newer rustThe text was updated successfully, but these errors were encountered: