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

Fix build with older Clang #2397

Merged
merged 1 commit into from
Mar 23, 2023

Conversation

ZhongRuoyu
Copy link
Contributor

@ZhongRuoyu ZhongRuoyu commented Mar 22, 2023

This fixes the following build error:

  /tmp/micromamba-20230322-77117-1jorcxo/mamba-micromamba-1.4.0/libmamba/src/solv-cpp/queue.cpp:163:35: error: chosen constructor is explicit in copy-initialization
                  std::stringstream ss = {};
                                    ^    ~~
  /Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk/usr/include/c++/v1/sstream:884:14: note: explicit constructor declared here
      explicit basic_stringstream(ios_base::openmode __wch = ios_base::in | ios_base::out);
               ^

The error was seen on macOS 11 (on both x86_64 and arm64) while packaging mamba for Homebrew at Homebrew/homebrew-core#126371. Build logs available here.

I am not sure about the root cause of this error, but it may be due to the lack of an implicit default constructor for std::stringstream in macOS 11 SDK's libc++. If I understand it correctly, this is related to the discussion on copy-list-initialization in https://stackoverflow.com/a/38419922.

This fixes the following build error:

```
  /tmp/micromamba-20230322-77117-1jorcxo/mamba-micromamba-1.4.0/libmamba/src/solv-cpp/queue.cpp:163:35: error: chosen constructor is explicit in copy-initialization
                  std::stringstream ss = {};
                                    ^    ~~
  /Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk/usr/include/c++/v1/sstream:884:14: note: explicit constructor declared here
      explicit basic_stringstream(ios_base::openmode __wch = ios_base::in | ios_base::out);
               ^
```

Signed-off-by: Ruoyu Zhong <zhongruoyu@outlook.com>
@jonashaag jonashaag merged commit bc7fa86 into mamba-org:main Mar 23, 2023
@ZhongRuoyu
Copy link
Contributor Author

Thanks @jonashaag! By the way, mamba 1.4.0 is not marked as the latest release on GitHub yet. Can we expect it to be announced soon?

@ZhongRuoyu ZhongRuoyu deleted the stringstream-copy-init branch March 23, 2023 10:02
@JohanMabille
Copy link
Member

@ZhongRuoyu This is now fixed :)

@ZhongRuoyu
Copy link
Contributor Author

Thanks, @JohanMabille!

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.

3 participants