Giter VIP home page Giter VIP logo

code_contests's Introduction

CodeContests

CodeContests is a competitive programming dataset for machine-learning. This dataset was used when training AlphaCode. AlphaCode has been published in Science, with a preprint on arXiv.

It consists of programming problems, from a variety of sources:

Site URL Source
Aizu https://judge.u-aizu.ac.jp CodeNet
AtCoder https://atcoder.jp CodeNet
CodeChef https://www.codechef.com description2code
Codeforces https://codeforces.com description2code and Codeforces
HackerEarth https://www.hackerearth.com description2code

Problems include test cases in the form of paired inputs and outputs, as well as both correct and incorrect human solutions in a variety of languages.

Install bazel

First install bazel and verify it builds correctly (we only support Linux with clang, but other platforms might work):

bazel build -c opt :print_names_and_sources

Downloading the dataset

Install the Cloud SDK, which provides the gsutil utility. You can then download the full data (~3GiB) with, e.g:

gsutil -m cp -r gs://dm-code_contests /tmp

The data consists of ContestProblem protocol buffers in Riegeli format. See contest_problem.proto for the protocol buffer definition and documentation of its fields.

The dataset contains three splits:

Split Filename
Training code_contests_train.riegeli-*-of-00128
Validation code_contests_valid.riegeli
Test code_contests_test.riegeli

There is example code for iterating over the dataset in C++ (in print_names.cc) and Python (in print_names_and_sources.py). For example, you can print the source and name of each problem in the validation data by installing bazel and then running:

bazel run -c opt \
  :print_names_and_sources /tmp/dm-code_contests/code_contests_valid.riegeli

Or do the same for the training data with the following command (which will print around 13000 lines of output):

bazel run -c opt \
  :print_names_and_sources /tmp/dm-code_contests/code_contests_train.riegeli*

Executing and evaluating solutions

The execution subdirectory contains code for executing a solution and evaluating whether it solves a problem. solve_example demonstrates this functionality, and can be run with e.g.

bazel run -c opt execution:solve_example -- \
  --valid_path=/tmp/dm-code_contests/code_contests_valid.riegeli

Note, for the last command you should see one Compilation failed and two Compilation succeeded, if you see three Compilation failed then there is likely an issue with the Python version used, please install and try several ones before reporting a bug.

The execution code defaults to using Python 3.9 and 2.7, located at /usr/bin/python3.9 and /usr/bin/python2.7, with standard libraries at /usr/lib/python3.9 and /usr/lib/python2.7. These can be changed with the flags defined in py_locations.cc, for example:

bazel run -c opt execution:solve_example -- \
  --valid_path=/tmp/dm-code_contests/code_contests_valid.riegeli \
  --python3_path=/usr/bin/python3.10 --python3_library_paths=/usr/lib/python3.10

In Debian/Ubuntu you can install specific Python versions with

sudo apt install python3.9 python3.10 python3.11

and you can check if you have some version installed by which provides output:

which python3.11

Note that the Python used for building with bazel and for executing inside the sandbox can be different.

Note on data and sandbox consistency

The incorrect and correct solutions attached to problems are not guaranteed to compile and execute in the exact same way as in their original contest website (for example different compiler versions or flags or different library versions). Some of the solutions will fail compilation, or will produce sandbox violations, especially if they are incorrect.

FAQ

We recommend running the following before reporting bugs, which wipes out the bazel state and sometimes fixes transient errors.

bazel clean --expunge
rm -rf ~/.cache/bazel

Supported platforms

This repository is supported on Linux, compiled with clang.

People on MacOS have reported this error: #5

Windows have reported this error: #9

Citing this work

If you use this dataset or code, please cite this paper:

@article{
  doi:10.1126/science.abq1158,
  author = {Yujia Li  and David Choi  and Junyoung Chung  and Nate Kushman  and Julian Schrittwieser  and R{\'e}mi Leblond  and Tom Eccles  and James Keeling  and Felix Gimeno  and Agustin Dal Lago  and Thomas Hubert  and Peter Choy  and Cyprien de Masson d’Autume  and Igor Babuschkin  and Xinyun Chen  and Po-Sen Huang  and Johannes Welbl  and Sven Gowal  and Alexey Cherepanov  and James Molloy  and Daniel J. Mankowitz  and Esme Sutherland Robson  and Pushmeet Kohli  and Nando de Freitas  and Koray Kavukcuoglu  and Oriol Vinyals },
  title = {Competition-level code generation with AlphaCode},
  journal = {Science},
  volume = {378},
  number = {6624},
  pages = {1092-1097},
  year = {2022},
  doi = {10.1126/science.abq1158},
  URL = {https://www.science.org/doi/abs/10.1126/science.abq1158},
  eprint = {https://www.science.org/doi/pdf/10.1126/science.abq1158},
  abstract = {Programming is a powerful and ubiquitous problem-solving tool. Systems that can assist programmers or even generate programs themselves could make programming more productive and accessible. Recent transformer-based neural network models show impressive code generation abilities yet still perform poorly on more complex tasks requiring problem-solving skills, such as competitive programming problems. Here, we introduce AlphaCode, a system for code generation that achieved an average ranking in the top 54.3\% in simulated evaluations on recent programming competitions on the Codeforces platform. AlphaCode solves problems by generating millions of diverse programs using specially trained transformer-based networks and then filtering and clustering those programs to a maximum of just 10 submissions. This result marks the first time an artificial intelligence system has performed competitively in programming competitions. Computer programming competitions are popular tests among programmers that require critical thinking informed by experience and creating solutions to unforeseen problems, both of which are key aspects of human intelligence but challenging to mimic by machine learning models. Using self-supervised learning and an encoder-decoder transformer architecture, Li et al. developed AlphaCode, a deep-learning model that can achieve approximately human-level performance on the Codeforces platform, which regularly hosts these competitions and attracts numerous participants worldwide (see the Perspective by Kolter). The development of such coding platforms could have a huge impact on programmers’ productivity. It may even change the culture of programming by shifting human work to formulating problems, with machine learning being the main one responsible for generating and executing codes. —YS Modern machine learning systems can achieve average human-level performance in popular competitive programming contests.}}

License

The code is licensed under the Apache 2.0 License.

All non-code materials provided are made available under the terms of the CC BY 4.0 license (Creative Commons Attribution 4.0 International license).

We gratefully acknowledge the contributions of the following:

Use of the third-party software, libraries code or data may be governed by separate terms and conditions or license provisions. Your use of the third-party software, libraries or code may be subject to any such terms. We make no representations here with respect to rights or abilities to use any such materials.

Disclaimer

This is not an official Google product.

code_contests's People

Contributors

felixgimeno avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

code_contests's Issues

Dataset Unavailable

I have used the huggingFace API to fetch the dataset.

On 23 August 2023
When the api is fetched it returns the error: {"error":"The server is busier than usual and the response is not ready yet. Please retry later."}

Just a few days before today (around 15 August, 2023) the api worked perfectly without any errors.

I rely heavily on the availability of the dataset. It is critical that the server is back running in no time.

When will the issue be fixed. If this is not the right place to post this issue, then where is the most appropriate place.

Validation setup

After reading the paper one thing remains unclear to me.

For some problems in the dataset there are only few private tests. Overall, which solutions do you consider correct -- the ones that passes private+generated tests or only private?

Thanks.

Compilation error when using gcc versions {7,9,10,11}

When I was trying to run the given command: bazel run -c opt :print_names_and_sources /tmp/dm-code_contests/code_contests_valid.riegeli, I got this compilation error.

image
error: cannot cast private base class 'std::__detail::__variant::_Variant_storage<false, std::shared_futureriegeli::ChunkHeader, riegeli::records_internal::FutureChunkBegin::PadToBlockBoundary>' to 'std::variant<std::shared_futureriegeli::ChunkHeader, riegeli::records_internal::FutureChunkBegin::PadToBlockBoundary>'

This seems to be related to GCC.

I tried gcc-7 and I got an error saying <filesystem.h> is not found.

Then I tried gcc-9/10/11 and they all resulted in the error above. How can I fix this? Thanks.

Failed: Gregor and Cryptography problem not found. Did you pass the validation dataset?

***UPDATE: I see now that the first command in the section "Executing and evaluating solutions" seems to be expected to fail, because running the subsequent command:

bazel run -c opt execution:solve_example -- \ --valid_path=/tmp/dm-code_contests/code_contests_valid.riegeli \ --python3_path=/usr/bin/python3.10 --python3_library_paths=/usr/lib/python3.10

...which specifies the Python version does attempt to solve the "Gregor and Cryptography" problem. It would have been very helpful if the instructions would have called out this expectation of an initial failure like "...demonstrates this functionality, and can be run with e.g., but this is expected to fail because of the need to specify a particular python version for certain problems. i.e. you should see 'Failed: Gregor and Cryptography problem not found. Did you pass the validation dataset?' "

That could have been explained better. Additionally, I had to jump through a few more hoops to get Python 3.10 installed on Ubuntu before that second command would work. I followed some instructions on this page https://computingforgeeks.com/how-to-install-python-on-ubuntu-linux-system/
...but had some errors with that which required updating certificates using:
sudo apt-get install --reinstall ca-certificates
...and even after that had to try several times the last step on that page^^ because kept getting gpg key errors. finally worked and i was able to run the line that performs the solving of "Gregor and Cryptography"

bazel run -c opt execution:solve_example -- \ --valid_path=/tmp/dm-code_contests/code_contests_valid.riegeli \ --python3_path=/usr/bin/python3.10 --python3_library_paths=/usr/lib/python3.10

...successfully. Now will someone please explain how to use this at work so I can just write a program that does my job for me and just keep an eye on my laptop while I sit on a beach this summer? ;)


I thought initially that this problem was native to LaudemPax's Docker image, which I was using on Windows 11 environment to try this out, but I switched over to Ubuntu and got so far as to get a good output from this command:

bazel run -c opt :print_names_and_sources /tmp/dm-code_contests/code_contests_valid.riegeli

...which returns a long list of code problems after compiling (see further down this post), but when I then execute the first example command under "Executing and evaluating solutions"...

bazel run -c opt execution:solve_example -- \ /tmp/dm-code_contests/code_contests_valid.riegeli

...I get the following error:

Failed: Gregor and Cryptography problem not found. Did you pass the validation dataset?
Please advise.

CODEFORCES 1548_C. The Three Little Pigs CODEFORCES 1548_D1. Gregor and the Odd Cows (Easy) CODEFORCES 1548_D2. Gregor and the Odd Cows (Hard) CODEFORCES 1548_E. Gregor and the Two Painters CODEFORCES 1549_A. Gregor and Cryptography CODEFORCES 1549_B. Gregor and the Pawn Game CODEFORCES 1549_C. Web of Lies CODEFORCES 1549_D. Integers Have Friends CODEFORCES 1551_A. Polycarp and Coins CODEFORCES 1551_B1. Wonderful Coloring - 1 CODEFORCES 1551_B2. Wonderful Coloring - 2 CODEFORCES 1551_C. Interesting Story CODEFORCES 1551_D1. Domino (easy version) CODEFORCES 1551_D2. Domino (hard version) CODEFORCES 1551_E. Fixed Points CODEFORCES 1551_F. Equidistant Vertices CODEFORCES 1552_A. Subsequence Permutation CODEFORCES 1552_B. Running for Gold CODEFORCES 1552_C. Maximize the Intersections CODEFORCES 1552_D. Array Differentiation CODEFORCES 1552_E. Colors and Intervals CODEFORCES 1552_F. Telepanting CODEFORCES 1552_G. A Serious Referee CODEFORCES 1552_I. Organizing a Music Festival CODEFORCES 1553_A. Digits Sum CODEFORCES 1553_B. Reverse String CODEFORCES 1553_C. Penalty CODEFORCES 1553_D. Backspace CODEFORCES 1553_E. Permutation Shift CODEFORCES 1553_F. Pairwise Modulo CODEFORCES 1553_G. Common Divisor Graph CODEFORCES 1553_H. XOR and Distance CODEFORCES 1553_I. Stairs CODEFORCES 1554_A. Cherry CODEFORCES 1554_B. Cobb CODEFORCES 1554_C. Mikasa CODEFORCES 1554_D. Diane CODEFORCES 1554_E. You CODEFORCES 1555_A. PizzaForces CODEFORCES 1555_B. Two Tables CODEFORCES 1555_C. Coin Rows CODEFORCES 1555_D. Say No to Palindromes CODEFORCES 1555_E. Boring Segments CODEFORCES 1555_F. Good Graph CODEFORCES 1556_A. A Variety of Operations CODEFORCES 1556_B. Take Your Places! CODEFORCES 1556_C. Compressed Bracket Sequence CODEFORCES 1556_D. Take a Guess CODEFORCES 1556_E. Equilibrium CODEFORCES 1556_F. Sports Betting CODEFORCES 1556_G. Gates to Another World CODEFORCES 1556_H. DIY Tree CODEFORCES 1557_A. Ezzat and Two Subsequences CODEFORCES 1557_B. Moamen and k-subarrays CODEFORCES 1557_C. Moamen and XOR CODEFORCES 1557_D. Ezzat and Grid CODEFORCES 1557_E. Assiut Chess CODEFORCES 1558_C. Bottom-Tier Reversals CODEFORCES 1558_D. Top-Notch Insertions CODEFORCES 1558_E. Down Below CODEFORCES 1559_A. Mocha and Math CODEFORCES 1559_B. Mocha and Red and Blue CODEFORCES 1559_C. Mocha and Hiking CODEFORCES 1559_D1. Mocha and Diana (Easy Version) CODEFORCES 1559_D2. Mocha and Diana (Hard Version) CODEFORCES 1559_E. Mocha and Stars CODEFORCES 1560_A. Dislike of Threes CODEFORCES 1560_B. Who's Opposite? CODEFORCES 1560_C. Infinity Table CODEFORCES 1560_D. Make a Power of Two CODEFORCES 1560_E. Polycarp and String Transformation CODEFORCES 1560_F1. Nearest Beautiful Number (easy version) CODEFORCES 1560_F2. Nearest Beautiful Number (hard version) CODEFORCES 1561_A. Simply Strange Sort CODEFORCES 1561_B. Charmed by the Game CODEFORCES 1561_C. Deep Down Below CODEFORCES 1561_D1. Up the Strip (simplified version) CODEFORCES 1561_D2. Up the Strip CODEFORCES 1562_A. The Miracle and the Sleeper CODEFORCES 1562_B. Scenes From a Memory CODEFORCES 1562_C. Rings CODEFORCES 1562_D1. Two Hundred Twenty One (easy version) CODEFORCES 1562_D2. Two Hundred Twenty One (hard version) CODEFORCES 1562_E. Rescue Niwen! CODEFORCES 1566_A. Median Maximization CODEFORCES 1566_B. MIN-MEX Cut CODEFORCES 1566_C. MAX-MEX Cut CODEFORCES 1566_D1. Seating Arrangements (easy version) CODEFORCES 1566_D2. Seating Arrangements (hard version) CODEFORCES 1566_E. Buds Re-hanging CODEFORCES 1566_F. Points Movement CODEFORCES 1566_G. Four Vertices CODEFORCES 1566_H. Xor-quiz CODEFORCES 1567_B. MEXor Mixup CODEFORCES 1567_C. Carrying Conundrum CODEFORCES 1567_D. Expression Evaluation Error CODEFORCES 1567_E. Non-Decreasing Dilemma CODEFORCES 1567_F. One-Four Overload CODEFORCES 1569_A. Balanced Substring CODEFORCES 1569_B. Chess Tournament CODEFORCES 1569_C. Jury Meeting CODEFORCES 1569_D. Inconvenient Pairs CODEFORCES 1569_E. Playoff Restoration CODEFORCES 1569_F. Palindromic Hamiltonian Path CODEFORCES 1572_B. Xor of 3 CODEFORCES 1572_C. Paint CODEFORCES 1572_D. Bridge Club CODEFORCES 1572_E. Polygon CODEFORCES 1572_F. Stations CODEFORCES 1573_A. Countdown CODEFORCES 1573_C. Book CODEFORCES 1574_A. Regular Bracket Sequences CODEFORCES 1574_B. Combinatorics Homework CODEFORCES 1574_C. Slay the Dragon CODEFORCES 1574_D. The Strongest Build CODEFORCES 1574_E. Coloring CODEFORCES 1574_F. Occurrences

AlphaCode Model Implementation Questions

@davidhchoi - I saw you mentioned in this closed issue you would be able to answer questions regarding implementation details of AlphaCode. I am in the process of creating a model based on the architecture described in the AlphaCode paper and, initially, I want to create something as close to the original implementation as possible.

To that end, I had a few questions about the architecture and training details and was hoping to get them answered here.

  1. The Tokenizer.
  • In the paper it mentions that a SentencePiece tokenizer with a vocab size of 8000 is used.
  • Is the tokenization 'unigram' style or something else? (bpe, subword, etc)
  • Are there any other parameters to the tokenizer I should be aware of?
  1. Padding/truncation of encoder/decoder inputs.
  • The paper that the pivot point is sampled from files and the text before is the input to the encoder while the text after the pivot is input to the decoder.
  • I know the encoder takes 1536 tokens and the decoder takes 768... so how is this padded/truncated?
  • My intuition is that the encoder would be padded/truncated at the beginning and the decoder would be padded/truncated at the end. This would ensure that the encoder and decoder inputs are continuous through the pivot point.
  • i.e. For the text "a cat sat on the mat and [pivot] jumped into a box of paper" (assume encoder is 8 tokens and decoder is 4 tokens and a token is a word)
    • Encoder inputs: ["[pad]", "a", "cat", "sat", "on", "the", "mat", "and"] (start of the text is padded/truncated)
    • Decoder inputs: ["jumped", "into", "a", "box"] (end of the text is padded/truncated)
  • Can you confirm that this is indeed how this works? Can you also comment on more details regarding the sampling of pivot point? Is it done completely randomly or with some sort of restriction? i.e. sample pivot position using standard distribution centered on n_tokens/2 with some standard deviation (maybe like n_tokens/10?) where n_tokens is the number of tokens in the file.

I appreciate your support in this. I will probably be running into other questions in the near future which I will post here. I'm looking forward to understanding more and getting this working. Thanks in advance!

Error downloading com_google_riegeli

Hi, it seems to be a network error since I am behind a system level proxy, should and how can I configure bazel to work with a proxy?

ERROR: An error occurred during the fetch of repository 'com_google_riegeli':

Error in download_and_extract: java.io.IOException: Error downloading [https://github.com/google/riegeli/archive/587c7921700a58f53fbd2b47fcf9c6dc38477a32.tar.gz]

Code for executing and evaluating

Thanks for the great work and sharing the data!

Just want to check if you have a rough timeline for publishing the code for executing and evaluating solutions?

How to compile C++ programs?

Hello, thank you for open-sourcing this dataset.

I see that you don't plan to release the C++ sandbox. #16
Can you share the options used to compile and execute the C++ programs, or point me to where I can find these options? I cannot find very clear documentation on the contest websites, and want to stick as close as possible to your existing work on cleaning this dataset.

Error - bazel run

Python 3.9.7
OS: Window

Having an error when running bazel to read RIEGELI files.

I followed the readme (install google sdk -> download data using 'gsutil' -> git clone code_contests ->
bazel run -c opt :print_names_and_sources C:\tmp\dm-code_contests\dm-code_contests/code_contests_valid.riegeli
).
I saw same issue with me (#4) and saw the answer of suggesting change of python version (3.x -> 2.x). But, "local variable 'python_include' is referenced before assignment" error also happened and I thought this problem and version issue have to be fixed.

image

Is there any way to read RIEGELI files easily?

Details of codeforces generated tests

3.2.1. of the arxiv version of the paper, page 8 mentions that the Codeforces generated tests are produced through a complex procedure based on mutating inputs and verifying agreement of correct solutions. Is there any plan to release the code for this generation procedure? Replication and extension of the codeforces portion of the code contests dataset might require the application of this process to more recent problems.

Thanks!

Good first issues

If possible, please open beginner friendly to medium to hard issues for contribution.

Executing and evaluating solutions 3x Compilation failure with many python versions

Default python:

(base) root@os-nvme-o49i23bw-cpu-4v-fin1:~/workspace/code_contests# which python
/root/anaconda3/bin/python

(base) root@os-nvme-o49i23bw-cpu-4v-fin1:~/workspace/code_contests# bazel run -c opt execution:solve_example --   --valid_path=/tmp/dm-code_contests/code_contests_valid.riegeli
INFO: Analyzed target //execution:solve_example (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
Target //execution:solve_example up-to-date:
  bazel-bin/execution/solve_example
INFO: Elapsed time: 0.106s, Critical Path: 0.00s
INFO: 1 process: 1 internal.
INFO: Build completed successfully, 1 total action
INFO: Running command line: bazel-bin/execution/solve_example '--valid_path=/tmp/dm-code_contests/code_contests_valid.riegeli'
We will try to solve "Gregor and Cryptography":
https://codeforces.com/problemset/problem/1549/A

We will run:
  1. A program that does not compile.
  2. A program that runs successfully, but gives the wrong answer sometimes.
  3. A correct solution.

--------------------------------------------------------------------------------
An invalid program is reported as not compiling:

[global_forkclient.cc : 122] RAW: Starting global forkserver
WARNING: Logging before InitGoogleLogging() is written to STDERR
E20230316 15:58:35.383378 1229811 monitor.cc:842] SANDBOX VIOLATION : PID: 1229816, PROG: 'python3.9' : [X86-64] arch_prctl [158](0x3001 [12289], 0x7ffd16369bd0) IP: 0x7efc528b2bf5, STACK: 0x7ffd16369b80
I20230316 15:58:35.383520 1229811 monitor.cc:386] Stack traces have been disabled
Compilation failed

--------------------------------------------------------------------------------
The bad solution passes a few tests but then fails.
Because we set stop_on_first_failure to True, we stop once we see a failure.
We are running on 4 threads, so it's possible that more than one failure occurs
before all threads stop.

E20230316 15:58:35.538933 1229818 monitor.cc:842] SANDBOX VIOLATION : PID: 1229821, PROG: 'python3.9' : [X86-64] arch_prctl [158](0x3001 [12289], 0x7ffc6307a710) IP: 0x7fc096ca8bf5, STACK: 0x7ffc6307a6c0
I20230316 15:58:35.539032 1229818 monitor.cc:386] Stack traces have been disabled
Compilation failed

--------------------------------------------------------------------------------
The good solution passes all tests.

E20230316 15:58:35.697964 1229824 monitor.cc:842] SANDBOX VIOLATION : PID: 1229827, PROG: 'python3.9' : [X86-64] arch_prctl [158](0x3001 [12289], 0x7fff542e0e00) IP: 0x7f0b74a0fbf5, STACK: 0x7fff542e0db0
I20230316 15:58:35.698267 1229824 monitor.cc:386] Stack traces have been disabled
Compilation failed

anaconda python 3.9

(base) root@os-nvme-o49i23bw-cpu-4v-fin1:~/workspace/code_contests# bazel run -c opt execution:solve_example --   --valid_path=/tmp/dm-code_contests/code_contests_valid.riegeli   --python3_path=/root/anaconda3/bin/python3.9 --python3_library_paths=/root/anaconda3/lib/python3.9
INFO: Analyzed target //execution:solve_example (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
Target //execution:solve_example up-to-date:
  bazel-bin/execution/solve_example
INFO: Elapsed time: 0.083s, Critical Path: 0.00s
INFO: 1 process: 1 internal.
INFO: Build completed successfully, 1 total action
INFO: Running command line: bazel-bin/execution/solve_example '--valid_path=/tmp/dm-code_contests/code_contests_valid.riegeli' '--python3_path=/root/anaconda3/bin/python3.9' '--python3_library_paths=/root/anaconda3/lib/python3.9'
We will try to solve "Gregor and Cryptography":
https://codeforces.com/problemset/problem/1549/A

We will run:
  1. A program that does not compile.
  2. A program that runs successfully, but gives the wrong answer sometimes.
  3. A correct solution.

--------------------------------------------------------------------------------
An invalid program is reported as not compiling:

[global_forkclient.cc : 122] RAW: Starting global forkserver
WARNING: Logging before InitGoogleLogging() is written to STDERR
E20230316 16:00:09.580668 1230504 monitor.cc:842] SANDBOX VIOLATION : PID: 1230509, PROG: 'python3.9' : [X86-64] arch_prctl [158](0x3001 [12289], 0x7ffe0238a890) IP: 0x7f95de0dbbf5, STACK: 0x7ffe0238a840
I20230316 16:00:09.580809 1230504 monitor.cc:386] Stack traces have been disabled
Compilation failed

--------------------------------------------------------------------------------
The bad solution passes a few tests but then fails.
Because we set stop_on_first_failure to True, we stop once we see a failure.
We are running on 4 threads, so it's possible that more than one failure occurs
before all threads stop.

E20230316 16:00:09.735759 1230511 monitor.cc:842] SANDBOX VIOLATION : PID: 1230514, PROG: 'python3.9' : [X86-64] arch_prctl [158](0x3001 [12289], 0x7ffe6356e7b0) IP: 0x7f551c435bf5, STACK: 0x7ffe6356e760
I20230316 16:00:09.735826 1230511 monitor.cc:386] Stack traces have been disabled
Compilation failed

--------------------------------------------------------------------------------
The good solution passes all tests.

E20230316 16:00:09.890873 1230516 monitor.cc:842] SANDBOX VIOLATION : PID: 1230519, PROG: 'python3.9' : [X86-64] arch_prctl [158](0x3001 [12289], 0x7fff51e6c1e0) IP: 0x7fc6584dcbf5, STACK: 0x7fff51e6c190
I20230316 16:00:09.890983 1230516 monitor.cc:386] Stack traces have been disabled
Compilation failed

python 3.8

(base) root@os-nvme-o49i23bw-cpu-4v-fin1:~/workspace/code_contests# bazel run -c opt execution:solve_example --   --valid_path=/tmp/dm-code_contests/code_contests_valid.riegeli   --python3_path=/usr/bin/python3.8 --python3_library_paths=/usr/lib/python3.8
INFO: Analyzed target //execution:solve_example (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
Target //execution:solve_example up-to-date:
  bazel-bin/execution/solve_example
INFO: Elapsed time: 0.086s, Critical Path: 0.00s
INFO: 1 process: 1 internal.
INFO: Build completed successfully, 1 total action
INFO: Running command line: bazel-bin/execution/solve_example '--valid_path=/tmp/dm-code_contests/code_contests_valid.riegeli' '--python3_path=/usr/bin/python3.8' '--python3_library_paths=/usr/lib/python3.8'
We will try to solve "Gregor and Cryptography":
https://codeforces.com/problemset/problem/1549/A

We will run:
  1. A program that does not compile.
  2. A program that runs successfully, but gives the wrong answer sometimes.
  3. A correct solution.

--------------------------------------------------------------------------------
An invalid program is reported as not compiling:

[global_forkclient.cc : 122] RAW: Starting global forkserver
WARNING: Logging before InitGoogleLogging() is written to STDERR
E20230316 16:01:16.592478 1231347 monitor.cc:842] SANDBOX VIOLATION : PID: 1231352, PROG: 'python3.8' : [X86-64] arch_prctl [158](0x3001 [12289], 0x7ffc04acc560) IP: 0x7f66f5082bf5, STACK: 0x7ffc04acc510
I20230316 16:01:16.592905 1231347 monitor.cc:386] Stack traces have been disabled
Compilation failed

--------------------------------------------------------------------------------
The bad solution passes a few tests but then fails.
Because we set stop_on_first_failure to True, we stop once we see a failure.
We are running on 4 threads, so it's possible that more than one failure occurs
before all threads stop.

E20230316 16:01:16.744000 1231354 monitor.cc:842] SANDBOX VIOLATION : PID: 1231357, PROG: 'python3.8' : [X86-64] arch_prctl [158](0x3001 [12289], 0x7ffe9b9ba820) IP: 0x7f49bca28bf5, STACK: 0x7ffe9b9ba7d0
I20230316 16:01:16.744094 1231354 monitor.cc:386] Stack traces have been disabled
Compilation failed

--------------------------------------------------------------------------------
The good solution passes all tests.

E20230316 16:01:16.897409 1231359 monitor.cc:842] SANDBOX VIOLATION : PID: 1231362, PROG: 'python3.8' : [X86-64] arch_prctl [158](0x3001 [12289], 0x7ffdf57544b0) IP: 0x7f4901a41bf5, STACK: 0x7ffdf5754460
I20230316 16:01:16.897512 1231359 monitor.cc:386] Stack traces have been disabled
Compilation failed

python 2.7

root@os-nvme-o49i23bw-cpu-4v-fin1:~/workspace/code_contests# bazel run -c opt execution:solve_example --   --valid_path=/tmp/dm-code_contests/code_contests_valid.riegeli   --python2_path=/usr/bin/python2.7 --python2_library_paths=/usr/lib/python2.7
INFO: Analyzed target //execution:solve_example (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
Target //execution:solve_example up-to-date:
  bazel-bin/execution/solve_example
INFO: Elapsed time: 0.080s, Critical Path: 0.00s
INFO: 1 process: 1 internal.
INFO: Build completed successfully, 1 total action
INFO: Running command line: bazel-bin/execution/solve_example '--valid_path=/tmp/dm-code_contests/code_contests_valid.riegeli' '--python2_path=/usr/bin/python2.7' '--python2_library_paths=/usr/lib/python2.7'
We will try to solve "Gregor and Cryptography":
https://codeforces.com/problemset/problem/1549/A

We will run:
  1. A program that does not compile.
  2. A program that runs successfully, but gives the wrong answer sometimes.
  3. A correct solution.

--------------------------------------------------------------------------------
An invalid program is reported as not compiling:

[global_forkclient.cc : 122] RAW: Starting global forkserver
WARNING: Logging before InitGoogleLogging() is written to STDERR
E20230316 16:01:52.078231 1231946 monitor.cc:842] SANDBOX VIOLATION : PID: 1231954, PROG: 'python3.9' : [X86-64] arch_prctl [158](0x3001 [12289], 0x7ffd73044620) IP: 0x7fd3674c1bf5, STACK: 0x7ffd730445d0
I20230316 16:01:52.078379 1231946 monitor.cc:386] Stack traces have been disabled
Compilation failed

--------------------------------------------------------------------------------
The bad solution passes a few tests but then fails.
Because we set stop_on_first_failure to True, we stop once we see a failure.
We are running on 4 threads, so it's possible that more than one failure occurs
before all threads stop.

E20230316 16:01:52.236987 1231961 monitor.cc:842] SANDBOX VIOLATION : PID: 1231964, PROG: 'python3.9' : [X86-64] arch_prctl [158](0x3001 [12289], 0x7ffee2bab2c0) IP: 0x7f3327f7fbf5, STACK: 0x7ffee2bab270
I20230316 16:01:52.237118 1231961 monitor.cc:386] Stack traces have been disabled
Compilation failed

--------------------------------------------------------------------------------
The good solution passes all tests.

E20230316 16:01:52.387142 1231966 monitor.cc:842] SANDBOX VIOLATION : PID: 1231969, PROG: 'python3.9' : [X86-64] arch_prctl [158](0x3001 [12289], 0x7fffe265f0f0) IP: 0x7f731a7fcbf5, STACK: 0x7fffe265f0a0
I20230316 16:01:52.387249 1231966 monitor.cc:386] Stack traces have been disabled
Compilation failed

Some test solutions do not return outputs in sandbox running, while they output successfully on CLI.

  • Environment: Dockerhub from #9 (comment) (Thanks to @LaudemPax)
  • Successfully ran solve_example.cc
  • Tested on both Python3.8.10 and Python3.10.4

I built a custom code based on solve_example.cc to evaluate an arbitrary test problem.

However, l found that some of the test solutions passed yet some did not.

After a round of debugging, l confirmed that some of the test solutions do not return any output through stdout.

My conjecture is that, for some reason, the sandbox fails to bind stdout of the running code time to time.

Here is one of the test solution code for 1580_A. Portal (test problem index=20, solution index=105):

import sys;input=sys.stdin.readline
T, = map(int, input().split())
for _ in range(T):
    N, M = map(int, input().split())
    X = [[0]*(M+1)]
    for _ in range(N):
        X.append([0]+[int(c) for c in input().strip()])
    Y = [[0]*(M+1) for _ in range(N+1)]
    for i in range(N+1):
        for j in range(M+1):
            Y[i][j] = X[i][j]
    for i in range(1, N+1):
        for j in range(1, M+1):
            X[i][j] += - X[i-1][j-1] + X[i][j-1] + X[i-1][j]
    R = 10**18
    L = []
    for i in range(5, N+1):
        for j in range(4, M+1):
            x = i-4
            y = j-3
            r = X[i-1][j-1]-X[x][j-1]-X[i-1][y]+X[x][y]
            rrr = (X[i-1][j]+X[i][j-1]-X[i-1][j-1]-r-(X[x-1][j]+X[i][y-1]-X[x-1][y-1]))
            r2 = rrr-Y[x][j]-Y[i][y]-Y[x][y]
            rr = r+(2*(i-x+1-2)+2*(j-y+1-2))-r2
            L.append((rr, x, y))
    L.sort(key=lambda x:x[0])
    for i in range(min(len(L), 23)):
        _, x, y = L[i]
#        print(x, y)
        for i in range(x+4, N+1):
            for j in range(y+3, M+1):
                r = X[i-1][j-1]-X[x][j-1]-X[i-1][y]+X[x][y]
                rrr = (X[i-1][j]+X[i][j-1]-X[i-1][j-1]-r-(X[x-1][j]+X[i][y-1]-X[x-1][y-1]))
                r2 = rrr-Y[x][j]-Y[i][y]-Y[x][y]
                rr = r+(2*(i-x+1-2)+2*(j-y+1-2))-r2
                if R > rr:
                    R = rr
    print(R)

I inserted std::cout in between #L404 and #405, for logging test_result->stdout and test_result->stderr.

Here is the log for running the sandbox:

test_result->stdout:
test_result->stderr:
test_result->stdout:
test_result->stderr:
test_result->stdout:
test_result->stderr:
test_result->stdout:
test_result->stderr:
Compilation succeeded
Test 0 failed.
Test 1 failed.
Test 2 failed.
Test 3 failed.
Test 4 did not run.
Test 5 did not run.
Test 6 did not run.
Test 7 did not run.
Test 8 did not run.
Test 9 did not run.

When I run this solution directly on my CLI, it successfully returns the output. (Input: '1\n9 9\n001010001\n101110100\n000010011\n100000001\n101010101\n110001111\n000001111\n111100000\n000110000\n'; Ouput: '5\n')
(Note that I used the same Python path for both sandbox running and CLI running.)

$ python code.py
1
9 9
001010001
101110100
000010011
100000001
101010101
110001111
000001111
111100000
000110000
5
$

For comparison, I also share a passed solution for 1579_G. Minimal Coverage (test problem index=19, solution index=9):

import sys
input = sys.stdin.readline

for _ in range(int(input())):
    n = int(input())
    a = list(map(int, input().split()))
    dp = [[2100]*2100 for _ in range(n)]
    dp[0][a[0]] = a[0]
    
    for i in range(1, n):
        for j in range(2100):
            nj = max(j-a[i], 0)
            dp[i][nj] = min(dp[i][nj], dp[i-1][j]+max(a[i]-j, 0))
            
            if j+a[i]<2100:
                dp[i][j+a[i]] = min(dp[i][j+a[i]], dp[i-1][j]+max(a[i]-(dp[i-1][j]-j), 0))
    
    print(min(dp[-1]))

test_result->stdout: 3
3
9
9
7
8

test_result->stderr:
test_result->stdout: 3
3
14
9
7
8

test_result->stderr:
test_result->stdout: 3
3
9
9
7
8

test_result->stderr:
test_result->stdout: 3
6
9
9
7
8

test_result->stderr:
test_result->stdout: 3
3
9
9
7
7

test_result->stderr:
test_result->stdout: 3
6
9
12
7
8

test_result->stderr:
test_result->stdout: 3
2
9
9
7
7

test_result->stderr:
test_result->stdout: 3
3
23
9
7
8

test_result->stderr:
test_result->stdout: 4
3
14
9
7
8

test_result->stderr:
test_result->stdout: 3
6
9
12
12
8

test_result->stderr:
Compilation succeeded
Test 0 passed.
Test 1 passed.
Test 2 passed.
Test 3 passed.
Test 4 passed.
Test 5 passed.
Test 6 passed.
Test 7 passed.
Test 8 passed.
Test 9 passed.

This solution successfully run on CLI as well (Input: '6\n2\n1 3\n3\n1 2 3\n4\n6 2 3 9\n4\n6 8 4 5\n7\n1 2 4 6 7 7 3\n8\n8 6 5 1 2 2 3 6\n'; Expected ouput: '3\n3\n9\n9\n7\n8\n').

$ python code.py
6
2
1 3
3
1 2 3
4
6 2 3 9
4
6 8 4 5
7
1 2 4 6 7 7 3
8
8 6 5 1 2 2 3 6
3
3
9
9
7
8
$

I checked stdin with the same way (insert std::cout in between of #L313 and #L314) I did for stdout, but it seems ok as both failed and passed solutions print inputs.

I tried to find the distinctions between failed solutions and passed solutions (e.g., the way they take inputs/outputs), but it was hard to point out the differences.

I leave the test problem indices for the passed and the failed solutions as follows:
(Remaining indices do not have Python solution.)
[Failed]

0, 3, 9, 14, 16, 17, 18, 20, 30, 31, 36, 37, 38, 39, 40, 41, 52, 54, 56, 60, 62, 63, 74, 75, 77, 79, 92, 95, 101, 103, 104, 105, 107, 108, 113, 116, 117, 122, 123, 128, 129, 131, 134, 135, 137, 138, 143, 144, 145, 146, 149, 157, 159, 160, 161, 162, 163, 164

[Passed]

8, 10, 11, 13, 15, 19, 26, 27, 28, 29, 33, 34, 44, 45, 46, 47, 48, 50, 51, 53, 55, 57, 58, 59, 61, 65, 67, 76, 78, 87, 88, 89, 90, 93, 94, 96, 98, 99, 100, 102, 106, 109, 114, 115, 119, 120, 121, 127, 132, 133, 136, 139, 140, 141, 142, 147, 148, 150, 151, 152, 154, 155, 156, 158

Throughout the Python solutions, I used the first ones, e.g., I got the index of the failed solution above as testset[20]['solutions']['language'].index(3).

P.S. As there is a possibility of sandbox discrepancy issue mentioned in #14 (comment), I checked that:

Thus it seems that this issue is independent from the sandbox discrepancy issue, as all the test solutions are implemented by internal libraries only and all solutions got no violation.

Thank you in advance.

Error running Bazel on Windows 11 in Visual Studio Code

I've made some significant progress, but when I attempt to "...print the source and name of each problem in the validation data by installing bazel and then running:..."

bazel run -c opt :print_names_and_sources /tmp/dm-code_contests/code_contests_train.riegeli*

I am running up against some issues with Riegeli:
ERROR: C:/users/XXXXX/_bazel_XXXXX/eqdzh4xg/external/com_google_riegeli/riegeli/bytes/BUILD:478:11: Compiling riegeli/bytes/chain_writer.cc failed: (Exit 2): cl.exe failed: error executing command C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64\cl.exe /nologo /DCOMPILER_MSVC /DNOMINMAX /D_WIN32_WINNT=0x0601 /D_CRT_SECURE_NO_DEPRECATE ... (remaining 26 arguments skipped) external/com_google_riegeli\riegeli/bytes/chain_writer.h(275): error C2512: 'riegeli::Writer': no appropriate default constructor available external/com_google_riegeli\riegeli/bytes/writer.h(58): note: see declaration of 'riegeli::Writer' ERROR: C:/users/XXXXX/_bazel_XXXXX/eqdzh4xg/external/com_google_riegeli/riegeli/brotli/BUILD:26:11: Compiling riegeli/brotli/brotli_reader.cc failed: (Exit 2): cl.exe failed: error executing command C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64\cl.exe /nologo /DCOMPILER_MSVC /DNOMINMAX /D_WIN32_WINNT=0x0601 /D_CRT_SECURE_NO_DEPRECATE ... (remaining 29 arguments skipped) ERROR: C:/users/XXXXX/_bazel_XXXXX/eqdzh4xg/external/com_google_riegeli/riegeli/snappy/BUILD:5:11: Compiling riegeli/snappy/snappy_writer.cc failed: (Exit 2): cl.exe failed: error executing command C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64\cl.exe /nologo /DCOMPILER_MSVC /DNOMINMAX /D_WIN32_WINNT=0x0601 /D_CRT_SECURE_NO_DEPRECATE ... (remaining 28 arguments skipped) external/com_google_riegeli\riegeli/snappy/snappy_writer.h(298): error C2512: 'riegeli::Writer': no appropriate default constructor available external/com_google_riegeli\riegeli/bytes/writer.h(58): note: see declaration of 'riegeli::Writer' external/com_google_absl\absl/types/compare.h(49): error C2338: Only literal 0is allowed. external/com_google_absl\absl/types/optional.h(701): note: see reference to class template instantiation 'absl::lts_20211102::compare_internal::Fail<T>' being compiled with [ T=riegeli::Position ] ERROR: C:/users/XXXXX/_bazel_XXXXX/eqdzh4xg/external/com_google_riegeli/riegeli/chunk_encoding/BUILD:88:11: Compiling riegeli/chunk_encoding/compressor_options.cc failed: (Exit 2): cl.exe failed: error executing command C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64\cl.exe /nologo /DCOMPILER_MSVC /DNOMINMAX /D_WIN32_WINNT=0x0601 /D_CRT_SECURE_NO_DEPRECATE ... (remaining 31 arguments skipped) external/com_google_riegeli\riegeli/bytes/buffered_writer.h(151): error C2512: 'riegeli::Writer': no appropriate default constructor available external/com_google_riegeli\riegeli/bytes/writer.h(58): note: see declaration of 'riegeli::Writer'external/com_google_absl\absl/types/compare.h(49): error C2338: Only literal0 is allowed. external/com_google_absl\absl/types/optional.h(711): note: see reference to class template instantiation 'absl::lts_20211102::compare_internal::Fail<T>' being compiled with [ T=riegeli::Position ] Target //:print_names_and_sources failed to build Use --verbose_failures to see the command lines of failed build steps. INFO: Elapsed time: 14.362s, Critical Path: 1.56s INFO: 35 processes: 16 internal, 19 local. FAILED: Build did NOT complete successfully FAILED: Build did NOT complete successfully

Auto-Configuration Error when run Bazel

When I run the bazel run -c opt :print_names_and_sources /tmp/dm-code_contests/code_contests_valid.riegeli, an error occurred.

ERROR: An error occurred during the fetch of repository 'local_config_cc':
Traceback (most recent call last):
File "/home/sameul/.cache/bazel/_bazel_sameul/25938179392971c8c07cd72c7f57c456/external/bazel_tools/tools/cpp/cc_configure.bzl", line 127, column 33, in cc_autoconf_impl
configure_unix_toolchain(repository_ctx, cpu_value, overriden_tools)
File "/home/sameul/.cache/bazel/_bazel_sameul/25938179392971c8c07cd72c7f57c456/external/bazel_tools/tools/cpp/unix_cc_configure.bzl", line 345, column 17, in configure_unix_toolchain
cc = find_cc(repository_ctx, overriden_tools)
File "/home/sameul/.cache/bazel/_bazel_sameul/25938179392971c8c07cd72c7f57c456/external/bazel_tools/tools/cpp/unix_cc_configure.bzl", line 310, column 23, in find_cc
cc = _find_generic(repository_ctx, "gcc", "CC", overriden_tools)
File "/home/sameul/.cache/bazel/_bazel_sameul/25938179392971c8c07cd72c7f57c456/external/bazel_tools/tools/cpp/unix_cc_configure.bzl", line 306, column 32, in _find_generic
auto_configure_fail(msg)
File "/home/sameul/.cache/bazel/_bazel_sameul/25938179392971c8c07cd72c7f57c456/external/bazel_tools/tools/cpp/lib_cc_configure.bzl", line 112, column 9, in auto_configure_fail
fail("\n%sAuto-Configuration Error:%s %s\n" % (red, no_color, msg))
Error in fail:
Auto-Configuration Error: Cannot find gcc or CC (clang); either correct your path or set the CC environment variable
ERROR: /DEFAULT.WORKSPACE.SUFFIX:519:13: fetching cc_autoconf rule //external:local_config_cc: Traceback (most recent call last):
File "/home/sameul/.cache/bazel/_bazel_sameul/25938179392971c8c07cd72c7f57c456/external/bazel_tools/tools/cpp/cc_configure.bzl", line 127, column 33, in cc_autoconf_impl
configure_unix_toolchain(repository_ctx, cpu_value, overriden_tools)
File "/home/sameul/.cache/bazel/_bazel_sameul/25938179392971c8c07cd72c7f57c456/external/bazel_tools/tools/cpp/unix_cc_configure.bzl", line 345, column 17, in configure_unix_toolchain
cc = find_cc(repository_ctx, overriden_tools)
File "/home/sameul/.cache/bazel/_bazel_sameul/25938179392971c8c07cd72c7f57c456/external/bazel_tools/tools/cpp/unix_cc_configure.bzl", line 310, column 23, in find_cc
cc = _find_generic(repository_ctx, "gcc", "CC", overriden_tools)
File "/home/sameul/.cache/bazel/_bazel_sameul/25938179392971c8c07cd72c7f57c456/external/bazel_tools/tools/cpp/unix_cc_configure.bzl", line 306, column 32, in _find_generic
auto_configure_fail(msg)
File "/home/sameul/.cache/bazel/_bazel_sameul/25938179392971c8c07cd72c7f57c456/external/bazel_tools/tools/cpp/lib_cc_configure.bzl", line 112, column 9, in auto_configure_fail
fail("\n%sAuto-Configuration Error:%s %s\n" % (red, no_color, msg))
Error in fail:
Auto-Configuration Error: Cannot find gcc or CC (clang); either correct your path or set the CC environment variable
INFO: Repository com_google_riegeli instantiated at:
/home/sameul/code_contests/WORKSPACE:40:13: in
Repository rule http_archive defined at:
/home/sameul/.cache/bazel/_bazel_sameul/25938179392971c8c07cd72c7f57c456/external/bazel_tools/tools/build_defs/repo/http.bzl:353:31: in
ERROR: /home/sameul/code_contests/BUILD:52:10: //:print_names_and_sources depends on @local_config_cc//:cc-compiler-k8 in repository @local_config_cc which failed to fetch. no such package '@local_config_cc//':
Auto-Configuration Error: Cannot find gcc or CC (clang); either correct your path or set the CC environment variable
ERROR: Analysis of target '//:print_names_and_sources' failed; build aborted: Analysis failed
INFO: Elapsed time: 34.222s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (34 packages loaded, 125 targets c
FAILED: Build did NOT complete successfully (34 packages loaded, 125 targets c
onfigured)

Could anyone help me to resolve this?

[macOS] Error Running Bazel: from riegeli.records import record_reader ImportError : symbol not found in flat namespace

Please help with Bazel run gets ImportError on macOS 12.2 Monterey (Intel chip):

% bazel run -c opt \ :print_names_and_sources /tmp/dm-code_contests/code_contests_valid.riegeli Starting local Bazel server and connecting to it... INFO: Analyzed target //:print_names_and_sources (82 packages loaded, 2025 targets configured). INFO: Found 1 target... Target //:print_names_and_sources up-to-date: bazel-bin/print_names_and_sources INFO: Elapsed time: 4.780s, Critical Path: 0.10s INFO: 1 process: 1 internal. INFO: Build completed successfully, 1 total action INFO: Build completed successfully, 1 total action Traceback (most recent call last): File "/private/var/tmp/_bazel_j/651bc297ae9686f74aa6889e91cbfc4c/execroot/__main__/bazel-out/darwin-opt/bin/print_names_and_sources.runfiles/__main__/print_names_and_sources.py", line 24, in <module> import riegeli File "/private/var/tmp/_bazel_j/651bc297ae9686f74aa6889e91cbfc4c/execroot/__main__/bazel-out/darwin-opt/bin/print_names_and_sources.runfiles/com_google_riegeli/python/riegeli/__init__.py", line 18, in <module> from riegeli.records import record_reader ImportError: dlopen(/private/var/tmp/_bazel_j/651bc297ae9686f74aa6889e91cbfc4c/execroot/__main__/bazel-out/darwin-opt/bin/print_names_and_sources.runfiles/com_google_riegeli/python/riegeli/records/record_reader.so, 0x0002): symbol not found in flat namespace '__ZNK11highwayhash11HighwayHashILj2EEclERA4_KyPKcmPy'

% bazel --version
bazel 5.0.0-homebrew
% python -V
Python 3.7.9
% uname -m
x86_64

Thanks!

Bazel run error on Ubuntu16.04

python 3.6
gcc 9.4
bazel 5.0
ERROR:/root/.cache/bazel/_bazel_root/6675997dee4e0376c54aabebada3b948/external/com_google_absl/absl/types/BUILD.bazel:153:11: Compiling absl/types/bad_optional_access.cc failed: (Exit 1): clang-11 failed: error executing command
I followed the instruction of the readme, and run the command "bazel run -c opt :print_names_and_sources ../dm-code_contestscode_contests_valid.riegeli --verbose_failures". The details is in the following picture
error-gcc-9

Actually, I have changed the gcc version from gcc-7 to gcc-9, as it occurred the "ERROR: /root/.cache/bazel/_bazel_root/51fbc34d3ea9958886586d668dbcdf68/external/snappy/BUILD.bazel:5:11: Compiling snappy-stubs-internal.cc failed: (Exit 1): gcc failed: error executing command" when executing the "bazel run...".
error-gcc7

And my first tries on the Windows system, it also cannot run sucessfully.
(Windows 10, Python 3.6, Microsoft Visual Studio Community 2019, Bazel 6.0.0 and msys)
Here is the error.
error-windows

I hope that someone could help me. I have try many times.
Is there any way to run successfully?

SANDBOX VIOLATION

UPDATE was able to resolve the by following responses after this post:

#12 (comment)


I had this working at one point, but now when I try to run the solve, it omits the actual code solution that was previously outputted to log. I'm guessing this is due to "Stack traces have been disabled":

` bazel run -c opt execution:solve_example -- --valid_path=//root/tmp/dm-code_contests/code_contests_valid.riegeli --python3_path=/usr/bin/python3.10 --python3_library_paths=/usr/lib/python3.10
DEBUG: Rule 'com_github_grpc_grpc' indicated that a canonical reproducible form can be obtained by modifying arguments commit = "96b73272eadc01afb5fb45b92b408c47e4387274", shallow_since = "1624063996 -0700" and dropping ["tag"]
DEBUG: Repository com_github_grpc_grpc instantiated at:
/root/WORKSPACE:4:15: in
Repository rule git_repository defined at:
/root/.cache/bazel/_bazel_root/887904812217cca9bc2b9adb875daf42/external/bazel_tools/tools/build_defs/repo/git.bzl:199:33: in
DEBUG: Rule 'com_google_sandboxed_api' indicated that a canonical reproducible form can be obtained by modifying arguments shallow_since = "1645093884 -0800"
DEBUG: Repository com_google_sandboxed_api instantiated at:
/root/WORKSPACE:109:6: in
/root/.cache/bazel/_bazel_root/887904812217cca9bc2b9adb875daf42/external/bazel_tools/tools/build_defs/repo/utils.bzl:233:18: in maybe
Repository rule git_repository defined at:
/root/.cache/bazel/_bazel_root/887904812217cca9bc2b9adb875daf42/external/bazel_tools/tools/build_defs/repo/git.bzl:199:33: in
DEBUG: Rule 'com_google_protobuf' indicated that a canonical reproducible form can be obtained by modifying arguments commit = "cc7b1b53234cd7a8f50d90ac3933b240dcf4cd97", shallow_since = "1641866895 -0800" and dropping ["tag"]
DEBUG: Repository com_google_protobuf instantiated at:
/root/WORKSPACE:22:15: in
Repository rule git_repository defined at:
/root/.cache/bazel/_bazel_root/887904812217cca9bc2b9adb875daf42/external/bazel_tools/tools/build_defs/repo/git.bzl:199:33: in
DEBUG: Rule 'com_google_absl' indicated that a canonical reproducible form can be obtained by modifying arguments commit = "215105818dfde3174fe799600bb0f3cae233d0bf", shallow_since = "1635953174 -0400" and dropping ["tag"]
DEBUG: Repository com_google_absl instantiated at:
/root/WORKSPACE:28:15: in
Repository rule git_repository defined at:
/root/.cache/bazel/_bazel_root/887904812217cca9bc2b9adb875daf42/external/bazel_tools/tools/build_defs/repo/git.bzl:199:33: in
DEBUG: Rule 'rules_python' indicated that a canonical reproducible form can be obtained by modifying arguments commit = "76ef44fdb8aaa8d5c607721ffe1b1cbf1e8f08dd", shallow_since = "1635214215 -0700" and dropping ["tag"]
DEBUG: Repository rules_python instantiated at:
/root/WORKSPACE:14:15: in
Repository rule git_repository defined at:
/root/.cache/bazel/_bazel_root/887904812217cca9bc2b9adb875daf42/external/bazel_tools/tools/build_defs/repo/git.bzl:199:33: in
INFO: Analyzed target //execution:solve_example (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
Target //execution:solve_example up-to-date:
bazel-bin/execution/solve_example
INFO: Elapsed time: 0.319s, Critical Path: 0.00s
INFO: 1 process: 1 internal.
INFO: Build completed successfully, 1 total action
INFO: Running command line: bazel-bin/execution/solve_example '--valid_path=//root/tmp/dm-code_contests/code_contests_valid.riegeli' '--python3_path=/usr/bin/python3.10' '--python3_librarINFO: Build completed successfully, 1 total action
We will try to solve "Gregor and Cryptography":
https://codeforces.com/problemset/problem/1549/A

We will run:

  1. A program that does not compile.
  2. A program that runs successfully, but gives the wrong answer sometimes.
  3. A correct solution.

An invalid program is reported as not compiling:

[global_forkclient.cc : 122] RAW: Starting global forkserver
WARNING: Logging before InitGoogleLogging() is written to STDERR
E20220922 03:16:46.685678 473369 monitor.cc:842] SANDBOX VIOLATION : PID: 473374, PROG: 'python3.10' : [X86-64] arch_prctl [158](0x3001 [12289], 0x7ffe03026890) IP: 0x7fb5e9583bf5, STACK: 0x7ffe03026840
I20220922 03:16:46.685863 473369 monitor.cc:386] Stack traces have been disabled
Compilation failed


The bad solution passes a few tests but then fails.
Because we set stop_on_first_failure to True, we stop once we see a failure.
We are running on 4 threads, so it's possible that more than one failure occurs
before all threads stop.

E20220922 03:16:46.965130 473376 monitor.cc:842] SANDBOX VIOLATION : PID: 473379, PROG: 'python3.10' : [X86-64] arch_prctl [158](0x3001 [12289], 0x7ffd0c9893d0) IP: 0x7f4a0ad42bf5, STACK: 0x7ffd0c989380
I20220922 03:16:46.965252 473376 monitor.cc:386] Stack traces have been disabled
Compilation failed


The good solution passes all tests.

E20220922 03:16:47.242813 473384 monitor.cc:842] SANDBOX VIOLATION : PID: 473387, PROG: 'python3.10' : [X86-64] arch_prctl [158](0x3001 [12289], 0x7ffe72cfa5f0) IP: 0x7f8b25f09bf5, STACK: 0x7ffe72cfa5a0
I20220922 03:16:47.242944 473384 monitor.cc:386] Stack traces have been disabled
Compilation failed`

Can't compile with clang 14 and gcc 12

On Ubuntu 20.04.5 LTS. clang and gcc versions:

(base) root@os-nvme-o49i23bw-cpu-4v-fin1:~/workspace/code_contests# clang --version
Ubuntu clang version 14.0.6
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
(base) root@os-nvme-o49i23bw-cpu-4v-fin1:~/workspace/code_contests# gcc --version
gcc (GCC) 12.2.1 20230316
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Compiling with --sandbox-debug throws the following:

INFO: Analyzed target //:print_names_and_sources (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
INFO: From Compiling uncompr.c [for tool]:
1678978886.148520003: src/main/tools/linux-sandbox.cc:152: calling pipe(2)...
1678978886.148547135: src/main/tools/linux-sandbox.cc:171: calling clone(2)...
1678978886.148751419: src/main/tools/linux-sandbox.cc:180: linux-sandbox-pid1 has PID 1198220
1678978886.150589322: src/main/tools/linux-sandbox-pid1.cc:681: Pid1Main started
1678978886.150708683: src/main/tools/linux-sandbox-pid1.cc:285: working dir: /root/.cache/bazel/_bazel_root/f7c375a72d49d13d93bddb7df2a53069/sandbox/linux-sandbox/13/execroot/__main__
1678978886.150719944: src/main/tools/linux-sandbox-pid1.cc:320: writable: /root/.cache/bazel/_bazel_root/f7c375a72d49d13d93bddb7df2a53069/sandbox/linux-sandbox/13/execroot/__main__
1678978886.150725004: src/main/tools/linux-sandbox-pid1.cc:320: writable: /tmp
1678978886.150729413: src/main/tools/linux-sandbox-pid1.cc:320: writable: /dev/shm
1678978886.150772556: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /
1678978886.150777365: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /dev
1678978886.150781042: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /dev/pts
1678978886.150784710: src/main/tools/linux-sandbox-pid1.cc:400: remount rw: /dev/shm
1678978886.150788196: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /dev/hugepages
1678978886.150791843: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /dev/mqueue
1678978886.150795510: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /run
1678978886.150798876: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /run/lock
1678978886.150802673: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /run/snapd/ns
1678978886.150806702: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /run/user/0
1678978886.150810940: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys
1678978886.150814096: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/kernel/security
1678978886.150818915: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup
1678978886.150822712: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/unified
1678978886.150850987: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/systemd
1678978886.150854844: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/perf_event
1678978886.150858461: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/memory
1678978886.150862329: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/net_cls,net_prio
1678978886.150866036: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/hugetlb
1678978886.150869443: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/blkio
1678978886.150873039: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/rdma
1678978886.150876867: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/cpu,cpuacct
1678978886.150880293: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/cpuset
1678978886.150883811: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/devices
1678978886.150887207: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/freezer
1678978886.150890754: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/pids
1678978886.150894380: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/pstore
1678978886.150917565: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/bpf
1678978886.150921433: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/kernel/debug
1678978886.150925461: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/kernel/tracing
1678978886.150929308: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/kernel/config
1678978886.150933275: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/fuse/connections
1678978886.150937874: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /proc
1678978886.150941742: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /proc/sys/fs/binfmt_misc
1678978886.150948445: src/main/tools/linux-sandbox-pid1.cc:422: remount(nullptr, /proc/sys/fs/binfmt_misc, nullptr, 2101281, nullptr) failure (Operation not permitted) ignored
1678978886.150964867: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /proc/sys/fs/binfmt_misc
1678978886.150969054: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /snap/snapd/17950
1678978886.150972571: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /snap/core20/1822
1678978886.150976539: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /boot/efi
1678978886.150980387: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /snap/lxd/22753
1678978886.150983723: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /snap/core20/1828
1678978886.150986699: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /snap/snapd/18357
1678978886.150995996: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /snap/lxd/24061
1678978886.150999293: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /snap/core18/2714
1678978886.151002930: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /snap/google-cloud-cli/115
1678978886.151006817: src/main/tools/linux-sandbox-pid1.cc:400: remount rw: /root/.cache/bazel/_bazel_root/f7c375a72d49d13d93bddb7df2a53069/sandbox/linux-sandbox/13/execroot/__main__
1678978886.151010474: src/main/tools/linux-sandbox-pid1.cc:400: remount rw: /root/.cache/bazel/_bazel_root/f7c375a72d49d13d93bddb7df2a53069/sandbox/linux-sandbox/13/execroot/__main__
1678978886.151013780: src/main/tools/linux-sandbox-pid1.cc:400: remount rw: /tmp
1678978886.151017098: src/main/tools/linux-sandbox-pid1.cc:400: remount rw: /dev/shm
1678978886.151034200: src/main/tools/linux-sandbox-pid1.cc:491: calling fork...
1678978886.151122981: src/main/tools/linux-sandbox-pid1.cc:521: child started with PID 2
1678978886.151283460: src/main/tools/linux-sandbox.cc:197: done manipulating pipes
1678978886.194077801: src/main/tools/linux-sandbox-pid1.cc:538: wait returned pid=2, status=0x00
1678978886.194090306: src/main/tools/linux-sandbox-pid1.cc:556: child exited normally with code 0
1678978886.215912775: src/main/tools/linux-sandbox.cc:233: child exited normally with code 0
INFO: From Executing genrule @com_google_protobuf//:protos_python_genrule:
1678978886.165345861: src/main/tools/linux-sandbox.cc:152: calling pipe(2)...
1678978886.165386129: src/main/tools/linux-sandbox.cc:171: calling clone(2)...
1678978886.165609529: src/main/tools/linux-sandbox.cc:180: linux-sandbox-pid1 has PID 1198227
1678978886.179718849: src/main/tools/linux-sandbox-pid1.cc:681: Pid1Main started
1678978886.179803333: src/main/tools/linux-sandbox.cc:197: done manipulating pipes
1678978886.179886242: src/main/tools/linux-sandbox-pid1.cc:285: working dir: /root/.cache/bazel/_bazel_root/f7c375a72d49d13d93bddb7df2a53069/sandbox/linux-sandbox/15/execroot/__main__
1678978886.179905720: src/main/tools/linux-sandbox-pid1.cc:320: writable: /root/.cache/bazel/_bazel_root/f7c375a72d49d13d93bddb7df2a53069/sandbox/linux-sandbox/15/execroot/__main__
1678978886.179910709: src/main/tools/linux-sandbox-pid1.cc:320: writable: /tmp
1678978886.179915017: src/main/tools/linux-sandbox-pid1.cc:320: writable: /dev/shm
1678978886.179970775: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /
1678978886.179975705: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /dev
1678978886.179979492: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /dev/pts
1678978886.179983179: src/main/tools/linux-sandbox-pid1.cc:400: remount rw: /dev/shm
1678978886.179986596: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /dev/hugepages
1678978886.179990273: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /dev/mqueue
1678978886.179994091: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /run
1678978886.179997307: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /run/lock
1678978886.180000934: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /run/snapd/ns
1678978886.180004921: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /run/user/0
1678978886.180008979: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys
1678978886.180012276: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/kernel/security
1678978886.180017706: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup
1678978886.180021944: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/unified
1678978886.180052012: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/systemd
1678978886.180056210: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/perf_event
1678978886.180059967: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/memory
1678978886.180064235: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/net_cls,net_prio
1678978886.180068083: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/hugetlb
1678978886.180071770: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/blkio
1678978886.180075357: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/rdma
1678978886.180079044: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/cpu,cpuacct
1678978886.180082601: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/cpuset
1678978886.180086157: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/devices
1678978886.180089685: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/freezer
1678978886.180093182: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/pids
1678978886.180096828: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/pstore
1678978886.180122948: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/bpf
1678978886.180127448: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/kernel/debug
1678978886.180131485: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/kernel/tracing
1678978886.180135453: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/kernel/config
1678978886.180139280: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/fuse/connections
1678978886.180144189: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /proc
1678978886.180148098: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /proc/sys/fs/binfmt_misc
1678978886.180165029: src/main/tools/linux-sandbox-pid1.cc:422: remount(nullptr, /proc/sys/fs/binfmt_misc, nullptr, 2101281, nullptr) failure (Operation not permitted) ignored
1678978886.180172164: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /proc/sys/fs/binfmt_misc
1678978886.180176312: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /snap/snapd/17950
1678978886.180179978: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /snap/core20/1822
1678978886.180183926: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /boot/efi
1678978886.180187814: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /snap/lxd/22753
1678978886.180191180: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /snap/core20/1828
1678978886.180194246: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /snap/snapd/18357
1678978886.180204455: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /snap/lxd/24061
1678978886.180208023: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /snap/core18/2714
1678978886.180211730: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /snap/google-cloud-cli/115
1678978886.180215427: src/main/tools/linux-sandbox-pid1.cc:400: remount rw: /root/.cache/bazel/_bazel_root/f7c375a72d49d13d93bddb7df2a53069/sandbox/linux-sandbox/15/execroot/__main__
1678978886.180219064: src/main/tools/linux-sandbox-pid1.cc:400: remount rw: /root/.cache/bazel/_bazel_root/f7c375a72d49d13d93bddb7df2a53069/sandbox/linux-sandbox/15/execroot/__main__
1678978886.180222240: src/main/tools/linux-sandbox-pid1.cc:400: remount rw: /tmp
1678978886.180225306: src/main/tools/linux-sandbox-pid1.cc:400: remount rw: /dev/shm
1678978886.180242158: src/main/tools/linux-sandbox-pid1.cc:491: calling fork...
1678978886.180365196: src/main/tools/linux-sandbox-pid1.cc:521: child started with PID 2
1678978886.213271193: src/main/tools/linux-sandbox-pid1.cc:538: wait returned pid=2, status=0x00
1678978886.213283807: src/main/tools/linux-sandbox-pid1.cc:556: child exited normally with code 0
1678978886.247837291: src/main/tools/linux-sandbox.cc:233: child exited normally with code 0
ERROR: /root/.cache/bazel/_bazel_root/f7c375a72d49d13d93bddb7df2a53069/external/com_google_protobuf/BUILD:513:10: Compiling src/google/protobuf/compiler/main.cc [for tool] failed: (Exit 1): linux-sandbox failed: error executing command 
  (cd /root/.cache/bazel/_bazel_root/f7c375a72d49d13d93bddb7df2a53069/sandbox/linux-sandbox/12/execroot/__main__ && \
  exec env - \
    LD_LIBRARY_PATH=/root/install/gcc-12/lib/../lib64: \
    PATH=/root/.cache/bazelisk/downloads/bazelbuild/bazel-6.1.1-linux-x86_64/bin:~/install/gcc-12/bin/gcc:/root/install/gcc-12/bin:/usr/local/cuda/bin:/root/.vscode-server/bin/e2816fe719a4026ffa1ee0189dc89bdfdbafb164/bin/remote-cli:/root/anaconda3/bin:/root/anaconda3/condabin:/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin \
    PWD=/proc/self/cwd \
    TMPDIR=/tmp \
  /root/.cache/bazel/_bazel_root/install/e63ada1a9406bff70c6efc9d97c3aeba/linux-sandbox -t 15 -w /root/.cache/bazel/_bazel_root/f7c375a72d49d13d93bddb7df2a53069/sandbox/linux-sandbox/12/execroot/__main__ -w /tmp -w /dev/shm -S /root/.cache/bazel/_bazel_root/f7c375a72d49d13d93bddb7df2a53069/sandbox/linux-sandbox/12/stats.out -D -- /usr/lib/llvm-14/bin/clang -U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -Wunused-but-set-parameter -Wno-free-nonheap-object -fcolor-diagnostics -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections -fdata-sections '-std=c++0x' -MD -MF bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/_objs/protoc/main.d '-frandom-seed=bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/_objs/protoc/main.o' '-DBAZEL_CURRENT_REPOSITORY="com_google_protobuf"' -iquote external/com_google_protobuf -iquote bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf -iquote external/zlib -iquote bazel-out/k8-opt-exec-2B5CBBC6/bin/external/zlib -iquote external/bazel_tools -iquote bazel-out/k8-opt-exec-2B5CBBC6/bin/external/bazel_tools -isystem external/com_google_protobuf/src -isystem bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/src -isystem external/zlib -isystem bazel-out/k8-opt-exec-2B5CBBC6/bin/external/zlib -g0 -g0 -no-canonical-prefixes -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c external/com_google_protobuf/src/google/protobuf/compiler/main.cc -o bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/_objs/protoc/main.o)
1678978886.142680495: src/main/tools/linux-sandbox.cc:152: calling pipe(2)...
1678978886.142709432: src/main/tools/linux-sandbox.cc:171: calling clone(2)...
1678978886.142941359: src/main/tools/linux-sandbox.cc:180: linux-sandbox-pid1 has PID 1198218
1678978886.151704492: src/main/tools/linux-sandbox-pid1.cc:681: Pid1Main started
1678978886.151750582: src/main/tools/linux-sandbox.cc:197: done manipulating pipes
1678978886.151853319: src/main/tools/linux-sandbox-pid1.cc:285: working dir: /root/.cache/bazel/_bazel_root/f7c375a72d49d13d93bddb7df2a53069/sandbox/linux-sandbox/12/execroot/__main__
1678978886.151862386: src/main/tools/linux-sandbox-pid1.cc:320: writable: /root/.cache/bazel/_bazel_root/f7c375a72d49d13d93bddb7df2a53069/sandbox/linux-sandbox/12/execroot/__main__
1678978886.151867036: src/main/tools/linux-sandbox-pid1.cc:320: writable: /tmp
1678978886.151870613: src/main/tools/linux-sandbox-pid1.cc:320: writable: /dev/shm
1678978886.151898045: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /
1678978886.151902944: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /dev
1678978886.151906723: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /dev/pts
1678978886.151910179: src/main/tools/linux-sandbox-pid1.cc:400: remount rw: /dev/shm
1678978886.151913305: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /dev/hugepages
1678978886.151917212: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /dev/mqueue
1678978886.151920849: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /run
1678978886.151924106: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /run/lock
1678978886.151927613: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /run/snapd/ns
1678978886.151931219: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /run/user/0
1678978886.151934906: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys
1678978886.151937972: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/kernel/security
1678978886.151942271: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup
1678978886.151946148: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/unified
1678978886.151961027: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/systemd
1678978886.151964915: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/perf_event
1678978886.151968572: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/memory
1678978886.151972409: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/net_cls,net_prio
1678978886.151976066: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/hugetlb
1678978886.151979592: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/blkio
1678978886.151983030: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/rdma
1678978886.151986616: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/cpu,cpuacct
1678978886.151990093: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/cpuset
1678978886.151993519: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/devices
1678978886.151996936: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/freezer
1678978886.152000493: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/cgroup/pids
1678978886.152004170: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/pstore
1678978886.152018337: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/bpf
1678978886.152021915: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/kernel/debug
1678978886.152025501: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/kernel/tracing
1678978886.152029008: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/kernel/config
1678978886.152032454: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /sys/fs/fuse/connections
1678978886.152036412: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /proc
1678978886.152040290: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /proc/sys/fs/binfmt_misc
1678978886.152048335: src/main/tools/linux-sandbox-pid1.cc:422: remount(nullptr, /proc/sys/fs/binfmt_misc, nullptr, 2101281, nullptr) failure (Operation not permitted) ignored
1678978886.152056531: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /proc/sys/fs/binfmt_misc
1678978886.152060389: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /snap/snapd/17950
1678978886.152063605: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /snap/core20/1822
1678978886.152067262: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /boot/efi
1678978886.152070758: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /snap/lxd/22753
1678978886.152073744: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /snap/core20/1828
1678978886.152076710: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /snap/snapd/18357
1678978886.152085337: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /snap/lxd/24061
1678978886.152088493: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /snap/core18/2714
1678978886.152091729: src/main/tools/linux-sandbox-pid1.cc:400: remount ro: /snap/google-cloud-cli/115
1678978886.152095235: src/main/tools/linux-sandbox-pid1.cc:400: remount rw: /root/.cache/bazel/_bazel_root/f7c375a72d49d13d93bddb7df2a53069/sandbox/linux-sandbox/12/execroot/__main__
1678978886.152098743: src/main/tools/linux-sandbox-pid1.cc:400: remount rw: /root/.cache/bazel/_bazel_root/f7c375a72d49d13d93bddb7df2a53069/sandbox/linux-sandbox/12/execroot/__main__
1678978886.152102169: src/main/tools/linux-sandbox-pid1.cc:400: remount rw: /tmp
1678978886.152105485: src/main/tools/linux-sandbox-pid1.cc:400: remount rw: /dev/shm
1678978886.152118250: src/main/tools/linux-sandbox-pid1.cc:491: calling fork...
1678978886.152215568: src/main/tools/linux-sandbox-pid1.cc:521: child started with PID 2
In file included from external/com_google_protobuf/src/google/protobuf/compiler/main.cc:31:
external/com_google_protobuf/src/google/protobuf/compiler/cpp/cpp_generator.h:40:10: fatal error: 'string' file not found
#include <string>
         ^~~~~~~~
1 error generated.
1678978886.234147709: src/main/tools/linux-sandbox-pid1.cc:538: wait returned pid=2, status=0x100
1678978886.234162178: src/main/tools/linux-sandbox-pid1.cc:556: child exited normally with code 1
1678978886.263911448: src/main/tools/linux-sandbox.cc:233: child exited normally with code 1
Target //:print_names_and_sources failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 0.377s, Critical Path: 0.16s
INFO: 7 processes: 5 internal, 2 linux-sandbox.
FAILED: Build did NOT complete successfully

bazel building error on grpc dependency when using Python 3.10

When running the first command, I'm getting the following errors:

`root@[COMPUTER NAME]:/tmp/dm-code_contests# bazel run -c opt \

:print_names_and_sources /tmp/dm-code_contests/code_contests_valid.riegeli
INFO: Build option --compilation_mode has changed, discarding analysis cache.
INFO: Repository local_config_python instantiated at:
/tmp/dm-code_contests/WORKSPACE:12:10: in
/root/.cache/bazel/_bazel_root/f815f9c148e5d06107d4dc9766d21406/external/com_github_grpc_grpc/bazel/grpc_deps.bzl:414:21: in grpc_deps
/root/.cache/bazel/_bazel_root/f815f9c148e5d06107d4dc9766d21406/external/com_github_grpc_grpc/bazel/grpc_python_deps.bzl:43:21: in grpc_python_deps
Repository rule python_configure defined at:
/root/.cache/bazel/_bazel_root/f815f9c148e5d06107d4dc9766d21406/external/com_github_grpc_grpc/third_party/py/python_configure.bzl:365:35: in
ERROR: An error occurred during the fetch of repository 'local_config_python':
Traceback (most recent call last):
File "/root/.cache/bazel/_bazel_root/f815f9c148e5d06107d4dc9766d21406/external/com_github_grpc_grpc/third_party/py/python_configure.bzl", line 355, column 35, in _python_autoconf_impl
_create_single_version_package(
File "/root/.cache/bazel/_bazel_root/f815f9c148e5d06107d4dc9766d21406/external/com_github_grpc_grpc/third_party/py/python_configure.bzl", line 304, column 45, in _create_single_version_package
python_include = _get_python_include(repository_ctx, python_bin)
File "/root/.cache/bazel/_bazel_root/f815f9c148e5d06107d4dc9766d21406/external/com_github_grpc_grpc/third_party/py/python_configure.bzl", line 236, column 22, in _get_python_include
result = _execute(
File "/root/.cache/bazel/_bazel_root/f815f9c148e5d06107d4dc9766d21406/external/com_github_grpc_grpc/third_party/py/python_configure.bzl", line 62, column 14, in _execute
_fail("\n".join([
File "/root/.cache/bazel/_bazel_root/f815f9c148e5d06107d4dc9766d21406/external/com_github_grpc_grpc/third_party/py/python_configure.bzl", line 35, column 9, in _fail
fail("%sPython Configuration Error:%s %s\n" % (red, no_color, msg))
Error in fail: Python Configuration Error: Problem getting python include path for /usr/bin/python3.
:1: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
:1: DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig instead
Is the Python binary path set up right? (See ./configure or /usr/bin/python3.) Is distutils installed? Are Python headers installed? Try installing python-dev or python3-dev on Debian-based systems. Try python-devel or python3-devel on Redhat-based systems.
ERROR: /tmp/dm-code_contests/WORKSPACE:12:10: fetching python_configure rule //external:local_config_python: Traceback (most recent call last):
File "/root/.cache/bazel/_bazel_root/f815f9c148e5d06107d4dc9766d21406/external/com_github_grpc_grpc/third_party/py/python_configure.bzl", line 355, column 35, in _python_autoconf_impl
_create_single_version_package(
File "/root/.cache/bazel/_bazel_root/f815f9c148e5d06107d4dc9766d21406/external/com_github_grpc_grpc/third_party/py/python_configure.bzl", line 304, column 45, in _create_single_version_package
python_include = _get_python_include(repository_ctx, python_bin)
File "/root/.cache/bazel/_bazel_root/f815f9c148e5d06107d4dc9766d21406/external/com_github_grpc_grpc/third_party/py/python_configure.bzl", line 236, column 22, in _get_python_include
result = _execute(
File "/root/.cache/bazel/_bazel_root/f815f9c148e5d06107d4dc9766d21406/external/com_github_grpc_grpc/third_party/py/python_configure.bzl", line 62, column 14, in _execute
_fail("\n".join([
File "/root/.cache/bazel/_bazel_root/f815f9c148e5d06107d4dc9766d21406/external/com_github_grpc_grpc/third_party/py/python_configure.bzl", line 35, column 9, in _fail
fail("%sPython Configuration Error:%s %s\n" % (red, no_color, msg))
Error in fail: Python Configuration Error: Problem getting python include path for /usr/bin/python3.
:1: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
:1: DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig instead
Is the Python binary path set up right? (See ./configure or /usr/bin/python3.) Is distutils installed? Are Python headers installed? Try installing python-dev or python3-dev on Debian-based systems. Try python-devel or python3-devel on Redhat-based systems.
ERROR: /root/.cache/bazel/_bazel_root/f815f9c148e5d06107d4dc9766d21406/external/com_google_riegeli/python/riegeli/records/BUILD:27:13: @com_google_riegeli//python/riegeli/records:record_reader_cc depends on @local_config_python//:python_headers in repository @local_config_python which failed to fetch. no such package '@local_config_python//': Python Configuration Error: Problem getting python include path for /usr/bin/python3.
:1: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
:1: DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig instead
Is the Python binary path set up right? (See ./configure or /usr/bin/python3.) Is distutils installed? Are Python headers installed? Try installing python-dev or python3-dev on Debian-based systems. Try python-devel or python3-devel on Redhat-based systems.
ERROR: Analysis of target '//:print_names_and_sources' failed; build aborted:
INFO: Elapsed time: 1.800s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (1 packages loaded, 218 targets configured)
FAILED: Build did NOT complete successfully (1 packages loaded, 218 targets configured)`

Executing fail in linux docker

Hello!

I tried to run the execution/solve_example in Docker and received the error :
[forkserver.cc : 576] RAW: Check pid != -1 failed: failed to fork initial namespaces process: Invalid argument [22]
It seems that this is caused by running the sandbox in the container. Could you please provide more detailed information about the environment if it is convenient? I used centos7 and Bazel 6 in the docker.

 code_contests git:(main) ✗ bazel run --cxxopt="-std=c++17" --host_cxxopt=-std=c++17 --cxxopt=-D_GLIBCXX_USE_CXX11_ABI=0 --copt="-w" --copt="-fbracket-depth=512"  -c opt execution:solve_example -- \
  --valid_path=/mnt/AlphaCode/dm-code_contests/code_contests_valid.riegeli
INFO: Analyzed target //execution:solve_example (1 packages loaded, 2 targets configured).
INFO: Found 1 target...
Target //execution:solve_example up-to-date:
  bazel-bin/execution/solve_example
INFO: Elapsed time: 133.204s, Critical Path: 26.64s
INFO: 695 processes: 5 internal, 690 processwrapper-sandbox.
INFO: Build completed successfully, 695 total actions
INFO: Running command line: bazel-bin/execution/solve_example '--valid_path=/mnt/AlphaCode/dm-code_contests/code_contests_valid.riegeli'
We will try to solve "Gregor and Cryptography":
https://codeforces.com/problemset/problem/1549/A

We will run:
  1. A program that does not compile.
  2. A program that runs successfully, but gives the wrong answer sometimes.
  3. A correct solution.

--------------------------------------------------------------------------------
An invalid program is reported as not compiling:

[global_forkclient.cc : 121] RAW: Starting global forkserver
[util.cc : 228] RAW: clone(): Invalid argument [22]
[forkserver.cc : 576] RAW: Check pid != -1 failed: failed to fork initial namespaces process: Invalid argument [22]
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
E0000 00:00:1679380386.186284  238802 fork_client.cc:61] Receiving init PID from the ForkServer failed
E0000 00:00:1679380386.186324  238802 global_forkclient.cc:276] Global forkserver connection terminated
[global_forkclient.cc : 200] RAW: forkserver (pid=238803) terminated by signal 6
[global_forkclient.cc : 121] RAW: Starting global forkserver
[util.cc : 228] RAW: clone(): Invalid argument [22]
[forkserver.cc : 576] RAW: Check pid != -1 failed: failed to fork initial namespaces process: Invalid argument [22]
E0000 00:00:1679380386.453641  238834 fork_client.cc:61] Receiving init PID from the ForkServer failed
E0000 00:00:1679380386.453702  238834 global_forkclient.cc:276] Global forkserver connection terminated
[global_forkclient.cc : 200] RAW: forkserver (pid=238835) terminated by signal 6
[global_forkclient.cc : 121] RAW: Starting global forkserver
[util.cc : 228] RAW: clone(): Invalid argument [22]
[forkserver.cc : 576] RAW: Check pid != -1 failed: failed to fork initial namespaces process: Invalid argument [22]
E0000 00:00:1679380386.691357  238876 fork_client.cc:61] Receiving init PID from the ForkServer failed
E0000 00:00:1679380386.691397  238876 global_forkclient.cc:276] Global forkserver connection terminated
[global_forkclient.cc : 200] RAW: forkserver (pid=238877) terminated by signal 6
Failed: Failed to run sandbox on compilation.

Looking forward to hearing from you!

Best

Error running: Bazel run

I followed the steps in the readme, clone the repo, download the data and tried to use bazel run command to check the training data.
It ran into this error:

ERROR: /private/var/tmp/_bazel_jeremy.zhang/a44e22cefef79c0c35685895270fd665/external/org_brotli/BUILD:113:11: Compiling c/dec/bit_reader.c failed: (Aborted): wrapped_clang failed: error executing command external/local_config_cc/wrapped_clang '-D_FORTIFY_SOURCE=1' -fstack-protector -fcolor-diagnostics -Wall -Wthread-safety -Wself-assign -fno-omit-frame-pointer -g0 -O2 -DNDEBUG '-DNS_BLOCK_ASSERTIONS=1' ... (remaining 40 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox
error: unknown warning option '-Wno-vla-parameter'; did you mean '-Wno-unused-parameter'? [-Werror,-Wunknown-warning-option]
Error in child process '/usr/bin/xcrun'. 1
Target //:print_names_and_sources failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 10.118s, Critical Path: 9.73s
INFO: 91 processes: 26 internal, 65 darwin-sandbox.
FAILED: Build did NOT complete successfully
FAILED: Build did NOT complete successfully

I installed bazel using homebrew

bazel 5.0.0-homebrew

Laptop: Mac

python:

3.7.9

solve_example SolveGregorAndCryptography compilation fails for all examples

When attempting to run the solve_example script using the second given command with the python2 and 3 paths specified on a Ubuntu 20 system, the build completes successfully however the compilation fails for all three given examples for the SolveGregorAndCryptography function. The full stack trace is shown below:

$ bazel run -c opt execution:solve_example -- --valid_path=/mnt/c/Users/DELL/Documents/UoE/MLP/cw4/CodeContest/dm-code_contests/code_contests_valid.riegeli --python3_path=/home/allen/anaconda3/bin/python --python3_library_paths=/home/allen/anaconda3/lib/python --python2_path=/usr/bin/python2 --python2_library_paths=/usr/lib/python2
Starting local Bazel server and connecting to it...
INFO: Analyzed target //execution:solve_example (88 packages loaded, 2108 targets configured).
INFO: Found 1 target...
INFO: From Compiling sandboxed_api/tools/filewrapper/filewrapper.cc [for host]:
In file included from external/com_google_sandboxed_api/sandboxed_api/tools/filewrapper/filewrapper.cc:29:
external/com_google_sandboxed_api/sandboxed_api/util/fileops.h:24:15: warning: nested namespace definition is a C++17 extension; define each namespace separately [-Wc++17-extensions]
namespace sapi::file_util::fileops {
              ^~~~~~~~~~~~~~~~~~~~
               { namespace file_util { namespace fileops
In file included from external/com_google_sandboxed_api/sandboxed_api/tools/filewrapper/filewrapper.cc:30:
external/com_google_sandboxed_api/sandboxed_api/util/raw_logging.h:134:15: warning: nested namespace definition is a C++17 extension; define each namespace separately [-Wc++17-extensions]
namespace sapi::raw_logging_internal {
              ^~~~~~~~~~~~~~~~~~~~~~
               { namespace raw_logging_internal
2 warnings generated.
INFO: From Compiling sandboxed_api/util/raw_logging.cc [for host]:
In file included from external/com_google_sandboxed_api/sandboxed_api/util/raw_logging.cc:15:
external/com_google_sandboxed_api/sandboxed_api/util/raw_logging.h:134:15: warning: nested namespace definition is a C++17 extension; define each namespace separately [-Wc++17-extensions]
namespace sapi::raw_logging_internal {
              ^~~~~~~~~~~~~~~~~~~~~~
               { namespace raw_logging_internal
external/com_google_sandboxed_api/sandboxed_api/util/raw_logging.cc:107:15: warning: nested namespace definition is a C++17 extension; define each namespace separately [-Wc++17-extensions]
namespace sapi::raw_logging_internal {
              ^~~~~~~~~~~~~~~~~~~~~~
               { namespace raw_logging_internal
2 warnings generated.
INFO: From Compiling sandboxed_api/util/fileops.cc [for host]:
In file included from external/com_google_sandboxed_api/sandboxed_api/util/fileops.cc:15:
external/com_google_sandboxed_api/sandboxed_api/util/fileops.h:24:15: warning: nested namespace definition is a C++17 extension; define each namespace separately [-Wc++17-extensions]
namespace sapi::file_util::fileops {
              ^~~~~~~~~~~~~~~~~~~~
               { namespace file_util { namespace fileops
external/com_google_sandboxed_api/sandboxed_api/util/fileops.cc:29:15: warning: nested namespace definition is a C++17 extension; define each namespace separately [-Wc++17-extensions]
namespace sapi::file_util::fileops {
              ^~~~~~~~~~~~~~~~~~~~
               { namespace file_util { namespace fileops
2 warnings generated.
Target //execution:solve_example up-to-date:
  bazel-bin/execution/solve_example
INFO: Elapsed time: 90.415s, Critical Path: 28.07s
INFO: 685 processes: 5 internal, 680 linux-sandbox.
INFO: Build completed successfully, 685 total actions
INFO: Running command line: bazel-bin/execution/solve_example '--valid_path=/mnt/c/Users/DELL/Documents/UoE/MLP/cw4/CodeINFO: Build completed successfully, 685 total actions
We will try to solve "Gregor and Cryptography":
https://codeforces.com/problemset/problem/1549/A

We will run:
  1. A program that does not compile.
  2. A program that runs successfully, but gives the wrong answer sometimes.
  3. A correct solution.

--------------------------------------------------------------------------------
An invalid program is reported as not compiling:

[global_forkclient.cc : 122] RAW: Starting global forkserver
WARNING: Logging before InitGoogleLogging() is written to STDERR
E20220322 11:50:05.226009  2539 monitor.cc:842] SANDBOX VIOLATION : PID: 2544, PROG: 'python3.9' : [X86-64] arch_prctl [158](0x3001 [12289], 0x7ffe3e622a60) IP: 0x7f79db5c0be5, STACK: 0x7ffe3e622a10
I20220322 11:50:05.226202  2539 monitor.cc:386] Stack traces have been disabled
Compilation failed

--------------------------------------------------------------------------------
The bad solution passes a few tests but then fails.
Because we set stop_on_first_failure to True, we stop once we see a failure.
We are running on 4 threads, so it's possible that more than one failure occurs
before all threads stop.

E20220322 11:50:05.231288  2545 monitor.cc:842] SANDBOX VIOLATION : PID: 2548, PROG: 'python3.9' : [X86-64] arch_prctl [158](0x3001 [12289], 0x7ffefd9ac980) IP: 0x7f6e16896be5, STACK: 0x7ffefd9ac930
I20220322 11:50:05.231374  2545 monitor.cc:386] Stack traces have been disabled
Compilation failed

--------------------------------------------------------------------------------
The good solution passes all tests.

E20220322 11:50:05.235946  2549 monitor.cc:842] SANDBOX VIOLATION : PID: 2552, PROG: 'python3.9' : [X86-64] arch_prctl [158](0x3001 [12289], 0x7ffe11fd4d30) IP: 0x7f0925a06be5, STACK: 0x7ffe11fd4ce0
I20220322 11:50:05.236099  2549 monitor.cc:386] Stack traces have been disabled
Compilation failed

clang --version:

clang version 10.0.0-4ubuntu1
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

Compilation error when using gcc versions {7,9}

Python: 3.6.15
Bazel 5.0.0

I followed the readme (bazel run -c opt :print_names_and_sources C:\tmp\dm-code_contests\dm-code_contests/code_contests_valid.riegeli), but met following errors. Both gcc-7/gcc-9 does not work.

`
ERROR: /root/.cache/bazel/_bazel_root/4c0c9775f3bba9ff6053ea6ee19afc7d/external/com_google_riegeli/riegeli/base/BUILD:85:11: Compiling riegeli/base/buffer.cc failed: (Exit 1): gcc failed: error executing command /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections ... (remaining 25 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox
In file included from external/com_google_riegeli/riegeli/base/memory.h:26,
from external/com_google_riegeli/riegeli/base/buffer.h:24,
from external/com_google_riegeli/riegeli/base/buffer.cc:15:
external/com_google_riegeli/riegeli/base/base.h:313:10: error: 'std::enable_if_t' has not been declared
313 | std::enable_if_t<std::is_unsigned::value && std::is_unsigned::value,
| ^~~~~~~~~~~
external/com_google_riegeli/riegeli/base/base.h:313:21: error: expected '>' before '<' token
313 | std::enable_if_t<std::is_unsigned
::value && std::is_unsigned::value,
| ^
external/com_google_riegeli/riegeli/base/base.h:322:16: error: 'std::enable_if_t' has not been declared
322 | std::enable_if_t<
| ^~~~~~~~~~~
external/com_google_riegeli/riegeli/base/base.h:322:27: error: expected '>' before '<' token
322 | std::enable_if_t<
| ^
external/com_google_riegeli/riegeli/base/base.h:324:10: error: redefinition of 'template<class A, class B, > A riegeli::IntCast(B)'
324 | inline A IntCast(B value) {
| ^~~~~~~
external/com_google_riegeli/riegeli/base/base.h:315:10: note: 'template<class A, class B, > A riegeli::IntCast(B)' previously declared here
315 | inline A IntCast(B value) {
| ^~~~~~~
external/com_google_riegeli/riegeli/base/base.h:333:16: error: 'std::enable_if_t' has not been declared
333 | std::enable_if_t<
| ^~~~~~~~~~~
external/com_google_riegeli/riegeli/base/base.h:333:27: error: expected '>' before '<' token
333 | std::enable_if_t<
| ^
external/com_google_riegeli/riegeli/base/base.h:335:10: error: redefinition of 'template<class A, class B, > A riegeli::IntCast(B)'
335 | inline A IntCast(B value) {
| ^~~~~~~
external/com_google_riegeli/riegeli/base/base.h:315:10: note: 'template<class A, class B, > A riegeli::IntCast(B)' previously declared here
315 | inline A IntCast(B value) {
| ^~~~~~~
external/com_google_riegeli/riegeli/base/base.h:343:16: error: 'std::enable_if_t' has not been declared
343 | std::enable_if_t<std::is_signed
::value && std::is_signed::value,
| ^~~~~~~~~~~
external/com_google_riegeli/riegeli/base/base.h:343:27: error: expected '>' before '<' token
343 | std::enable_if_t<std::is_signed
::value && std::is_signed::value,
| ^
external/com_google_riegeli/riegeli/base/base.h:345:10: error: redefinition of 'template<class A, class B, > A riegeli::IntCast(B)'
345 | inline A IntCast(B value) {
| ^~~~~~~
external/com_google_riegeli/riegeli/base/base.h:315:10: note: 'template<class A, class B, > A riegeli::IntCast(B)' previously declared here
315 | inline A IntCast(B value) {
| ^~~~~~~
external/com_google_riegeli/riegeli/base/base.h:358:10: error: 'std::enable_if_t' has not been declared
358 | std::enable_if_t<std::is_unsigned
::value && std::is_unsigned::value,
| ^~~~~~~~~~~
external/com_google_riegeli/riegeli/base/base.h:358:21: error: expected '>' before '<' token
358 | std::enable_if_t<std::is_unsigned
::value && std::is_unsigned::value,
| ^
external/com_google_riegeli/riegeli/base/base.h:368:16: error: 'std::enable_if_t' has not been declared
368 | std::enable_if_t<
| ^~~~~~~~~~~
external/com_google_riegeli/riegeli/base/base.h:368:27: error: expected '>' before '<' token
368 | std::enable_if_t<
| ^
external/com_google_riegeli/riegeli/base/base.h:370:10: error: redefinition of 'template<class A, class B, > A riegeli::SaturatingIntCast(B)'
370 | inline A SaturatingIntCast(B value) {
| ^~~~~~~~~~~~~~~~~
external/com_google_riegeli/riegeli/base/base.h:360:10: note: 'template<class A, class B, > A riegeli::SaturatingIntCast(B)' previously declared here
360 | inline A SaturatingIntCast(B value) {
| ^~~~~~~~~~~~~~~~~
external/com_google_riegeli/riegeli/base/base.h:380:16: error: 'std::enable_if_t' has not been declared
380 | std::enable_if_t<
| ^~~~~~~~~~~
external/com_google_riegeli/riegeli/base/base.h:380:27: error: expected '>' before '<' token
380 | std::enable_if_t<
| ^
external/com_google_riegeli/riegeli/base/base.h:382:10: error: redefinition of 'template<class A, class B, > A riegeli::SaturatingIntCast(B)'
382 | inline A SaturatingIntCast(B value) {
| ^~~~~~~~~~~~~~~~~
external/com_google_riegeli/riegeli/base/base.h:360:10: note: 'template<class A, class B, > A riegeli::SaturatingIntCast(B)' previously declared here
360 | inline A SaturatingIntCast(B value) {
| ^~~~~~~~~~~~~~~~~
external/com_google_riegeli/riegeli/base/base.h:391:16: error: 'std::enable_if_t' has not been declared
391 | std::enable_if_t<std::is_signed
::value && std::is_signed::value,
| ^~~~~~~~~~~
external/com_google_riegeli/riegeli/base/base.h:391:27: error: expected '>' before '<' token
391 | std::enable_if_t<std::is_signed
::value && std::is_signed::value,
| ^
external/com_google_riegeli/riegeli/base/base.h:393:10: error: redefinition of 'template<class A, class B, > A riegeli::SaturatingIntCast(B)'
393 | inline A SaturatingIntCast(B value) {
| ^~~~~~~~~~~~~~~~~
external/com_google_riegeli/riegeli/base/base.h:360:10: note: 'template<class A, class B, > A riegeli::SaturatingIntCast(B)' previously declared here
360 | inline A SaturatingIntCast(B value) {
| ^~~~~~~~~~~~~~~~~
external/com_google_riegeli/riegeli/base/base.h:415:28: error: 'std::enable_if_t' has not been declared
415 | template <typename A, std::enable_if_t<std::is_signed
::value, int> = 0>
| ^~~~~~~~~~~
external/com_google_riegeli/riegeli/base/base.h:415:39: error: expected '>' before '<' token
415 | template <typename A, std::enable_if_t<std::is_signed::value, int> = 0>
| ^
external/com_google_riegeli/riegeli/base/base.h:421:16: error: 'std::enable_if_t' has not been declared
421 | std::enable_if_t<std::is_signed::value && std::is_signed::value,
| ^~~~~~~~~~~
external/com_google_riegeli/riegeli/base/base.h:421:27: error: expected '>' before '<' token
421 | std::enable_if_t<std::is_signed
::value && std::is_signed::value,
| ^
external/com_google_riegeli/riegeli/base/base.h:423:16: error: 'common_type_t' in namespace 'std' does not name a template type; did you mean 'common_type'?
423 | constexpr std::common_type_t<A, B> SignedMin(A a, B b) {
| ^~~~~~~~~~~~~
| common_type
external/com_google_riegeli/riegeli/base/base.h:429:10: error: 'std::enable_if_t' has not been declared
429 | std::enable_if_t<(sizeof...(Rest) > 0 &&
| ^~~~~~~~~~~
external/com_google_riegeli/riegeli/base/base.h:429:21: error: expected '>' before '<' token
429 | std::enable_if_t<(sizeof...(Rest) > 0 &&
| ^
external/com_google_riegeli/riegeli/base/base.h:433:16: error: 'common_type_t' in namespace 'std' does not name a template type; did you mean 'common_type'?
433 | constexpr std::common_type_t<A, B, Rest...> SignedMin(A a, B b, Rest... rest) {
| ^~~~~~~~~~~~~
| common_type
external/com_google_riegeli/riegeli/base/base.h:440:28: error: 'std::enable_if_t' has not been declared
440 | template <typename A, std::enable_if_t<std::is_signed
::value, int> = 0>
| ^~~~~~~~~~~
external/com_google_riegeli/riegeli/base/base.h:440:39: error: expected '>' before '<' token
440 | template <typename A, std::enable_if_t<std::is_signed::value, int> = 0>
| ^
external/com_google_riegeli/riegeli/base/base.h:446:16: error: 'std::enable_if_t' has not been declared
446 | std::enable_if_t<std::is_signed::value && std::is_signed::value,
| ^~~~~~~~~~~
external/com_google_riegeli/riegeli/base/base.h:446:27: error: expected '>' before '<' token
446 | std::enable_if_t<std::is_signed
::value && std::is_signed::value,
| ^
external/com_google_riegeli/riegeli/base/base.h:448:16: error: 'common_type_t' in namespace 'std' does not name a template type; did you mean 'common_type'?
448 | constexpr std::common_type_t<A, B> SignedMax(A a, B b) {
| ^~~~~~~~~~~~~
| common_type
external/com_google_riegeli/riegeli/base/base.h:454:10: error: 'std::enable_if_t' has not been declared
454 | std::enable_if_t<(sizeof...(Rest) > 0 &&
| ^~~~~~~~~~~
external/com_google_riegeli/riegeli/base/base.h:454:21: error: expected '>' before '<' token
454 | std::enable_if_t<(sizeof...(Rest) > 0 &&
| ^
external/com_google_riegeli/riegeli/base/base.h:458:16: error: 'common_type_t' in namespace 'std' does not name a template type; did you mean 'common_type'?
458 | constexpr std::common_type_t<A, B, Rest...> SignedMax(A a, B b, Rest... rest) {
| ^~~~~~~~~~~~~
| common_type
external/com_google_riegeli/riegeli/base/base.h:500:49: error: 'common_type_t' is not a member of 'std'; did you mean 'common_type'?
500 | : internal::IntersectionTypeImpl<A, B, std::common_type_t<A, B>> {};
| ^~~~~~~~~~~~~
| common_type
external/com_google_riegeli/riegeli/base/base.h:500:49: error: 'common_type_t' is not a member of 'std'; did you mean 'common_type'?
500 | : internal::IntersectionTypeImpl<A, B, std::common_type_t<A, B>> {};
| ^~~~~~~~~~~~~
| common_type
external/com_google_riegeli/riegeli/base/base.h:500:66: error: wrong number of template arguments (4, should be 3)
500 | : internal::IntersectionTypeImpl<A, B, std::common_type_t<A, B>> {};
| ^
external/com_google_riegeli/riegeli/base/base.h:468:8: note: provided for 'template<class A, class B, class Common> struct riegeli::internal::IntersectionTypeImpl'
468 | struct IntersectionTypeImpl;
| ^~~~~~~~~~~~~~~~~~~~
external/com_google_riegeli/riegeli/base/base.h:500:67: error: expected '{' before '>' token
500 | : internal::IntersectionTypeImpl<A, B, std::common_type_t<A, B>> {};
| ^~
external/com_google_riegeli/riegeli/base/base.h:506:28: error: 'std::enable_if_t' has not been declared
506 | template <typename A, std::enable_if_t<std::is_unsigned
::value, int> = 0>
| ^~~~~~~~~~~
external/com_google_riegeli/riegeli/base/base.h:506:39: error: expected '>' before '<' token
506 | template <typename A, std::enable_if_t<std::is_unsigned::value, int> = 0>
| ^
external/com_google_riegeli/riegeli/base/base.h:513:10: error: 'std::enable_if_t' has not been declared
513 | std::enable_if_t<std::is_unsigned::value && std::is_unsigned::value,
| ^~~~~~~~~~~
external/com_google_riegeli/riegeli/base/base.h:513:21: error: expected '>' before '<' token
513 | std::enable_if_t<std::is_unsigned
::value && std::is_unsigned::value,
| ^
external/com_google_riegeli/riegeli/base/base.h:520:16: error: 'std::enable_if_t' has not been declared
520 | std::enable_if_t<
| ^~~~~~~~~~~
external/com_google_riegeli/riegeli/base/base.h:520:27: error: expected '>' before '<' token
520 | std::enable_if_t<
| ^
external/com_google_riegeli/riegeli/base/base.h:532:28: error: 'std::enable_if_t' has not been declared
532 | template <typename A, std::enable_if_t<std::is_unsigned
::value, int> = 0>
| ^~~~~~~~~~~
external/com_google_riegeli/riegeli/base/base.h:532:39: error: expected '>' before '<' token
532 | template <typename A, std::enable_if_t<std::is_unsigned::value, int> = 0>
| ^
external/com_google_riegeli/riegeli/base/base.h:539:10: error: 'std::enable_if_t' has not been declared
539 | std::enable_if_t<std::is_unsigned::value && std::is_unsigned::value,
| ^~~~~~~~~~~
external/com_google_riegeli/riegeli/base/base.h:539:21: error: expected '>' before '<' token
539 | std::enable_if_t<std::is_unsigned
::value && std::is_unsigned::value,
| ^
external/com_google_riegeli/riegeli/base/base.h:541:16: error: 'common_type_t' in namespace 'std' does not name a template type; did you mean 'common_type'?
541 | constexpr std::common_type_t<A, B> UnsignedMax(A a, B b) {
| ^~~~~~~~~~~~~
| common_type
external/com_google_riegeli/riegeli/base/base.h:546:16: error: 'std::enable_if_t' has not been declared
546 | std::enable_if_t<
| ^~~~~~~~~~~
external/com_google_riegeli/riegeli/base/base.h:546:27: error: expected '>' before '<' token
546 | std::enable_if_t<
| ^
external/com_google_riegeli/riegeli/base/base.h:551:16: error: 'common_type_t' in namespace 'std' does not name a template type; did you mean 'common_type'?
551 | constexpr std::common_type_t<A, B, Rest...> UnsignedMax(A a, B b,
| ^~~~~~~~~~~~~
| common_type
external/com_google_riegeli/riegeli/base/base.h:559:28: error: 'std::enable_if_t' has not been declared
559 | template <typename T, std::enable_if_t<std::is_unsigned::value, int> = 0>
| ^~~~~~~~~~~
external/com_google_riegeli/riegeli/base/base.h:559:39: error: expected '>' before '<' token
559 | template <typename T, std::enable_if_t<std::is_unsigned::value, int> = 0>
| ^
external/com_google_riegeli/riegeli/base/base.h:564:28: error: 'std::enable_if_t' has not been declared
564 | template <typename T, std::enable_if_t<std::is_unsigned::value, int> = 0>
| ^~~~~~~~~~~
external/com_google_riegeli/riegeli/base/base.h:564:39: error: expected '>' before '<' token
564 | template <typename T, std::enable_if_t<std::is_unsigned::value, int> = 0>
| ^
external/com_google_riegeli/riegeli/base/base.h:571:10: error: 'std::enable_if_t' has not been declared
571 | std::enable_if_t<(sizeof...(Rest) > 0 &&
| ^~~~~~~~~~~
external/com_google_riegeli/riegeli/base/base.h:571:21: error: expected '>' before '<' token
571 | std::enable_if_t<(sizeof...(Rest) > 0 &&
| ^
external/com_google_riegeli/riegeli/base/base.h:581:28: error: 'std::enable_if_t' has not been declared
581 | template <typename T, std::enable_if_t<std::is_unsigned::value, int> = 0>
| ^~~~~~~~~~~
external/com_google_riegeli/riegeli/base/base.h:581:39: error: expected '>' before '<' token
581 | template <typename T, std::enable_if_t<std::is_unsigned::value, int> = 0>
| ^
external/com_google_riegeli/riegeli/base/base.h:589:16: error: 'std::enable_if_t' has not been declared
589 | std::enable_if_t<std::is_unsigned::value && alignment != 0 &&
| ^~~~~~~~~~~
external/com_google_riegeli/riegeli/base/base.h:589:27: error: expected '>' before '<' token
589 | std::enable_if_t<std::is_unsigned::value && alignment != 0 &&
| ^
external/com_google_riegeli/riegeli/base/base.h:599:16: error: 'std::enable_if_t' has not been declared
599 | std::enable_if_t<std::is_unsigned::value && alignment != 0 &&
| ^~~~~~~~~~~
external/com_google_riegeli/riegeli/base/base.h:599:27: error: expected '>' before '<' token
599 | std::enable_if_t<std::is_unsigned::value && alignment != 0 &&
| ^
external/com_google_riegeli/riegeli/base/base.h:611:10: error: 'common_type_t' in namespace 'std' does not name a template type; did you mean 'common_type'?
611 | std::common_type_t<size_t, std::make_unsigned_t
std::streamoff, uint64_t>;
| ^~~~~~~~~~~~~
| common_type
external/com_google_riegeli/riegeli/base/base.h:673:47: error: 'Position' has not been declared
673 | inline size_t BufferLength(size_t min_length, Position recommended_length,
| ^~~~~~~~
external/com_google_riegeli/riegeli/base/base.h:674:47: error: 'Position' has not been declared
674 | size_t max_length, Position size_hint,
| ^~~~~~~~
external/com_google_riegeli/riegeli/base/base.h:675:28: error: 'Position' has not been declared
675 | Position current_size) {
| ^~~~~~~~
external/com_google_riegeli/riegeli/base/base.h: In function 'size_t riegeli::BufferLength(size_t, int, size_t, int, int)':
external/com_google_riegeli/riegeli/base/base.h:677:64: error: no matching function for call to 'UnsignedMin(int&, size_t&)'
677 | return UnsignedMax(UnsignedMin(recommended_length, max_length), min_length);
| ^
external/com_google_riegeli/riegeli/base/base.h:507:13: note: candidate: 'template<class A, > constexpr A riegeli::UnsignedMin(A)'
507 | constexpr A UnsignedMin(A a) {
| ^~~~~~~~~~~
external/com_google_riegeli/riegeli/base/base.h:507:13: note: template argument deduction/substitution failed:
external/com_google_riegeli/riegeli/base/base.h:677:64: note: candidate expects 1 argument, 2 provided
677 | return UnsignedMax(UnsignedMin(recommended_length, max_length), min_length);
| ^
external/com_google_riegeli/riegeli/base/base.h:515:35: note: candidate: 'template<class A, class B, > constexpr riegeli::IntersectionTypeT<A, B> riegeli::UnsignedMin(A, B)'
515 | constexpr IntersectionTypeT<A, B> UnsignedMin(A a, B b) {
| ^~~~~~~~~~~
external/com_google_riegeli/riegeli/base/base.h:515:35: note: template argument deduction/substitution failed:
external/com_google_riegeli/riegeli/base/base.h:677:64: note: couldn't deduce template parameter ''
677 | return UnsignedMax(UnsignedMin(recommended_length, max_length), min_length);
| ^
external/com_google_riegeli/riegeli/base/base.h:525:44: note: candidate: 'template<class A, class B, class ... Rest, > constexpr riegeli::IntersectionTypeT<A, B, Rest ...> riegeli::UnsignedMin(A, B, Rest ...)'
525 | constexpr IntersectionTypeT<A, B, Rest...> UnsignedMin(A a, B b, Rest... rest) {
| ^~~~~~~~~~~
external/com_google_riegeli/riegeli/base/base.h:525:44: note: template argument deduction/substitution failed:
external/com_google_riegeli/riegeli/base/base.h:677:64: note: couldn't deduce template parameter ''
677 | return UnsignedMax(UnsignedMin(recommended_length, max_length), min_length);
| ^
external/com_google_riegeli/riegeli/base/base.h: At global scope:
external/com_google_riegeli/riegeli/base/base.h:682:28: error: 'Position' has not been declared
682 | Position size_hint, Position current_size) {
| ^~~~~~~~
external/com_google_riegeli/riegeli/base/base.h:682:48: error: 'Position' has not been declared
682 | Position size_hint, Position current_size) {
| ^~~~~~~~
external/com_google_riegeli/riegeli/base/base.h: In function 'size_t riegeli::BufferLength(size_t, size_t, int, int)':
external/com_google_riegeli/riegeli/base/base.h:684:66: error: no matching function for call to 'UnsignedMin(int, size_t&)'
684 | max_length = UnsignedMin(size_hint - current_size, max_length);
| ^
external/com_google_riegeli/riegeli/base/base.h:507:13: note: candidate: 'template<class A, > constexpr A riegeli::UnsignedMin(A)'
507 | constexpr A UnsignedMin(A a) {
| ^~~~~~~~~~~
external/com_google_riegeli/riegeli/base/base.h:507:13: note: template argument deduction/substitution failed:
external/com_google_riegeli/riegeli/base/base.h:684:66: note: candidate expects 1 argument, 2 provided
684 | max_length = UnsignedMin(size_hint - current_size, max_length);
| ^
external/com_google_riegeli/riegeli/base/base.h:515:35: note: candidate: 'template<class A, class B, > constexpr riegeli::IntersectionTypeT<A, B> riegeli::UnsignedMin(A, B)'
515 | constexpr IntersectionTypeT<A, B> UnsignedMin(A a, B b) {
| ^~~~~~~~~~~
external/com_google_riegeli/riegeli/base/base.h:515:35: note: template argument deduction/substitution failed:
external/com_google_riegeli/riegeli/base/base.h:684:66: note: couldn't deduce template parameter ''
684 | max_length = UnsignedMin(size_hint - current_size, max_length);
| ^
external/com_google_riegeli/riegeli/base/base.h:525:44: note: candidate: 'template<class A, class B, class ... Rest, > constexpr riegeli::IntersectionTypeT<A, B, Rest ...> riegeli::UnsignedMin(A, B, Rest ...)'
525 | constexpr IntersectionTypeT<A, B, Rest...> UnsignedMin(A a, B b, Rest... rest) {
| ^~~~~~~~~~~
external/com_google_riegeli/riegeli/base/base.h:525:44: note: template argument deduction/substitution failed:
external/com_google_riegeli/riegeli/base/base.h:684:66: note: couldn't deduce template parameter ''
684 | max_length = UnsignedMin(size_hint - current_size, max_length);
| ^
external/com_google_riegeli/riegeli/base/base.h:686:44: error: no matching function for call to 'UnsignedMax(size_t&, size_t&)'
686 | return UnsignedMax(max_length, min_length);
| ^
external/com_google_riegeli/riegeli/base/base.h:533:13: note: candidate: 'template<class A, > constexpr A riegeli::UnsignedMax(A)'
533 | constexpr A UnsignedMax(A a) {
| ^~~~~~~~~~~
external/com_google_riegeli/riegeli/base/base.h:533:13: note: template argument deduction/substitution failed:
external/com_google_riegeli/riegeli/base/base.h:686:44: note: candidate expects 1 argument, 2 provided
686 | return UnsignedMax(max_length, min_length);
| ^
external/com_google_riegeli/riegeli/base/base.h: In function 'bool riegeli::Wasteful(size_t, size_t)':
external/com_google_riegeli/riegeli/base/base.h:691:57: error: no matching function for call to 'UnsignedMax(size_t&, riegeli::internal::type_identity_t&)'
691 | return total - used > UnsignedMax(used, kMinBufferSize);
| ^
external/com_google_riegeli/riegeli/base/base.h:533:13: note: candidate: 'template<class A, > constexpr A riegeli::UnsignedMax(A)'
533 | constexpr A UnsignedMax(A a) {
| ^~~~~~~~~~~
external/com_google_riegeli/riegeli/base/base.h:533:13: note: template argument deduction/substitution failed:
external/com_google_riegeli/riegeli/base/base.h:691:57: note: candidate expects 1 argument, 2 provided
691 | return total - used > UnsignedMax(used, kMinBufferSize);
| ^
In file included from external/com_google_riegeli/riegeli/base/buffer.h:24,
from external/com_google_riegeli/riegeli/base/buffer.cc:15:
external/com_google_riegeli/riegeli/base/memory.h: In function 'size_t riegeli::EstimatedAllocatedSize(size_t)':
external/com_google_riegeli/riegeli/base/memory.h:66:52: error: no matching function for call to 'RoundUp<(sizeof (size_t) * 2)>(size_t&)'
66 | return RoundUp<sizeof(size_t) * 2>(requested_size);
| ^
In file included from external/com_google_riegeli/riegeli/base/memory.h:26,
from external/com_google_riegeli/riegeli/base/buffer.h:24,
from external/com_google_riegeli/riegeli/base/buffer.cc:15:
external/com_google_riegeli/riegeli/base/base.h:602:13: note: candidate: 'template<long unsigned int alignment, class T, > constexpr T riegeli::RoundUp(T)'
602 | constexpr T RoundUp(T value) {
| ^~~~~~~
external/com_google_riegeli/riegeli/base/base.h:602:13: note: template argument deduction/substitution failed:
In file included from external/com_google_riegeli/riegeli/base/buffer.h:24,
from external/com_google_riegeli/riegeli/base/buffer.cc:15:
external/com_google_riegeli/riegeli/base/memory.h:66:52: note: couldn't deduce template parameter ''
66 | return RoundUp<sizeof(size_t) * 2>(requested_size);
| ^
external/com_google_riegeli/riegeli/base/memory.h: In function 'T* riegeli::NewAligned(size_t, Args&& ...)':
external/com_google_riegeli/riegeli/base/memory.h:91:47: error: no matching function for call to 'UnsignedMax(size_t&, long unsigned int)'
91 | num_bytes = UnsignedMax(num_bytes, sizeof(T));
| ^
In file included from external/com_google_riegeli/riegeli/base/memory.h:26,
from external/com_google_riegeli/riegeli/base/buffer.h:24,
from external/com_google_riegeli/riegeli/base/buffer.cc:15:
external/com_google_riegeli/riegeli/base/base.h:533:13: note: candidate: 'template<class A, > constexpr A riegeli::UnsignedMax(A)'
533 | constexpr A UnsignedMax(A a) {
| ^~~~~~~~~~~
external/com_google_riegeli/riegeli/base/base.h:533:13: note: template argument deduction/substitution failed:
In file included from external/com_google_riegeli/riegeli/base/buffer.h:24,
from external/com_google_riegeli/riegeli/base/buffer.cc:15:
external/com_google_riegeli/riegeli/base/memory.h:91:47: note: candidate expects 1 argument, 2 provided
91 | num_bytes = UnsignedMax(num_bytes, sizeof(T));
| ^
external/com_google_riegeli/riegeli/base/memory.h: In function 'void riegeli::DeleteAligned(T*, size_t)':
external/com_google_riegeli/riegeli/base/memory.h:129:47: error: no matching function for call to 'UnsignedMax(size_t&, long unsigned int)'
129 | num_bytes = UnsignedMax(num_bytes, sizeof(T));
| ^
In file included from external/com_google_riegeli/riegeli/base/memory.h:26,
from external/com_google_riegeli/riegeli/base/buffer.h:24,
from external/com_google_riegeli/riegeli/base/buffer.cc:15:
external/com_google_riegeli/riegeli/base/base.h:533:13: note: candidate: 'template<class A, > constexpr A riegeli::UnsignedMax(A)'
533 | constexpr A UnsignedMax(A a) {
| ^~~~~~~~~~~
external/com_google_riegeli/riegeli/base/base.h:533:13: note: template argument deduction/substitution failed:
In file included from external/com_google_riegeli/riegeli/base/buffer.h:24,
from external/com_google_riegeli/riegeli/base/buffer.cc:15:
external/com_google_riegeli/riegeli/base/memory.h:129:47: note: candidate expects 1 argument, 2 provided
129 | num_bytes = UnsignedMax(num_bytes, sizeof(T));
| ^
external/com_google_riegeli/riegeli/base/memory.h: In function 'T* riegeli::SizeReturningNewAligned(size_t, size_t*, Args&& ...)':
external/com_google_riegeli/riegeli/base/memory.h:192:55: error: no matching function for call to 'UnsignedMax(size_t&, long unsigned int)'
192 | min_num_bytes = UnsignedMax(min_num_bytes, sizeof(T));
| ^
In file included from external/com_google_riegeli/riegeli/base/memory.h:26,
from external/com_google_riegeli/riegeli/base/buffer.h:24,
from external/com_google_riegeli/riegeli/base/buffer.cc:15:
external/com_google_riegeli/riegeli/base/base.h:533:13: note: candidate: 'template<class A, > constexpr A riegeli::UnsignedMax(A)'
533 | constexpr A UnsignedMax(A a) {
| ^~~~~~~~~~~
external/com_google_riegeli/riegeli/base/base.h:533:13: note: template argument deduction/substitution failed:
In file included from external/com_google_riegeli/riegeli/base/buffer.h:24,
from external/com_google_riegeli/riegeli/base/buffer.cc:15:
external/com_google_riegeli/riegeli/base/memory.h:192:55: note: candidate expects 1 argument, 2 provided
192 | min_num_bytes = UnsignedMax(min_num_bytes, sizeof(T));
| ^
In file included from external/com_google_riegeli/riegeli/base/buffer.cc:15:
external/com_google_riegeli/riegeli/base/buffer.h: In constructor 'riegeli::Buffer::Buffer(riegeli::Buffer&&)':
external/com_google_riegeli/riegeli/base/buffer.h:89:18: error: 'exchange' is not a member of 'std'; did you mean 'absl::lts_20211102::exchange'?
89 | : data_(std::exchange(that.data_, nullptr)),
| ^~~~~~~~
In file included from external/com_google_absl/absl/container/internal/compressed_tuple.h:40,
from external/com_google_absl/absl/container/internal/inlined_vector.h:30,
from external/com_google_absl/absl/container/inlined_vector.h:54,
from external/com_google_absl/absl/strings/cord.h:78,
from external/com_google_riegeli/riegeli/base/buffer.h:22,
from external/com_google_riegeli/riegeli/base/buffer.cc:15:
external/com_google_absl/absl/utility/utility.h:314:3: note: 'absl::lts_20211102::exchange' declared here
314 | T exchange(T& obj, U&& new_value) {
| ^~~~~~~~
In file included from external/com_google_riegeli/riegeli/base/buffer.cc:15:
external/com_google_riegeli/riegeli/base/buffer.h:90:22: error: 'exchange' is not a member of 'std'; did you mean 'absl::lts_20211102::exchange'?
90 | capacity_(std::exchange(that.capacity_, 0)) {}
| ^~~~~~~~
In file included from external/com_google_absl/absl/container/internal/compressed_tuple.h:40,
from external/com_google_absl/absl/container/internal/inlined_vector.h:30,
from external/com_google_absl/absl/container/inlined_vector.h:54,
from external/com_google_absl/absl/strings/cord.h:78,
from external/com_google_riegeli/riegeli/base/buffer.h:22,
from external/com_google_riegeli/riegeli/base/buffer.cc:15:
external/com_google_absl/absl/utility/utility.h:314:3: note: 'absl::lts_20211102::exchange' declared here
314 | T exchange(T& obj, U&& new_value) {
| ^~~~~~~~
In file included from external/com_google_riegeli/riegeli/base/buffer.cc:15:
external/com_google_riegeli/riegeli/base/buffer.h: In member function 'riegeli::Buffer& riegeli::Buffer::operator=(riegeli::Buffer&&)':
external/com_google_riegeli/riegeli/base/buffer.h:94:27: error: 'exchange' is not a member of 'std'; did you mean 'absl::lts_20211102::exchange'?
94 | char* const data = std::exchange(that.data_, nullptr);
| ^~~~~~~~
In file included from external/com_google_absl/absl/container/internal/compressed_tuple.h:40,
from external/com_google_absl/absl/container/internal/inlined_vector.h:30,
from external/com_google_absl/absl/container/inlined_vector.h:54,
from external/com_google_absl/absl/strings/cord.h:78,
from external/com_google_riegeli/riegeli/base/buffer.h:22,
from external/com_google_riegeli/riegeli/base/buffer.cc:15:
external/com_google_absl/absl/utility/utility.h:314:3: note: 'absl::lts_20211102::exchange' declared here
314 | T exchange(T& obj, U&& new_value) {
| ^~~~~~~~
In file included from external/com_google_riegeli/riegeli/base/buffer.cc:15:
external/com_google_riegeli/riegeli/base/buffer.h:97:20: error: 'exchange' is not a member of 'std'; did you mean 'absl::lts_20211102::exchange'?
97 | capacity_ = std::exchange(that.capacity_, 0);
| ^~~~~~~~
In file included from external/com_google_absl/absl/container/internal/compressed_tuple.h:40,
from external/com_google_absl/absl/container/internal/inlined_vector.h:30,
from external/com_google_absl/absl/container/inlined_vector.h:54,
from external/com_google_absl/absl/strings/cord.h:78,
from external/com_google_riegeli/riegeli/base/buffer.h:22,
from external/com_google_riegeli/riegeli/base/buffer.cc:15:
external/com_google_absl/absl/utility/utility.h:314:3: note: 'absl::lts_20211102::exchange' declared here
314 | T exchange(T& obj, U&& new_value) {
| ^~~~~~~~
In file included from external/com_google_riegeli/riegeli/base/buffer.cc:15:
external/com_google_riegeli/riegeli/base/buffer.h: In member function 'char* riegeli::Buffer::Release()':
external/com_google_riegeli/riegeli/base/buffer.h:125:15: error: 'exchange' is not a member of 'std'; did you mean 'absl::lts_20211102::exchange'?
125 | return std::exchange(data_, nullptr);
| ^~~~~~~~
In file included from external/com_google_absl/absl/container/internal/compressed_tuple.h:40,
from external/com_google_absl/absl/container/internal/inlined_vector.h:30,
from external/com_google_absl/absl/container/inlined_vector.h:54,
from external/com_google_absl/absl/strings/cord.h:78,
from external/com_google_riegeli/riegeli/base/buffer.h:22,
from external/com_google_riegeli/riegeli/base/buffer.cc:15:
external/com_google_absl/absl/utility/utility.h:314:3: note: 'absl::lts_20211102::exchange' declared here
314 | T exchange(T& obj, U&& new_value) {
| ^~~~~~~~
In file included from external/com_google_riegeli/riegeli/base/memory.h:26,
from external/com_google_riegeli/riegeli/base/buffer.h:24,
from external/com_google_riegeli/riegeli/base/buffer.cc:15:
external/com_google_riegeli/riegeli/base/buffer.cc: In member function 'absl::lts_20211102::Cord riegeli::Buffer::ToCord(absl::lts_20211102::string_view) &&':
external/com_google_riegeli/riegeli/base/buffer.cc:39:37: error: wrong number of template arguments (0, should be 1)
39 | RIEGELI_ASSERT(std::greater_equal<>()(substr.data(), data()))
| ^
external/com_google_riegeli/riegeli/base/base.h:247:21: note: in definition of macro 'RIEGELI_ASSERT'
247 | while (false && !(expr)) ::riegeli::internal::UnreachableStream()
| ^~~~
In file included from /usr/include/c++/9/string:48,
from /usr/include/c++/9/bits/locale_classes.h:40,
from /usr/include/c++/9/bits/ios_base.h:41,
from /usr/include/c++/9/ios:42,
from /usr/include/c++/9/ostream:38,
from /usr/include/c++/9/iterator:64,
from external/com_google_absl/absl/strings/cord.h:69,
from external/com_google_riegeli/riegeli/base/buffer.h:22,
from external/com_google_riegeli/riegeli/base/buffer.cc:15:
/usr/include/c++/9/bits/stl_function.h:391:12: note: provided for 'template struct std::greater_equal'
391 | struct greater_equal : public binary_function<_Tp, _Tp, bool>
| ^~~~~~~~~~~~~
In file included from external/com_google_riegeli/riegeli/base/memory.h:26,
from external/com_google_riegeli/riegeli/base/buffer.h:24,
from external/com_google_riegeli/riegeli/base/buffer.cc:15:
external/com_google_riegeli/riegeli/base/buffer.cc:43:23: error: wrong number of template arguments (0, should be 1)
43 | std::less_equal<>()(substr.data() + substr.size(), data() + capacity()))
| ^
external/com_google_riegeli/riegeli/base/base.h:247:21: note: in definition of macro 'RIEGELI_ASSERT'
247 | while (false && !(expr)) ::riegeli::internal::UnreachableStream()
| ^~~~
In file included from /usr/include/c++/9/string:48,
from /usr/include/c++/9/bits/locale_classes.h:40,
from /usr/include/c++/9/bits/ios_base.h:41,
from /usr/include/c++/9/ios:42,
from /usr/include/c++/9/ostream:38,
from /usr/include/c++/9/iterator:64,
from external/com_google_absl/absl/strings/cord.h:69,
from external/com_google_riegeli/riegeli/base/buffer.h:22,
from external/com_google_riegeli/riegeli/base/buffer.cc:15:
/usr/include/c++/9/bits/stl_function.h:401:12: note: provided for 'template struct std::less_equal'
401 | struct less_equal : public binary_function<_Tp, _Tp, bool>
| ^~~~~~~~~~
In file included from external/com_google_riegeli/riegeli/base/memory.h:26,
from external/com_google_riegeli/riegeli/base/buffer.h:24,
from external/com_google_riegeli/riegeli/base/buffer.cc:15:
external/com_google_riegeli/riegeli/base/buffer.cc: In member function 'void riegeli::Buffer::AppendSubstrTo(absl::lts_20211102::string_view, absl::lts_20211102::Cord&) &&':
external/com_google_riegeli/riegeli/base/buffer.cc:55:37: error: wrong number of template arguments (0, should be 1)
55 | RIEGELI_ASSERT(std::greater_equal<>()(substr.data(), data()))
| ^
external/com_google_riegeli/riegeli/base/base.h:247:21: note: in definition of macro 'RIEGELI_ASSERT'
247 | while (false && !(expr)) ::riegeli::internal::UnreachableStream()
| ^~~~
In file included from /usr/include/c++/9/string:48,
from /usr/include/c++/9/bits/locale_classes.h:40,
from /usr/include/c++/9/bits/ios_base.h:41,
from /usr/include/c++/9/ios:42,
from /usr/include/c++/9/ostream:38,
from /usr/include/c++/9/iterator:64,
from external/com_google_absl/absl/strings/cord.h:69,
from external/com_google_riegeli/riegeli/base/buffer.h:22,
from external/com_google_riegeli/riegeli/base/buffer.cc:15:
/usr/include/c++/9/bits/stl_function.h:391:12: note: provided for 'template struct std::greater_equal'
391 | struct greater_equal : public binary_function<_Tp, _Tp, bool>
| ^~~~~~~~~~~~~
In file included from external/com_google_riegeli/riegeli/base/memory.h:26,
from external/com_google_riegeli/riegeli/base/buffer.h:24,
from external/com_google_riegeli/riegeli/base/buffer.cc:15:
external/com_google_riegeli/riegeli/base/buffer.cc:59:23: error: wrong number of template arguments (0, should be 1)
59 | std::less_equal<>()(substr.data() + substr.size(), data() + capacity()))
| ^
external/com_google_riegeli/riegeli/base/base.h:247:21: note: in definition of macro 'RIEGELI_ASSERT'
247 | while (false && !(expr)) ::riegeli::internal::UnreachableStream()
| ^~~~
In file included from /usr/include/c++/9/string:48,
from /usr/include/c++/9/bits/locale_classes.h:40,
from /usr/include/c++/9/bits/ios_base.h:41,
from /usr/include/c++/9/ios:42,
from /usr/include/c++/9/ostream:38,
from /usr/include/c++/9/iterator:64,
from external/com_google_absl/absl/strings/cord.h:69,
from external/com_google_riegeli/riegeli/base/buffer.h:22,
from external/com_google_riegeli/riegeli/base/buffer.cc:15:
/usr/include/c++/9/bits/stl_function.h:401:12: note: provided for 'template struct std::less_equal'
401 | struct less_equal : public binary_function<_Tp, _Tp, bool>
| ^~~~~~~~~~
In file included from external/com_google_riegeli/riegeli/base/memory.h:26,
from external/com_google_riegeli/riegeli/base/buffer.h:24,
from external/com_google_riegeli/riegeli/base/buffer.cc:15:
external/com_google_riegeli/riegeli/base/buffer.cc: In member function 'void riegeli::Buffer::PrependSubstrTo(absl::lts_20211102::string_view, absl::lts_20211102::Cord&) &&':
external/com_google_riegeli/riegeli/base/buffer.cc:71:37: error: wrong number of template arguments (0, should be 1)
71 | RIEGELI_ASSERT(std::greater_equal<>()(substr.data(), data()))
| ^
external/com_google_riegeli/riegeli/base/base.h:247:21: note: in definition of macro 'RIEGELI_ASSERT'
247 | while (false && !(expr)) ::riegeli::internal::UnreachableStream()
| ^~~~
In file included from /usr/include/c++/9/string:48,
from /usr/include/c++/9/bits/locale_classes.h:40,
from /usr/include/c++/9/bits/ios_base.h:41,
from /usr/include/c++/9/ios:42,
from /usr/include/c++/9/ostream:38,
from /usr/include/c++/9/iterator:64,
from external/com_google_absl/absl/strings/cord.h:69,
from external/com_google_riegeli/riegeli/base/buffer.h:22,
from external/com_google_riegeli/riegeli/base/buffer.cc:15:
/usr/include/c++/9/bits/stl_function.h:391:12: note: provided for 'template struct std::greater_equal'
391 | struct greater_equal : public binary_function<_Tp, _Tp, bool>
| ^~~~~~~~~~~~~
In file included from external/com_google_riegeli/riegeli/base/memory.h:26,
from external/com_google_riegeli/riegeli/base/buffer.h:24,
from external/com_google_riegeli/riegeli/base/buffer.cc:15:
external/com_google_riegeli/riegeli/base/buffer.cc:75:23: error: wrong number of template arguments (0, should be 1)
75 | std::less_equal<>()(substr.data() + substr.size(), data() + capacity()))
| ^
external/com_google_riegeli/riegeli/base/base.h:247:21: note: in definition of macro 'RIEGELI_ASSERT'
247 | while (false && !(expr)) ::riegeli::internal::UnreachableStream()
| ^~~~
In file included from /usr/include/c++/9/string:48,
from /usr/include/c++/9/bits/locale_classes.h:40,
from /usr/include/c++/9/bits/ios_base.h:41,
from /usr/include/c++/9/ios:42,
from /usr/include/c++/9/ostream:38,
from /usr/include/c++/9/iterator:64,
from external/com_google_absl/absl/strings/cord.h:69,
from external/com_google_riegeli/riegeli/base/buffer.h:22,
from external/com_google_riegeli/riegeli/base/buffer.cc:15:
/usr/include/c++/9/bits/stl_function.h:401:12: note: provided for 'template struct std::less_equal'
401 | struct less_equal : public binary_function<_Tp, _Tp, bool>
| ^~~~~~~~~~
Target //:print_names_and_sources failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 31.576s, Critical Path: 12.47s
INFO: 203 processes: 17 internal, 186 processwrapper-sandbox.
FAILED: Build did NOT complete successfully
FAILED: Build did NOT complete successfully
`

Is there any other way to use this dataset?

SANDBOX VIOLATION

I have written a file similar to solve_example.cc to run all solutions to problems in a files. However, I get the following output:

1548_C. The Three Little Pigs
[global_forkclient.cc : 122] RAW: Starting global forkserver
WARNING: Logging before InitGoogleLogging() is written to STDERR
E20220420 15:38:49.259812 589011 monitor.cc:842] SANDBOX VIOLATION : PID: 589016, PROG: 'python3.9' : [X86-64] arch_prctl [158](0x3001 [12289], 0x7ffc9bfbd5b0) IP: 0x7f936cdefbe5, STACK: 0x7ffc9bfbd560
I20220420 15:38:49.259986 589011 monitor.cc:386] Stack traces have been disabled
Compilation failed

I tried to only run it on one thread, but I still get the same result.
Below is my code:

#include <iostream>
#include <tuple>
#include <vector>

#include "absl/strings/string_view.h"
#include "absl/types/span.h"
#include "contest_problem.pb.h"
#include "riegeli/bytes/fd_reader.h"
#include "riegeli/records/record_reader.h"

#include <fcntl.h>

#include <functional>
#include <iostream>
#include <string>
#include <tuple>
#include <vector>

#include "absl/flags/parse.h"
#include "absl/flags/flag.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/strings/string_view.h"
#include "absl/types/span.h"
#include "contest_problem.pb.h"
#include "execution/py_locations.h"
#include "execution/py_tester_sandboxer.h"
#include "execution/status_macros.h"
#include "execution/tester_sandboxer.h"
#include "riegeli/bytes/fd_reader.h"
#include "riegeli/records/record_reader.h"

ABSL_FLAG(std::string, valid_path, "", "Path to validation dataset.");

namespace deepmind::code_contests {
namespace {

std::vector<absl::string_view> GetInputs(const ContestProblem& problem,
                                         int max_size) {
  std::vector<absl::string_view> inputs;
  for (const auto& test : problem.public_tests()) {
    inputs.push_back(test.input());
  }
  for (const auto& test : problem.private_tests()) {
    inputs.push_back(test.input());
  }
  for (const auto& test : problem.generated_tests()) {
    inputs.push_back(test.input());
  }
  inputs.resize(max_size);
  return inputs;
}

std::vector<absl::string_view> GetOutputs(const ContestProblem& problem,
                                          int max_size) {
  std::vector<absl::string_view> outputs;
  for (const auto& test : problem.public_tests()) {
    outputs.push_back(test.output());
  }
  for (const auto& test : problem.private_tests()) {
    outputs.push_back(test.output());
  }
  for (const auto& test : problem.generated_tests()) {
    outputs.push_back(test.output());
  }
  outputs.resize(max_size);
  return outputs;
}

void ReportResults(const MultiTestResult& multi_result) {
  std::cout << "Compilation "
            << (multi_result.compilation_result.program_status ==
                        ProgramStatus::kSuccess
                    ? "succeeded"
                    : "failed")
            << "\n";
  int i = 0;
  for (const auto& test_result : multi_result.test_results) {
    if (!test_result.passed.has_value()) {
      std::cout << "Test " << i << " did not run.\n";
    } else if (*test_result.passed) {
      std::cout << "Test " << i << " passed.\n";
    } else {
      std::cout << "Test " << i << " failed.\n";
    }
    ++i;
  }
}

absl::Status SolveProblem(
    const absl::string_view valid_filename, ContestProblem problem) {
  const std::vector<absl::string_view> inputs =
      GetInputs(problem,
                /*max_size=*/10);
  const std::vector<absl::string_view> outputs =
      GetOutputs(problem,
                 /*max_size=*/10);

  Py3TesterSandboxer tester(Py3InterpreterPath(), Py3LibraryPaths());
  TestOptions options;
  options.num_threads = 4;
  options.stop_on_first_failure = false;

  for (int i = 0; i < problem.incorrect_solutions_size(); i++)
  {
    const absl::string_view code = problem.incorrect_solutions(i).solution();
    
    ASSIGN_OR_RETURN(MultiTestResult bad_result,
                   tester.Test(code, inputs, options, outputs));
    ReportResults(bad_result);
  }

  for (int i = 0; i < problem.solutions_size(); i++)
  {
    const absl::string_view code = problem.solutions(i).solution();
    ASSIGN_OR_RETURN(MultiTestResult good_result,
                    tester.Test(code, inputs, options, outputs));
    ReportResults(good_result);
  }

  return absl::OkStatus();
}

}  // namespace
}  // namespace deepmind::code_contests


namespace {

using ::deepmind::code_contests::ContestProblem;

void PrintNames(const absl::Span<const absl::string_view> filenames) {
  for (const absl::string_view filename : filenames) {
    riegeli::RecordReader<riegeli::FdReader<>> reader(
        std::forward_as_tuple(filename));
    ContestProblem problem;
    while (reader.ReadRecord(problem)) {
      std::cout << problem.name() << '\n';
      ::deepmind::code_contests::SolveProblem(filename, problem);
    }
    reader.Close();
  }
}

}  // namespace

int main(int argc, char* argv[]) {
  std::vector<absl::string_view> filenames;
  filenames.reserve(argc - 1);
  for (int i = 1; i < argc; ++i) {
    filenames.push_back(argv[i]);
  }
  PrintNames(filenames);
}

Does anyone know what Segmentation fault means ?

I execute bazel command on my computer :

bazel run -c opt execution:solve_example -- --valid_path=/tmp/dm-code_contests/code_contests_valid.riegeli --python3_path=/usr/bin/python3 --python3_library_paths=/usr/lib/python3

Then I got Segmentation fault, Something wrong right?

I had already use gsutil to download code contests dataset, My OS is Ubuntu 18.04 on Windows 11.

Any ideas ?

Thanks

Print other features for each problem

Hi,
Thank you for this great dataset. I have two questions:

  1. How can we print the description of the problems and solutions (including correct, wrong, etc) and test cases? do you have any list of features that can help us to fetch other attributes?
  2. for example "CODEFORCES 1569_A" as a source, means the problem is fetched from codeforces but what is 1569_A or_B? It seems more than an index to me.

Thank you :)

License of data usage

Hi the authors,

I want to use this data. In the "License" section, it reads:

The code is licensed under the [Apache 2.0 License](https://www.apache.org/licenses/LICENSE-2.0).

All non-code materials provided are made available under the terms of the CC BY 4.0 license ([Creative Commons Attribution 4.0 International license](https://creativecommons.org/licenses/by/4.0/legalcode)).

The data that contains coding problems are "non-code materials", right? I assume that the Apache 2.0 Licensed code here is the code in this github repo, not the actual code data.

no such attribute 'env' in 'py_binary' rule

I followed instructions detailed in a kaggle kernal. However, I encountered the titled error.

Bazel output:

Extracting Bazel installation...
Starting local Bazel server and connecting to it...
Loading: 
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
    Fetching ...c_grpc; Cloning tags/v1.38.1 of [https://github.com/grpc/grpc.g\](https://github.com/grpc/grpc.g/)
it
Loading: 0 packages loaded
    Fetching ...c_grpc; Cloning tags/v1.38.1 of [https://github.com/grpc/grpc.g\](https://github.com/grpc/grpc.g/)
it
Loading: 0 packages loaded
    Fetching ...c_grpc; Cloning tags/v1.38.1 of [https://github.com/grpc/grpc.g\](https://github.com/grpc/grpc.g/)
it
Loading: 0 packages loaded
    Fetching ...c_grpc; Cloning tags/v1.38.1 of [https://github.com/grpc/grpc.g\](https://github.com/grpc/grpc.g/)
it
Loading: 0 packages loaded
    Fetching ...c_grpc; Cloning tags/v1.38.1 of [https://github.com/grpc/grpc.g\](https://github.com/grpc/grpc.g/)
it 4s
Loading: 0 packages loaded
    Fetching ...c_grpc; Cloning tags/v1.38.1 of [https://github.com/grpc/grpc.g\](https://github.com/grpc/grpc.g/)
it 5s
Loading: 0 packages loaded
    Fetching @com_github_grpc_grpc; Recording actual commit 5s
DEBUG: Rule 'com_github_grpc_grpc' indicated that a canonical reproducible form can be obtained by modifying arguments commit = "96b73272eadc01afb5fb45b92b408c47e4387274", shallow_since = "1624063996 -0700" and dropping ["tag"]
Loading: 0 packages loaded
DEBUG: Repository com_github_grpc_grpc instantiated at:
  /kaggle/working/code_contests/WORKSPACE:4:15: in <toplevel>
Repository rule git_repository defined at:
  /root/.cache/bazel/_bazel_root/3be79ad75151b6763eed16d084c75f7d/external/bazel_tools/tools/build_defs/repo/git.bzl:199:33: in <toplevel>
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
    currently loading: 
    Fetching @rules_proto; fetching
Loading: 0 packages loaded
    currently loading: 
    Fetching @rules_proto; fetching
    Fetching https://mirror.bazel.build/...595af3900dd85cb3a29ad28cc313.tar.gz
Analyzing: target //:print_names_and_sources (1 packages loaded)
Analyzing: target //:print_names_and_sources (1 packages loaded, 0 targets con\
figured)
Analyzing: target //:print_names_and_sources (2 packages loaded, 1 target conf\
igured)
    currently loading: @bazel_tools//tools/cpp
    Fetching @rules_cc; fetching
Analyzing: target //:print_names_and_sources (6 packages loaded, 2 targets con\
figured)
Analyzing: target //:print_names_and_sources (9 packages loaded, 14 targets co\
nfigured)
    currently loading: @bazel_tools//tools/sh
Analyzing: target //:print_names_and_sources (12 packages loaded, 18 targets c\
onfigured)
    Fetching @local_config_cc; fetching
    Fetching @com_google_riegeli; fetching
Analyzing: target //:print_names_and_sources (12 packages loaded, 18 targets c\
onfigured)
    Fetching @local_config_cc; fetching
    Fetching @com_google_riegeli; fetching
    Fetching https://github.com/...7921700a58f53fbd2b47fcf9c6dc38477a32.tar.gz
Analyzing: target //:print_names_and_sources (12 packages loaded, 18 targets c\
onfigured)
    Fetching @local_config_cc; fetching
    Fetching @com_google_riegeli; fetching
    Fetching https://github.com/...f53fbd2b47fcf9c6dc38477a32.tar.gz; 154,274B
Analyzing: target //:print_names_and_sources (12 packages loaded, 18 targets c\
onfigured)
    Fetching @local_config_cc; fetching
    Fetching @com_google_riegeli; fetching
    Fetching ...iegeli; Extracting /root/.cache/bazel/_bazel_root/3be79ad75151\
b6763eed16d084c75f7d/external/com_google_riegeli/temp11287151664443332764/587c\
7921700a58f53fbd2b47fcf9c6dc38477a32.tar.gz
Analyzing: target //:print_names_and_sources (13 packages loaded, 18 targets c\
onfigured)
    Fetching @local_config_cc; fetching
Analyzing: target //:print_names_and_sources (19 packages loaded, 57 targets c\
onfigured)
    currently loading: @com_google_riegeli//python/riegeli/records
    Fetching ...otobuf; Cloning tags/v3.19.3 of [https://github.com/protocolbuf\](https://github.com/protocolbuf/)
fers/protobuf.git
Analyzing: target //:print_names_and_sources (20 packages loaded, 77 targets c\
onfigured)
    currently loading: @com_google_riegeli//python/riegeli/records
    Fetching ...otobuf; Cloning tags/v3.19.3 of [https://github.com/protocolbuf\](https://github.com/protocolbuf/)
fers/protobuf.git
Analyzing: target //:print_names_and_sources (20 packages loaded, 83 targets c\
onfigured)
    currently loading: @com_google_riegeli//python/riegeli/records
    Fetching ...otobuf; Cloning tags/v3.19.3 of [https://github.com/protocolbuf\](https://github.com/protocolbuf/)
fers/protobuf.git
Analyzing: target //:print_names_and_sources (20 packages loaded, 83 targets c\
onfigured)
    currently loading: @com_google_riegeli//python/riegeli/records
    Fetching ...otobuf; Cloning tags/v3.19.3 of [https://github.com/protocolbuf\](https://github.com/protocolbuf/)
fers/protobuf.git
Analyzing: target //:print_names_and_sources (20 packages loaded, 83 targets c\
onfigured)
    currently loading: @com_google_riegeli//python/riegeli/records
    Fetching ...otobuf; Cloning tags/v3.19.3 of [https://github.com/protocolbuf\](https://github.com/protocolbuf/)
fers/protobuf.git
Analyzing: target //:print_names_and_sources (20 packages loaded, 83 targets c\
onfigured)
    currently loading: @com_google_riegeli//python/riegeli/records
    Fetching @com_google_protobuf; Recording actual commit
DEBUG: Rule 'com_google_protobuf' indicated that a canonical reproducible form can be obtained by modifying arguments commit = "cc7b1b53234cd7a8f50d90ac3933b240dcf4cd97", shallow_since = "1641866895 -0800" and dropping ["tag"]
Analyzing: target //:print_names_and_sources (20 packages loaded, 83 targets c\
onfigured)
    currently loading: @com_google_riegeli//python/riegeli/records
DEBUG: Repository com_google_protobuf instantiated at:
  /kaggle/working/code_contests/WORKSPACE:22:15: in <toplevel>
Repository rule git_repository defined at:
  /root/.cache/bazel/_bazel_root/3be79ad75151b6763eed16d084c75f7d/external/bazel_tools/tools/build_defs/repo/git.bzl:199:33: in <toplevel>
Analyzing: target //:print_names_and_sources (20 packages loaded, 83 targets c\
onfigured)
    currently loading: @com_google_riegeli//python/riegeli/records
Analyzing: target //:print_names_and_sources (20 packages loaded, 83 targets c\
onfigured)
    currently loading: @com_google_riegeli//python/riegeli/records ... (2 pack\
ages)
    Fetching ...python; Cloning tags/0.5.0 of [https://github.com/bazelbuild/ru\](https://github.com/bazelbuild/ru/)
les_python.git
Analyzing: target //:print_names_and_sources (20 packages loaded, 83 targets c\
onfigured)
    currently loading: @com_google_riegeli//python/riegeli/records ... (2 pack\
ages)
    Fetching ...python; Cloning tags/0.5.0 of [https://github.com/bazelbuild/ru\](https://github.com/bazelbuild/ru/)
les_python.git
Analyzing: target //:print_names_and_sources (20 packages loaded, 83 targets c\
onfigured)
    currently loading: @com_google_riegeli//python/riegeli/records ... (2 pack\
ages)
    Fetching @rules_python; Recording actual commit
DEBUG: Rule 'rules_python' indicated that a canonical reproducible form can be obtained by modifying arguments commit = "76ef44fdb8aaa8d5c607721ffe1b1cbf1e8f08dd", shallow_since = "1635214215 -0700" and dropping ["tag"]
Analyzing: target //:print_names_and_sources (20 packages loaded, 83 targets c\
onfigured)
    currently loading: @com_google_riegeli//python/riegeli/records ... (2 pack\
ages)
DEBUG: Repository rules_python instantiated at:
  /kaggle/working/code_contests/WORKSPACE:14:15: in <toplevel>
Repository rule git_repository defined at:
  /root/.cache/bazel/_bazel_root/3be79ad75151b6763eed16d084c75f7d/external/bazel_tools/tools/build_defs/repo/git.bzl:199:33: in <toplevel>
Analyzing: target //:print_names_and_sources (20 packages loaded, 83 targets c\
onfigured)
    currently loading: @com_google_riegeli//python/riegeli/records ... (2 pack\
ages)
Analyzing: target //:print_names_and_sources (25 packages loaded, 89 targets c\
onfigured)
    currently loading: @com_google_protobuf//
    Fetching ...e_absl; Cloning tags/20211102.0 of [https://github.com/abseil/a\](https://github.com/abseil/a/)
bseil-cpp.git
    Fetching @local_config_python; fetching
Analyzing: target //:print_names_and_sources (26 packages loaded, 101 targets \
configured)
    Fetching ...e_absl; Cloning tags/20211102.0 of [https://github.com/abseil/a\](https://github.com/abseil/a/)
bseil-cpp.git
Analyzing: target //:print_names_and_sources (28 packages loaded, 279 targets \
configured)
    Fetching ...e_absl; Cloning tags/20211102.0 of [https://github.com/abseil/a\](https://github.com/abseil/a/)
bseil-cpp.git
    Fetching @zlib; fetching
Analyzing: target //:print_names_and_sources (28 packages loaded, 279 targets \
configured)
    Fetching ...e_absl; Cloning tags/20211102.0 of [https://github.com/abseil/a\](https://github.com/abseil/a/)
bseil-cpp.git
    Fetching @zlib; fetching
    Fetching http://zlib.net/fossils/zlib-1.2.11.tar.gz
Analyzing: target //:print_names_and_sources (29 packages loaded, 400 targets \
configured)
    Fetching ...e_absl; Cloning tags/20211102.0 of [https://github.com/abseil/a\](https://github.com/abseil/a/)
bseil-cpp.git
DEBUG: Rule 'com_google_absl' indicated that a canonical reproducible form can be obtained by modifying arguments commit = "215105818dfde3174fe799600bb0f3cae233d0bf", shallow_since = "1635953174 -0400" and dropping ["tag"]
Analyzing: target //:print_names_and_sources (29 packages loaded, 633 targets \
configured)
DEBUG: Repository com_google_absl instantiated at:
  /kaggle/working/code_contests/WORKSPACE:28:15: in <toplevel>
Repository rule git_repository defined at:
  /root/.cache/bazel/_bazel_root/3be79ad75151b6763eed16d084c75f7d/external/bazel_tools/tools/build_defs/repo/git.bzl:199:33: in <toplevel>
Analyzing: target //:print_names_and_sources (29 packages loaded, 633 targets \
configured)
Analyzing: target //:print_names_and_sources (35 packages loaded, 646 targets \
configured)
    currently loading: @rules_python//python ... (2 packages)
ERROR: /root/.cache/bazel/_bazel_root/3be79ad75151b6763eed16d084c75f7d/external/rules_python/python/BUILD:144:25: @rules_python//python:requirements.update: no such attribute 'env' in 'py_binary' rule
Analyzing: target //:print_names_and_sources (37 packages loaded, 646 targets \
configured)
ERROR: /root/.cache/bazel/_bazel_root/3be79ad75151b6763eed16d084c75f7d/external/rules_python/python/BUILD:144:25: @rules_python//python:requirements_test: no such attribute 'env' in 'py_test' rule
Analyzing: target //:print_names_and_sources (37 packages loaded, 646 targets \
configured)
Analyzing: target //:print_names_and_sources (43 packages loaded, 773 targets \
configured)
    currently loading: @com_google_absl//absl/container
ERROR: /root/.cache/bazel/_bazel_root/3be79ad75151b6763eed16d084c75f7d/external/local_config_python/BUILD:16:15: Target '@rules_python//python:python_version' contains an error and its package is in error and referenced by '@local_config_python//:python3'
Analyzing: target //:print_names_and_sources (52 packages loaded, 915 targets \
configured)
    Fetching @highwayhash; fetching
Analyzing: target //:print_names_and_sources (52 packages loaded, 916 targets \
configured)
    Fetching @highwayhash; fetching
Analyzing: target //:print_names_and_sources (52 packages loaded, 916 targets \
configured)
    Fetching @highwayhash; fetching
    Fetching https://github.com/...76dd7b4b6d330e4734b756e97ccfb1b69cc2e12.zip
INFO: Repository highwayhash instantiated at:
  /kaggle/working/code_contests/WORKSPACE:86:13: in <toplevel>
Repository rule http_archive defined at:
  /root/.cache/bazel/_bazel_root/3be79ad75151b6763eed16d084c75f7d/external/bazel_tools/tools/build_defs/repo/http.bzl:336:31: in <toplevel>
Analyzing: target //:print_names_and_sources (52 packages loaded, 916 targets \
configured)
    Fetching @highwayhash; fetching
ERROR: While resolving configuration keys for @local_config_python//:python_headers: Analysis failed
Analyzing: target //:print_names_and_sources (52 packages loaded, 916 targets \
configured)
ERROR: Analysis of target '//:print_names_and_sources' failed; build aborted: Analysis failed
Analyzing: target //:print_names_and_sources (52 packages loaded, 916 targets \
configured)
INFO: Elapsed time: 25.967s
Analyzing: target //:print_names_and_sources (52 packages loaded, 916 targets \
configured)
INFO: 0 processes.
Analyzing: target //:print_names_and_sources (52 packages loaded, 916 targets \
configured)
FAILED: Build did NOT complete successfully (52 packages loaded, 916 targets c\
onfigured)
ERROR: Build failed. Not running target
FAILED: Build did NOT complete successfully (52 packages loaded, 916 targets c\
onfigured)Extracting Bazel installation...
Starting local Bazel server and connecting to it...
Loading: 
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
    Fetching ...c_grpc; Cloning tags/v1.38.1 of [https://github.com/grpc/grpc.g\](https://github.com/grpc/grpc.g/)
it
Loading: 0 packages loaded
    Fetching ...c_grpc; Cloning tags/v1.38.1 of [https://github.com/grpc/grpc.g\](https://github.com/grpc/grpc.g/)
it
Loading: 0 packages loaded
    Fetching ...c_grpc; Cloning tags/v1.38.1 of [https://github.com/grpc/grpc.g\](https://github.com/grpc/grpc.g/)
it
Loading: 0 packages loaded
    Fetching ...c_grpc; Cloning tags/v1.38.1 of [https://github.com/grpc/grpc.g\](https://github.com/grpc/grpc.g/)
it
Loading: 0 packages loaded
    Fetching ...c_grpc; Cloning tags/v1.38.1 of [https://github.com/grpc/grpc.g\](https://github.com/grpc/grpc.g/)
it 4s
Loading: 0 packages loaded
    Fetching ...c_grpc; Cloning tags/v1.38.1 of [https://github.com/grpc/grpc.g\](https://github.com/grpc/grpc.g/)
it 5s
Loading: 0 packages loaded
    Fetching @com_github_grpc_grpc; Recording actual commit 5s
DEBUG: Rule 'com_github_grpc_grpc' indicated that a canonical reproducible form can be obtained by modifying arguments commit = "96b73272eadc01afb5fb45b92b408c47e4387274", shallow_since = "1624063996 -0700" and dropping ["tag"]
Loading: 0 packages loaded
DEBUG: Repository com_github_grpc_grpc instantiated at:
  /kaggle/working/code_contests/WORKSPACE:4:15: in <toplevel>
Repository rule git_repository defined at:
  /root/.cache/bazel/_bazel_root/3be79ad75151b6763eed16d084c75f7d/external/bazel_tools/tools/build_defs/repo/git.bzl:199:33: in <toplevel>
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
    currently loading: 
    Fetching @rules_proto; fetching
Loading: 0 packages loaded
    currently loading: 
    Fetching @rules_proto; fetching
    Fetching https://mirror.bazel.build/...595af3900dd85cb3a29ad28cc313.tar.gz
Analyzing: target //:print_names_and_sources (1 packages loaded)
Analyzing: target //:print_names_and_sources (1 packages loaded, 0 targets con\
figured)
Analyzing: target //:print_names_and_sources (2 packages loaded, 1 target conf\
igured)
    currently loading: @bazel_tools//tools/cpp
    Fetching @rules_cc; fetching
Analyzing: target //:print_names_and_sources (6 packages loaded, 2 targets con\
figured)
Analyzing: target //:print_names_and_sources (9 packages loaded, 14 targets co\
nfigured)
    currently loading: @bazel_tools//tools/sh
Analyzing: target //:print_names_and_sources (12 packages loaded, 18 targets c\
onfigured)
    Fetching @local_config_cc; fetching
    Fetching @com_google_riegeli; fetching
Analyzing: target //:print_names_and_sources (12 packages loaded, 18 targets c\
onfigured)
    Fetching @local_config_cc; fetching
    Fetching @com_google_riegeli; fetching
    Fetching https://github.com/...7921700a58f53fbd2b47fcf9c6dc38477a32.tar.gz
Analyzing: target //:print_names_and_sources (12 packages loaded, 18 targets c\
onfigured)
    Fetching @local_config_cc; fetching
    Fetching @com_google_riegeli; fetching
    Fetching https://github.com/...f53fbd2b47fcf9c6dc38477a32.tar.gz; 154,274B
Analyzing: target //:print_names_and_sources (12 packages loaded, 18 targets c\
onfigured)
    Fetching @local_config_cc; fetching
    Fetching @com_google_riegeli; fetching
    Fetching ...iegeli; Extracting /root/.cache/bazel/_bazel_root/3be79ad75151\
b6763eed16d084c75f7d/external/com_google_riegeli/temp11287151664443332764/587c\
7921700a58f53fbd2b47fcf9c6dc38477a32.tar.gz
Analyzing: target //:print_names_and_sources (13 packages loaded, 18 targets c\
onfigured)
    Fetching @local_config_cc; fetching
Analyzing: target //:print_names_and_sources (19 packages loaded, 57 targets c\
onfigured)
    currently loading: @com_google_riegeli//python/riegeli/records
    Fetching ...otobuf; Cloning tags/v3.19.3 of [https://github.com/protocolbuf\](https://github.com/protocolbuf/)
fers/protobuf.git
Analyzing: target //:print_names_and_sources (20 packages loaded, 77 targets c\
onfigured)
    currently loading: @com_google_riegeli//python/riegeli/records
    Fetching ...otobuf; Cloning tags/v3.19.3 of [https://github.com/protocolbuf\](https://github.com/protocolbuf/)
fers/protobuf.git
Analyzing: target //:print_names_and_sources (20 packages loaded, 83 targets c\
onfigured)
    currently loading: @com_google_riegeli//python/riegeli/records
    Fetching ...otobuf; Cloning tags/v3.19.3 of [https://github.com/protocolbuf\](https://github.com/protocolbuf/)
fers/protobuf.git
Analyzing: target //:print_names_and_sources (20 packages loaded, 83 targets c\
onfigured)
    currently loading: @com_google_riegeli//python/riegeli/records
    Fetching ...otobuf; Cloning tags/v3.19.3 of [https://github.com/protocolbuf\](https://github.com/protocolbuf/)
fers/protobuf.git
Analyzing: target //:print_names_and_sources (20 packages loaded, 83 targets c\
onfigured)
    currently loading: @com_google_riegeli//python/riegeli/records
    Fetching ...otobuf; Cloning tags/v3.19.3 of [https://github.com/protocolbuf\](https://github.com/protocolbuf/)
fers/protobuf.git
Analyzing: target //:print_names_and_sources (20 packages loaded, 83 targets c\
onfigured)
    currently loading: @com_google_riegeli//python/riegeli/records
    Fetching @com_google_protobuf; Recording actual commit
DEBUG: Rule 'com_google_protobuf' indicated that a canonical reproducible form can be obtained by modifying arguments commit = "cc7b1b53234cd7a8f50d90ac3933b240dcf4cd97", shallow_since = "1641866895 -0800" and dropping ["tag"]
Analyzing: target //:print_names_and_sources (20 packages loaded, 83 targets c\
onfigured)
    currently loading: @com_google_riegeli//python/riegeli/records
DEBUG: Repository com_google_protobuf instantiated at:
  /kaggle/working/code_contests/WORKSPACE:22:15: in <toplevel>
Repository rule git_repository defined at:
  /root/.cache/bazel/_bazel_root/3be79ad75151b6763eed16d084c75f7d/external/bazel_tools/tools/build_defs/repo/git.bzl:199:33: in <toplevel>
Analyzing: target //:print_names_and_sources (20 packages loaded, 83 targets c\
onfigured)
    currently loading: @com_google_riegeli//python/riegeli/records
Analyzing: target //:print_names_and_sources (20 packages loaded, 83 targets c\
onfigured)
    currently loading: @com_google_riegeli//python/riegeli/records ... (2 pack\
ages)
    Fetching ...python; Cloning tags/0.5.0 of [https://github.com/bazelbuild/ru\](https://github.com/bazelbuild/ru/)
les_python.git
Analyzing: target //:print_names_and_sources (20 packages loaded, 83 targets c\
onfigured)
    currently loading: @com_google_riegeli//python/riegeli/records ... (2 pack\
ages)
    Fetching ...python; Cloning tags/0.5.0 of [https://github.com/bazelbuild/ru\](https://github.com/bazelbuild/ru/)
les_python.git
Analyzing: target //:print_names_and_sources (20 packages loaded, 83 targets c\
onfigured)
    currently loading: @com_google_riegeli//python/riegeli/records ... (2 pack\
ages)
    Fetching @rules_python; Recording actual commit
DEBUG: Rule 'rules_python' indicated that a canonical reproducible form can be obtained by modifying arguments commit = "76ef44fdb8aaa8d5c607721ffe1b1cbf1e8f08dd", shallow_since = "1635214215 -0700" and dropping ["tag"]
Analyzing: target //:print_names_and_sources (20 packages loaded, 83 targets c\
onfigured)
    currently loading: @com_google_riegeli//python/riegeli/records ... (2 pack\
ages)
DEBUG: Repository rules_python instantiated at:
  /kaggle/working/code_contests/WORKSPACE:14:15: in <toplevel>
Repository rule git_repository defined at:
  /root/.cache/bazel/_bazel_root/3be79ad75151b6763eed16d084c75f7d/external/bazel_tools/tools/build_defs/repo/git.bzl:199:33: in <toplevel>
Analyzing: target //:print_names_and_sources (20 packages loaded, 83 targets c\
onfigured)
    currently loading: @com_google_riegeli//python/riegeli/records ... (2 pack\
ages)
Analyzing: target //:print_names_and_sources (25 packages loaded, 89 targets c\
onfigured)
    currently loading: @com_google_protobuf//
    Fetching ...e_absl; Cloning tags/20211102.0 of [https://github.com/abseil/a\](https://github.com/abseil/a/)
bseil-cpp.git
    Fetching @local_config_python; fetching
Analyzing: target //:print_names_and_sources (26 packages loaded, 101 targets \
configured)
    Fetching ...e_absl; Cloning tags/20211102.0 of [https://github.com/abseil/a\](https://github.com/abseil/a/)
bseil-cpp.git
Analyzing: target //:print_names_and_sources (28 packages loaded, 279 targets \
configured)
    Fetching ...e_absl; Cloning tags/20211102.0 of [https://github.com/abseil/a\](https://github.com/abseil/a/)
bseil-cpp.git
    Fetching @zlib; fetching
Analyzing: target //:print_names_and_sources (28 packages loaded, 279 targets \
configured)
    Fetching ...e_absl; Cloning tags/20211102.0 of [https://github.com/abseil/a\](https://github.com/abseil/a/)
bseil-cpp.git
    Fetching @zlib; fetching
    Fetching http://zlib.net/fossils/zlib-1.2.11.tar.gz
Analyzing: target //:print_names_and_sources (29 packages loaded, 400 targets \
configured)
    Fetching ...e_absl; Cloning tags/20211102.0 of [https://github.com/abseil/a\](https://github.com/abseil/a/)
bseil-cpp.git
DEBUG: Rule 'com_google_absl' indicated that a canonical reproducible form can be obtained by modifying arguments commit = "215105818dfde3174fe799600bb0f3cae233d0bf", shallow_since = "1635953174 -0400" and dropping ["tag"]
Analyzing: target //:print_names_and_sources (29 packages loaded, 633 targets \
configured)
DEBUG: Repository com_google_absl instantiated at:
  /kaggle/working/code_contests/WORKSPACE:28:15: in <toplevel>
Repository rule git_repository defined at:
  /root/.cache/bazel/_bazel_root/3be79ad75151b6763eed16d084c75f7d/external/bazel_tools/tools/build_defs/repo/git.bzl:199:33: in <toplevel>
Analyzing: target //:print_names_and_sources (29 packages loaded, 633 targets \
configured)
Analyzing: target //:print_names_and_sources (35 packages loaded, 646 targets \
configured)
    currently loading: @rules_python//python ... (2 packages)
ERROR: /root/.cache/bazel/_bazel_root/3be79ad75151b6763eed16d084c75f7d/external/rules_python/python/BUILD:144:25: @rules_python//python:requirements.update: no such attribute 'env' in 'py_binary' rule
Analyzing: target //:print_names_and_sources (37 packages loaded, 646 targets \
configured)
ERROR: /root/.cache/bazel/_bazel_root/3be79ad75151b6763eed16d084c75f7d/external/rules_python/python/BUILD:144:25: @rules_python//python:requirements_test: no such attribute 'env' in 'py_test' rule
Analyzing: target //:print_names_and_sources (37 packages loaded, 646 targets \
configured)
Analyzing: target //:print_names_and_sources (43 packages loaded, 773 targets \
configured)
    currently loading: @com_google_absl//absl/container
ERROR: /root/.cache/bazel/_bazel_root/3be79ad75151b6763eed16d084c75f7d/external/local_config_python/BUILD:16:15: Target '@rules_python//python:python_version' contains an error and its package is in error and referenced by '@local_config_python//:python3'
Analyzing: target //:print_names_and_sources (52 packages loaded, 915 targets \
configured)
    Fetching @highwayhash; fetching
Analyzing: target //:print_names_and_sources (52 packages loaded, 916 targets \
configured)
    Fetching @highwayhash; fetching
Analyzing: target //:print_names_and_sources (52 packages loaded, 916 targets \
configured)
    Fetching @highwayhash; fetching
    Fetching https://github.com/...76dd7b4b6d330e4734b756e97ccfb1b69cc2e12.zip
INFO: Repository highwayhash instantiated at:
  /kaggle/working/code_contests/WORKSPACE:86:13: in <toplevel>
Repository rule http_archive defined at:
  /root/.cache/bazel/_bazel_root/3be79ad75151b6763eed16d084c75f7d/external/bazel_tools/tools/build_defs/repo/http.bzl:336:31: in <toplevel>
Analyzing: target //:print_names_and_sources (52 packages loaded, 916 targets \
configured)
    Fetching @highwayhash; fetching
ERROR: While resolving configuration keys for @local_config_python//:python_headers: Analysis failed
Analyzing: target //:print_names_and_sources (52 packages loaded, 916 targets \
configured)
ERROR: Analysis of target '//:print_names_and_sources' failed; build aborted: Analysis failed
Analyzing: target //:print_names_and_sources (52 packages loaded, 916 targets \
configured)
INFO: Elapsed time: 25.967s
Analyzing: target //:print_names_and_sources (52 packages loaded, 916 targets \
configured)
INFO: 0 processes.
Analyzing: target //:print_names_and_sources (52 packages loaded, 916 targets \
configured)
FAILED: Build did NOT complete successfully (52 packages loaded, 916 targets c\
onfigured)
ERROR: Build failed. Not running target
FAILED: Build did NOT complete successfully (52 packages loaded, 916 targets c\
onfigured)

Error Running: Bazel

I followed the readme file to clone the repo and download the data.
When I tried bazel run -c opt :print_names_and_sources /tmp/dm-code_contests/code_contests_train.riegeli*, it ran into the error:

ERROR: /home/ubuntu64/.cache/bazel/_bazel_ubuntu64/0383bdf747a541d9fe51b3d550b07b10/external/com_google_riegeli/riegeli/records/BUILD:79:11: Compiling riegeli/records/record_position.cc failed: (Exit 1): gcc failed: error executing command /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections ... (remaining 31 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox
In file included from external/com_google_riegeli/riegeli/records/record_position.cc:36:0:
external/com_google_riegeli/riegeli/bytes/string_writer.h: In instantiation of 'riegeli::StringWriter<Dest>::StringWriter(Dest&&, riegeli::StringWriterBase::Options) [with Dest = std::basic_string<char>*]':
external/com_google_riegeli/riegeli/records/record_position.cc:73:36:   required from here
external/com_google_riegeli/riegeli/bytes/string_writer.h:291:28: error: no matching function for call to 'riegeli::StringWriterBase::StringWriterBase()'
     : dest_(std::move(dest)) {
                            ^
external/com_google_riegeli/riegeli/bytes/string_writer.h:92:17: note: candidate: riegeli::StringWriterBase::StringWriterBase(riegeli::Closed)
   using Writer::Writer;
                 ^
external/com_google_riegeli/riegeli/bytes/string_writer.h:92:17: note:   candidate expects 1 argument, 0 provided
external/com_google_riegeli/riegeli/bytes/string_writer.h:232:8: note: candidate: riegeli::StringWriterBase::StringWriterBase(riegeli::StringWriterBase&&)
 inline StringWriterBase::StringWriterBase(StringWriterBase&& that) noexcept
        ^
external/com_google_riegeli/riegeli/bytes/string_writer.h:232:8: note:   candidate expects 1 argument, 0 provided
In file included from external/com_google_riegeli/riegeli/records/record_position.cc:35:0:
external/com_google_riegeli/riegeli/bytes/string_reader.h: In instantiation of 'riegeli::StringReader<Src>::StringReader(const Src&) [with Src = absl::lts_20211102::string_view]':
external/com_google_riegeli/riegeli/records/record_position.cc:94:35:   required from here
external/com_google_riegeli/riegeli/bytes/string_reader.h:172:66: error: no matching function for call to 'riegeli::StringReaderBase::StringReaderBase()'
 inline StringReader<Src>::StringReader(const Src& src) : src_(src) {
                                                                  ^
external/com_google_riegeli/riegeli/bytes/string_reader.h:46:17: note: candidate: riegeli::StringReaderBase::StringReaderBase(riegeli::Closed)
   using Reader::Reader;
                 ^
external/com_google_riegeli/riegeli/bytes/string_reader.h:46:17: note:   candidate expects 1 argument, 0 provided
external/com_google_riegeli/riegeli/bytes/string_reader.h:157:8: note: candidate: riegeli::StringReaderBase::StringReaderBase(riegeli::StringReaderBase&&)
 inline StringReaderBase::StringReaderBase(StringReaderBase&& that) noexcept
        ^
external/com_google_riegeli/riegeli/bytes/string_reader.h:157:8: note:   candidate expects 1 argument, 0 provided
Target //:print_names_and_sources failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 1.878s, Critical Path: 1.50s
INFO: 5 processes: 3 internal, 2 linux-sandbox.
FAILED: Build did NOT complete successfully
FAILED: Build did NOT complete successfully

i install bazel using apt install
sudo apt update && sudo apt install bazel
python 2.7 && python 3.5
ubuntu 16.04 (vmware virtual machine)

Availability of AlphaCode

Hi,
I am fascinated by the results from your paper and I was wondering whether there is a way for us to test AlphaCode ourselves. Is AlphaCode available to the public for testing?

Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.