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

Incremental compilation support for modules #3000

Closed
11 tasks done
waruqi opened this issue Oct 30, 2022 · 4 comments
Closed
11 tasks done

Incremental compilation support for modules #3000

waruqi opened this issue Oct 30, 2022 · 4 comments

Comments

@waruqi
Copy link
Member

waruqi commented Oct 30, 2022

Xmake Version

2.7.2

Operating System Version and Architecture

ubuntu

Describe Bug

Modifying headers doesn't trigger recompiling; #2961

we can test it in user_headerunits test.

  • xxx.mpp cannot generate deps with header
    • gcc
    • clang
    • msvc
  • we need improve to parse header file from xxx.gcm.d and xxx.cpp.o.d if it contains modules
    • gcc
    • clang
    • msvc
  • ccache will also affect incremental compilation (disabled)
    • object
    • fix dependfile

Expected Behavior

..

Project Configuration

No response

Additional Information and Error Logs

No response

@waruqi
Copy link
Member Author

waruqi commented Oct 31, 2022

we need improve to parse include deps with modules.

gcc

hello.gcm.d

build/.objs/src/hello.mpp.o  /modules/cache/hello.gcm:  src/hello.mpp\
build/.objs/src/hello.mpp.o  /modules/cache/hello.gcm:  ./src/header.hpp.c++m\
hello.c++m:  /modules/cache/hello.gcm\
.PHONY: hello.c++m\
/modules/cache/hello.gcm:|  build/.objs/src/hello.mpp.o\
CXX_IMPORTS += ./src/header.hpp.c++m

I really don't understand this include dependency format of gcc. what's :|?
😐

main.cpp.d

build/.objs/user_headerunit/linux/x86_64/release/src/main.cpp.o:  src/main.cpp\
build/.objs/user_headerunit/linux/x86_64/release/src/main.cpp.o:  ./src/header.hpp.c++m hello.c++m\
CXX_IMPORTS += ./src/header.hpp.c++m hello.c++m\

without modules

main.o: src/main.cpp src/interface.h\

clang

main.cpp.o.d

build/.objs/hello/linux/x86_64/release/src/main.cpp.o:   build/.gens/hello/linux/x86_64/release/rules/modules/cache/hello.pcm   /usr/lib/llvm-15/lib/clang/15.0.2/include/module.modulemap   src/main.cpp\

hello.pcm.d

build/.gens/hello/linux/x86_64/release/rules/modules/cache/hello.pcm:   /usr/lib/llvm-15/lib/clang/15.0.2/include/module.modulemap   src/hello.mpp\

msvc

main.cpp.o.d

{
    "Version": "1.2",
    "Data": {
        "Source": "c:\users\ruki\desktop\user_headerunit\src\main.cpp",
        "ProvidedModule": "",
        "Includes": [],
        "ImportedModules": [
            {
                "Name": "hello",
                "BMI": "c:\users\ruki\desktop\user_headerunit\src\hello.ifc"
            }
        ],
        "ImportedHeaderUnits": [
            {
                "Header": "c:\users\ruki\desktop\user_headerunit\src\header.hpp",
                "BMI": "c:\users\ruki\desktop\user_headerunit\src\header.hpp.ifc"
            }
        ]
    }
}

@waruqi waruqi added this to the v2.7.3 milestone Oct 31, 2022
@waruqi
Copy link
Member Author

waruqi commented Nov 1, 2022

we need parse CXX_IMPORTS += ./src/header.hpp.c++m for gcc/deps.

waruqi added a commit that referenced this issue Nov 1, 2022
Incremental compilation support for modules #3000
@waruqi waruqi closed this as completed Nov 2, 2022
@barcharcraz
Copy link

we need improve to parse include deps with modules.

gcc

hello.gcm.d

build/.objs/src/hello.mpp.o  /modules/cache/hello.gcm:  src/hello.mpp\
build/.objs/src/hello.mpp.o  /modules/cache/hello.gcm:  ./src/header.hpp.c++m\
hello.c++m:  /modules/cache/hello.gcm\
.PHONY: hello.c++m\
/modules/cache/hello.gcm:|  build/.objs/src/hello.mpp.o\
CXX_IMPORTS += ./src/header.hpp.c++m

I really don't understand this include dependency format of gcc. what's :|? neutral_face

That's an order only dependency, it just means hello.gcm must be built after hello.mpp.o, but need not be rebuilt if it's older than hello.mpp.o.

@waruqi
Copy link
Member Author

waruqi commented Nov 2, 2022

we need improve to parse include deps with modules.

gcc

hello.gcm.d

build/.objs/src/hello.mpp.o  /modules/cache/hello.gcm:  src/hello.mpp\
build/.objs/src/hello.mpp.o  /modules/cache/hello.gcm:  ./src/header.hpp.c++m\
hello.c++m:  /modules/cache/hello.gcm\
.PHONY: hello.c++m\
/modules/cache/hello.gcm:|  build/.objs/src/hello.mpp.o\
CXX_IMPORTS += ./src/header.hpp.c++m

I really don't understand this include dependency format of gcc. what's :|? neutral_face

That's an order only dependency, it just means hello.gcm must be built after hello.mpp.o, but need not be rebuilt if it's older than hello.mpp.o.

Got it, 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