Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
srcbuild srcbuild
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Labels
    • Labels
  • Merge requests 2
    • Merge requests 2
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • Members
    • Members
  • Activity
  • Graph
  • Jobs
  • Commits
Collapse sidebar
  • RiscOS
    • UUtilities
  • Release
  • srcbuildsrcbuild
  • Merge requests
  • !7

Closed
Created Nov 15, 2022 by Theo Markettos@tmarkettos
  • Report abuse
Report abuse

Fix sb_system() to propagate PATH correctly using execvpe()

  • Overview 5
  • Commits 1
  • Changes 1

srcbuild contains its own version of system(), in which it forks and execs a new process when running commands like 'mkdir' on Unix. In previous versions this used execve(), but this does not propagate the PATH from parent to child. This is unfortunate because 'mkdir' might actually live in '/usr/bin/mkdir'. We could resolve the binary in the parent by walking $PATH before passing to execve(), but this is messy. Hence we use execvpe() to pass $PATH as well as environment through to the new process.

However execvpe() doesn't exist on MacOS, so as a workaround we use system() as RISC OS does.

(Building on MacOS is at present broken for other reasons, so it's not possible to test this)

I'm not sure the correct way to build this on RISC OS (I tried the BuildHost product, but that had a lot of unrelated errors) so I'm not able to test that it still builds. It is merely a #ifdef changed to a #if in the RISC OS build - there should be no code changes from the RISC OS perspective.

Assignee
Assign to
Reviewer
Request review from
None
Milestone
None
Assign milestone
Time tracking
Source branch: cross-execvpe