Build server maintenance for 1.8.0

I’ll be doing some build server maintenance now.
It shouldn’t take more than 10-20 minutes.
In the meantime, you can use https://build-stage.defold.com

5 Likes

The live server has now been updated to the latest version (ac4097a7fe9495a7b9f25126e045ed4914a721e1) and is now up and running again.

1 Like

@Mathias_Westerdahl
I am not usre what is happened and it this is relevant to this?

I have strange errors in my game. This game was worked yesterday in evening.

https://build.defold.com

	pprint(illumination)
	illumination.lights_init(128, 8, 8, 8, 64)
DEBUG:SCRIPT: 
{ --[[000002C3BD3FA320]]
  fill_stream_uint8 = function: 0x02c3bd3fa450,
  frustum_is_box_visible = function: 0x02c3bd3fa4d0,
  float_to_rgba = function: 0x02c3bd3fa3e0
}
ERROR:SCRIPT: illumination/illumination.lua:236: attempt to call field 'lights_init' (a nil value)
stack traceback:

extension.cpp

#define EXTENSION_NAME Illumination
#define LIB_NAME "Illumination"
#define MODULE_NAME "illumination"

#include <dmsdk/sdk.h>

#include "utils.h"
#include "frustum_cull.h"
#include "lights.h"

using namespace IlluminationLights;

namespace IlluminationLights {
    LightsManager g_lightsManager;
}


static int FloatToRGBALua(lua_State* L){
    DM_LUA_STACK_CHECK(L, 4);
    check_arg_count(L, 3);
    float value = lua_tonumber(L,1);
    float min = lua_tonumber(L,2);
    float max = lua_tonumber(L,3);
    if (value < min) return DM_LUA_ERROR("value < min");
    if (value > max) return DM_LUA_ERROR("value > max");
    if (min >= max) return DM_LUA_ERROR("min >= max");

    dmVMath::Vector4 vec4 = EncodeFloatRGBA(value,min,max);
    lua_pushnumber(L,vec4.getX());
    lua_pushnumber(L,vec4.getY());
    lua_pushnumber(L,vec4.getZ());
    lua_pushnumber(L,vec4.getW());

    return 4;
}

static int FillStreamUint8(lua_State* L){
    DM_LUA_STACK_CHECK(L, 0);
     check_arg_count(L, 5);
    int index = lua_tonumber(L,1)-1; //c array start from 0
    if (index<0){
        return DM_LUA_ERROR("index is <0")
    }
    dmBuffer::HBuffer buffer = dmScript::CheckBufferUnpack(L, 2);
    dmhash_t streamName = dmScript::CheckHashOrString(L,3);
    int componentsSize = lua_tonumber(L,4);
    if (!lua_istable(L, 5)) {
         return DM_LUA_ERROR("data not table");
    }

    uint8_t* values = 0x0;
    uint32_t sizeBuffer = 0;
    uint32_t components = 0;
    uint32_t stride = 0;
    dmBuffer::Result dataResult = dmBuffer::GetStream(buffer, streamName, (void**)&values, &sizeBuffer, &components, &stride);
    if (dataResult != dmBuffer::RESULT_OK) {
       return DM_LUA_ERROR("can't get stream");
    }

    if (components!=componentsSize){
         return DM_LUA_ERROR("stream have: %d components. Need %d", components, componentsSize);
    }

    int size = luaL_getn(L, 5);
    if (size % components != 0){
      return DM_LUA_ERROR("bad size:%d", size);
    }
    if (index + size/components>=sizeBuffer){
        return DM_LUA_ERROR("buffer not enough size");
    }

    values += index * stride;

    for (int i=0; i<size/components; ++i) {
        for (int j=0;j<components;++j){
            lua_rawgeti(L, 5, i*components+j+1);
            values[j] = lua_tonumber(L,-1)*255.0;
            lua_pop(L,1);
        }
        values += stride;
    }
    dmBuffer::UpdateContentVersion(buffer);
    return 0;
}

static int FrustumIsBoxVisibleLua(lua_State* L){
    DM_LUA_STACK_CHECK(L, 1);
    check_arg_count(L, 7);
    dmVMath::Matrix4* m = dmScript::CheckMatrix4(L, 1);
    dmVMath::Vector3 min(luaL_checknumber(L, 2),luaL_checknumber(L, 3),luaL_checknumber(L, 4));
    dmVMath::Vector3 max(luaL_checknumber(L, 5),luaL_checknumber(L, 6),luaL_checknumber(L, 7));

    Frustum frustum = Frustum(*m);

    const bool visible = frustum.IsBoxVisible(min, max);

    lua_pushboolean(L, visible);
    return 1;
}


// Functions exposed to Lua
static const luaL_reg Module_methods[] = {
   // {"float_to_rgba", FloatToRGBALua},
    {"fill_stream_uint8",FillStreamUint8},
    {"frustum_is_box_visible",FrustumIsBoxVisibleLua},
    {"lights_init", LuaLightsManagerInit},
    {"lights_get_texture_path", LuaLightsManagerGetTexturePath},
    {"lights_set_texture_path", LuaLightsManagerSetTexturePath},
    {"lights_set_frustum", LuaLightsManagerSetFrustumMatrix},
    {"lights_set_view", LuaLightsManagerSetViewMatrix},
    {"lights_set_camera_fov", LuaLightsManagerSetCameraFov},
    {"lights_set_camera_far", LuaLightsManagerSetCameraFar},
    {"lights_set_camera_near", LuaLightsManagerSetCameraNear},
    {"lights_set_camera_aspect", LuaLightsManagerSetCameraAspect},
    {"lights_get_texture_size", LuaLightsManagerGetTextureSize},
    {"lights_get_max_lights", LuaLightsManagerGetMaxLights},
    {"lights_get_max_radius", LuaLightsManagerGetMaxRadius},
    {"lights_get_borders_x", LuaLightsManagerGetBordersX},
    {"lights_get_borders_y", LuaLightsManagerGetBordersY},
    {"lights_get_borders_z", LuaLightsManagerGetBordersZ},
    {"lights_get_x_slice", LuaLightsManagerGetXSlice},
    {"lights_get_y_slice", LuaLightsManagerGetYSlice},
    {"lights_get_z_slice", LuaLightsManagerGetZSlice},
    {"lights_get_lights_per_cluster", LuaLightsManagerGetLightsPerCluster},
    {"lights_update", LuaLightsManagerUpdateLights},
    {"light_create", LuaLightsManagerCreateLight},
    {"light_destroy", LuaLightsManagerDestroyLight},
    {"lights_get_all_count", LuaLightsManagerGetInWorldCount},
    {"lights_get_visible_count", LuaLightsManagerGetInWorldVisibleCount},
    {0, 0}

};

static void LuaInit(lua_State *L) {
    int top = lua_gettop(L);
       dmLogInfo("REGISTER ILLUMINATION TEST");
    luaL_register(L, MODULE_NAME, Module_methods);
    lua_pop(L, 1);
    assert(top == lua_gettop(L));
    dmLogInfo("test 1");
    LuaLightsManagerGetXSlice(LuaLightsManagerGetInWorldVisibleCount(L))
    dmLogInfo("test 1 end");
}

static dmExtension::Result AppInitializeMyExtension(dmExtension::AppParams *params) { return dmExtension::RESULT_OK; }
static dmExtension::Result InitializeMyExtension(dmExtension::Params *params) {
    // Init Lua
    LuaInit(params->m_L);
    printf("Registered %s Extension\n", MODULE_NAME);
    return dmExtension::RESULT_OK;
}

static dmExtension::Result AppFinalizeMyExtension(dmExtension::AppParams *params) { return dmExtension::RESULT_OK; }

static dmExtension::Result FinalizeMyExtension(dmExtension::Params *params) { return dmExtension::RESULT_OK; }

DM_DECLARE_EXTENSION(EXTENSION_NAME, LIB_NAME, AppInitializeMyExtension, AppFinalizeMyExtension, InitializeMyExtension, 0, 0, FinalizeMyExtension)

It is interesting that i add some logs and remove " float_to_rgba"
But after build i don’t get chages

DEBUG:SCRIPT: 
{ --[[0000023DEAFFA300]]
  float_to_rgba = function: 0x023deaffa3c0,
  fill_stream_uint8 = function: 0x023deaffa430,
  frustum_is_box_visible = function: 0x023deaffa4b0
}
Registered utf8 Extension
Registered android_toast Extension
Registered lua_script_instance Extension
Registered illumination Extension
Registered game Extension

log.txt (125.9 KB)

I don’t see any errors in that log.

But after build i don’t get chages

Are you sure it is in fact rebuilding? Are there different timestamps on your exe in your build folder?
Are you testing the same version?

1 Like

I test this in 1.7.0
In editor. I try build and rebuild

First build i comment line.
Second build i change function name to not existed function.

No sure what happened. Server return cache? editor upload not last changes?

Editor 1476f3bbafbf090e2041bce0722255ac51decdcf
Engine bf4dc66ab5fbbafd4294d32c2797c08b630c0be5
https://build.defold.com


Illumination_15.lib.zip (56.5 KB)
This is lib file from build folder

This is same ne but from another game
Illumination_19.lib.zip (211.9 KB)

Tryed bob same problem.
I add you to my game. Please take a look.
This problem is blocking me :sob:
https://github.com/d954mas/game-tanks-online

1 Like

Ok, let’s start from the beginning. What are you trying to build? A project with a native extension? Which one? Can I try to build it? You’re using Windows right? And building for Windows? Using bob.jar or the editor? Have you tried deleting the build folder and .internal/cache?

1 Like

Thanks. I think i find problem, testing new build
I have 2 native extensions with same name. I have no ideas how this worked before) :hear_no_evil: :see_no_evil:

Is it possible to add warning/error for such situations?

Not sure. Maybe. You can add a feature request to defold/extender, but I don’t think we’ll give it a very high priority at the moment at least.

Heh, that was what I was beginning to suspect.

I think it should be possible in theory, as we collect the names and put them into an initialization function.
However, I recently did have to remove duplicates there recently (for a reason I don’t rully recall). But, in short, yes, it should be possible.

2 Likes