Skip to content
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

abi generation failure on Windows (outside of wsl) - always #1221

Open
dj8yfo opened this issue Jul 30, 2024 · 13 comments
Open

abi generation failure on Windows (outside of wsl) - always #1221

dj8yfo opened this issue Jul 30, 2024 · 13 comments
Assignees
Labels

Comments

@dj8yfo
Copy link
Collaborator

dj8yfo commented Jul 30, 2024

Steps to reproduce: cargo build --features near-sdk/__abi-generate on any contract

More details: near/cargo-near#188

Problematic target is x86_64-pc-windows-msvc
image

@Jemiiah
Copy link

Jemiiah commented Jul 30, 2024

@dj8yfo i would love to work on this issue may I ?

Copy link

onlydustapp bot commented Jul 30, 2024

Hey @Jemiiah!
Thanks for showing interest.
We've created an application for you to contribute to near-sdk-rs.
Go check it out on OnlyDust!

@frol frol added good first issue Good for newcomers bug ODHack labels Jul 30, 2024
@frol
Copy link
Collaborator

frol commented Jul 30, 2024

@Jemiiah How is your Rust experience? Please, try to reproduce the issue first and if you have an idea of where to look at, apply it via OnlyDust website.

@Josh-121
Copy link

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

Software engineering background with contributions to similar projects in past odhacks

How I plan on tackling this issue

I would use the provided info from the guide and make necessary adjustments & implementations

@frol
Copy link
Collaborator

frol commented Jul 31, 2024

@Josh-121 Do you have Windows machine to reproduce the issue? Do you have understanding of the DLL / shared symbols topic to address the problem we have here?

P.S. First thing we should try is to enable unit-testing feature: cargo build --features near-sdk/__abi-generate,unit-testing, see #1168 (comment) for context. If that will fix it, we would need to make sure we enable mocked blockchain functions (storage_read, ...) together with near-sdk/__abi-generate feature.

@Josh-121
Copy link

@Josh-121 Do you have Windows machine to reproduce the issue? Do you have understanding of the DLL / shared symbols topic to address the problem we have here?

P.S. First thing we should try is to enable unit-testing feature: cargo build --features near-sdk/__abi-generate,unit-testing, see #1168 (comment) for context. If that will fix it, we would need to make sure we enable mocked blockchain functions (storage_read, ...) together with near-sdk/__abi-generate feature.

Yes I do. I'll be working on that

@ScottyDavies
Copy link

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged
I am a backend developer who usually works with django and I have made use of OAuth on a number of projects. I want to contribute on this proJect

How I plan on tackling this issue
Understand the Issue: The cargo build --features near-sdk/__abi-generate command is failing on Windows, while other commands succeed, suggesting an issue with the ABI generation process.
Reproduce the Issue: Set up a fresh Windows environment and follow the steps to reproduce the problem.
Analyze Logs: Carefully examine the error logs to identify potential root causes.
Research Solutions: Look into the Rust RFC 1717 on DllImport and explore other known workarounds or fixes.
Implement and Test: Develop a solution, test it thoroughly, and document the implementation details.
Contribute the Solution: Submit a pull request to the near/cargo-near repository with the solution.

Copy link

onlydustapp bot commented Jul 31, 2024

Hi @ScottyDavies!
Maintainers during the ODHack #6.0 will be tracking applications via OnlyDust.
Therefore, in order for you to have a chance at being assigned to this issue, please apply directly here, or else your application may not be considered.

@lauchaves
Copy link
Contributor

lauchaves commented Jul 31, 2024

hey @frol is this the right way to reproduce it?

Im using windows btw

image

if so, looks good to me 🤔

@dj8yfo
Copy link
Collaborator Author

dj8yfo commented Jul 31, 2024

@lauchaves the issue 😭 occurred with x86_64-pc-windows-msvc rust target in Command shell and PowerShell.

It looks like it's ok with x86_64-pc-windows-gnu rust target in MinGW environment. Please confirm the latter, if you feel like doing so

@lauchaves
Copy link
Contributor

lauchaves commented Aug 1, 2024

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

Hi again! Lau here 👋. I've been contributing these days! I'd like to give this one a try!

How I plan on tackling this issue

Earlier I tried to reproduce it on my end, but it seems to work on x86_64-pc-windows-gnu which is my current setup so...

  • I'll set up the x86_64-pc-windows-msvc for cmd and PowerShell (I'll install that target as the default for powershell).
  • I'd reproduce the issue.
  • I'll give Frol's approach a try, which is to enable the unit-testing feature with: cargo build --features near-sdk/__abi-generate, unit-testing, hoping it works. If not, I'll keep investigating and def read about DLL/shared symbols!

@Josh-121
Copy link

Josh-121 commented Aug 1, 2024

@Josh-121 Do you have Windows machine to reproduce the issue? Do you have understanding of the DLL / shared symbols topic to address the problem we have here?

P.S. First thing we should try is to enable unit-testing feature: cargo build --features near-sdk/__abi-generate,unit-testing, see #1168 (comment) for context. If that will fix it, we would need to make sure we enable mocked blockchain functions (storage_read, ...) together with near-sdk/__abi-generate feature.

I now have it setup as well on my windows & know about dll/shared symbols as previously mentioned. Still awaiting ur response so far

@frol
Copy link
Collaborator

frol commented Aug 1, 2024

@Josh-121 Please, go ahead.

@lauchaves I want to maximize chances of everyone to participate in contributions to NEAR stack, but I will find more issues to work on later today

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants