Skip to content

[build] libsairedis takes 1.5h to build (used to be 3-4 min in the past) #13775

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

Closed
stepanblyschak opened this issue Feb 10, 2023 · 5 comments · Fixed by sonic-net/sonic-sairedis#1253
Assignees
Labels
MSFT Triaged this issue has been triaged

Comments

@stepanblyschak
Copy link
Collaborator

Description

Steps to reproduce the issue:

  1. make -f slave.mk target/debs/bullseye/libsairedis_1.0.0_amd64.deb

Describe the results you received:

It takes 1.5h to build

Describe the results you expected:

202019/202012 libsairedis can be built in 3-4 minutes.

Output of show version:

14012cf (master)

Output of show techsupport:

(paste your output here or download and attach the file here )

Additional information you deem important (e.g. issue happens only occasionally):

@stepanblyschak stepanblyschak changed the title [build] libsairedis takes 1.5h to build (was 3-4 min in the past) [build] libsairedis takes 1.5h to build (used to be 3-4 min in the past) Feb 10, 2023
@saiarcot895
Copy link
Contributor

Could you elaborate on where you're seeing the 1.5-hour build time? The most recent commit in sairedis was built in 25 minutes, which is still high, IMO, but much less than 1.5 hours.

@saiarcot895
Copy link
Contributor

Could you also check to see if sonic-net/sonic-sairedis#1194 results in any improvement? Note that testing this PR as part of the full sonic build will require some additional changes (specifically, the build profiles will need to be set instead of build targets).

@stepanblyschak
Copy link
Collaborator Author

@saiarcot895 I am not measuring CI build, if I do make -f slave.mk target/debs/bullseye/libsairedis_1.0.0_amd64.deb once all dependencies of libsairedis are compiled it takes for me almost 1.5 h

@judyjoseph judyjoseph added the Triaged this issue has been triaged label Mar 15, 2023
@saiarcot895
Copy link
Contributor

saiarcot895 commented Mar 20, 2023

It appears that SWIG 4.0 is resulting in a large time increase to compile the C++ files that it generates, compared to SWIG 3.0 (in Buster). The changes in sonic-net/sonic-sairedis#1194 should cut down the time significantly from 1.5 hours (I'm estimating it should go down to 30 minutes), but it won't be the same as what it was with SWIG 3.0.

Edit: Either SWIG 4.0 or gcc is causing the compilation time increase; I'm leaning towards SWIG 4.0, since this scale of time increase doesn't appear to be present in other builds.

@mikeberesford
Copy link

We are seeing an increase in sairedis build time after migrating to 202211 that may be related here as well - our local builds went from ~25 mins to ~50 mins, which appears to be mostly time spent in SWIG.

kcudnik pushed a commit to sonic-net/sonic-sairedis that referenced this issue Jun 19, 2023
Fix sonic-net/sonic-buildimage#13775

-fvar-tracking-assignments
Annotate assignments to user variables early in the compilation and attempt to carry the annotations over throughout the compilation all the way to the end, in an attempt to improve debug information while optimizing.
By default, this flag is enabled.

There is no reason to use this flag for auto-generated code.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
MSFT Triaged this issue has been triaged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants