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

bzip2 & brotli: Fix tests with ASan #3606

Closed
wants to merge 4 commits into from
Closed

bzip2 & brotli: Fix tests with ASan #3606

wants to merge 4 commits into from

Conversation

SirLynix
Copy link
Member

I think this should be automated by xmake, but when building a lib with ASan and testing its binaries, it will fail on Windows:

install ok!
finding bzip2 from xmake ..
checking for xmake::bzip2 ... bzip2 1.0.8
{
  libfiles = {
    "C:\Users\lynix\AppData\Local\.xmake\packages\b\bzip2\1.0.8\83ee4cf31e5841d8a38c178e6ffab69b\lib\bz2.lib"
  },
  linkdirs = {
    "C:\Users\lynix\AppData\Local\.xmake\packages\b\bzip2\1.0.8\83ee4cf31e5841d8a38c178e6ffab69b\lib"
  },
  sysincludedirs = {
    "C:\Users\lynix\AppData\Local\.xmake\packages\b\bzip2\1.0.8\83ee4cf31e5841d8a38c178e6ffab69b\include"
  },
  version = "1.0.8",
  static = true,
  links = {
    "bz2"
  }
}

patching C:\Users\lynix\AppData\Local\.xmake\packages\b\bzip2\1.0.8\83ee4cf31e5841d8a38c178e6ffab69b\lib\pkgconfig\bzip2.pc ..
bunzip2 --help
error: @programdir\core\sandbox\modules\os.lua:337: exec(bunzip2 --help) failed(-1073741515)
stack traceback:
    [C]: in function 'error'
    [@programdir\core\base\os.lua:957]:
    [@programdir\core\sandbox\modules\os.lua:337]:
    [@programdir\core\sandbox\modules\os.lua:282]: in function 'vrun'
    [...xmake\repositories\xmake-repo\packages\b\bzip2\xmake.lua:29]: in function 'script'
    [...dir\modules\private\action\require\impl\utils\filter.lua:114]: in function 'call'
    [...dir\modules\private\action\require\impl\actions\test.lua:41]:
    [...\modules\private\action\require\impl\actions\install.lua:412]:

  => install bzip2 1.0.8 .. failed
error: @programdir\core\main.lua:306: @programdir\core\sandbox\modules\import\core\base\task.lua:65: @programdir\modules\async\runjobs.lua:320: ...\modules\private\action\require\impl\actions\install.lua:474: install failed!
stack traceback:
    [C]: in function 'error'
    [@programdir\core\base\os.lua:957]:
    [...\modules\private\action\require\impl\actions\install.lua:474]: in function 'catch'
    [@programdir\core\sandbox\modules\try.lua:123]: in function 'try'
    [...\modules\private\action\require\impl\actions\install.lua:333]:
    [...modules\private\action\require\impl\install_packages.lua:487]: in function 'jobfunc'
    [@programdir\modules\async\runjobs.lua:237]:

stack traceback:
        [C]: in function 'error'
        @programdir\core\base\os.lua:957: in function 'base/os.raiselevel'
        (...tail calls...)
        @programdir\core\main.lua:306: in upvalue 'cotask'
        @programdir\core\base\scheduler.lua:406: in function <@programdir\core\base\scheduler.lua:399>

this is because it doesn't find MSVC asan DLL (which are not in the PATH).

The same issue can occur with MinGW and its libstdc++ or pthread dlls (not the case here).

So this is a temporary fix until xmake can hopefully fix this.

@SirLynix SirLynix changed the title bzip2: Fix tests with ASan bzip2 & brotli: Fix tests with ASan Mar 25, 2024
SirLynix added a commit to SirLynix/xmake that referenced this pull request Mar 25, 2024
@waruqi
Copy link
Member

waruqi commented Mar 25, 2024

We should not modify on_test for a temporary fix, please open an issue and wait for improvements.

@SirLynix
Copy link
Member Author

Fixed by xmake-io/xmake#4879

@SirLynix SirLynix closed this Mar 26, 2024
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.

2 participants