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

リポジトリのルート以外でのコンパイルができなくなった #268

Closed
kmyk opened this issue Feb 6, 2020 · 10 comments · Fixed by #269
Closed

リポジトリのルート以外でのコンパイルができなくなった #268

kmyk opened this issue Feb 6, 2020 · 10 comments · Fixed by #269

Comments

@kmyk
Copy link
Contributor

kmyk commented Feb 6, 2020

たとえばカレントディレクトリが sample/aplusb の状態で python3 ../generate.py info.toml をするなどです。以前は動いていたのですが、動かなくなりました。

online-judge-tools からはそのようにして呼び出している (chdir すると面倒が増える) ので、これが動かないのは困ります。

$ pwd
/home/ubuntu/.cache/online-judge-tools/library-checker-problems/sample/aplusb
$ python3 ../../generate.py info.toml
2020-02-07 03:41:27,635 INFO __main__ : Start
2020-02-07 03:41:27,636 INFO __main__ : generate params.h
2020-02-07 03:41:27,636 INFO __main__ : compile solution
2020-02-07 03:41:28,029 INFO __main__ : compile generators
2020-02-07 03:41:28,030 INFO __main__ : compile example.in
2020-02-07 03:41:28,030 INFO __main__ : compile random.cpp
gen/random.cpp:3:10: fatal error: random.h: No such file or directory
 #include "random.h"
          ^~~~~~~~~~
compilation terminated.
Traceback (most recent call last):
  File "../../generate.py", line 445, in <module>
    Path(args.htmldir) if args.htmldir else None)
  File "../../generate.py", line 357, in generate
    problem.compile_gens()
  File "../../generate.py", line 130, in compile_gens
    compile(self.basedir / 'gen' / name, self.libdir)
  File "../../generate.py", line 43, in compile
    ['-o', str(src.with_suffix(''))] + [str(src)])
  File "/usr/lib/python3.6/subprocess.py", line 311, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['g++', '-O2', '-std=c++14', '-Wall', '-Wextra', '-Werror', '-Wno-unused-result', '-I', '/home/ubuntu/.cache/online-judge-tools/library-checker-problems/sample/aplusb/common', '-o', 'gen/random', 'gen/random.cpp']' returned non-zero exit status 1.
@beet-aizu
Copy link
Contributor

これはoj側で呼んでいてojよりはこっちの方がマージされるまでの時間が短いのでこっちを修正した方がいいということでしょうか (ここですかね https://github.com/kmyk/online-judge-tools/blob/7c9340d1cc73748d64d87350f110cac480af7474/onlinejudge/service/library_checker.py#L100

@kmyk
Copy link
Contributor Author

kmyk commented Feb 7, 2020

いい感じ (libdirgenerate.py の親ディレクトリにする)

@yosupo06
Copy link
Owner

yosupo06 commented Feb 7, 2020

今まではproblems.tomlがリポジトリルートへのアンカーの役割を果たしていたんですが、problems.tomlを消したのでこれが起きたということですね

@yosupo06
Copy link
Owner

yosupo06 commented Feb 7, 2020

これまだ死んでました

@yosupo06 yosupo06 reopened this Feb 7, 2020
@kmyk
Copy link
Contributor Author

kmyk commented Feb 7, 2020

online-judge-tools/oj#671 は動いてます。deprecated になった旧形式の指定がだめぽい

$ python3 ~/.cache/online-judge-tools/library-checker-problems/generate.py ~/.cache/online-judge-tools/library-checker-problems/problems.toml -p aplusb
2020-02-07 22:23:44,318 WARNING __main__ : problems.toml is deprecated
2020-02-07 22:23:53,324 ERROR __main__ : Cannot find problem: aplusb

@yosupo06
Copy link
Owner

yosupo06 commented Feb 7, 2020

-p unionfind は使うかなと思って(deprecatedではなく)残すつもりでした(IDから実際のinfoを探すのは少し手間なので)

@beet-aizu
Copy link
Contributor

はい #271 (comment)

@kmyk
Copy link
Contributor Author

kmyk commented Feb 7, 2020

直った

@kmyk kmyk closed this as completed Feb 7, 2020
kmyk pushed a commit to kmyk-jikka/jikka-judge-problems that referenced this issue Sep 2, 2021
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 a pull request may close this issue.

3 participants