Skip to content

build: extract ninja cflags_cc from electron_app.ninja in spec runners #34209

Closed as not planned

Description

@ckerr

Discussed at

// TODO(ckerr) this is cribbed from read obj/electron/electron_app.ninja.
// Maybe it would be better to have this script literally open up that
// file and pull cflags_cc from it instead of using bespoke code here?
// I think it's unlikely to work; but if it does, it would be more futureproof
const cxxflags = [
'-std=c++14',
'-nostdinc++',
`-isystem"${path.resolve(BASE, 'buildtools', 'third_party', 'libc++')}"`,
`-isystem"${path.resolve(BASE, 'buildtools', 'third_party', 'libc++', 'trunk', 'include')}"`,
`-isystem"${path.resolve(BASE, 'buildtools', 'third_party', 'libc++abi', 'trunk', 'include')}"`,
'-fPIC'
].join(' ');
const ldflags = [
'-stdlib=libc++',
'-fuse-ld=lld',
`-L"${path.resolve(BASE, 'out', `${utils.getOutDir({ shouldLog: true })}`, 'obj', 'buildtools', 'third_party', 'libc++abi')}"`,
`-L"${path.resolve(BASE, 'out', `${utils.getOutDir({ shouldLog: true })}`, 'obj', 'buildtools', 'third_party', 'libc++')}"`,
'-lc++abi'
].join(' ');
but not implemented. Would have prevented the need for 41a03a5.

Most importantly, cxxflags -std= and -nostdinc++ are needed.

It's possible that the includes and isystem also need to be pulled in if it's necessary for the chromium/v8 and the 3rd party modules to be built with the same system system headers

Activity

  1. added
    upgrade-follow-up
    on May 12, 2022
  2. self-assigned this
    on May 12, 2022
  3. moved this to Blocks Stable in 20-x-yon May 16, 2022
  4. ckerr commented on Jul 27, 2022

    @ckerr
    MemberAuthor

    I'm not sure how to proceed with this ticket:

    The original scope was to sync cflags between the Electron build and the specs. In that situation where we know the build sandbox is available, we could do something like gn desc /path/to/src/out //electron:electron_app cflags_cc to pull out the build cflags.

    But it looks like there's also the question of syncing it between Electron and electron-rebuild as discussed at electron/rebuild#1022 which maybe makes things a little more complicated? I'm not aware of a good way to shuttle these cflags (e.g. --std=c++17 vs --std=c++14) from Electron to electron-rebuild so that they'll be in sync.

    Options:

    • Maybe someone has an idea of how to cleanly sync between electron/electron and electron/electron-rebuild. (@MarshallOfSound? @nornagon?)

    • If all else fails, we could hardcode everything to --std=c++17. V8 FTBFS without that flag, so it's a hard requirement for E20. That would unblock this issue for E20 (it's marked as blocks-stable) and would clear us until Chromium starts using `--std=c++20 sometime in 2025 😄, but it's not as satisfying as a non-hardcoded fix.

  5. moved this from Blocks Stable to Fixed for Next Release in 20-x-yon Aug 1, 2022
  6. github-actions commented on Oct 26, 2022

    @github-actions
    Contributor

    This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment!

  7. github-actions commented on Nov 26, 2022

    @github-actions
    Contributor

    This issue has been closed due to inactivity, and will not be monitored. If this is a bug and you can reproduce this issue on a supported version of Electron please open a new issue and include instructions for reproducing the issue.

  8. Govind-gupta75 commented on Dec 13, 2022

    @Govind-gupta75

    bump

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

staleupgrade-follow-up

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions