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

fix rustflags for musl targets #75599

Merged
merged 1 commit into from
Feb 3, 2025
Merged

fix rustflags for musl targets #75599

merged 1 commit into from
Feb 3, 2025

Conversation

sokra
Copy link
Member

@sokra sokra commented Feb 3, 2025

What?

napi sets the RUSTFLAGS env var for musl targets: https://github.com/napi-rs/napi-rs/blob/2d8e19d7c626405287b73a52dc91731c3b89c8df/cli/src/api/build.ts#L467-L485
this means our .cargo/config.toml rustflags are not applied.
This fixes that by adding the RUSTFLAGS env var to the build script

Closes PACK-3844

napi sets the RUSTFLAGS env var for musl targets: https://github.com/napi-rs/napi-rs/blob/2d8e19d7c626405287b73a52dc91731c3b89c8df/cli/src/api/build.ts#L467-L485
this means out .cargo/config.toml rustflags are not applied.
This fixes that my adding the RUSTFLAGS env var to the build script
@ijjk ijjk added the created-by: Turbopack team PRs by the Turbopack team. label Feb 3, 2025
Copy link
Member Author

sokra commented Feb 3, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

@sokra sokra requested a review from bgw February 3, 2025 07:52
@sokra sokra marked this pull request as ready for review February 3, 2025 07:52
@ijjk
Copy link
Member

ijjk commented Feb 3, 2025

Failing test suites

Commit: 8b53be8

pnpm test-start-turbo test/e2e/app-dir/rewrite-headers/rewrite-headers.test.ts (turbopack)

  • rewrite-headers > middleware rewrite external Prefetch RSC (/hello/vercel) > should have the expected headers
  • rewrite-headers > middleware rewrite external RSC (/hello/vercel) > should have the expected headers
Expand output

● rewrite-headers › middleware rewrite external RSC (/hello/vercel) › should have the expected headers

expect(received).toEqual(expected) // deep equality

- Expected  - 1
+ Received  + 1

  Object {
-   "x-nextjs-rewritten-path": null,
+   "x-nextjs-rewritten-path": "/home",
    "x-nextjs-rewritten-query": null,
  }

  404 |         })
  405 |
> 406 |         expect(headers).toEqual(expected)
      |                         ^
  407 |       })
  408 |     }
  409 |   )

  at Object.toEqual (e2e/app-dir/rewrite-headers/rewrite-headers.test.ts:406:25)

● rewrite-headers › middleware rewrite external Prefetch RSC (/hello/vercel) › should have the expected headers

expect(received).toEqual(expected) // deep equality

- Expected  - 1
+ Received  + 1

  Object {
-   "x-nextjs-rewritten-path": null,
+   "x-nextjs-rewritten-path": "/home",
    "x-nextjs-rewritten-query": null,
  }

  404 |         })
  405 |
> 406 |         expect(headers).toEqual(expected)
      |                         ^
  407 |       })
  408 |     }
  409 |   )

  at Object.toEqual (e2e/app-dir/rewrite-headers/rewrite-headers.test.ts:406:25)

Read more about building and testing Next.js in contributing.md.

@sokra sokra requested a review from mischnic February 3, 2025 09:53
@eps1lon eps1lon merged commit bcef4dd into canary Feb 3, 2025
129 of 141 checks passed
@eps1lon eps1lon deleted the sokra/fix-musl-build branch February 3, 2025 10:15
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 17, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
created-by: Turbopack team PRs by the Turbopack team. locked
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants