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

Initial draft of ninja support #3508

Closed
wants to merge 19 commits into from
Closed

Initial draft of ninja support #3508

wants to merge 19 commits into from

Conversation

randombit
Copy link
Owner

This is sufficient to build the static library, but there is a lot more work to be done here. Many missing targets, also I think there is something wrong with the dependencies since ninja tries to link the cli before the library has finished.

@securitykernel @reneme or whoever, feel free to either push onto this branch or take it as a base for a new PR. I probably am not going to do any more work towards this, with the exception that if there are bugs/missing features in the template language that are needed I would take that part.

#3495

@securitykernel
Copy link
Collaborator

Fixed the CLI build in 26bdd18.

@coveralls
Copy link

coveralls commented Aug 2, 2023

Coverage Status

coverage: 91.707% (+0.03%) from 91.676% when pulling 0f8b43c on jack/ninja-build into ee20e4a on master.

@securitykernel
Copy link
Collaborator

securitykernel commented Aug 11, 2023

Targets to include:

  • cli
  • tests
  • libs
  • docs
  • all
  • check
  • clean
  • distclean
  • install
  • fmt
  • tidy

@securitykernel
Copy link
Collaborator

securitykernel commented Aug 12, 2023

I think I got the most important targets supported now (see list in comment above). @randombit Any additional targets we want to support?

There is one issue remaining though: When using absolute paths on Windows, e.g., as in the Analysis (sanitizer, msvc, windows-2022, ninja) job, Ninja treats the colon as the end of output separator in the build statement:

ninja: error: build.ninja:44: expected build command name
build D:/a/botan/botan/build/botan-3.dll: link_shared D:/a/botan/botan/b...
        ^ near here
Command 'ninja libs tests cli' failed with error code 1

Colons in Ninja can be escaped as $:, but that would need support from the template language I suppose.

@securitykernel
Copy link
Collaborator

Added bogo_shim, fuzzers and examples targets as well. Also updated the docs and removed support for JOM.

@securitykernel securitykernel marked this pull request as ready for review August 20, 2023 16:52
@reneme
Copy link
Collaborator

reneme commented Aug 20, 2023

I smoke tested this on macOS and it seems to work nicely. Only thing missing is the Windows sanitizer CI job:

Running 'indir:D:\a\botan\botan/build ninja libs tests cli' ...
ninja: error: build.ninja:48: expected build command name
build D:/a/botan/botan/build/botan-3.dll: link_shared D:/a/botan/botan/b...
        ^ near here
Command 'ninja libs tests cli' failed with error code 1

On my Mac the build occasionally spits out lines like below. I can't really place that off the top of my head.

'++simd' is not a recognized feature for this target (ignoring feature)
'++simd' is not a recognized feature for this target (ignoring feature)
'++crypto' is not a recognized feature for this target (ignoring feature)
'++crypto' is not a recognized feature for this target (ignoring feature)

@securitykernel
Copy link
Collaborator

Yeah I developed this on macOS and then cross-tested on Windows.

@randombit
Copy link
Owner Author

@securitykernel I can't review/approve my own PR - can you open a new PR?

@randombit randombit closed this Aug 22, 2023
@randombit
Copy link
Owner Author

Do we still need a resolution to the pathname escaping?

Can we use quotes instead? Ideally we don't have to build ninja-specific handling into the template language

@securitykernel
Copy link
Collaborator

securitykernel commented Aug 22, 2023

Do we still need a resolution to the pathname escaping?

Can we use quotes instead? Ideally we don't have to build ninja-specific handling into the template language

Nope, tested and is not sufficient. What fixes it only is using the escape character $.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants