Closed Bug 1576054 Opened 4 months ago Closed 24 days ago

RLBox - RLBox Lucet sandbox repo's dependencies refer functions available in newer libc - which breaks the build

Categories

(Core :: General, defect, P3)

x86_64
Linux
defect

Tracking

()

RESOLVED FIXED
mozilla72
Tracking Status
firefox72 --- fixed

People

(Reporter: shravanrn, Assigned: shravanrn)

References

Details

Attachments

(1 file, 1 obsolete file)

The RLBox Lucet sandbox repo is a rust library. It has dependencies that transitively depend on the rust crate "nix". nix provides wrappers to common libc functions including those that are only when using a newer GNU libc. These newer functions are not allowed in Firefox, and do not work on try servers.

While these functions are never used by the library, including a reference to them creates an unresolved symbol error. We need to find a way to get past this. Possible solutions include

  1. maintaining a fork of nix with these wrappers removed
  2. upstreaming a feature switch to nix which allows compilation without these wrappers
  3. adding a functions with these names, that simply abort...
  4. something else altogether...

Nathan: Actually, I was wondering if there is a reason using GNU extension functions isn't allowed in rust code?

I have opened a bug on the nix package which is the package using these functions to see if they are open to adding a feature flag that removes this. While this gets resolved, I was wondering if it was possible/easy to allow calls to GNU extension functions from rust code... If so, this would definitely be the simplest way forward

The GNU functions in question are process_vm_writev, process_vm_readv and setns

Flags: needinfo?(nfroyd)

Hmm... also in the try build, it seems the triple specified to the rust compiler is x86_64-unknown-linux-gnu indicating that the gnu extensions are available, that makes this more confusing...

[task 2019-08-31T23:33:34.150Z] 23:33:34     INFO -  /builds/worker/fetches/rustc/bin/cargo rustc  --frozen --manifest-path /builds/worker/workspace/build/src/toolkit/library/rust/Cargo.toml -vv --lib --target=x86_64-unknown-linux-gnu --features 'gecko_debug gecko_refcount_logging quantum_render cubeb_pulse_rust simd-accel cubeb-remoting moz_memory moz_places gecko_profiler gecko_profiler_parse_elf new_xulstore new_cert_storage include_rlbox_lucet_sandbox' --

Hmm... upstream nix rejected option 2 above...

Summary: RLBox - RLBox Lucet sandbox repo's dependencies have references to GNU extension functions - which breaks the build → RLBox - RLBox Lucet sandbox repo's dependencies refer functions available in newer libc - which breaks the build

Depends on D44341

Implemented option 1 from above

Attachment #9089780 - Attachment description: Bug 1576054 part 1 - Use forked rust/nix that removes references to unsupported libc functions r=erahm,froydnj → Bug 1576054 part 1 - Use forked rust/nix that removes references to newer libc functions setns, process_vm_writv, process_vm_readv. References to these functions create missing symbols in gkrust, which is configured to a build failure in Firefox r=froydnj
Attachment #9089781 - Attachment description: Bug 1576054 part 2 - Vendor rust for forked rust/nix package r=erahm,froydnj → Bug 1576054 part 2 - Vendor rust for forked rust/nix package r=froydnj

(In reply to Shravan Narayan from comment #1)

Nathan: Actually, I was wondering if there is a reason using GNU extension functions isn't allowed in rust code?

I have opened a bug on the nix package which is the package using these functions to see if they are open to adding a feature flag that removes this. While this gets resolved, I was wondering if it was possible/easy to allow calls to GNU extension functions from rust code... If so, this would definitely be the simplest way forward

The GNU functions in question are process_vm_writev, process_vm_readv and setns

I think we have resolved this question; please ping me again if that's not true.

Flags: needinfo?(nfroyd)
Attachment #9089780 - Attachment description: Bug 1576054 part 1 - Use forked rust/nix that removes references to newer libc functions setns, process_vm_writv, process_vm_readv. References to these functions create missing symbols in gkrust, which is configured to a build failure in Firefox r=froydnj → Bug 1576054 part 1 - Use forked rust/nix that removes references to newer libc functions setns, process_vm_writv, process_vm_readv. References to these functions create missing symbols in gkrust, which is configured to a build failure in Firefox...
Attachment #9089780 - Attachment description: Bug 1576054 part 1 - Use forked rust/nix that removes references to newer libc functions setns, process_vm_writv, process_vm_readv. References to these functions create missing symbols in gkrust, which is configured to a build failure in Firefox... → Bug 1576054 part 1 - Use forked rust/nix that removes references to newer libc functions setns, process_vm_writv, process_vm_readv. References to these functions create missing symbols in gkrust, which is configured to a build failure in Firefox r=froydnj
Attachment #9089780 - Attachment description: Bug 1576054 part 1 - Use forked rust/nix that removes references to newer libc functions setns, process_vm_writv, process_vm_readv. References to these functions create missing symbols in gkrust, which is configured to a build failure in Firefox r=froydnj → Bug 1576054 part 1 - Use forked rust/nix that removes references to newer libc functions setns, process_vm_writv, process_vm_readv. References to these functions create missing symbols in gkrust, which is configured to a build failure in Firefox...
Attachment #9089780 - Attachment description: Bug 1576054 part 1 - Use forked rust/nix that removes references to newer libc functions setns, process_vm_writv, process_vm_readv. References to these functions create missing symbols in gkrust, which is configured to a build failure in Firefox... → Bug 1576054 part 1 - Use forked rust/nix that removes references to newer libc functions setns, process_vm_writv, process_vm_readv. References to these functions create missing symbols in gkrust, which is configured to a build failure in Firefox r=froydnj
Attachment #9089780 - Attachment description: Bug 1576054 part 1 - Use forked rust/nix that removes references to newer libc functions setns, process_vm_writv, process_vm_readv. References to these functions create missing symbols in gkrust, which is configured to a build failure in Firefox r=froydnj → Bug 1576054 part 1 - Use forked rust/nix that removes references to newer libc functions setns, process_vm_writv, process_vm_readv. References to these functions create missing symbols in gkrust, which is configured to a build failure in Firefox...
Attachment #9089780 - Attachment description: Bug 1576054 part 1 - Use forked rust/nix that removes references to newer libc functions setns, process_vm_writv, process_vm_readv. References to these functions create missing symbols in gkrust, which is configured to a build failure in Firefox... → Bug 1576054 - Use forked rust/nix that removes references to newer libc functions setns, process_vm_writv, process_vm_readv. References to these functions create missing symbols in gkrust, which is configured to a build failure in Firefox r=froydnj
Attachment #9089781 - Attachment is obsolete: true
Pushed by nfroyd@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/db942d515d8e
Use forked rust/nix that removes references to newer libc functions setns, process_vm_writv, process_vm_readv. References to these functions create missing symbols in gkrust, which is configured to a build failure in Firefox r=froydnj
Status: NEW → RESOLVED
Closed: 24 days ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla72
You need to log in before you can comment on or make changes to this bug.