-
-
Notifications
You must be signed in to change notification settings - Fork 363
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setup chmod for certain files in downloaded exercise. #903
Comments
This has been discussed previously, and the conclusion at the time was to create files as non-executable: #276 |
I can't say I understand why, as running the gradlew scripts should be the way mentees run the tests, isn't it? Why make it harder? In any case, I think we need to include instructions which explain how to chmod the files if we decide to make them non-executable. |
I agree with @uzilan here. There are some traideoffs for running executable scripts fetched from remote source, indeed. But I think people will not check executable files anyway. |
Summary and evaluation of argument made in #276#276 was (presumably) created because some tracks commit some files as executable because track maintainers assume file permissions are retained upon download. But they're not. To resolve this discrepancy we should either retain file permissions upon download, or at least have a principle to not do so. Making script files executable via a The only argument against this, mentioned in #276, is one of perceived security:
... which they would be doing anyway, even when prefixed with an interpreter. It'd be code from a remote location executed via an interpreter, whether through I think the argument against executable scripts can be reduced to an aesthetical preference. Windows compatibility and consistency of documentationI present another argument against making scripts directly executable. While This won't be a problem as long as Windows users can execute tests whichever way is most convenient on Windows, and Linux/MacOSX/BSD users execute tests in the same way or with
Since we don't know the operating system of the student as we present the README (on the website and in the copy downloaded by the CLI), generating, maintaining and presenting alternative hints for different operating systems seems like a lot of work when a single instruction does exist for multiple operating systems. For which tracks does this apply?This discussion applies to tracks for which the test suite is directly executable because the programming language (or choice of framework around it) does not provide a test command. For example, in Haskell the chosen command is Having executable test files would mainly benefit tracks where testing equipment is not provided in a separate command. For that reason it would be nice to know which track stands to benefit here? Performing this change should, in my opinion, be based on the observation that it would benefit a track that does not have a better way to execute tests. This would most likely be an archaic scripting language. (Archaic: Has no modern test framework. Scripting: Allows Gradle on Kotlin track@uzilan mentions So in the case of Kotlin track (which I presume @uzilan to represent in this issue), how about doing the same for Kotlin track as Java track does? I see that Kotlin track's Installing Kotlin does not mention This is not to disqualify the proposal, but in the particular case of Kotlin track, isn't there actually a better choice? ("Why make it harder?" is a biased question because it assumes that students, on average, see that files are exetuable and know to run them with |
Thanks @sshine for such extended answer. In Kotlin/Java world Gradle is de-facto a default build system. (Probably some legacy enterprise projects still use something like Maven). Using
With wrapper we can configure any required Gradle version to use with our build-script. It allows us to be sure that our build scenarios works as expected even if student have outdated/another Gradle version installed. Invoking |
It is also important to maintain a certain version when we build the java and kotlin test runners. Otherwise we would have to guess which version of gradle the mentees are using to build and test their solutions. Using gradlew we can assert a certain gradle version. |
Just wanted to weigh in here saying that the Java track is now also using the Gradle wrapper and no longer instructs students to install Gradle locally. This means we also run into the issue where the Gradle wrapper script has to be marked executable by the student for each exercise they download. |
According to sources, exercism tool is just downloading files. But sometimes it's really nice to make certain files executable (see exercism/4991).
The text was updated successfully, but these errors were encountered: