Skip to content

Commit

Permalink
move lua/ up to the top level directory where python/ lives
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 486786325
  • Loading branch information
ericsalo authored and copybara-github committed Nov 7, 2022
1 parent d4425d3 commit a77b966
Show file tree
Hide file tree
Showing 15 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/bazel_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- { NAME: "GCC Optimized", BAZEL: bazel, CC: gcc, os: ubuntu-20.04, flags: "-c opt" }
- { NAME: "FastTable", BAZEL: bazel, CC: clang, os: ubuntu-20.04, flags: "--//:fasttable_enabled=true -- -cmake:test_generated_files" }
- { NAME: "ASAN", BAZEL: bazel, CC: clang, os: ubuntu-20.04, flags: "--config=asan -c dbg -- -benchmarks:benchmark -python/..." }
- { NAME: "UBSAN", BAZEL: bazel, CC: clang, os: ubuntu-20.04, flags: "--config=ubsan -c dbg -- -benchmarks:benchmark -python/... -upb/bindings/lua/...", install: "libunwind-dev" }
- { NAME: "UBSAN", BAZEL: bazel, CC: clang, os: ubuntu-20.04, flags: "--config=ubsan -c dbg -- -benchmarks:benchmark -python/... -lua/...", install: "libunwind-dev" }
- { NAME: "32-bit", BAZEL: bazel, CC: clang, os: ubuntu-20.04, flags: "--copt=-m32 --linkopt=-m32 -- -... benchmarks:benchmark ", install: "g++-multilib" }
- { NAME: "macOS", BAZEL: bazel, CC: clang, os: macos-11, flags: "" }
# We support two Bazel versions back per https://opensource.google/documentation/policies/cplusplus-support
Expand Down
2 changes: 1 addition & 1 deletion BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -1196,7 +1196,7 @@ exports_files(
"third_party/lunit/console.lua",
"third_party/lunit/lunit.lua",
],
visibility = ["//upb/bindings/lua:__pkg__"],
visibility = ["//lua:__pkg__"],
)

filegroup(
Expand Down
6 changes: 3 additions & 3 deletions upb/bindings/lua/BUILD.bazel → lua/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ load(
"UPB_DEFAULT_CPPOPTS",
)
load(
"//upb/bindings/lua:lua_proto_library.bzl",
"//lua:lua_proto_library.bzl",
"lua_proto_library",
)

Expand Down Expand Up @@ -82,13 +82,13 @@ cc_test(
":test_proto_lua",
"//:third_party/lunit/console.lua",
"//:third_party/lunit/lunit.lua",
"//upb/bindings/lua:upb.lua",
"//lua:upb.lua",
"@com_google_protobuf//:descriptor_proto",
"@com_google_protobuf//conformance:conformance_proto",
],
linkstatic = 1,
deps = [
"//upb/bindings/lua:lupb",
"//lua:lupb",
"@lua//:liblua",
],
)
Expand Down
8 changes: 8 additions & 0 deletions lua/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# upb Lua bindings

These are some bare-bones upb bindings for Lua.

These bindings exist primarily for experimentation and testing.
They are incomplete and are not really intended for use in any application.
This is by no means a complete or supported protobuf library, and in fact
we don't even claim it to be functional.
2 changes: 1 addition & 1 deletion upb/bindings/lua/def.c → lua/def.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include <string.h>

#include "lauxlib.h"
#include "upb/bindings/lua/upb.h"
#include "lua/upb.h"
#include "upb/reflection.h"

#define LUPB_ENUMDEF "lupb.enumdef"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ _lua_proto_library_aspect = aspect(
"_upbc": attr.label(
executable = True,
cfg = "exec",
default = "//upb/bindings/lua:protoc-gen-lua",
default = "//lua:protoc-gen-lua",
),
"_protoc": attr.label(
executable = True,
Expand Down
6 changes: 3 additions & 3 deletions upb/bindings/lua/main.c → lua/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include <lualib.h>
#include <signal.h>

#include "upb/bindings/lua/upb.h"
#include "lua/upb.h"

lua_State* L;

Expand All @@ -57,7 +57,7 @@ const char* init =
"bazel-bin/external/com_google_protobuf/src/?.lua;"
"bazel-bin/external/com_google_protobuf/?.lua;"
"bazel-bin/external/com_google_protobuf/?.lua;"
"upb/bindings/lua/?.lua"
"lua/?.lua"
"'";

int main(int argc, char** argv) {
Expand All @@ -70,7 +70,7 @@ int main(int argc, char** argv) {

signal(SIGINT, sighandler);
ret = ret || lua_pcall(L, 1, LUA_MULTRET, 0) ||
luaL_dofile(L, "upb/bindings/lua/test_upb.lua");
luaL_dofile(L, "lua/test_upb.lua");
signal(SIGINT, SIG_DFL);

if (ret) {
Expand Down
6 changes: 3 additions & 3 deletions upb/bindings/lua/msg.c → lua/msg.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@
#include <string.h>

#include "lauxlib.h"
#include "upb/bindings/lua/upb.h"
#include "lua/upb.h"
#include "upb/collections/map.h"
#include "upb/json/decode.h"
#include "upb/json/encode.h"
#include "upb/map.h"
#include "upb/port/def.inc"
#include "upb/reflection/message.h"
#include "upb/text_encode.h"
#include "upb/text/encode.h"

/*
* Message/Map/Array objects. These objects form a directed graph: a message
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion upb/bindings/lua/test_upb.lua → lua/test_upb.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

local upb = require "lupb"
local lunit = require "lunit"
local upb_test = require "upb.bindings.lua.test_pb"
local upb_test = require "lua.test_pb"
local test_messages_proto3 = require "google.protobuf.test_messages_proto3_pb"
local test_messages_proto2 = require "google.protobuf.test_messages_proto2_pb"
local descriptor = require "google.protobuf.descriptor_pb"
Expand Down
2 changes: 1 addition & 1 deletion upb/bindings/lua/upb.c → lua/upb.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
* domain of [u]int64 values.
*/

#include "upb/bindings/lua/upb.h"
#include "lua/upb.h"

#include <float.h>
#include <math.h>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 0 additions & 8 deletions upb/bindings/lua/README.md

This file was deleted.

0 comments on commit a77b966

Please sign in to comment.