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

Linking.Release Skipped When Building Previously Cached Files #2655

Closed
jteppinette opened this issue Aug 7, 2022 · 4 comments
Closed

Linking.Release Skipped When Building Previously Cached Files #2655

jteppinette opened this issue Aug 7, 2022 · 4 comments

Comments

@jteppinette
Copy link

jteppinette commented Aug 7, 2022

Version

v2.6.9+202207181016

Operating System Version and Architecture

macOS 12.4 M1

Describe Bug

If you run xmake build on a file which has already been compiled, then the linking.release step is skipped. Therefore, the new binary is not created. This results in the previous binary being used during xmake run.

main.cpp - v1

#include <iostream>

int main() {
  std::cout << 1 << std::endl;
}

xmake.lua

target("main")
    set_kind("binary")
    set_languages("cxx17")
    add_files("main.cpp")

build - v1

$ xmake; xmake run 
[ 25%]: ccache compiling.release main.cpp
[ 50%]: linking.release main
[100%]: build ok!
1

main.cpp - v2

#include <iostream>

int main() {
  std::cout << 2 << std::endl;
}

build - v2

$ xmake; xmake run 
[ 25%]: ccache compiling.release main.cpp
[ 50%]: linking.release main
[100%]: build ok!
2

main.cpp - v1

#include <iostream>

int main() {
  std::cout << 1 << std::endl;
}

build - v1

$ xmake; xmake run 
[ 25%]: ccache compiling.release main.cpp
[100%]: build ok!
2

Notice, above, the linking.release stage was skipped and the resulting binary wrote 2 instead of 1 to the console.

Temporary Resolution

I was able to remediate this issue by disabling the build cache:

xmake.lua

set_policy("build.ccache", false)

target("main")
    set_kind("binary")
    set_languages("cxx17")
    add_files("main.cpp")
@jteppinette jteppinette added the bug label Aug 7, 2022
@waruqi
Copy link
Member

waruqi commented Aug 7, 2022

? I don't understand what you mean.

@jteppinette jteppinette changed the title Build Ignores Changes After Closing GUI Application Linking.Release Skipped When Building Previously Cached Files Aug 7, 2022
@jteppinette
Copy link
Author

jteppinette commented Aug 7, 2022

@waruqi I have written about the issue in more detail after digging in a little more. I isolated the issue to the build cache.

@waruqi
Copy link
Member

waruqi commented Aug 7, 2022

I have fixed it in previous issue. #2620

please update to dev and try it again.

xmke update dev

@jteppinette
Copy link
Author

Thanks!

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

No branches or pull requests

2 participants