-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Building new architecture sources on Windows #33582
Conversation
LogError: RequestError [HttpError]: Must have admin rights to Repository.
at /root/react-native/bots/node_modules/@octokit/request/dist-node/index.js:86:21
at processTicksAndRejections (internal/process/task_queues.js:95:5) {
status: 403,
response: {
url: 'https://api.github.com/repos/facebook/react-native/issues/33582/labels',
status: 403,
headers: {
'access-control-allow-origin': '*',
'access-control-expose-headers': 'ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset',
connection: 'close',
'content-encoding': 'gzip',
'content-security-policy': "default-src 'none'",
'content-type': 'application/json; charset=utf-8',
date: 'Tue, 12 Apr 2022 11:50:03 GMT',
'referrer-policy': 'origin-when-cross-origin, strict-origin-when-cross-origin',
server: 'GitHub.com',
'strict-transport-security': 'max-age=31536000; includeSubdomains; preload',
'transfer-encoding': 'chunked',
vary: 'Accept-Encoding, Accept, X-Requested-With',
'x-accepted-oauth-scopes': '',
'x-content-type-options': 'nosniff',
'x-frame-options': 'deny',
'x-github-media-type': 'github.v3; format=json',
'x-github-request-id': 'CE54:7611:3EA982:907346:6255676B',
'x-oauth-scopes': 'public_repo',
'x-ratelimit-limit': '5000',
'x-ratelimit-remaining': '4964',
'x-ratelimit-reset': '1649766854',
'x-ratelimit-resource': 'core',
'x-ratelimit-used': '36',
'x-xss-protection': '0'
},
data: {
message: 'Must have admin rights to Repository.',
documentation_url: 'https://docs.github.com/rest/reference/issues#add-labels-to-an-issue'
}
},
request: {
method: 'POST',
url: 'https://api.github.com/repos/facebook/react-native/issues/33582/labels',
headers: {
accept: 'application/vnd.github.v3+json',
'user-agent': 'octokit.js/16.43.2 Node.js/14.18.1 (Linux 5.13; x64)',
authorization: 'token [REDACTED]',
'content-type': 'application/json; charset=utf-8'
},
body: '{"labels":["Pick Request"]}',
request: { hook: [Function: bound bound register] }
}
}
danger-results://tmp/danger-results.json |
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.
Great stuff! Thanks for looking into this @mganandraj and thanks for leaving the great explanation. Left a couple of comments that needs to be addressed before we can land this
ReactAndroid/build.gradle
Outdated
project.hasProperty("newArchEnabled") && | ||
project.newArchEnabled == "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.
Those two are probably unnecessary. You will be including ReactAndroid/build.gradle
only when using the new arch.
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 think we need to keep those check for those who directly build the react-native repo to launch rntester, but don't want to enable new arch..
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 think we need to keep those check for those who directly build the react-native repo to launch rntester, but don't want to enable new arch..
RN-Tester has New Arch enabled by default and can't be turned off there. It consumes RN from source so you'll end up failing the build there regardeless (or maybe the paths are short enough as there is no node_modules/react-native/ReactAndroid
extra involved in the path).
Base commit: 7dceb9b |
Base commit: 7dceb9b |
Could you also point this PR to |
Sorry, I've just realized this can't target |
Makese sense .. Ill limit the PR to 'template/android' changes .. |
I've submitted also #33611 which could superseed this one. I'm looking for someone to test it though. @mganandraj would you be able to give it a try? |
d8af84e
to
5d61e63
Compare
Hey @mganandraj I've force pushed including my suggestions. Let me know if that doesn't work for you We should be good to go merging this then 👍 |
5d61e63
to
b899bbc
Compare
On Windows there are limits on number of character in file paths and in command lines Ref: https://android.googlesource.com/platform/ndk/+/master/docs/BuildSystemMaintainers.md#Path-Length-Limits NDK allows circumventing command line limits using response(RSP) files as inputs using NDK_APP_SHORT_COMMANDS flag. Windows can support long file paths if configured through registry or by prefixing all file paths with a special character sequence The latter requires changes in NDK. And there are tools in NDK (AR) which is not able to handle long paths (>256) even after setting the registry key. The new architecutre source tree is too deep, and the object file naming conventions in NDK makes the matters worse, by producing incredibly long file paths. Other solutions such as symlinking source code etc. didn't work as expected, and makes the build scripts complicated and hard to manage. This change temporarily works around the issue by placing the temporary build outputs as short a path as possible within the project path. Changelog: [Android] [Fixed] - Fix for building new architecture sources on Windows
b899bbc
to
5a8033d
Compare
Here's my full trace testing v3 of this patch from a couple hours ago (last push I think) TL;DR: it worked to a point but still may have some issues? (that is, it worked for project rooted in C:\RN068 but failed with project rooted in C:\Users\micro\work\react-random\RN068 |
Great.. I'll merge the change asap .. |
Yeah, I'm looking for a more general solution.. ndk r23 improves the situation by avoiding ar, ld etc. but still has some issues which I'm looking into.. |
On Windows there are limits on number of character in file paths and in command lines
Ref: https://android.googlesource.com/platform/ndk/+/master/docs/BuildSystemMaintainers.md#Path-Length-Limits
NDK allows circumventing command line limits using response(RSP) files as inputs using NDK_APP_SHORT_COMMANDS flag.
Windows can support long file paths if configured through registry or by prefixing all file paths with a special character sequence
The latter requires changes in NDK. And there are tools in NDK (AR) which is not able to handle long paths (>256) even after setting the registry key.
The new architecutre source tree is too deep, and the object file naming conventions in NDK makes the matters worse, by producing incredibly long file paths.
Other solutions such as symlinking source code etc. didn't work as expected, and makes the build scripts complicated and hard to manage.
This change temporarily works around the issue by placing the temporary build outputs as short a path as possible within the project path.
Summary
Changelog
[CATEGORY] [TYPE] - Message
Test Plan