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

Sync feature/py3 branch with master #5692

Merged
merged 133 commits into from
Jun 17, 2024

Conversation

stephenchengCloud
Copy link
Contributor

@stephenchengCloud stephenchengCloud commented Jun 17, 2024

  1. Sync with the master branch
  2. Fix pytype issues: 597e50c

duobei and others added 30 commits April 15, 2024 13:40
Signed-off-by: Luca Zhang <feiya.zhang@cloud.com>
CP-47350: Add mustache template for Record/Ref/Class Types
CP-47365: Add mustache template for API messages/errors
CP-47363: Add mustache template for file header

Signed-off-by: Luca Zhang <feiya.zhang@cloud.com>
Signed-off-by: Luca Zhang <feiya.zhang@cloud.com>
Signed-off-by: Luca Zhang <feiya.zhang@cloud.com>
Signed-off-by: Luca Zhang <feiya.zhang@cloud.com>
Signed-off-by: Luca Zhang <feiya.zhang@cloud.com>
Signed-off-by: Luca Zhang <feiya.zhang@cloud.com>
…ed JSON is wanted

Signed-off-by: Luca Zhang <feiya.zhang@cloud.com>
…mmonFunctions`

Signed-off-by: Luca Zhang <feiya.zhang@cloud.com>
…files

Signed-off-by: Luca Zhang <feiya.zhang@cloud.com>
Signed-off-by: Luca Zhang <feiya.zhang@cloud.com>
Before we got the enums alongside objs,  the readability of code is so poor. We separate to get them now.

Signed-off-by: Luca Zhang <feiya.zhang@cloud.com>
Just check the fields only we need instead of generalized recursive functions

Signed-off-by: Luca Zhang <feiya.zhang@cloud.com>
Signed-off-by: Luca Zhang <feiya.zhang@cloud.com>
…unctions

Signed-off-by: xueqingz <xueqing.zhang@citrix.com>
Signed-off-by: Luca Zhang <feiya.zhang@cloud.com>
Signed-off-by: Luca Zhang <feiya.zhang@cloud.com>
Signed-off-by: xueqingz <xueqing.zhang@citrix.com>
Signed-off-by: Luca Zhang <feiya.zhang@cloud.com>
changed templates: APIVersions.mustache,APIErrors.mustache, Record.mustache

Signed-off-by: Luca Zhang <feiya.zhang@cloud.com>
Signed-off-by: xueqingz <xueqing.zhang@citrix.com>
Signed-off-by: Luca Zhang <feiya.zhang@cloud.com>
Signed-off-by: Luca Zhang <feiya.zhang@cloud.com>
…lass messages

Signed-off-by: Luca Zhang <feiya.zhang@cloud.com>
Signed-off-by: Luca Zhang <feiya.zhang@cloud.com>
…h_enums`

Signed-off-by: Luca Zhang <feiya.zhang@cloud.com>
Signed-off-by: Luca Zhang <feiya.zhang@cloud.com>
Signed-off-by: Luca Zhang <feiya.zhang@cloud.com>
Signed-off-by: Luca Zhang <feiya.zhang@cloud.com>
Signed-off-by: Luca Zhang <feiya.zhang@cloud.com>
robhoes and others added 23 commits June 11, 2024 15:32
…virt_script_removal

CP-49828: Remove iovirt script
Initial commit message:

"Provides simple code to generate S-expression trees and attempt to parse them
across a large number of threads. It serves to demonstrate that ocamlyacc's
generated parses are not thread-safe (in that they modify a global variable
"env")."

Move Colin's unit test for parallel parsing into xapi.

Signed-off-by: Colin Barr <colin.barr@cloud.com>
Signed-off-by: Gabriel Buica <danutgabriel.buica@cloud.com>
Make `test_sexpr` run using alcotest.

Signed-off-by: Gabriel Buica <danutgabriel.buica@cloud.com>
From https://ocaml.org/manual/5.1/lexyacc.html on ocamlyacc concurrency
sefety:

"Parsers generated by ocamlyacc are not thread-safe. Those parsers rely
on an internal work state which is shared by all ocamlyacc generated parsers.
The menhir parser generator is a better option if you want thread-safe parsers."

We currently hold a global lock while calling the sexpr parser, so even if we
try to parse a small sexpression, it'll be blocked behind parsing the large one.

Switch to Menhir to make this thread-safe.

Signed-off-by: Gabriel Buica <danutgabriel.buica@cloud.com>
Using `ocamlyacc` with this change results in a test failure. Thus
showing the issue of parallel parsing using `ocamlyacc`.

Signed-off-by: Gabriel Buica <danutgabriel.buica@cloud.com>
Signed-off-by: Edwin Török <edwin.torok@cloud.com>
We want to be sure there are no more uses of `ocamlyacc`, because of
concurrency issues.

Menhir should be used instead.

Signed-off-by: Gabriel Buica <danutgabriel.buica@cloud.com>
…/CP-49129

CP-49129: Drop global lock around sexpr parsing
qcheck is in the wrong part of xs-opam currently, and although we're moving it
this test really only needs qcheck-core, so link only that to fix an internal CI failure.

Signed-off-by: Edwin Török <edwin.torok@cloud.com>
Signed-off-by: Edwin Török <edwin.torok@cloud.com>
Github CI runs the makefile using SHELL=/bin/dash, which doesn't support
SIG* names for traps.
Drop the SIG prefix, which works with both `dash` and `bash`.

Signed-off-by: Edwin Török <edwin.torok@cloud.com>
Signed-off-by: Ming Lu <ming.lu@cloud.com>
Signed-off-by: Ming Lu <ming.lu@cloud.com>
Signed-off-by: Ming Lu <ming.lu@cloud.com>
Prior to this change, the function parameter list is generated by
Mustache template. As a result, a template boolean variable 'first' has
to be used to determine if a leading comma is presented or not. E.g.
when the 'first' is true, a parameter would be rendered as "a string',
and then the next parameter with the 'first' being false would be
rendered as ", b string". Putting them together would result in
"a string, b string".

This could work but is difficult to be understood.

In this commit, it is changed to construct the whole function parameter
list as a string in OCaml code and bind it to the template variable
'func_params'.

Similar changes apply to the template variable 'is_session_id'. It is
removed in this commit and the expected values are generated by OCaml
code.

Signed-off-by: Ming Lu <ming.lu@cloud.com>
Signed-off-by: Ming Lu <ming.lu@cloud.com>
Remove `package` and `public_name` stanzas for `sexprpp` executable.

Signed-off-by: Gabriel Buica <danutgabriel.buica@cloud.com>
This fixes opam-based builds in xs-opam

Signed-off-by: Pau Ruiz Safont <pau.ruizsafont@cloud.com>
…/fix-rpm-build

rpm: remove `sexprpp` from public_name
Signed-off-by: Stephen Cheng <stephen.cheng@cloud.com>
@liulinC liulinC merged commit e4b0be9 into xapi-project:feature/py3 Jun 17, 2024
14 checks passed
@stephenchengCloud stephenchengCloud deleted the sync_with_master branch July 31, 2024 05:55
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.