Skip to content

build-remote: Implement in C++ - #981

Merged
edolstra merged 4 commits into
NixOS:masterfrom
shlevy:build-remote-c++
Jan 19, 2017
Merged

edolstra merged 4 commits into
NixOS:masterfrom
shlevy:build-remote-c++

Conversation

@shlevy

@shlevy shlevy commented Jul 18, 2016

Copy link
Copy Markdown
Member

No description provided.

@shlevy

shlevy commented Jul 18, 2016

Copy link
Copy Markdown
Member Author

Ref #341

@shlevy shlevy mentioned this pull request Jul 18, 2016
12 tasks done
@domenkozar

Copy link
Copy Markdown
Member

Shouldn't this also remove ./scripts/build-remote.pl.in?

@shlevy

shlevy commented Jul 19, 2016

Copy link
Copy Markdown
Member Author

That needs to be coordinated with a change in NixOS.

@domenkozar

domenkozar commented Jul 19, 2016 •

Copy link
Copy Markdown
Member

@shlevy cool, let's then keep a list of TODOs somewhere for NixOS so this is not forgotten.

@domenkozar

Copy link
Copy Markdown
Member

cc @edolstra

look at the actual remote load.</para>

<para>Additionally, you may define the environment variable
<envar>NIX_REMOTE_USE_SUBSTITUTES</envar>, which will instruct

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why an environment variable instead of a nix.conf option?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@k0001 ?

@k0001 k0001 Jul 21, 2016 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I expected the options in nix.conf to be directly related to Nix, not to the build-remote hook. But I agree that a nix.conf option would be better, if that is acceptable.

@shlevy
shlevy force-pushed the build-remote-c++ branch from b58da8b to d06ac7d Compare July 21, 2016 22:23
@shlevy

shlevy commented Jul 21, 2016

Copy link
Copy Markdown
Member Author

@edolstra switched to the nix conf option for hook substitutes

@shlevy
shlevy force-pushed the build-remote-c++ branch from d06ac7d to bd5d153 Compare July 25, 2016 17:15
@shlevy

shlevy commented Jul 25, 2016

Copy link
Copy Markdown
Member Author

Rebased on top of #997 (sorry @k0001, had to lose #937 for now). Note that tests don't pass because the VM test framework doesn't add proper hashes to store paths inherited from the parent store.

Comment thread src/build-remote/build-remote.cc Outdated

auto localSystem = argv[1];
settings.maxSilentTime = strtoull(argv[2], NULL, 10);
settings.buildTimeout = strtoull(argv[3], NULL, 10);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Calls to strtoull are not checked for parse error.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will return ULLONG_MAX, which is a fine default. Note that this is an internal (libexec) tool.

@rasendubi rasendubi Jul 29, 2016 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This prints 0:

unsigned long long res = strtoull("blah", NULL, 10);
printf("%llu\n", res);

The function returns ULLONG_MAX in case of overflow.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 5dd21d1

@shlevy

shlevy commented Nov 10, 2016

Copy link
Copy Markdown
Member Author

@edolstra rebased on master.

@shlevy

shlevy commented Nov 18, 2016

Copy link
Copy Markdown
Member Author

ping

@domenkozar

Copy link
Copy Markdown
Member

@shlevy can we fix the tests here?

@shlevy

shlevy commented Nov 21, 2016

Copy link
Copy Markdown
Member Author

@edolstra said he was working on a fix

@shlevy

shlevy commented Nov 29, 2016

Copy link
Copy Markdown
Member Author

ping

1 similar comment
@shlevy

shlevy commented Dec 10, 2016

Copy link
Copy Markdown
Member Author

ping

@shlevy
shlevy requested a review from edolstra December 18, 2016 22:39
@shlevy

shlevy commented Dec 18, 2016

Copy link
Copy Markdown
Member Author

Ping

@shlevy

shlevy commented Dec 26, 2016

Copy link
Copy Markdown
Member Author

Merry Christmas! Ping.

@shlevy

shlevy commented Jan 6, 2017

Copy link
Copy Markdown
Member Author

@edolstra Can you give me a time by which I can expect a review, even if that's not in the near future?

Comment thread src/build-remote/build-remote.cc Outdated

class machine {
const std::vector<string> supportedFeatures;
const std::vector<string> mandatoryFeatures;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

=> std::set ?

Comment thread src/build-remote/build-remote.cc Outdated
[&](const string & feature) {
return std::find(supportedFeatures.begin(),
supportedFeatures.end(),
feature) != supportedFeatures.end() ||

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be changed to supportedFeatures.count(feature) is supportedFeatures is a set.

Comment thread src/build-remote/build-remote.cc Outdated
auto machines = std::vector<machine>{};
auto confFile = std::ifstream{conf};
if (confFile.good()) {
confFile.exceptions(std::ifstream::badbit);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C++ streams considered harmful, among other things due to the wacky error/exception handling. I would just do tokenizeString(readFile(conf), "\n").

@shlevy
shlevy requested a review from edolstra January 10, 2017 15:37
@domenkozar

Copy link
Copy Markdown
Member

@edolstra what's the plan for this PR?

@edolstra
edolstra merged commit 8af062f into NixOS:master Jan 19, 2017
@copumpkin

Copy link
Copy Markdown
Member

🍾

@copumpkin

Copy link
Copy Markdown
Member

Was this the last remnant of perl or is there other stuff left? I can't wait to see perl disappear from release.nix 😄

@domenkozar

Copy link
Copy Markdown
Member

#1023
#1027

And we're done :)

@edolstra

Copy link
Copy Markdown
Member

Thanks @shlevy !

@edolstra

Copy link
Copy Markdown
Member

@domenkozar

domenkozar commented Jan 24, 2017 •

Copy link
Copy Markdown
Member

@shlevy

shlevy commented Jan 24, 2017

Copy link
Copy Markdown
Member Author

Commit using futimes pushed.

@domenkozar

Copy link
Copy Markdown
Member

@edolstra now we need NixOS/nixpkgs#17697 to fix tests, does that mean we finally get #1134 ? 🙈

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants