The Tur wrote that even ex post facto, when the house was built through a prohibition by a non-Jew—it is proper to be stringent that they should not enter it. Thus far his words. That is to say: according to the law it is permitted, but it is proper to be stringent (Beit Yosef). And there is one who wrote that according to the law it is forbidden (Bach), but it is not so (Taz). However, when he gave him work with detached items before the Moed, to perform it during the Moed inside the house of the non-Jew and as a contractor, and he did not explicitly designate for him that he should perform it specifically during the Moed—it is permitted. And it is permitted to give a non-Jew any work, even attached to the ground, as a contractor or as a day laborer before the Moed, and to stipulate with him that he should perform it specifically after the Moed. And even during the Moed—he may hire him to perform it after the Moed. But when he hires him during the Moed—he should be careful not to measure, weigh, or count in the manner that he does on a weekday, but rather he should only make a transaction with him. And for a Jew it is also permitted in such a case, except that regarding a non-Jew there is a greater novelty, even though there is reason to fear that he will not obey and will perform it during Chol HaMoed. Nevertheless, even if he transgressed and performed it during Chol HaMoed—it is permitted, since he stipulated with him to perform it after the Moed. And he also does not need to protest his action (Magen Avraham). But in a matter publicized to the masses—he must protest. (And the Magen Avraham wrote in subsection 1, that for the sake of a mitzvah it is permitted to tell a non-Jew to perform work during Chol HaMoed, see there. And it seems to me that this is with detached items and not with items attached to the ground. And even a beit knesset and a beit midrash—it is forbidden to build, and there is a desecration of God's name in this. And if the non-Jew is a sharecropper in his field—he is permitted to work. And see above siman 243, and see Magen Avraham subsection 3.)
וכתב הטור דאפילו בדיעבד, כשנבנה הבית באיסור על ידי אינו יהודי – נכון להחמיר שלא יכנסו בה, עד כאן לשונו. כלומר: מדינא מותר, אבל נכון להחמיר (בית יוסף). ויש מי שכתב דמדינא אסור (ב"ח), ואינו כן (ט"ז). אבל כשנתן לו מלאכה בתלוש קודם המועד, לעשותה במועד בתוך ביתו של האינו יהודי ובקבלנות, ולא ייחד לו מפורש שיעשנה במועד דווקא – מותר. ומותר ליתן לאינו יהודי כל מלאכה, אפילו מחובר, בקיבולת או בשכיר יום קודם המועד, ולהתנות עמו שיעשה דווקא אחר המועד. ואפילו בתוך המועד – יכול לשוכרו שיעשה אחר המועד. אך כשמשכירו במועד – יזהר שלא ימדוד וישקול וימנה כדרך שהוא עושה בחול, אלא יעשה עמו מקח בלבד. וגם לישראל מותר בכהאי גוונא, אלא דבאינו יהודי יש רבותא יותר, אף על פי שיש לחוש שלא יציית ויעשה בחול המועד. ומיהו אם אפילו עבר ועשה בחול המועד – מותר, הואיל והתנה עמו לעשותה לאחר המועד. וגם אינו צריך למחות בידו (מגן אברהם). ובדבר מפורסם לרבים – צריך למחות. (וכתב המגן אברהם סעיף קטן א, דלדבר מצוה מותר לומר לאינו יהודי לעשות מלאכה בחול המועד, עיין שם. ונראה לי דזהו בתלוש ולא במחובר. ואפילו בית הכנסת ובית המדרש – אסור לבנות, ויש בזה חילול ה'. ואם האינו יהודי אריס בשדהו – מותר לו לעשות. ועיין לעיל סימן רמג, ועיין מגן אברהם סעיף קטן ג.)