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

error: no type named 'OptionException' in namespace 'cxxopts' issue #997

Closed
chenrui333 opened this issue Sep 21, 2023 · 18 comments · Fixed by #999
Closed

error: no type named 'OptionException' in namespace 'cxxopts' issue #997

chenrui333 opened this issue Sep 21, 2023 · 18 comments · Fixed by #999
Milestone

Comments

@chenrui333
Copy link

chenrui333 commented Sep 21, 2023

👋 while trying to build the bottle for sonoma, we found there is build issue with error: no type named 'OptionException' in namespace 'cxxopts' , details as below:

clang   -MMD -MP -I. -std=c  17 -Wextra -Wpedantic -Wall -O3 -DASIO_STANDALONE -DUSE_ROUTING=true -DNDEBUG -c algorithms/local_search/operator.cpp -o algorithms/local_search/operator.o
  main.cpp:105:22: error: no member named 'OptionException' in namespace 'cxxopts'
        throw cxxopts::OptionException("Argument '"   limit_arg  
              ~~~~~~~~~^
  main.cpp:[118](https://github.com/Homebrew/homebrew-core/actions/runs/6255124360/job/16983922323#step:4:119):27: error: no type named 'OptionException' in namespace 'cxxopts'
    } catch (const cxxopts::OptionException& e) {
                   ~~~~~~~~~^
  2 errors generated.
  clang   -MMD -MP -I. -std=c  17 -Wextra -Wpedantic -Wall -O3 -DASIO_STANDALONE -DUSE_ROUTING=true -DNDEBUG -c routing/http_wrapper.cpp -o routing/http_wrapper.o
  make: *** [main.o] Error 1
  make: *** Waiting for unfinished jobs....

brew config

  Clang: 15.0.0 build 1500
  Git: 2.39.3 => /usr/bin/git
  Curl: 8.1.2 => /usr/bin/curl
  macOS: 14.0-arm64
  CLT: 15.0.0.0.1.1694021235
  Xcode: 15.0
  Rosetta 2: false

full build log, https://github.com/Homebrew/homebrew-core/actions/runs/6255124360/job/16983922323

relates to Homebrew/homebrew-core#142161

@jcoupey
Copy link
Collaborator

jcoupey commented Sep 22, 2023

I have no idea what "build the bottle for Sonoma" actually means, but I guess that's beside the point.

What version of VROOM are you trying to build here?

This looks like a problem with cxxopts which is a dependency we currently ship using a submodule. Did you git submodule init and git submodule update at some point?

@Orthae
Copy link
Contributor

Orthae commented Sep 22, 2023

It is related to building Vroom on MacOS for brew. Anyway, the issue is that brew is not using the cxxopts or rapidjson from the Vroom repository, instead they are injecting their own versions, causing the source mismatch. I have the same issue building it on MacOS 13, AARM M1.

https://github.com/Homebrew/homebrew-core/blob/2440a7a0dd273ef9accfd5ef003e3beb3a0e66b4/Formula/v/vroom.rb#L28

    # Use brewed dependencies instead of vendored dependencies
    cd "include" do
      rm_rf ["cxxopts", "rapidjson"]
      mkdir_p "cxxopts"
      ln_s Formula["cxxopts"].opt_include, "cxxopts/include"
      ln_s Formula["rapidjson"].opt_include, "rapidjson"
    end

Bumping cxxopts should do the trick.

@jcoupey
Copy link
Collaborator

jcoupey commented Sep 22, 2023

It is related to building Vroom on MacOS for brew

I kinda figured out but I have to say the name is somewhat misleading. ;-)

instead they are injecting their own versions

Right, that was my intuition too. Depending on the cxxopts version, it means either:

  • brew is on an older version so there is nothing to do on our side, just update cxxopts over at brew;
  • brew is on a more recent version and we'll hit that when we update.

Only in the latter case would we need to do something, but I would be surprised since we're currently on cxxopts @ c74846a which is v3.0.0 so this would mean more recent releases from the v3 series broke something.

@jcoupey
Copy link
Collaborator

jcoupey commented Sep 22, 2023

Can someone confirm the cxxopts version at brew is older than v3.0.0?

@Orthae
Copy link
Contributor

Orthae commented Sep 22, 2023

They are using the newest version, I have taken a look at the cxxopts releases and 3.1 made some changes on the exceptions. The change looks small enough, and I can make PR, hopefully not breaking anything in the process.

3.1 cxxopts
Cleanup exception code, add cxxopts::exceptions namespace.```

@Orthae Orthae mentioned this issue Sep 22, 2023
2 tasks
@jcoupey
Copy link
Collaborator

jcoupey commented Sep 22, 2023

Does this means that the cxxopts::OptionException type disappeared between version 3.0 and 3.1? Sounds like a breaking change.

@Orthae
Copy link
Contributor

Orthae commented Sep 22, 2023

Yea, they nuked the previous version of exceptions and replaced them with new one.

https://github.com/jarro2783/cxxopts/pull/347/files

@jcoupey
Copy link
Collaborator

jcoupey commented Sep 22, 2023

OK, the changelog over there states "The project adheres to semantic versioning" but nevermind. Thanks for the PR!

@jcoupey jcoupey added this to the v1.14.0 milestone Sep 25, 2023
@jamesjjk
Copy link

@jcoupey Would an interim release v1.13.1 with the PR not be advisable? - Working on a aws Lambda container for vroom and it would be helpful.

@Orthae
Copy link
Contributor

Orthae commented Oct 16, 2023

You should have zero issues with building lambda layers with current version.

@jcoupey
Copy link
Collaborator

jcoupey commented Oct 16, 2023

#999 (comment)

@jamesjjk
Copy link

@jcoupey @Orthae vroom-docker unfortunately fails to build now with cxxopts::OptionException

@jcoupey
Copy link
Collaborator

jcoupey commented Oct 16, 2023

I don't really understand: when using cxxopts via git submodule, then the code should be consistent with the vendored version, no matter if using Docker or not.

@Orthae
Copy link
Contributor

Orthae commented Oct 16, 2023

There is issue with checkout in Dockerfile, submodules are using master branch which have new cxxopts.

@jamesjjk
Copy link

RUN echo "Cloning and installing vroom release ${VROOM_RELEASE}..." && \
    git clone  --recurse-submodules https://github.com/VROOM-Project/vroom.git && \
    cd vroom && \
    git fetch --tags && \
    git checkout -q $VROOM_RELEASE && \
    make -C /vroom/src -j$(nproc) && \
    cd /

@Orthae
Copy link
Contributor

Orthae commented Oct 16, 2023

@jamesjjk You can use this one for now and it should do the trick.

VROOM-Project/vroom-docker#69

@jamesjjk
Copy link

git clone --branch $VROOM_RELEASE --recurse-submodules https://github.com/VROOM-Project/vroom.git

@jamesjjk
Copy link

@Orthae You were too fast :) thank you! I also would like to commit some additional constraint features that I still have to document - and a aws lambda image that I will work on in other tickets/branches

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

Successfully merging a pull request may close this issue.

4 participants